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);
82 procedure DeleteIndividualAbon( ResNum : Integer);
83 function GetAbonResCount() : Integer;
84 function GetAbonResString(Num : Integer) : String;
85 function CheckIndividualAbonList(ResNum : Integer) : Boolean;
87 procedure EditNGwords(); //NGword.txt
\82ð
\8aJ
\82
\81B
88 function ShowAllTokens() : String; //
\83f
\83o
\83b
\83O
\97p
90 procedure GoHome();//List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
91 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Þ
92 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Þ
94 function TreatSyria(AString: string): string;
99 NGwordListFileName : String = 'NGwords.list';
105 constructor TAbon.Create;
108 FAbonString := ' <> <> <> <><>';
109 FCreateNGwordFile := true;
110 SetLength(FAbonRes,1);
111 FAbonRes[0].Res := 0;
112 FAbonRes[0].option := -1;
116 destructor TAbon.Destroy;
120 //root
\82ÍExe\config\NGwords
\83t
\83H
\83\8b\83_
121 procedure TAbon.Setroot(root :String);
123 bufStringList : TStringList;
125 bufStringList := TStringList.Create;
127 if not DirectoryExists(root) then begin
130 if root[Length(root)] <> '\' then begin
133 Flistpath := root + NGwordListFileName;
134 LoadListFile(Flistpath, bufStringList);
140 function TAbon.Getroot() : String;
144 //NGwordpath
\82ÍNGword.txt
\82Ì
\83t
\83\8b\83p
\83X
145 procedure TAbon.SetNGwordpath(path :String);
147 FNGwordpath := Getfullpath(path);
148 LoadFromNGwordFile(FNGwordpath);
150 function TAbon.GetNGwordpath() : String;
152 Result := FNGwordpath;
154 //
\83t
\83\8b\83p
\83X
\82Å
\82È
\82¯
\82ê
\82Î
\83t
\83\8b\83p
\83X
\82É
\82µ
\82Ä
\95Ô
\82·
\81B
155 function TAbon.Getfullpath(argpath : String) : String;
157 if AnsiPos(':\',argpath) <> 2 then begin //
\83h
\83\89\83C
\83u
\82©
\82ç
\82Ì
\83t
\83\8b\83p
\83X
\82ª
\96³
\82¯
\82ê
\82Î
158 if Getroot() = '' then begin
159 Result := ''; //root
\83p
\83X
\82ª
\90Ý
\92è
\82³
\82ê
\82Ä
\82È
\82¢
\82©
\8bó
\82É
\82·
\82é
161 if (Froot[Length(Froot)] = '\') and (argpath[1] = '\') then begin //
\90æ
\93ª
\82Ì\
\82ð
\8dí
\8f\9c
164 Insert( Getroot(), argpath , 1);//root
\83p
\83X
\82ð
\91}
\93ü
172 //NGword
\83t
\83@
\83C
\83\8b\82Ì
\93Ç
\82Ý
\8d\9e\82Ý
173 function TAbon.LoadFromNGwordFile(path :String) : boolean;
175 bufstl : TStringList;
177 path := Getfullpath(path);
178 if path = '' then begin
181 bufstl := TStringList.Create;
184 bufstl.LoadFromFile(path);
185 LoadFromStringList( bufstl );
188 if CreateNGwordFile = true then begin
189 bufstl.SaveToFile(path);
199 //NGword
\83\8a\83X
\83g
\93Ç
\82Ý
\8d\9e\82Ý
200 procedure TAbon.LoadFromStringList( bufstl : TStringList );
205 for i := bufstl.Count -1 downto 0 do begin
206 if bufstl.Strings[i] = '' then begin
210 SetLength(Ftokens,bufstl.Count);
211 for i := 0 to bufstl.Count -1 do begin
212 SetTokens(i , bufstl.Strings[i]);
219 //NGwordpath
\82ª
\8aù
\82É
\90Ý
\92è
\82³
\82ê
\82Ä
\82¢
\82é
\82Æ
\82«
\82Ì
\83\8a\83\8d\81[
\83h
\97p
\8aÖ
\90\94
220 function TAbon.ReLoadFromNGwordFile() : boolean;
222 if GetNGwordpath() ='' then begin
225 Result := LoadFromNGwordFile( GetNGwordpath() );
228 function TAbon.Getlistpath() : String;
232 procedure TAbon.Setlistpath(const Value : String);
234 Flistpath := Getfullpath(Value);
236 //
\88ê
\8ds
\82Ì
\92\86\82Ì
\83g
\81[
\83N
\83\93\82ð
\90Ø
\82è
\95ª
\82¯
\82Ä
\83Z
\83b
\83g
237 procedure TAbon.SetTokens(index: integer ; argline : String);
240 bufstl : TStringList;
246 bufstl := TStringList.Create;
248 if Length(argline) > 0 then begin
249 pos := AnsiPos(#9,argline);
250 while pos <> 0 DO begin
251 buftoken := Copy(argline,1,pos-1);
252 Delete(argline,1,pos);
253 if Length(buftoken) > 0 then begin
254 bufstl.Append(buftoken);
255 end else if ( bufstl.Count = 0 ) then begin
258 pos := AnsiPos(#9,argline);
260 if Length(argline) > 0 then begin
261 bufstl.Append(argline);
264 SetLength(Ftokens[index],ret);
265 for i := 0 to bufstl.Count - 1 do begin
266 Ftokens[index][i] := bufstl.Strings[i];
274 //Debug
\97p
\82¿
\82á
\82ñ
\82ÆNG
\83\8f\81[
\83h
\82ð
\8fE
\82¦
\82Ä
\82¢
\82é
\82©
275 function TAbon.ShowAllTokens() : String;
281 for i := 0 to High(Ftokens) do begin
282 for j := 0 to High(Ftokens[i]) do begin
283 ret := ret + Ftokens[i][j];
291 //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
292 //
\82à
\82µ
\82à
\93§
\96¾
\82 \82Ú
\81`
\82ñ
\82É
\82·
\82é
\82È
\82çInbisible
\82ðtrue
\82É
\82µ
\82Ä
\95Ô
\82·
293 function TAbon.FindNGwords(const line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; //1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
302 if AnsiPos(FAbonString,line) <> 1 then begin
303 for lines := 0 to High(Ftokens) do begin
306 if Ftokens[lines][0] <> '' then begin
314 for cells := start to High(Ftokens[lines]) do begin
315 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
319 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
322 if hit = true then begin
323 NGwordsLineNum := lines + 1;
330 //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
331 //
\82à
\82µ
\82à
\93§
\96¾
\82 \82Ú
\81`
\82ñ
\82É
\82·
\82é
\82È
\82çInbisible
\82ðtrue
\82É
\82µ
\82Ä
\95Ô
\82·
332 //
\94¼
\8ap
\91S
\8ap
\96³
\8e\8b
333 function TAbon.FindNGwordsEx(const line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean;//1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
342 if AnsiPos(FAbonString,line) <> 1 then begin
343 for lines := 0 to High(Ftokens) do begin
346 if Ftokens[lines][0] <> '' then begin
354 for cells := start to High(Ftokens[lines]) do begin
355 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
359 Delete(bufline, AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
362 if hit = true then begin
363 NGwordsLineNum := lines + 1;
370 //
\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
371 procedure TAbon.Execute(var ThreadStrings : TStringList);
374 NGwordsLine : Integer;
378 for i:=0 to ThreadStrings.Count - 1 do begin
380 if FindNGwords(ThreadStrings.Strings[i], NGwordsLine ,invisi) <> Reverse then begin
381 if invisi = true then begin
382 ThreadStrings.Strings[i] := '';
384 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
385 ThreadStrings.Strings[i] := FAbonString;
386 end else if not ReturnNGwordLineNum then begin
387 ThreadStrings.Strings[i] := Format(' <> <> <>>%d<><>',[(i+1)]);
388 end else if not SetNGResAnchor then begin
389 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]);
391 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)]);
395 bufline := ThreadStrings.Strings[i];
396 if Deleterlo = true then begin
397 bufline := CustomStringReplace(bufline,'&rlo;','');
398 bufline := CustomStringReplace(bufline,'&lro;','');
400 if Replaceul = true then begin
401 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
402 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
404 if DeleteSyria = true then
405 bufline := TreatSyria(bufline);
406 ThreadStrings.Strings[i] := bufline;
410 procedure TAbon.Execute(var ResString : String; ResNumber : Integer);
412 NGwordsLine : Integer;
417 if FindNGwords(ResString, NGwordsLine ,invisi) <> Reverse then begin
418 if invisi = true then begin
421 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
422 ResString := FAbonString;
423 end else if not ReturnNGwordLineNum then begin
424 ResString := Format(' <> <> <>>%d<><>',[(ResNumber)]);
425 end else if not SetNGResAnchor then begin
426 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
428 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)]);
432 bufline := ResString;
433 if Deleterlo = true then begin
434 bufline := CustomStringReplace( bufline,'&rlo;','' );
435 bufline := CustomStringReplace( bufline,'&lro;','' );
437 if Replaceul = true then begin
438 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
439 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
441 if DeleteSyria = true then
442 bufline := TreatSyria(bufline);
443 ResString := bufline;
447 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStringList);
451 SetLength(Ftokens,NGwords.Count);
452 for i := 0 to NGwords.Count -1 do begin
453 SetTokens(i , NGwords.Strings[i]);
455 Execute(ThreadStrings);
458 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStrings);
463 buf := TStringList.Create;
464 buf.AddStrings(NGwords);
465 SetLength(Ftokens,buf.Count);
466 for i := 0 to buf.Count -1 do begin
467 SetTokens(i , buf.Strings[i]);
469 Execute(ThreadStrings);
473 //
\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
474 procedure TAbon.ExecuteEx(var ThreadStrings : TStringList);
477 NGwordsLine : Integer;
481 for i:=0 to ThreadStrings.Count - 1 do begin
483 if FindNGwordsEx(ThreadStrings.Strings[i], NGwordsLine ,invisi) <> Reverse then begin
484 if invisi = true then begin
485 ThreadStrings.Strings[i] := '';
487 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
488 ThreadStrings.Strings[i] := FAbonString;
489 end else if not ReturnNGwordLineNum then begin
490 ThreadStrings.Strings[i] := Format(' <> <> <>>%d<><>',[(i+1)]);
491 end else if not SetNGResAnchor then begin
492 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]);
494 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)]);
498 bufline := ThreadStrings.Strings[i];
499 if Deleterlo = true then begin
500 bufline := CustomStringReplace(bufline,'&rlo;','');
501 bufline := CustomStringReplace(bufline,'&lro;','');
503 if Replaceul = true then begin
504 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
505 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
507 if DeleteSyria = true then
508 bufline := TreatSyria(bufline);
509 ThreadStrings.Strings[i] := bufline;
513 procedure TAbon.ExecuteEx(var ResString : String; ResNumber : Integer);
515 NGwordsLine : Integer;
520 if FindNGwordsEx(ResString, NGwordsLine ,invisi) <> Reverse then begin
521 if invisi = true then begin
524 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
525 ResString := FAbonString;
526 end else if not ReturnNGwordLineNum then begin
527 ResString := Format(' <> <> <>>%d<><>',[(ResNumber)]);
528 end else if not SetNGResAnchor then begin
529 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
531 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)]);
535 bufline := ResString;
536 if Deleterlo = true then begin
537 bufline := CustomStringReplace( bufline,'&rlo;','' );
538 bufline := CustomStringReplace( bufline,'&lro;','' );
540 if Replaceul = true then begin
541 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
542 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
544 if DeleteSyria = true then
545 bufline := TreatSyria(bufline);
546 ResString := bufline;
550 procedure TAbon.ExecuteEx(var ThreadStrings : TStringList; NGwords : TStringList);
554 SetLength(Ftokens,NGwords.Count);
555 for i := 0 to NGwords.Count -1 do begin
556 SetTokens(i , NGwords.Strings[i]);
558 ExecuteEx(ThreadStrings);
561 procedure TAbon.ExecuteEx(var ThreadStrings : TStringList; NGwords : TStrings);
566 buf := TStringList.Create;
567 buf.AddStrings(NGwords);
568 SetLength(Ftokens,buf.Count);
569 for i := 0 to buf.Count -1 do begin
570 SetTokens(i , buf.Strings[i]);
572 ExecuteEx(ThreadStrings);
576 //****************************************************************************//
577 //
\8c»
\8dÝ
\83Z
\83b
\83g
\82³
\82ê
\82Ä
\82¢
\82éNGword.txt
\82ð
\8aJ
\82
578 procedure TAbon.EditNGwords();
580 ShellExecute(0 ,nil,PChar(FNGwordpath),nil,nil,SW_SHOW);
582 //
\83|
\83b
\83v
\83A
\83b
\83v
\97p
\94»
\92è
\8aÖ
\90\94
583 function TAbon.CheckAbonPopupRes(line : String) :Boolean;
588 if AbonPopupRes = true then begin
589 Result := FindNGwords(line, i ,v);
594 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ==============================================
595 //List
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
596 function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;
599 listStringList.LoadFromFile(path);
602 listStringList.Append('
\88ê
\94Ê=NGword.txt');
603 listStringList.SaveToFile(path);
607 //List
\82Ì
\88ê
\82Â
\8e\9f\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
608 function TAbon.GoForward() : Boolean;
610 FNGwordFileIndex := FNGwordFileIndex + 1;
611 Result := ReadNGwordslist(FNGwordFileIndex);
613 //List
\82Ì
\88ê
\82Â
\91O
\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
614 function TAbon.GoBack() : Boolean;
616 FNGwordFileIndex := FNGwordFileIndex -1;
617 Result := ReadNGwordslist(FNGwordFileIndex);
619 //List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
620 procedure TAbon.GoHome();
622 FNGwordFileIndex := 0;
623 ReadNGwordslist(FNGwordFileIndex);
625 //List
\82Ìline
\8ds
\96Ú
\82ð
\93Ç
\82Þ
626 function TAbon.ReadNGwordslist(line : Integer) : Boolean;
628 liststl : TStringList;
631 liststl := TStringList.Create;
633 if LoadListFile(Flistpath,liststl) = true then begin
634 if line < 0 then begin
635 line := liststl.Count - 1;
636 FNGwordFileIndex := liststl.Count - 1;
637 end else if line > liststl.Count - 1 then begin
639 FNGwordFileIndex := 0;
641 linebuf := liststl.Strings[line];
642 FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);
643 Delete(linebuf,1,AnsiPos('=',linebuf));
644 SetNGwordpath(linebuf);
654 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ=====
\82±
\82±
\82Ü
\82Å=================================
655 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\8eÀ
\8ds
\8aÖ
\90\94
656 procedure TAbon.IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String);
660 if FileExists(SetResNumFile) = true then begin
661 if LoadFromSetResNumFile(SetResNumFile) = true then begin
662 for i := 0 to High(FAbonRes) do begin
663 if (FAbonRes[i].Res <= ThreadStrings.Count) and (FAbonRes[i].Res > 0) then begin
664 if FAbonRes[i].option = 0 then begin
665 ThreadStrings.Strings[FAbonRes[i].Res-1] := '';
667 ThreadStrings.Strings[FAbonRes[i].Res-1] := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
674 FIndividualFileName := SetResNumFile;
675 SetLength(FAbonRes,1);
676 FAbonRes[0].Res := 0;
677 FAbonRes[0].option := -1;
680 procedure TAbon.IndividualAbon(var ResString : String; SetResNumFile : String; ResNumber : Integer);
684 if FileExists(SetResNumFile) = true then begin
685 if LoadFromSetResNumFile(SetResNumFile) = true then begin
686 for i := 0 to High(FAbonRes) do begin
687 if FAbonRes[i].Res = ResNumber then begin
688 if FAbonRes[i].option = 0 then begin
691 ResString := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
698 FIndividualFileName := SetResNumFile;
699 SetLength(FAbonRes,1);
700 FAbonRes[0].Res := 0;
701 FAbonRes[0].option := -1;
705 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
\8aÖ
\90\94
706 function TAbon.LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
708 bufStringList : TStringList;
712 bufStringList := TStringList.Create;
715 bufStringList.LoadFromFile(SetResNumFile);
716 FIndividualFileName := SetResNumFile;
718 for i := bufStringList.Count-1 downto 0 do begin
719 if bufStringList.Strings[i] = '' then begin
720 bufStringList.Delete(i);
724 //
\83\81\83\82\83\8a\8am
\95Û
725 SetLength(FAbonRes,bufStringList.Count);
727 for i :=0 to bufStringList.Count - 1 do begin
728 bufLine := Trim(bufStringList.Strings[i]);
729 FAbonRes[i].Res := StrToInt(Copy(bufLine,1,AnsiPos('-',bufLine)-1));
730 FAbonRes[i].option := StrToInt(Copy(bufLine,AnsiPos('-',bufLine)+1,1));
741 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82É
\92Ç
\89Á
742 procedure TAbon.AddIndividualAbon( ResNum : Integer ; option : Integer);
744 IndividualFile : TStringList;
748 IndividualFile := TStringList.Create;
749 if FAbonRes[0].Res <> 0 then begin
750 for i := 0 to High(FAbonRes) do begin
751 if FAbonRes[i].Res <> ResNum then begin
752 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
753 IndividualFile.Append(linebuf);
757 linebuf := IntToStr(ResNum) + '-' + IntToStr(option);
758 IndividualFile.Append(linebuf);
760 IndividualFile.SaveToFile(FIndividualFileName);
765 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82©
\82ç
\8dí
\8f\9c
766 procedure TAbon.DeleteIndividualAbon( ResNum : Integer);
768 IndividualFile : TStringList;
772 IndividualFile := TStringList.Create;
773 if FAbonRes[0].Res <> 0 then begin
774 for i := 0 to High(FAbonRes) do begin
775 if FAbonRes[i].Res <> ResNum then begin
776 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
777 IndividualFile.Append(linebuf);
781 if IndividualFile.Count <> 0 then begin
783 IndividualFile.SaveToFile(FIndividualFileName);
788 if FileExists(FIndividualFileName) = true then begin
789 DeleteFile(FIndividualFileName);
793 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83\8a\83X
\83g
\82Ì
\8cÂ
\90\94\82ð
\95Ô
\82·
794 function TAbon.GetAbonResCount() : Integer;
798 if FAbonRes[0].Res = 0 then begin
805 //
\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·
806 function TAbon.GetAbonResString(Num : Integer) : String;
808 if (Num <= High(FAbonRes)) and (Num >= 0) then begin
809 Result := IntToStr(FAbonRes[Num].Res);
814 //
\83|
\83b
\83v
\83A
\83b
\83v
\82Ì
\94»
\92è
\97p
815 function TAbon.CheckIndividualAbonList(ResNum : Integer) : Boolean;
819 if FAbonRes[0].Res <> 0 then begin
820 for i := 0 to High(FAbonRes) do begin
821 if FAbonRes[i].Res = ResNum then begin
830 //
\83V
\83\8a\83A
\8cê
\83u
\83\89\83N
\83\89\91Î
\8dô
831 function TAbon.TreatSyria(AString: string): string;
833 //count: Integer; //(܀~ݏ)
837 pos := AnsiPos('', AString);
838 while pos <> 0 do begin
839 if StrToIntDef(Copy(AString, pos+4, 2), -1) > 0 then begin
840 if (AString[pos+6] = ';' ) or (AString[pos+6] = ' ') then begin
841 tmp := tmp + Copy(AString, 1, pos - 1);
842 Delete(AString, 1, pos+6);
843 end else if StrToIntDef(AString[pos+6], -1) = -1 then begin
844 tmp := tmp + Copy(AString, 1, pos - 1);
845 Delete(AString, 1, pos+5);
847 tmp := tmp + Copy(AString, 1, pos + 5);
848 Delete(AString, 1, pos+5);
851 tmp := tmp + Copy(AString, 1, pos + 5);
852 Delete(AString, 1, pos+5);
854 pos := AnsiPos('', AString);
856 if Length(AString) > 0 then
857 tmp := tmp + AString;
861 pos := AnsiPos('³', AString);
862 while pos <> 0 do begin
863 if StrToIntDef(Copy(AString, pos+5, 1), 0) > 2 then begin
864 if (AString[pos+6] = ';') or (AString[pos+6] = ' ') then begin
865 tmp := tmp + Copy(AString, 1, pos - 1);
866 Delete(AString, 1, pos+6);
867 end else if StrToIntDef(AString[pos+6], -1) = -1 then begin
868 tmp := tmp + Copy(AString, 1, pos - 1);
869 Delete(AString, 1, pos+5);
871 tmp := tmp + Copy(AString, 1, pos + 5);
872 Delete(AString, 1, pos+5);
875 tmp := tmp + Copy(AString, 1, pos + 5);
876 Delete(AString, 1, pos+5);
878 pos := AnsiPos('³', AString);
880 if Length(AString) > 0 then
881 tmp := tmp + AString;