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(line : String) : Boolean; overload;//1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
67 function FindNGwords(line : String; var NGwordsLineNum : Integer) : Boolean; overload;//1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
68 function FindNGwords(line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; overload;//1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
69 function Cutoff(line : String) : Boolean; //CutOff
\92l
\88È
\8fã
\8cÂ
\82Ì
\93¯
\82¶
\89p
\90\94\82ª
\95À
\82ñ
\82Å
\82¢
\82½
\82çtrue
70 //
\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)
71 procedure Execute(var ThreadStrings : TStringList); overload;
72 procedure Execute(var ThreadStrings : TStringList; NGwords : TStringList); overload;
73 procedure Execute(var ThreadStrings : TStringList; NGwords : TStrings); overload;
74 procedure Execute(var ResString : String; ResNumber : Integer); overload; //
\8eå
\82Éplugin
\82©
\82ç
\82ÌDat To HTML
\97p
75 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82µ
\82å
\82è
76 procedure IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String); overload;
77 procedure IndividualAbon(var ResString : String; SetResNumFile : String; ResNumber : Integer); overload;
78 procedure AddIndividualAbon( ResNum : Integer ; option : Integer);
79 procedure DeleteIndividualAbon( ResNum : Integer);
80 function GetAbonResCount() : Integer;
81 function GetAbonResString(Num : Integer) : String;
82 function CheckIndividualAbonList(ResNum : Integer) : Boolean;
84 function ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; overload;//DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
85 function ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
86 function ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
87 function ReverseExecuteFile(datfilepath : String) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
88 function ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
89 function ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; overload; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
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];
296 //****************************************************************************//
297 //NG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82½
\82çtrue
\82ð
\95Ô
\82·
\81B
298 function TAbon.FindNGwords(line : String) : Boolean;
306 if AnsiPos(FAbonString,line) <> 1 then begin
307 for lines := 0 to High(Ftokens) do begin
310 for cells := 0 to High(Ftokens[lines]) do begin
311 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
315 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
318 if hit = true then begin
325 //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·
326 function TAbon.FindNGwords(line : String; var NGwordsLineNum : Integer) : Boolean;
334 if AnsiPos(FAbonString,line) <> 1 then begin
335 for lines := 0 to High(Ftokens) do begin
338 for cells := 0 to High(Ftokens[lines]) do begin
339 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
343 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
346 if hit = true then begin
347 NGwordsLineNum := lines + 1;
354 //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
355 //
\82à
\82µ
\82à
\93§
\96¾
\82 \82Ú
\81`
\82ñ
\82É
\82·
\82é
\82È
\82çInbisible
\82ðtrue
\82É
\82µ
\82Ä
\95Ô
\82·
356 function TAbon.FindNGwords(line : String; var NGwordsLineNum : Integer; var Invisible : Boolean) : Boolean; //1
\83\89\83C
\83\93\82¸
\82Â
\97p
\81B
365 if AnsiPos(FAbonString,line) <> 1 then begin
366 for lines := 0 to High(Ftokens) do begin
369 if Ftokens[lines][0] <> '' then begin
377 for cells := start to High(Ftokens[lines]) do begin
378 if AnsiPos(Ftokens[lines][cells],bufline) = 0 then begin
382 Delete(bufline,AnsiPos(Ftokens[lines][cells],bufline),Length(Ftokens[lines][cells]));
385 if hit = true then begin
386 NGwordsLineNum := lines + 1;
394 //CutOff
\92l
\88È
\8fã
\8cÂ
\82Ì
\93¯
\82¶
\89p
\90\94\82ª
\95À
\82ñ
\82Å
\82¢
\82½
\82çtrue
395 function TAbon.Cutoff(line : String) : Boolean;
403 if FCutoffNum <> 0 then begin
404 for i := 65 to 90 do begin
406 buf := DupeString(sheed, FCutoffNum);
407 if AnsiContainsText(line, buf) = true then begin
415 //
\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
416 procedure TAbon.Execute(var ThreadStrings : TStringList);
419 NGwordsLine : Integer;
423 for i:=0 to ThreadStrings.Count - 1 do begin
425 if FindNGwords(ThreadStrings.Strings[i], NGwordsLine ,invisi) <> Reverse then begin
426 if invisi = true then begin
427 ThreadStrings.Strings[i] := '';
429 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
430 ThreadStrings.Strings[i] := FAbonString;
431 end else if not ReturnNGwordLineNum then begin
432 ThreadStrings.Strings[i] := Format(' <> <> <>>%d<><>',[(i+1)]);
433 end else if not SetNGResAnchor then begin
434 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]);
436 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)]);
440 bufline := ThreadStrings.Strings[i];
441 if Deleterlo = true then begin
442 bufline := CustomStringReplace(bufline,'&rlo;','');
443 bufline := CustomStringReplace(bufline,'&lro;','');
445 if Replaceul = true then begin
446 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
447 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
449 if DeleteSyria = true then
450 bufline := TreatSyria(bufline);
451 ThreadStrings.Strings[i] := bufline;
455 procedure TAbon.Execute(var ResString : String; ResNumber : Integer);
457 NGwordsLine : Integer;
462 if FindNGwords(ResString, NGwordsLine ,invisi) <> Reverse then begin
463 if invisi = true then begin
466 if not ReturnNGwordLineNum and not SetNGResAnchor then begin
467 ResString := FAbonString;
468 end else if not ReturnNGwordLineNum then begin
469 ResString := Format(' <> <> <>>%d<><>',[(ResNumber)]);
470 end else if not SetNGResAnchor then begin
471 ResString := Format(' <> <> <><B> %d
\8ds
\96Ú
\82ÌNG
\83\8f\81[
\83h
\82ª
\8aÜ
\82Ü
\82ê
\82Ä
\82¢
\82Ü
\82·
\81B</B><><>',[NGwordsLine]);
473 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)]);
477 bufline := ResString;
478 if Deleterlo = true then begin
479 bufline := CustomStringReplace( bufline,'&rlo;','' );
480 bufline := CustomStringReplace( bufline,'&lro;','' );
482 if Replaceul = true then begin
483 bufline := CustomStringReplace( bufline,'<ul>','<br>' );
484 bufline := CustomStringReplace( bufline,'</ul>','<br>' );
486 if DeleteSyria = true then
487 bufline := TreatSyria(bufline);
488 ResString := bufline;
492 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStringList);
496 SetLength(Ftokens,NGwords.Count);
497 for i := 0 to NGwords.Count -1 do begin
498 SetTokens(i , NGwords.Strings[i]);
500 Execute(ThreadStrings);
503 procedure TAbon.Execute(var ThreadStrings : TStringList; NGwords : TStrings);
508 buf := TStringList.Create;
509 buf.AddStrings(NGwords);
510 SetLength(Ftokens,buf.Count);
511 for i := 0 to buf.Count -1 do begin
512 SetTokens(i , buf.Strings[i]);
514 Execute(ThreadStrings);
519 //****************************************************************************//
520 //DAT
\82ð
\92¼
\82É
\82¢
\82¶
\82é
\93z
\82ç===========================================================
521 //NG
\83\8f\81[
\83h
\82ð
\8aÜ
\82Þ
\83\8c\83X
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\82ð
\91}
\93ü
522 function TAbon.ExecuteFile(datfilepath : String; NGwordpath : String) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
524 datstl : TStringList;
528 datstl := TStringList.Create;
532 datstl.LoadFromFile(datfilepath);
533 for i := 0 to datstl.Count -1 do begin
534 if FindNGwords(datstl.Strings[i]) = true then begin
535 datstl.Strings[i] := FAbonString + datstl.Strings[i]
539 datstl.SaveToFile(datfilepath);
549 //
\8ew
\92è
\82³
\82ê
\82½
\83\8c\83X
\94Ô
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\91}
\93ü
550 function TAbon.ExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
552 datstl : TStringList;
556 datstl := TStringList.Create;
559 datstl.LoadFromFile(datfilepath);
560 if (resnum > 0) and (resnum <= datstl.Count) then begin
561 if AnsiPos(FAbonString, datstl.Strings[resnum-1]) <> 1 then begin
562 datstl.Strings[resnum-1] := FAbonString + datstl.Strings[resnum-1];
565 datstl.SaveToFile(datfilepath);
574 //firstres
\82©
\82çcount
\8cÂ
\82Ì
\83\8c\83X
\82Ì
\90æ
\93ª
\82É
\82 \82Ú
\81[
\82ñ
\91}
\93ü
575 function TAbon.ExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
577 datstl : TStringList;
579 endnum : Integer; //
\8fI
\82í
\82è
\82Ì
\83\8c\83X
\94Ô
583 datstl := TStringList.Create;
586 datstl.LoadFromFile(datfilepath);
587 if (firstres > 0) and (firstres <= datstl.Count) then begin
588 if firstres + count -1 > datstl.Count then begin
589 endnum := datstl.Count;
590 end else if count <= 0 then begin
591 endnum := firstres + 1;
593 endnum := firstres + count -1;
596 for i := firstres to endnum do begin
597 if AnsiPos(FAbonString, datstl.Strings[i-1]) <> 1 then begin
598 datstl.Strings[i-1] := FAbonString + datstl.Strings[i-1];
602 datstl.SaveToFile(datfilepath);
611 //DAT
\82ð
\92¼
\82É
\82¢
\82¶
\82é
\93z
\82ç==========
\82±
\82±
\82Ü
\82Å=========================================
613 //
\8c³
\82É
\96ß
\82·
\93z
\82ç==================================================================
614 function TAbon.ReverseExecuteFile(datfilepath : String) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
616 datstl : TStringList;
622 datstl := TStringList.Create;
625 datstl.LoadFromFile(datfilepath);
626 for i:=0 to datstl.Count -1 do begin
627 if AnsiPos(FAbonString, datstl.Strings[i]) = 1 then begin
628 buf := datstl.Strings[i];
629 Delete(buf,1,Length(FAbonString));
630 datstl.Strings[i] := buf;
633 datstl.SaveToFile(datfilepath);
643 function TAbon.ReverseExecuteFile(datfilepath : String; resnum : Integer) : Boolean; //DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
645 datstl : TStringList;
650 datstl := TStringList.Create;
653 datstl.LoadFromFile(datfilepath);
654 if (resnum > 0) and (resnum <= datstl.Count) then begin
655 if AnsiPos(FAbonString, datstl.Strings[resnum-1]) = 1 then begin
656 buf := datstl.Strings[resnum-1];
657 Delete(buf,1,Length(FAbonString));
658 datstl.Strings[resnum-1] := buf;
661 datstl.SaveToFile(datfilepath);
671 function TAbon.ReverseExecuteFile(datfilepath : String; firstres : Integer; count : Integer) : Boolean;//DAT
\83t
\83@
\83C
\83\8b\82ð
\92¼
\82É
\82¢
\82¶
\82é
673 datstl : TStringList;
675 endnum : Integer; //
\8fI
\82í
\82è
\82Ì
\83\8c\83X
\94Ô
680 datstl := TStringList.Create;
683 datstl.LoadFromFile(datfilepath);
684 if (firstres > 0) and (firstres <= datstl.Count) then begin
685 if firstres + count -1 > datstl.Count then begin
686 endnum := datstl.Count;
687 end else if count <= 0 then begin
688 endnum := firstres + 1;
690 endnum := firstres + count -1;
692 for i := firstres to endnum do begin
693 if AnsiPos(FAbonString, datstl.Strings[i-1]) = 1 then begin
694 buf := datstl.Strings[i-1];
695 Delete(buf,1,Length(FAbonString));
696 datstl.Strings[i-1] := buf;
700 datstl.SaveToFile(datfilepath);
709 //
\8c³
\82É
\96ß
\82·
\93z
\82ç=================
\82±
\82±
\82Ü
\82Å=========================================
710 //
\8c»
\8dÝ
\83Z
\83b
\83g
\82³
\82ê
\82Ä
\82¢
\82éNGword.txt
\82ð
\8aJ
\82
711 procedure TAbon.EditNGwords();
713 ShellExecute(0 ,nil,PChar(FNGwordpath),nil,nil,SW_SHOW);
715 //
\83|
\83b
\83v
\83A
\83b
\83v
\97p
\94»
\92è
\8aÖ
\90\94
716 function TAbon.CheckAbonPopupRes(line : String) :Boolean;
718 if AbonPopupRes = true then begin
719 Result := FindNGwords(line);
724 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ==============================================
725 //List
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
726 function TAbon.LoadListFile(path :String; listStringList : TStringList) : Boolean;
729 listStringList.LoadFromFile(path);
732 listStringList.Append('
\88ê
\94Ê=NGword.txt');
733 listStringList.SaveToFile(path);
737 //List
\82Ì
\88ê
\82Â
\8e\9f\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
738 function TAbon.GoForward() : Boolean;
740 FNGwordFileIndex := FNGwordFileIndex + 1;
741 Result := ReadNGwordslist(FNGwordFileIndex);
743 //List
\82Ì
\88ê
\82Â
\91O
\82ÌNG
\83\8f\81[
\83h
\83t
\83@
\83C
\83\8b\82ð
\93Ç
\82Ý
\8d\9e\82Þ
744 function TAbon.GoBack() : Boolean;
746 FNGwordFileIndex := FNGwordFileIndex -1;
747 Result := ReadNGwordslist(FNGwordFileIndex);
749 //List
\82Ì
\82P
\8ds
\96Ú
\82ð
\93Ç
\82Þ
750 procedure TAbon.GoHome();
752 FNGwordFileIndex := 0;
753 ReadNGwordslist(FNGwordFileIndex);
755 //List
\82Ìline
\8ds
\96Ú
\82ð
\93Ç
\82Þ
756 function TAbon.ReadNGwordslist(line : Integer) : Boolean;
758 liststl : TStringList;
761 liststl := TStringList.Create;
763 if LoadListFile(Flistpath,liststl) = true then begin
764 if line < 0 then begin
765 line := liststl.Count - 1;
766 FNGwordFileIndex := liststl.Count - 1;
767 end else if line > liststl.Count - 1 then begin
769 FNGwordFileIndex := 0;
771 linebuf := liststl.Strings[line];
772 FNGwordname := Copy(linebuf,1,AnsiPos('=',linebuf)-1);
773 Delete(linebuf,1,AnsiPos('=',linebuf));
774 SetNGwordpath(linebuf);
784 //
\95¡
\90\94\82ÌNG
\83\8f\81[
\83h
\83e
\83L
\83X
\83g
\82ð
\93Ç
\82Ý
\8d\9e\82Þ=====
\82±
\82±
\82Ü
\82Å=================================
785 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\8eÀ
\8ds
\8aÖ
\90\94
786 procedure TAbon.IndividualAbon(var ThreadStrings : TStringList; SetResNumFile : String);
790 if FileExists(SetResNumFile) = true then begin
791 if LoadFromSetResNumFile(SetResNumFile) = true then begin
792 for i := 0 to High(FAbonRes) do begin
793 if (FAbonRes[i].Res <= ThreadStrings.Count) and (FAbonRes[i].Res > 0) then begin
794 if FAbonRes[i].option = 0 then begin
795 ThreadStrings.Strings[FAbonRes[i].Res-1] := '';
797 ThreadStrings.Strings[FAbonRes[i].Res-1] := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
804 FIndividualFileName := SetResNumFile;
805 SetLength(FAbonRes,1);
806 FAbonRes[0].Res := 0;
807 FAbonRes[0].option := -1;
810 procedure TAbon.IndividualAbon(var ResString : String; SetResNumFile : String; ResNumber : Integer);
814 if FileExists(SetResNumFile) = true then begin
815 if LoadFromSetResNumFile(SetResNumFile) = true then begin
816 for i := 0 to High(FAbonRes) do begin
817 if FAbonRes[i].Res = ResNumber then begin
818 if FAbonRes[i].option = 0 then begin
821 ResString := '
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>
\82 \82Ú
\81`
\82ñ<>';
828 FIndividualFileName := SetResNumFile;
829 SetLength(FAbonRes,1);
830 FAbonRes[0].Res := 0;
831 FAbonRes[0].option := -1;
835 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\93Ç
\82Ý
\8d\9e\82Ý
\8aÖ
\90\94
836 function TAbon.LoadFromSetResNumFile(SetResNumFile : String) : Boolean;
838 bufStringList : TStringList;
842 bufStringList := TStringList.Create;
845 bufStringList.LoadFromFile(SetResNumFile);
846 FIndividualFileName := SetResNumFile;
848 for i := bufStringList.Count-1 downto 0 do begin
849 if bufStringList.Strings[i] = '' then begin
850 bufStringList.Delete(i);
854 //
\83\81\83\82\83\8a\8am
\95Û
855 SetLength(FAbonRes,bufStringList.Count);
857 for i :=0 to bufStringList.Count - 1 do begin
858 bufLine := Trim(bufStringList.Strings[i]);
859 FAbonRes[i].Res := StrToInt(Copy(bufLine,1,AnsiPos('-',bufLine)-1));
860 FAbonRes[i].option := StrToInt(Copy(bufLine,AnsiPos('-',bufLine)+1,1));
871 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82É
\92Ç
\89Á
872 procedure TAbon.AddIndividualAbon( ResNum : Integer ; option : Integer);
874 IndividualFile : TStringList;
878 IndividualFile := TStringList.Create;
879 if FAbonRes[0].Res <> 0 then begin
880 for i := 0 to High(FAbonRes) do begin
881 if FAbonRes[i].Res <> ResNum then begin
882 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
883 IndividualFile.Append(linebuf);
887 linebuf := IntToStr(ResNum) + '-' + IntToStr(option);
888 IndividualFile.Append(linebuf);
890 IndividualFile.SaveToFile(FIndividualFileName);
895 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\83t
\83@
\83C
\83\8b\82©
\82ç
\8dí
\8f\9c
896 procedure TAbon.DeleteIndividualAbon( ResNum : Integer);
898 IndividualFile : TStringList;
902 IndividualFile := TStringList.Create;
903 if FAbonRes[0].Res <> 0 then begin
904 for i := 0 to High(FAbonRes) do begin
905 if FAbonRes[i].Res <> ResNum then begin
906 linebuf := IntToStr(FAbonRes[i].Res) + '-' + IntToStr(FabonRes[i].option);
907 IndividualFile.Append(linebuf);
911 if IndividualFile.Count <> 0 then begin
913 IndividualFile.SaveToFile(FIndividualFileName);
918 if FileExists(FIndividualFileName) = true then begin
919 DeleteFile(FIndividualFileName);
923 //
\8cÂ
\95Ê
\82 \82Ú
\81`
\82ñ
\82Ì
\83\8a\83X
\83g
\82Ì
\8cÂ
\90\94\82ð
\95Ô
\82·
924 function TAbon.GetAbonResCount() : Integer;
928 if FAbonRes[0].Res = 0 then begin
935 //
\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·
936 function TAbon.GetAbonResString(Num : Integer) : String;
938 if (Num <= High(FAbonRes)) and (Num >= 0) then begin
939 Result := IntToStr(FAbonRes[Num].Res);
944 //
\83|
\83b
\83v
\83A
\83b
\83v
\82Ì
\94»
\92è
\97p
945 function TAbon.CheckIndividualAbonList(ResNum : Integer) : Boolean;
949 if FAbonRes[0].Res <> 0 then begin
950 for i := 0 to High(FAbonRes) do begin
951 if FAbonRes[i].Res = ResNum then begin
960 //
\83V
\83\8a\83A
\8cê
\83u
\83\89\83N
\83\89\91Î
\8dô
961 function TAbon.TreatSyria(AString: string): string;
963 //count: Integer; //(܀~ݏ)
967 pos := AnsiPos('', AString);
968 while pos <> 0 do begin
969 if AString[pos+6] = ';' then begin
970 if StrToIntDef(Copy(AString, pos+4, 2), 0) <= 71 then begin
971 tmp := tmp + Copy(AString, 1, pos - 1);
972 Delete(AString, 1, pos+6);
974 tmp := tmp + Copy(AString, 1, pos + 6);
975 Delete(AString, 1, pos+6);
978 tmp := tmp + Copy(AString, 1, pos + 3);
979 Delete(AString, 1, pos+3);
981 pos := AnsiPos('', AString);
983 if Length(AString) > 0 then
984 tmp := tmp + AString;
988 pos := AnsiPos('³', AString);
989 while pos <> 0 do begin
990 if AString[pos+6] = ';' then begin
991 if StrToIntDef(Copy(AString, pos+5, 1), 0) > 2 then begin
992 tmp := tmp + Copy(AString, 1, pos - 1);
993 Delete(AString, 1, pos+6);
995 tmp := tmp + Copy(AString, 1, pos + 6);
996 Delete(AString, 1, pos+6);
998 tmp := tmp + Copy(AString, 1, pos - 1);
999 Delete(AString, 1, pos+6);
1001 tmp := tmp + Copy(AString, 1, pos + 4);
1002 Delete(AString, 1, pos+4);
1004 pos := AnsiPos('³', AString);
1006 if Length(AString) > 0 then
1007 tmp := tmp + AString;