5 Windows,Messages, ShellAPI, SysUtils, Classes,StdCtrls,StrUtils;
10 option: Integer; // 0:
\93§
\96¾ 1:
\92Ê
\8fí
\82 \82Ú
\81[
\82ñ
13 TAbon = class(TObject)
19 Ftokens : array of array of string;
20 FAbonRes : array of TIndiviAbon;
22 // FCutoffNum : Integer; //
\82±
\82Ì
\90\94\88È
\8fã
\98A
\91±
\82·
\82é
\93¯
\82¶
\89p
\8e\9a\82ðNG
\83\8f\81[
\83h
\82Æ
\82·
\82é
23 FDeleterlo : Boolean; //&rlo;
\82ð
\8dí
\82é
\82© //
\92Ç
\89Á&lro;
\82à
\8dí
\82é
24 FReplaceul :Boolean ; //<ul>
\83^
\83O
\82ð<br>
\83^
\83O
\82É
\92u
\8a·
\82·
\82é
\82©
25 FReverse : Boolean ; //NG
\83\8f\81[
\83h
\82Å
\82Ì
\82 \82Ú
\81`
\82ñ
\82Ì
\8c\8b\89Ê
\82ð
\94½
\93]
\82³
\82¹
\82é
\82©
26 FAbonPopupRes : Boolean; //
\83\8c\83X
\83|
\83b
\83v
\83A
\83b
\83v
\82Ì
\8e\9e\82É
\82 \82Ú
\81[
\82ñ
\82·
\82é
\82©
27 FCreateNGwordFile : Boolean; //
\8ew
\92è
\82³
\82ê
\82½path
\82ÉNG
\83\8f\81[
\83htxt
\82ª
\96³
\82©
\82Á
\82½
\82Æ
\82«
\82É
\8e©
\93®
\93I
\82É
\90¶
\90¬
\82·
\82é
\82©
28 FNGwordFileIndex : Integer; //
\8c»
\8dÝ
\93Ç
\82Ý
\8d\9e\82ñ
\82Å
\82éNG
\83\8f\81[
\83h
\82ªlist
\82Ì
\89½
\8ds
\96Ú
\82©
29 FNGwordname : String; //
\8c»
\8dÝ
\93Ç
\82Ý
\8d\9e\82ñ
\82Å
\82éNG
\83\8f\81[
\83h
\82Ì
\95\
\8e¦
\96¼
30 FIndividualFileName : String; //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83t
\83@
\83C
\83\8b\96¼
31 FReturnNGwordLineNum : Boolean; //NG
\83\8f\81[
\83h
\82Ì
\8ds
\90\94\82ð
\95Ô
\82·
\81B
32 FSetNGResAnchor : Boolean; //NG
\82É
\8aY
\93\96\82µ
\82½
\82Æ
\82«
\82É
\96{
\95¶
\82É
\82»
\82Ì
\83\8c\83X
\82Ö
\82Ì
\83\8c\83X
\83A
\83\93\83J
\81[
\82ð
\82Â
\82¯
\82é
\82©
\82Ç
\82¤
\82©
33 FDeleteSyria: Boolean; //
\83V
\83\8a\83A
\8cê
\83u
\83\89\83N
\83\89\91Î
\8dô
\81i܀~ݏ
\81j
34 procedure SetTokens(index: integer ; argline:String);
35 function Getlistpath() : String;
36 procedure Setlistpath(const Value : String);
37 function LoadListFile(path :String;listStringList : TStringList) : Boolean;
38 function ReadNGwordslist(line : Integer) : Boolean;
39 function LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
42 constructor Create; //
\83R
\83\93\83X
\83g
\83\89\83N
\83^
43 destructor Destroy; override; //
\83f
\83X
\83g
\83\89\83N
\83^
44 property Deleterlo: Boolean read FDeleterlo write FDeleterlo default false;
45 property Replaceul: Boolean read FReplaceul write FReplaceul default false;
46 property Reverse: Boolean read FReverse write FReverse default false;
47 property CreateNGwordFile: Boolean read FCreateNGwordFile write FCreateNGwordFile;
48 property AbonString : String read FAbonString write FAbonString;
49 property AbonPopupRes : Boolean read FAbonPopupRes write FAbonPopupRes default false;
50 property listpath : String read Getlistpath write Setlistpath;
51 property NGwordFileIndex : Integer read FNGwordFileIndex write FNGwordFileIndex default 0;
52 property NGwordname : String read FNGwordname write FNGwordname;
53 property ReturnNGwordLineNum : Boolean read FReturnNGwordLineNum write FReturnNGwordLineNum default false;
54 property SetNGResAnchor : Boolean read FSetNGResAnchor write FSetNGResAnchor default false;
55 property DeleteSyria : Boolean read FDeleteSyria write FDeleteSyria default false;
56 procedure Setroot(root :String);
57 function Getroot() : String;
59 function Getfullpath(argpath : String) : String;
60 procedure SetNGwordpath(path :String);
61 function GetNGwordpath() : String;
62 function LoadFromNGwordFile(path :String) : Boolean;
63 function ReLoadFromNGwordFile() : Boolean;
64 procedure LoadFromStringList( bufstl : TStringList );
65 function CheckAbonPopupRes(line : String) :Boolean;
66 function FindNGwords(const line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean;//1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
67 function FindNGwordsEx(const line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean;//1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
68 //
\82 \82Ú
\81`
\82ñ
\8f\88\97\9d(NG
\83\8f\81[
\83h
\82Å
\82Ì
\83t
\83B
\83\8b\83^
\83\8a\83\93\83O)
69 procedure Execute(var ThreadStrings : TStringList); overload;
70 procedure Execute(var ThreadStrings : TStringList; NGwords : TStringList); overload;
71 procedure Execute(var ThreadStrings : TStringList; NGwords : TStrings); overload;
72 procedure Execute(var ResString : String; ResNumber : Integer); overload; //
\8eå
\82Éplugin
\82©
\82ç
\82ÌDat To HTML
\97p
73 procedure ExecuteEx(var ThreadStrings : TStringList); overload;
74 procedure ExecuteEx(var ThreadStrings : TStringList; NGwords : TStringList); overload;
75 procedure ExecuteEx(var ThreadStrings : TStringList; NGwords : TStrings); overload;
76 procedure ExecuteEx(var ResString : String; ResNumber : Integer); overload; //
\8eå
\82Éplugin
\82©
\82ç
\82ÌDat To HTML
\97p
78 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82µ
\82å
\82è
79 procedure IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String); overload;
80 procedure IndividualAbon(var ResString : String; SetResNumFile : String; ResNumber : Integer); overload;
81 procedure AddIndividualAbon( ResNum : Integer ; option : Integer; SetResNumFile : String);
82 procedure DeleteIndividualAbon( ResNum : Integer); overload;
83 procedure DeleteIndividualAbon( ResNum : Integer; SetResNumFile : String); overload;
85 function GetAbonResCount() : Integer; overload;
86 function GetAbonResCount(SetResNumFile : String) : Integer; overload;
88 function GetAbonResString(Num : Integer) : String;
89 function CheckIndividualAbonList(ResNum : Integer) : Boolean;
91 procedure EditNGwords(); //NGword.txt
\82ð
\8aJ
\82
\81B
92 function ShowAllTokens() : String; //
\83f
\83o
\83b
\83O
\97p
94 procedure GoHome();//List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
95 function GoForward() : Boolean; //List
\82Ì
\88ê
\82Â
\8e\9f\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
96 function GoBack() : Boolean; //List
\82Ì
\88ê
\82Â
\91O
\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
98 function TreatSyria(AString: string): string;
103 NGwordListFileName : String = 'NGwords.list';
109 constructor TAbon.Create;
112 FAbonString := ' <> <> <> <><>';
113 FCreateNGwordFile := true;
114 SetLength(FAbonRes,1);
115 FAbonRes[0].Res := 0;
116 FAbonRes[0].option := -1;
120 destructor TAbon.Destroy;
124 //root
\82ÍExe\config\NGwords
\83t
\83H
\83\8b\83_
125 procedure TAbon.Setroot(root :String);
127 bufStringList : TStringList;
129 bufStringList := TStringList.Create;
131 if not DirectoryExists(root) then begin
134 if root[Length(root)] <> '\' then begin
137 Flistpath := root + NGwordListFileName;
138 LoadListFile(Flistpath, bufStringList);
144 function TAbon.Getroot() : String;
148 //NGwordpath
\82ÍNGword.txt
\82Ì
\83t
\83\8b\83p
\83X
149 procedure TAbon.SetNGwordpath(path :String);
151 FNGwordpath := Getfullpath(path);
152 LoadFromNGwordFile(FNGwordpath);
154 function TAbon.GetNGwordpath() : String;
156 Result := FNGwordpath;
158 //
\83t
\83\8b\83p
\83X
\82Å
\82È
\82¯
\82ê
\82Î
\83t
\83\8b\83p
\83X
\82É
\82µ
\82Ä
\95Ô
\82·
\81B
159 function TAbon.Getfullpath(argpath : String) : String;
161 if AnsiPos(':\',argpath) <> 2 then begin //
\83h
\83\89\83C
\83u
\82©
\82ç
\82Ì
\83t
\83\8b\83p
\83X
\82ª
\96³
\82¯
\82ê
\82Î
162 if Getroot() = '' then begin
163 Result := ''; //root
\83p
\83X
\82ª
\90Ý
\92è
\82³
\82ê
\82Ä
\82È
\82¢
\82©
\8bó
\82É
\82·
\82é
165 if (Froot[Length(Froot)] = '\') and (argpath[1] = '\') then begin //
\90æ
\93ª
\82Ì\
\82ð
\8dí
\8f\9c
168 Insert( Getroot(), argpath , 1);//root
\83p
\83X
\82ð
\91}
\93ü
176 //NGword
\83t
\83@
\83C
\83\8b\82Ì
\93Ç
\82Ý
\8d\9e\82Ý
177 function TAbon.LoadFromNGwordFile(path :String) : boolean;
179 bufstl : TStringList;
181 path := Getfullpath(path);
182 if path = '' then begin
185 bufstl := TStringList.Create;
188 bufstl.LoadFromFile(path);
189 LoadFromStringList( bufstl );
192 if CreateNGwordFile = true then begin
193 bufstl.SaveToFile(path);
203 //NGword
\83\8a\83X
\83g
\93Ç
\82Ý
\8d\9e\82Ý
204 procedure TAbon.LoadFromStringList( bufstl : TStringList );
209 for i := bufstl.Count -1 downto 0 do begin
210 if bufstl.Strings[i] = '' then begin
214 SetLength(Ftokens,bufstl.Count);
215 for i := 0 to bufstl.Count -1 do begin
216 SetTokens(i , bufstl.Strings[i]);
223 //NGwordpath
\82ª
\8aù
\82É
\90Ý
\92è
\82³
\82ê
\82Ä
\82¢
\82é
\82Æ
\82«
\82Ì
\83\8a\83\8d\81[
\83h
\97p
\8aÖ
\90\94
224 function TAbon.ReLoadFromNGwordFile() : boolean;
226 if GetNGwordpath() ='' then begin
229 Result := LoadFromNGwordFile( GetNGwordpath() );
232 function TAbon.Getlistpath() : String;
236 procedure TAbon.Setlistpath(const Value : String);
238 Flistpath := Getfullpath(Value);
240 //
\88ê
\8ds
\82Ì
\92\86\82Ì
\83g
\81[
\83N
\83\93\82ð
\90Ø
\82è
\95ª
\82¯
\82Ä
\83Z
\83b
\83g
241 procedure TAbon.SetTokens(index: integer ; argline : String);
244 bufstl : TStringList;
250 bufstl := TStringList.Create;
252 if Length(argline) > 0 then begin
253 pos := AnsiPos(#9,argline);
254 while pos <> 0 DO begin
255 buftoken := Copy(argline,1,pos-1);
256 Delete(argline,1,pos);
257 if Length(buftoken) > 0 then begin
258 bufstl.Append(buftoken);
259 end else if ( bufstl.Count = 0 ) then begin
262 pos := AnsiPos(#9,argline);
264 if Length(argline) > 0 then begin
265 bufstl.Append(argline);
268 SetLength(Ftokens[index],ret);
269 for i := 0 to bufstl.Count - 1 do begin
270 Ftokens[index][i] := bufstl.Strings[i];
278 //Debug
\97p
\82¿
\82á
\82ñ
\82ÆNG
\83\8f\81[
\83h
\82ð
\8fE
\82¦
\82Ä
\82¢
\82é
\82©
279 function TAbon.ShowAllTokens() : String;
285 for i := 0 to High(Ftokens) do begin
286 for j := 0 to High(Ftokens[i]) do begin
287 ret := ret + Ftokens[i][j];
295 //NG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82½
\82çtrue
\82ð
\95Ô
\82µ
\81A
\82»
\82ÌNG
\83\8f\81[
\83h
\82Ì
\8ds
\90\94\82ðNGwordsLineNum
\82É
\93ü
\82ê
\82Ä
\95Ô
\82·
\81B
296 //
\82à
\82µ
\82à
\93§
\96¾
\82 \82Ú
\81`
\82ñ
\82É
\82·
\82é
\82È
\82çInbisible
\82ðtrue
\82É
\82µ
\82Ä
\95Ô
\82·
297 function TAbon.FindNGwords(const line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; //1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
306 if AnsiPos(FAbonString,line) <> 1 then begin
307 for lines := 0 to High(Ftokens) do begin
310 if Ftokens[lines][0] <> '' then begin
318 for cells := start to High(Ftokens[lines]) do begin
319 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
323 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
326 if hit = true then begin
327 NGwordsLineNum := lines + 1;
334 //NG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82½
\82çtrue
\82ð
\95Ô
\82µ
\81A
\82»
\82ÌNG
\83\8f\81[
\83h
\82Ì
\8ds
\90\94\82ðNGwordsLineNum
\82É
\93ü
\82ê
\82Ä
\95Ô
\82·
\81B
335 //
\82à
\82µ
\82à
\93§
\96¾
\82 \82Ú
\81`
\82ñ
\82É
\82·
\82é
\82È
\82çInbisible
\82ðtrue
\82É
\82µ
\82Ä
\95Ô
\82·
336 //
\94¼
\8ap
\91S
\8ap
\96³
\8e\8b
337 function TAbon.FindNGwordsEx(const line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean;//1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
346 if AnsiPos(FAbonString,line) <> 1 then begin
347 for lines := 0 to High(Ftokens) do begin
350 if Ftokens[lines][0] <> '' then begin
358 for cells := start to High(Ftokens[lines]) do begin
359 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
363 Delete(bufline, AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
366 if hit = true then begin
367 NGwordsLineNum := lines + 1;
374 //
\96\96\94ö
\82Ì
\83u
\81[
\83\8b\92l
\82Ítrue
\82¾
\82Æ
\81ANG
\83\8f\81[
\83h
\82ð
\8aÜ
\82Þ
\82à
\82Ì
\82¾
\82¯
\82ð
\95Ô
\82·
\81B
375 procedure TAbon.Execute(var ThreadStrings : TStringList);
378 NGwordsLine : Integer;
382 for i:=0 to ThreadStrings.Count - 1 do begin
384 if FindNGwords(ThreadStrings.Strings[i], NGwordsLine ,invisi) <> Reverse then begin
385 if invisi = true then begin
386 ThreadStrings.Strings[i] := '';
388 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
389 ThreadStrings.Strings[i] := FAbonString;
390 end else if not ReturnNGwordLineNum then begin
391 ThreadStrings.Strings[i] := Format(' <> <> <>>%d<><>',[(i+1)]);
392 end else if not SetNGResAnchor then begin
393 ThreadStrings.Strings[i] := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
395 ThreadStrings.Strings[i] := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B>>%d <><>',[NGwordsLine,(i+1)]);
399 bufline := ThreadStrings.Strings[i];
400 if Deleterlo = true then begin
401 bufline := CustomStringReplace(bufline,'&rlo;','');
402 bufline := CustomStringReplace(bufline,'&lro;','');
404 if Replaceul = true then begin
405 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
406 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
408 if DeleteSyria = true then
409 bufline := TreatSyria(bufline);
410 ThreadStrings.Strings[i] := bufline;
414 procedure TAbon.Execute(var ResString : String; ResNumber : Integer);
416 NGwordsLine : Integer;
421 if FindNGwords(ResString, NGwordsLine ,invisi) <> Reverse then begin
422 if invisi = true then begin
425 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
426 ResString := FAbonString;
427 end else if not ReturnNGwordLineNum then begin
428 ResString := Format(' <> <> <>>%d<><>',[(ResNumber)]);
429 end else if not SetNGResAnchor then begin
430 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
432 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B>>%d <><>',[NGwordsLine,(ResNumber)]);
436 bufline := ResString;
437 if Deleterlo = true then begin
438 bufline := CustomStringReplace( bufline,'&rlo;','' );
439 bufline := CustomStringReplace( bufline,'&lro;','' );
441 if Replaceul = true then begin
442 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
443 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
445 if DeleteSyria = true then
446 bufline := TreatSyria(bufline);
447 ResString := bufline;
451 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStringList);
455 SetLength(Ftokens,NGwords.Count);
456 for i := 0 to NGwords.Count -1 do begin
457 SetTokens(i , NGwords.Strings[i]);
459 Execute(ThreadStrings);
462 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStrings);
467 buf := TStringList.Create;
468 buf.AddStrings(NGwords);
469 SetLength(Ftokens,buf.Count);
470 for i := 0 to buf.Count -1 do begin
471 SetTokens(i , buf.Strings[i]);
473 Execute(ThreadStrings);
477 //
\96\96\94ö
\82Ì
\83u
\81[
\83\8b\92l
\82Ítrue
\82¾
\82Æ
\81ANG
\83\8f\81[
\83h
\82ð
\8aÜ
\82Þ
\82à
\82Ì
\82¾
\82¯
\82ð
\95Ô
\82·
\81B
478 procedure TAbon.ExecuteEx(var ThreadStrings : TStringList);
481 NGwordsLine : Integer;
485 for i:=0 to ThreadStrings.Count - 1 do begin
487 if FindNGwordsEx(ThreadStrings.Strings[i], NGwordsLine ,invisi) <> Reverse then begin
488 if invisi = true then begin
489 ThreadStrings.Strings[i] := '';
491 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
492 ThreadStrings.Strings[i] := FAbonString;
493 end else if not ReturnNGwordLineNum then begin
494 ThreadStrings.Strings[i] := Format(' <> <> <>>%d<><>',[(i+1)]);
495 end else if not SetNGResAnchor then begin
496 ThreadStrings.Strings[i] := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
498 ThreadStrings.Strings[i] := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B>>%d <><>',[NGwordsLine,(i+1)]);
502 bufline := ThreadStrings.Strings[i];
503 if Deleterlo = true then begin
504 bufline := CustomStringReplace(bufline,'&rlo;','');
505 bufline := CustomStringReplace(bufline,'&lro;','');
507 if Replaceul = true then begin
508 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
509 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
511 if DeleteSyria = true then
512 bufline := TreatSyria(bufline);
513 ThreadStrings.Strings[i] := bufline;
517 procedure TAbon.ExecuteEx(var ResString : String; ResNumber : Integer);
519 NGwordsLine : Integer;
524 if FindNGwordsEx(ResString, NGwordsLine ,invisi) <> Reverse then begin
525 if invisi = true then begin
528 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
529 ResString := FAbonString;
530 end else if not ReturnNGwordLineNum then begin
531 ResString := Format(' <> <> <>>%d<><>',[(ResNumber)]);
532 end else if not SetNGResAnchor then begin
533 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
535 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B>>%d <><>',[NGwordsLine,(ResNumber)]);
539 bufline := ResString;
540 if Deleterlo = true then begin
541 bufline := CustomStringReplace( bufline,'&rlo;','' );
542 bufline := CustomStringReplace( bufline,'&lro;','' );
544 if Replaceul = true then begin
545 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
546 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
548 if DeleteSyria = true then
549 bufline := TreatSyria(bufline);
550 ResString := bufline;
554 procedure TAbon.ExecuteEx(var ThreadStrings : TStringList; NGwords : TStringList);
558 SetLength(Ftokens,NGwords.Count);
559 for i := 0 to NGwords.Count -1 do begin
560 SetTokens(i , NGwords.Strings[i]);
562 ExecuteEx(ThreadStrings);
565 procedure TAbon.ExecuteEx(var ThreadStrings : TStringList; NGwords : TStrings);
570 buf := TStringList.Create;
571 buf.AddStrings(NGwords);
572 SetLength(Ftokens,buf.Count);
573 for i := 0 to buf.Count -1 do begin
574 SetTokens(i , buf.Strings[i]);
576 ExecuteEx(ThreadStrings);
580 //****************************************************************************//
581 //
\8c»
\8dÝ
\83Z
\83b
\83g
\82³
\82ê
\82Ä
\82¢
\82éNGword.txt
\82ð
\8aJ
\82
582 procedure TAbon.EditNGwords();
584 ShellExecute(0 ,nil,PChar(FNGwordpath),nil,nil,SW_SHOW);
586 //
\83|
\83b
\83v
\83A
\83b
\83v
\97p
\94»
\92è
\8aÖ
\90\94
587 function TAbon.CheckAbonPopupRes(line : String) :Boolean;
592 if AbonPopupRes = true then begin
593 Result := FindNGwords(line, i ,v);
598 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ==============================================
599 //List
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
600 function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;
603 listStringList.LoadFromFile(path);
606 listStringList.Append('
\88ê
\94Ê=NGword.txt');
607 listStringList.SaveToFile(path);
611 //List
\82Ì
\88ê
\82Â
\8e\9f\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
612 function TAbon.GoForward() : Boolean;
614 FNGwordFileIndex := FNGwordFileIndex + 1;
615 Result := ReadNGwordslist(FNGwordFileIndex);
617 //List
\82Ì
\88ê
\82Â
\91O
\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
618 function TAbon.GoBack() : Boolean;
620 FNGwordFileIndex := FNGwordFileIndex -1;
621 Result := ReadNGwordslist(FNGwordFileIndex);
623 //List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
624 procedure TAbon.GoHome();
626 FNGwordFileIndex := 0;
627 ReadNGwordslist(FNGwordFileIndex);
629 //List
\82Ìline
\8ds
\96Ú
\82ð
\93Ç
\82Þ
630 function TAbon.ReadNGwordslist(line : Integer) : Boolean;
632 liststl : TStringList;
635 liststl := TStringList.Create;
637 if LoadListFile(Flistpath,liststl) = true then begin
638 if line < 0 then begin
639 line := liststl.Count - 1;
640 FNGwordFileIndex := liststl.Count - 1;
641 end else if line > liststl.Count - 1 then begin
643 FNGwordFileIndex := 0;
645 linebuf := liststl.Strings[line];
646 FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);
647 Delete(linebuf,1,AnsiPos('=',linebuf));
648 SetNGwordpath(linebuf);
658 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ=====
\82±
\82±
\82Ü
\82Å=================================
659 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\8eÀ
\8ds
\8aÖ
\90\94
660 procedure TAbon.IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String);
664 if FileExists(SetResNumFile) = true then begin
665 if LoadFromSetResNumFile(SetResNumFile) = true then begin
666 for i := 0 to High(FAbonRes) do begin
667 if (FAbonRes[i].Res <= ThreadStrings.Count) and (FAbonRes[i].Res > 0) then begin
668 if FAbonRes[i].option = 0 then begin
669 ThreadStrings.Strings[FAbonRes[i].Res-1] := '';
671 ThreadStrings.Strings[FAbonRes[i].Res-1] := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
678 FIndividualFileName := SetResNumFile;
679 SetLength(FAbonRes,1);
680 FAbonRes[0].Res := 0;
681 FAbonRes[0].option := -1;
684 procedure TAbon.IndividualAbon(var ResString : String; SetResNumFile : String; ResNumber : Integer);
688 if FileExists(SetResNumFile) = true then begin
689 if LoadFromSetResNumFile(SetResNumFile) = true then begin
690 for i := 0 to High(FAbonRes) do begin
691 if FAbonRes[i].Res = ResNumber then begin
692 if FAbonRes[i].option = 0 then begin
695 ResString := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
702 FIndividualFileName := SetResNumFile;
703 SetLength(FAbonRes,1);
704 FAbonRes[0].Res := 0;
705 FAbonRes[0].option := -1;
709 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
\8aÖ
\90\94
710 function TAbon.LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
712 bufStringList : TStringList;
716 bufStringList := TStringList.Create;
719 bufStringList.LoadFromFile(SetResNumFile);
720 FIndividualFileName := SetResNumFile;
722 for i := bufStringList.Count-1 downto 0 do begin
723 if bufStringList.Strings[i] = '' then begin
724 bufStringList.Delete(i);
728 //
\83\81\83\82\83\8a\8am
\95Û
729 SetLength(FAbonRes,bufStringList.Count);
731 for i :=0 to bufStringList.Count - 1 do begin
732 bufLine := Trim(bufStringList.Strings[i]);
733 FAbonRes[i].Res := StrToInt(Copy(bufLine,1,AnsiPos('-',bufLine)-1));
734 FAbonRes[i].option := StrToInt(Copy(bufLine,AnsiPos('-',bufLine)+1,1));
745 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82É
\92Ç
\89Á
746 procedure TAbon.AddIndividualAbon( ResNum : Integer ; option : Integer; SetResNumFile : String);
748 IndividualFile : TStringList;
751 IndividualFile := TStringList.Create;
753 if FileExists(SetResNumFile) then begin
754 IndividualFile.LoadFromFile(SetResNumFile);
756 for j := 0 to IndividualFile.Count -1 do begin
757 if AnsiPos(IntToStr(ResNum) + '-', IndividualFile[j]) = 1 then begin
763 IndividualFile.Add(IntToStr(ResNum) + '-' + IntToStr(option))
765 IndividualFile[j] := IntToStr(ResNum) + '-' + IntToStr(option);
768 IndividualFile.Add(IntToStr(ResNum) + '-' + IntToStr(option));
770 IndividualFile.SaveToFile(SetResNumFile);
775 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82©
\82ç
\8dí
\8f\9c
776 procedure TAbon.DeleteIndividualAbon( ResNum : Integer);
778 IndividualFile : TStringList;
782 IndividualFile := TStringList.Create;
783 if FAbonRes[0].Res <> 0 then begin
784 for i := 0 to High(FAbonRes) do begin
785 if FAbonRes[i].Res <> ResNum then begin
786 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
787 IndividualFile.Append(linebuf);
791 if IndividualFile.Count <> 0 then begin
793 IndividualFile.SaveToFile(FIndividualFileName);
798 if FileExists(FIndividualFileName) = true then begin
799 DeleteFile(FIndividualFileName);
803 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83\8a\83X
\83g
\82Ì
\8cÂ
\90\94\82ð
\95Ô
\82·
804 function TAbon.GetAbonResCount() : Integer;
808 if FAbonRes[0].Res = 0 then begin
815 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83\8a\83X
\83g
\82Ì
\82\8e\8ds
\96Ú
\82Ì
\83\8c\83X
\82ð
\95¶
\8e\9a\97ñ
\82Å
\95Ô
\82·
816 function TAbon.GetAbonResString(Num : Integer) : String;
818 if (Num <= High(FAbonRes)) and (Num >= 0) then begin
819 Result := IntToStr(FAbonRes[Num].Res);
824 function TAbon.GetAbonResCount(SetResNumFile : String) : Integer;
826 bufStringList : TStringList;
829 if FileExists(SetResNumFile) then begin
830 bufStringList := TStringList.Create;
833 bufStringList.LoadFromFile(SetResNumFile);
834 Result := bufStringList.Count;
842 procedure TAbon.DeleteIndividualAbon( ResNum : Integer; SetResNumFile : String);
845 bufStringList : TStringList;
847 if FileExists(SetResNumFile) then begin
848 bufStringList := TStringList.Create;
851 bufStringList.LoadFromFile(SetResNumFile);
852 i := bufStringList.IndexOf(IntToStr(ResNum)+'-');
854 bufStringList.Delete(i);
863 //
\83|
\83b
\83v
\83A
\83b
\83v
\82Ì
\94»
\92è
\97p
864 function TAbon.CheckIndividualAbonList(ResNum : Integer) : Boolean;
868 if FAbonRes[0].Res <> 0 then begin
869 for i := 0 to High(FAbonRes) do begin
870 if FAbonRes[i].Res = ResNum then begin
879 //
\83V
\83\8a\83A
\8cê
\83u
\83\89\83N
\83\89\91Î
\8dô
880 function TAbon.TreatSyria(AString: string): string;
882 //count: Integer; //(܀~ݏ)
886 pos := AnsiPos('', AString);
887 while pos <> 0 do begin
888 if StrToIntDef(Copy(AString, pos+4, 2), -1) > 0 then begin
889 if (AString[pos+6] = ';' ) or (AString[pos+6] = ' ') then begin
890 tmp := tmp + Copy(AString, 1, pos - 1);
891 Delete(AString, 1, pos+6);
892 end else if StrToIntDef(AString[pos+6], -1) = -1 then begin
893 tmp := tmp + Copy(AString, 1, pos - 1);
894 Delete(AString, 1, pos+5);
896 tmp := tmp + Copy(AString, 1, pos + 5);
897 Delete(AString, 1, pos+5);
900 tmp := tmp + Copy(AString, 1, pos + 5);
901 Delete(AString, 1, pos+5);
903 pos := AnsiPos('', AString);
905 if Length(AString) > 0 then
906 tmp := tmp + AString;
910 pos := AnsiPos('³', AString);
911 while pos <> 0 do begin
912 if StrToIntDef(Copy(AString, pos+5, 1), 0) > 2 then begin
913 if (AString[pos+6] = ';') or (AString[pos+6] = ' ') then begin
914 tmp := tmp + Copy(AString, 1, pos - 1);
915 Delete(AString, 1, pos+6);
916 end else if StrToIntDef(AString[pos+6], -1) = -1 then begin
917 tmp := tmp + Copy(AString, 1, pos - 1);
918 Delete(AString, 1, pos+5);
920 tmp := tmp + Copy(AString, 1, pos + 5);
921 Delete(AString, 1, pos+5);
924 tmp := tmp + Copy(AString, 1, pos + 5);
925 Delete(AString, 1, pos+5);
927 pos := AnsiPos('³', AString);
929 if Length(AString) > 0 then
930 tmp := tmp + AString;