This is decrypting lib using Synopse delphi open source .
Demo is a console application. I do not know how to use it in a graphical application.
Below is my test, but not work. It does not display a word with a hyphen (or separator). Lib can be 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;
It does not display a hyphen word. In the demo, I also got confused in the constructor:
H := THyphen.create('ISO8859-1'
The author also attached the obj file. If I want to compile it into one exe, how to do it?
Could you help me understand how to use it correctly?
Many thanks.
Warren
source share