mirror of
https://github.com/Jetsparrow/antiantiswearingbot.git
synced 2026-01-21 07: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 struct UnbleeperSettings
|
||||||
{
|
{
|
||||||
public string BleepedSwearsRegex { get; private set; }
|
public string BleepedSwearsRegex { get; private set; }
|
||||||
|
public int MinAmbiguousWordLength { get; private set; }
|
||||||
|
public int MinWordLength { get; private set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct SearchDictionarySettings
|
public struct SearchDictionarySettings
|
||||||
|
|||||||
@ -36,8 +36,8 @@ namespace AntiAntiSwearingBot
|
|||||||
!Language.IsTelegramMention(w)
|
!Language.IsTelegramMention(w)
|
||||||
&& Language.HasNonWordChars(w)
|
&& Language.HasNonWordChars(w)
|
||||||
&& !Language.IsHashTag(w)
|
&& !Language.IsHashTag(w)
|
||||||
&& (Language.HasWordChars(w) || w.Length > 5)
|
&& (Language.HasWordChars(w) || w.Length >= Cfg.MinAmbiguousWordLength)
|
||||||
&& w.Length > 2
|
&& w.Length >= Cfg.MinWordLength
|
||||||
&& BleepedSwearsRegex.IsMatch(w)
|
&& BleepedSwearsRegex.IsMatch(w)
|
||||||
)
|
)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"Unbleeper": {
|
"Unbleeper": {
|
||||||
"BleepedSwearsRegex": "[а-яА-Я@\\*#]+"
|
"BleepedSwearsRegex": "[а-яА-Я@\\*#]+",
|
||||||
|
"MinWordLength": 3,
|
||||||
|
"MinAmbiguousWordLength": 5
|
||||||
},
|
},
|
||||||
"SearchDictionary": {
|
"SearchDictionary": {
|
||||||
"DictionaryPath": "dict/ObsceneDictionaryRu.txt",
|
"DictionaryPath": "dict/ObsceneDictionaryRu.txt",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user