Skip to content

Commit

Permalink
fix phrase counter (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
zawodskoj authored Jun 13, 2024
1 parent ea38d2c commit 7bbb7c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/VahterBanBot/Antispam.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ let phrases = [
10, [ "обучение"; "бесплатное" ]
10, [ "бесплатное"; "обучение" ]
7, [ "удаленная"; "работа" ]
7, [ "удаленный"; "заработок" ]
7, [ "удаленную"; "работу" ]
3, [ "в"; "лс" ]
3, [ "в"; "личку" ]
Expand All @@ -42,6 +43,8 @@ let countPhrases (wl: string list) =
countPhrase (List.skip ps.Length ws) (totalScore + score) phrase
else
countPhrase ws totalScore phrase
| _ :: ws ->
countPhrase ws totalScore phrase
| _ -> totalScore

List.sumBy (countPhrase wl 0) phrases
Expand Down

0 comments on commit 7bbb7c5

Please sign in to comment.