unit Unit2;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
result_t=record
start:integer; //start position,词语在输入句子中的开始位置
length:integer; //length,词语的长度
sPOS:array[0..4] of char;//word type,词性ID值,可以快速的获取词性表
iPOS:integer;//词性
word_ID:integer; //如果是未登录词,设成或者-1
word_type:integer; //区分用户词典;1,是用户词典中的词;,非用户词典中的词
weight:integer;// word weight
end;
presult=^result_t;
vresult=array of presult;
function ICTCLAS_Init(const sInitDirPath:pchar):boolean;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_Init';
function ICTCLAS_Exit():boolean;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_Exit';
function ICTCLAS_ImportUserDict(const sFilename:pchar):integer;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_ImportUserDict';
function ICTCLAS_ParagraphProcess(const sParagraph:pchar;bPOStagged:integer):pchar;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_ParagraphProcess';
function ICTCLAS_KeyWord(resultKey:vresult;nCountKey:Integer):integer;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_KeyWord';
function ICTCLAS_ParagraphProcessA(const sParagraph:pchar;pResultCount:Integer):vresult;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_ParagraphProcessA';
function ICTCLAS_GetParagraphProcessAWordCount(const sParagraph:pchar):integer;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_GetParagraphProcessAWordCount';
procedure ICTCLAS_ParagraphProcessAW(nCount:integer;result:result_t);stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_ParagraphProcessAW';
TForm2 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Memo2: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form2: TForm2;implementation{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
//
end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
result_t=record
start:integer; //start position,词语在输入句子中的开始位置
length:integer; //length,词语的长度
sPOS:array[0..4] of char;//word type,词性ID值,可以快速的获取词性表
iPOS:integer;//词性
word_ID:integer; //如果是未登录词,设成或者-1
word_type:integer; //区分用户词典;1,是用户词典中的词;,非用户词典中的词
weight:integer;// word weight
end;
presult=^result_t;
vresult=array of presult;
function ICTCLAS_Init(const sInitDirPath:pchar):boolean;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_Init';
function ICTCLAS_Exit():boolean;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_Exit';
function ICTCLAS_ImportUserDict(const sFilename:pchar):integer;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_ImportUserDict';
function ICTCLAS_ParagraphProcess(const sParagraph:pchar;bPOStagged:integer):pchar;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_ParagraphProcess';
function ICTCLAS_KeyWord(resultKey:vresult;nCountKey:Integer):integer;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_KeyWord';
function ICTCLAS_ParagraphProcessA(const sParagraph:pchar;pResultCount:Integer):vresult;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_ParagraphProcessA';
function ICTCLAS_GetParagraphProcessAWordCount(const sParagraph:pchar):integer;stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_GetParagraphProcessAWordCount';
procedure ICTCLAS_ParagraphProcessAW(nCount:integer;result:result_t);stdcall;external 'ICTCLAS30.dll' name 'ICTCLAS_ParagraphProcessAW';
TForm2 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Memo2: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form2: TForm2;implementation{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
//
end;end.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货