Simple example how to call seman.dll (Delphi 4.3)
program Project2;
uses
Windows,
SysUtils,
ActiveX,
SEMANLib_TLB in '..\..\..\..\Program Files\Borland\Delphi4\Imports\SEMANLib_TLB.pas';
{$APPTYPE CONSOLE}
var Seman : ISemStructure;
var hr : HRESULT;
i : integer;
R:IComSemRelation;
s:string;
function GetWordStrOfNode(Node: IComSemNode):string;
var
WordStr: string;
i:integer;
begin
for i:=0 to Node.WordsCount-1 do
begin
WordStr:=WordStr+string(Node.Words[i].WordStr)+' ';
end;
GetWordStrOfNode:=WordStr;
end;
begin
hr := CoInitialize(nil);
if (hr <> S_OK) then
begin
writeln('cannot load Component Object Model(COM) library');
halt(1);
end;
Seman := CoSemStructure.Create;
Seman.InitPresemanDicts();
Seman.InitSemanDicts();
Seman.InitializeIndices();
Seman.ShouldBuildTclGraph := 0;
Seman.FindSituations('мама мыла раму', 0,'общ',2000,-1,' ');
for i:=0 to Seman.RelationsCount-1 do
begin
R := Seman.Relations[i];
s := string(R.Name)+' (';
s := s+ string(GetWordStrOfNode(Seman.Nodes[R.TargetNodeNo])) + ', ';
s := s + string(GetWordStrOfNode(Seman.Nodes[R.SourceNodeNo]))+');';
writeln (s);
end;
Seman := nil;
CoUninitialize();
end.