| 1209 |
|
|
| 1210 |
uses |
uses |
| 1211 |
About, Option, Round, Splash, Sort, ListSelect, |
About, Option, Round, Splash, Sort, ListSelect, |
| 1212 |
NewBoard, MojuUtils,Clipbrd; |
NewBoard, MojuUtils, Clipbrd, GikoBayesian; |
| 1213 |
|
|
| 1214 |
const |
const |
| 1215 |
CAPTION_NAME: string = 'ギコナビ'; |
CAPTION_NAME: string = 'ギコナビ'; |
| 1714 |
//Samba24のファイルチェック |
//Samba24のファイルチェック |
| 1715 |
GikoSys.SambaFileExists(); |
GikoSys.SambaFileExists(); |
| 1716 |
|
|
| 1717 |
|
// スパムフィルタ学習履歴 |
| 1718 |
|
GikoSys.Bayesian.LoadFromFile( GikoSys.Setting.GetSpamFilterFileName ); |
| 1719 |
|
|
| 1720 |
// マウスジェスチャー |
// マウスジェスチャー |
| 1721 |
MouseGesture := TMouseGesture.Create; |
MouseGesture := TMouseGesture.Create; |
| 1722 |
GikoSys.Setting.Gestures.LoadGesture( |
GikoSys.Setting.Gestures.LoadGesture( |
| 9313 |
//個別あぼーん「通常」 |
//個別あぼーん「通常」 |
| 9314 |
procedure TGikoForm.IndividualAbon1Click(Sender: TObject); |
procedure TGikoForm.IndividualAbon1Click(Sender: TObject); |
| 9315 |
var |
var |
| 9316 |
ThreadItem : TThreadItem; |
ThreadItem : TThreadItem; |
| 9317 |
|
ReadList : TStringList; |
| 9318 |
|
wordCount : TWordCount; |
| 9319 |
begin |
begin |
| 9320 |
ThreadItem := GetActiveContent; |
ThreadItem := GetActiveContent; |
| 9321 |
GikoSys.FAbon.AddIndividualAbon(KokoPopupMenu.Tag, 1, ChangeFileExt(ThreadItem.GetThreadFileName, '.NG')); |
ReadList := TStringList.Create; |
| 9322 |
|
wordCount := TWordCount.Create; |
| 9323 |
|
try |
| 9324 |
|
// スパムに設定 |
| 9325 |
|
ReadList.LoadFromFile( ThreadItem.GetThreadFileName ); |
| 9326 |
|
GikoSys.Bayesian.CountWord( ReadList[ KokoPopupMenu.Tag ], wordCount ); |
| 9327 |
|
GikoSys.Bayesian.Forget( wordCount, False ); // ハムを解除 |
| 9328 |
|
GikoSys.Bayesian.Learn( wordCount, True ); // スパムに設定 |
| 9329 |
|
// あぼーんに設定 |
| 9330 |
|
GikoSys.FAbon.AddIndividualAbon(KokoPopupMenu.Tag, 1, ChangeFileExt(ThreadItem.GetThreadFileName, '.NG')); |
| 9331 |
|
finally |
| 9332 |
|
wordCount.Free; |
| 9333 |
|
ReadList.Free; |
| 9334 |
|
end; |
| 9335 |
FActiveContent.Repaint := true; |
FActiveContent.Repaint := true; |
| 9336 |
if ThreadItem <> nil then |
if ThreadItem <> nil then |
| 9337 |
InsertBrowserTab( ThreadItem, True ); |
InsertBrowserTab( ThreadItem, True ); |
| 9340 |
procedure TGikoForm.IndividualAbon2Click(Sender: TObject); |
procedure TGikoForm.IndividualAbon2Click(Sender: TObject); |
| 9341 |
var |
var |
| 9342 |
ThreadItem : TThreadItem; |
ThreadItem : TThreadItem; |
| 9343 |
|
ReadList : TStringList; |
| 9344 |
|
wordCount : TWordCount; |
| 9345 |
begin |
begin |
| 9346 |
ThreadItem := GetActiveContent; |
ThreadItem := GetActiveContent; |
| 9347 |
GikoSys.FAbon.AddIndividualAbon(KokoPopupMenu.Tag, 0, ChangeFileExt(ThreadItem.GetThreadFileName, '.NG')); |
ReadList := TStringList.Create; |
| 9348 |
|
wordCount := TWordCount.Create; |
| 9349 |
|
try |
| 9350 |
|
// スパムに設定 |
| 9351 |
|
ReadList.LoadFromFile( ThreadItem.GetThreadFileName ); |
| 9352 |
|
GikoSys.Bayesian.CountWord( ReadList[ KokoPopupMenu.Tag ], wordCount ); |
| 9353 |
|
GikoSys.Bayesian.Forget( wordCount, False ); // ハムを解除 |
| 9354 |
|
GikoSys.Bayesian.Learn( wordCount, True ); // スパムに設定 |
| 9355 |
|
// あぼーんに設定 |
| 9356 |
|
GikoSys.FAbon.AddIndividualAbon(KokoPopupMenu.Tag, 0, ChangeFileExt(ThreadItem.GetThreadFileName, '.NG')); |
| 9357 |
|
finally |
| 9358 |
|
wordCount.Free; |
| 9359 |
|
ReadList.Free; |
| 9360 |
|
end; |
| 9361 |
FActiveContent.Repaint := true; |
FActiveContent.Repaint := true; |
| 9362 |
if ThreadItem <> nil then |
if ThreadItem <> nil then |
| 9363 |
InsertBrowserTab( ThreadItem, True ); |
InsertBrowserTab( ThreadItem, True ); |
| 9368 |
IndividualForm :TIndividualAbonForm; |
IndividualForm :TIndividualAbonForm; |
| 9369 |
ThreadItem : TThreadItem; |
ThreadItem : TThreadItem; |
| 9370 |
msg : String; |
msg : String; |
| 9371 |
|
ReadList : TStringList; |
| 9372 |
|
wordCount : TWordCount; |
| 9373 |
begin |
begin |
| 9374 |
IndividualForm := TIndividualAbonForm.Create(Self); |
IndividualForm := TIndividualAbonForm.Create(Self); |
| 9375 |
try |
try |
| 9376 |
ThreadItem := GetActiveContent; |
ThreadItem := GetActiveContent; |
| 9377 |
if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin |
if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin |
| 9378 |
if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin |
if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin |
| 9379 |
if IndividualForm.DeleteNG(KokoPopupMenu.Tag) then begin |
ReadList := TStringList.Create; |
| 9380 |
FActiveContent.Repaint := true; |
wordCount := TWordCount.Create; |
| 9381 |
InsertBrowserTab( ThreadItem, True ); |
try |
| 9382 |
|
// スパムを解除 |
| 9383 |
|
ReadList.LoadFromFile( ThreadItem.GetThreadFileName ); |
| 9384 |
|
GikoSys.Bayesian.CountWord( ReadList[ KokoPopupMenu.Tag ], wordCount ); |
| 9385 |
|
GikoSys.Bayesian.Forget( wordCount, True ); // スパムを解除 |
| 9386 |
|
GikoSys.Bayesian.Learn( wordCount, False ); // ハムに設定 |
| 9387 |
|
if IndividualForm.DeleteNG(KokoPopupMenu.Tag) then begin |
| 9388 |
|
FActiveContent.Repaint := true; |
| 9389 |
|
InsertBrowserTab( ThreadItem, True ); |
| 9390 |
|
end; |
| 9391 |
|
finally |
| 9392 |
|
wordCount.Free; |
| 9393 |
|
ReadList.Free; |
| 9394 |
end; |
end; |
| 9395 |
end else begin |
end else begin |
| 9396 |
msg := 'このスレッドでは個別あぼ〜んを行ってません'; |
msg := 'このスレッドでは個別あぼ〜んを行ってません'; |
| 9407 |
IndividualForm :TIndividualAbonForm; |
IndividualForm :TIndividualAbonForm; |
| 9408 |
ThreadItem : TThreadItem; |
ThreadItem : TThreadItem; |
| 9409 |
msg : String; |
msg : String; |
| 9410 |
|
ReadList : TStringList; |
| 9411 |
|
wordCount : TWordCount; |
| 9412 |
begin |
begin |
| 9413 |
IndividualForm := TIndividualAbonForm.Create(Self); |
IndividualForm := TIndividualAbonForm.Create(Self); |
| 9414 |
try |
try |
| 9416 |
if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin |
if (ThreadItem <> nil) and (ThreadItem.IsLogFile) then begin |
| 9417 |
if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin |
if IndividualForm.SetThreadLogFileName(ThreadItem.GetThreadFileName) then begin |
| 9418 |
if IndividualForm.ShowModal = mrOK then begin |
if IndividualForm.ShowModal = mrOK then begin |
| 9419 |
if IndividualForm.FRepaint then begin |
ReadList := TStringList.Create; |
| 9420 |
FActiveContent.Repaint := true; |
wordCount := TWordCount.Create; |
| 9421 |
InsertBrowserTab( ThreadItem, True ); |
try |
| 9422 |
|
// スパムを解除 |
| 9423 |
|
ReadList.LoadFromFile( ThreadItem.GetThreadFileName ); |
| 9424 |
|
GikoSys.Bayesian.CountWord( ReadList[ KokoPopupMenu.Tag ], wordCount ); |
| 9425 |
|
GikoSys.Bayesian.Forget( wordCount, True ); // スパムを解除 |
| 9426 |
|
GikoSys.Bayesian.Learn( wordCount, False ); // ハムに設定 |
| 9427 |
|
if IndividualForm.FRepaint then begin |
| 9428 |
|
FActiveContent.Repaint := true; |
| 9429 |
|
InsertBrowserTab( ThreadItem, True ); |
| 9430 |
|
end; |
| 9431 |
|
finally |
| 9432 |
|
wordCount.Free; |
| 9433 |
|
ReadList.Free; |
| 9434 |
end; |
end; |
| 9435 |
end; |
end; |
| 9436 |
end else begin |
end else begin |