mirror of
https://github.com/Jetsparrow/antiantiswearingbot.git
synced 2026-01-20 23:16:08 +03:00
moved minimum word lengths to config
This commit is contained in:
parent
453bbdf9e4
commit
5db1aefcbb
@ -11,6 +11,8 @@
|
||||
public struct UnbleeperSettings
|
||||
{
|
||||
public string BleepedSwearsRegex { get; private set; }
|
||||
public int MinAmbiguousWordLength { get; private set; }
|
||||
public int MinWordLength { get; private set; }
|
||||
}
|
||||
|
||||
public struct SearchDictionarySettings
|
||||
|
||||
@ -36,8 +36,8 @@ namespace AntiAntiSwearingBot
|
||||
!Language.IsTelegramMention(w)
|
||||
&& Language.HasNonWordChars(w)
|
||||
&& !Language.IsHashTag(w)
|
||||
&& (Language.HasWordChars(w) || w.Length > 5)
|
||||
&& w.Length > 2
|
||||
&& (Language.HasWordChars(w) || w.Length >= Cfg.MinAmbiguousWordLength)
|
||||
&& w.Length >= Cfg.MinWordLength
|
||||
&& BleepedSwearsRegex.IsMatch(w)
|
||||
)
|
||||
.ToArray();
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
{
|
||||
"Unbleeper": {
|
||||
"BleepedSwearsRegex": "[а-яА-Я@\\*#]+"
|
||||
"BleepedSwearsRegex": "[а-яА-Я@\\*#]+",
|
||||
"MinWordLength": 3,
|
||||
"MinAmbiguousWordLength": 5
|
||||
},
|
||||
"SearchDictionary": {
|
||||
"DictionaryPath": "dict/ObsceneDictionaryRu.txt",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user