【发布时间】:2012-04-12 11:05:48
【问题描述】:
这是Synopse delphi open source 的连字符库。
演示是一个控制台应用程序。我不知道如何在 GUI 应用程序中使用它。
以下是我的测试,但不起作用。它不显示带有连字符(或分隔符)的单词。该库可以是downloaded here:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, hyphen, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
procedure testhyphenator;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TForm1 }
procedure TForm1.testhyphenator;
var
h: THyphen;
s: string;
F, L: Integer;
begin
s := 'hyph_en_US.txt'; //this is from the folder, is that correct to call?
if FileExists(s) then
begin
F := FileOpen(s, fmOpenRead);
L := FileSeek(F, 0, soFromEnd);
if L > 0 then
begin
SetLength(s, L);
FileSeek(F, 0, soFromBeginning);
FileRead(F, s[1], L);
end;
FileClose(F);
end;
h := THyphen.Create(s);
h.Execute('pronunciation'); //is this correct?
ShowMessage(h.filllist); //not display hyphenated word
end;
它不显示连字符。在演示中,我也对构造函数感到困惑:
H := THyphen.create('ISO8859-1'#10'f1f'#10'if3fa/ff=f,2,2'#10'tenerif5fa');
writeln('"',H.Execute('SchiffahrT'),'"'); writeln(H.FillList);
...
作者还附上了obj文件。如果我想编译成一个单独的exe,该怎么做?
你能帮我理解如何正确使用它吗?
非常感谢。
【问题讨论】:
-
您能说得更具体些吗? 不起作用是对您可以使用的问题的最糟糕的描述。对于您的问题如何链接 *.obj 文件在您的单元中使用
{$LINK 'file.obj'}。 -
@TLama,感谢您的回复。请参阅编辑。我的意思是它不显示连字符。
-
1) 您是否在您的机器上成功编译了原始控制台应用程序版本? 2) 你的 Delphi 版本是什么?
-
你为什么不在 Synopse 论坛上发布你的问题:synopse.info/forum/viewtopic.php?id=74 我相信程序的作者 Arnaud Bouchez 会在那里回答你(如果他不在这里回答你首先)。
标签: delphi hyphenation