add regex;

This commit is contained in:
Chrys 2019-10-22 00:45:38 +02:00
parent aa5bb94237
commit 981bf85cf0
7 changed files with 137 additions and 130 deletions

View File

@ -44,29 +44,30 @@ _:===:Lienie unten
=:===:Istgleich
[customDict]
[emoticonDict]
# This dictionary uses regexp, so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
[\s*|'|"][\s*|'|"]:-/:===:confused
[\s*|'|"][\s*|'|"]-\.-:===:bugged
[\s*|'|"][\s*|'|"]>\.<:===:laughing
[\s*|'|"][\s*|'|"]8-X:===:skull
[\s*|'|"][\s*|'|"]>:\):===:evil smile
[\s*|'|"][\s*|'|"]>:-\):===:evil smile
[\s*|'|"][\s*|'|"]\\o/:===:Hurray
[\s*|'|"][\s*|'|"]:/:===:confused
[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
[\s*|'|"]:D[\s*|'|"]:===:laugh
[\s*|'|"];\)[\s*|'|"]:===:wink
[\s*|'|"]XD[\s*|'|"]:===:LOL
[\s*|'|"]:-\)[\s*|'|"]:===:smile
[\s*|'|"]:\)[\s*|'|"]:===:smile
[\s*|'|"]->[\s*|'|"]:===:arrow right
# This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
# example for arrow left
#(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
# or
#([ |^])<-([ ,.!?$]):===:arrow left\2
[\s*|'|"]<-[\s*|'|"]:===:arrow left
[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile

View File

@ -44,31 +44,30 @@ _:===:line
=:===:equals
[customDict]
# This dictionary uses regexp, so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
[emoticonDict]
# This dictionary uses regexp, so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
[\s*|'|"][\s*|'|"]:-/:===:confused
[\s*|'|"][\s*|'|"]-\.-:===:bugged
[\s*|'|"][\s*|'|"]>\.<:===:laughing
[\s*|'|"][\s*|'|"]8-X:===:skull
[\s*|'|"][\s*|'|"]>:\):===:evil smile
[\s*|'|"][\s*|'|"]>:-\):===:evil smile
[\s*|'|"][\s*|'|"]\\o/:===:Hurray
[\s*|'|"][\s*|'|"]:/:===:confused
[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
[\s*|'|"]:D[\s*|'|"]:===:laugh
[\s*|'|"];\)[\s*|'|"]:===:wink
[\s*|'|"]XD[\s*|'|"]:===:LOL
[\s*|'|"]:-\)[\s*|'|"]:===:smile
[\s*|'|"]:\)[\s*|'|"]:===:smile
[\s*|'|"]->[\s*|'|"]:===:arrow right
# This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
# example for arrow left
#(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
# or
#([ |^])<-([ ,.!?$]):===:arrow left\2
[\s*|'|"]<-[\s*|'|"]:===:arrow left
[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile

View File

@ -44,29 +44,30 @@ _:===:line
=:===:equals
[customDict]
[emoticonDict]
# This dictionary uses regexp, so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
[\s*|'|"][\s*|'|"]:-/:===:confused
[\s*|'|"][\s*|'|"]-\.-:===:bugged
[\s*|'|"][\s*|'|"]>\.<:===:laughing
[\s*|'|"][\s*|'|"]8-X:===:skull
[\s*|'|"][\s*|'|"]>:\):===:evil smile
[\s*|'|"][\s*|'|"]>:-\):===:evil smile
[\s*|'|"][\s*|'|"]\\o/:===:Hurray
[\s*|'|"][\s*|'|"]:/:===:confused
[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
[\s*|'|"]:D[\s*|'|"]:===:laugh
[\s*|'|"];\)[\s*|'|"]:===:wink
[\s*|'|"]XD[\s*|'|"]:===:LOL
[\s*|'|"]:-\)[\s*|'|"]:===:smile
[\s*|'|"]:\)[\s*|'|"]:===:smile
[\s*|'|"]->[\s*|'|"]:===:arrow right
# This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
# example for arrow left
#(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
# or
#([ |^])<-([ ,.!?$]):===:arrow left\2
[\s*|'|"]<-[\s*|'|"]:===:arrow left
[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile

View File

@ -44,29 +44,30 @@ _:===:subrayado
=:===:igual
[customDict]
[emoticonDict]
# This dictionary uses regexp, so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
[\s*|'|"][\s*|'|"]:-/:===:confused
[\s*|'|"][\s*|'|"]-\.-:===:bugged
[\s*|'|"][\s*|'|"]>\.<:===:laughing
[\s*|'|"][\s*|'|"]8-X:===:skull
[\s*|'|"][\s*|'|"]>:\):===:evil smile
[\s*|'|"][\s*|'|"]>:-\):===:evil smile
[\s*|'|"][\s*|'|"]\\o/:===:Hurray
[\s*|'|"][\s*|'|"]:/:===:confused
[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
[\s*|'|"]:D[\s*|'|"]:===:laugh
[\s*|'|"];\)[\s*|'|"]:===:wink
[\s*|'|"]XD[\s*|'|"]:===:LOL
[\s*|'|"]:-\)[\s*|'|"]:===:smile
[\s*|'|"]:\)[\s*|'|"]:===:smile
[\s*|'|"]->[\s*|'|"]:===:arrow right
# This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
# example for arrow left
#(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
# or
#([ |^])<-([ ,.!?$]):===:arrow left\2
[\s*|'|"]<-[\s*|'|"]:===:arrow left
[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile

View File

@ -44,29 +44,30 @@ _:===:souligné
=:===:égale à
[customDict]
[emoticonDict]
# This dictionary uses regexp, so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
[\s*|'|"][\s*|'|"]:-/:===:confused
[\s*|'|"][\s*|'|"]-\.-:===:bugged
[\s*|'|"][\s*|'|"]>\.<:===:laughing
[\s*|'|"][\s*|'|"]8-X:===:skull
[\s*|'|"][\s*|'|"]>:\):===:evil smile
[\s*|'|"][\s*|'|"]>:-\):===:evil smile
[\s*|'|"][\s*|'|"]\\o/:===:Hurray
[\s*|'|"][\s*|'|"]:/:===:confused
[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
[\s*|'|"]:D[\s*|'|"]:===:laugh
[\s*|'|"];\)[\s*|'|"]:===:wink
[\s*|'|"]XD[\s*|'|"]:===:LOL
[\s*|'|"]:-\)[\s*|'|"]:===:smile
[\s*|'|"]:\)[\s*|'|"]:===:smile
[\s*|'|"]->[\s*|'|"]:===:arrow right
# This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
# example for arrow left
#(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
# or
#([ |^])<-([ ,.!?$]):===:arrow left\2
[\s*|'|"]<-[\s*|'|"]:===:arrow left
[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile

View File

@ -44,29 +44,30 @@ _:===:podkreślnik
=:===:równa się
[customDict]
[emoticonDict]
# This dictionary uses regexp, so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
[\s*|'|"][\s*|'|"]:-/:===:confused
[\s*|'|"][\s*|'|"]-\.-:===:bugged
[\s*|'|"][\s*|'|"]>\.<:===:laughing
[\s*|'|"][\s*|'|"]8-X:===:skull
[\s*|'|"][\s*|'|"]>:\):===:evil smile
[\s*|'|"][\s*|'|"]>:-\):===:evil smile
[\s*|'|"][\s*|'|"]\\o/:===:Hurray
[\s*|'|"][\s*|'|"]:/:===:confused
[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
[\s*|'|"]:D[\s*|'|"]:===:laugh
[\s*|'|"];\)[\s*|'|"]:===:wink
[\s*|'|"]XD[\s*|'|"]:===:LOL
[\s*|'|"]:-\)[\s*|'|"]:===:smile
[\s*|'|"]:\)[\s*|'|"]:===:smile
[\s*|'|"]->[\s*|'|"]:===:arrow right
# This dictionary uses regexp when prefixed with "regex;", so be sure to escape anything that would be parsed by regexp, e.g. *, ., ^, $, etc.
regex;[\s*|'|"][\s*|'|"]<{-.-}>:===:Raves
regex;[\s*|'|"][\s*|'|"]8-\):===:smile with sunglasses
regex;[\s*|'|"][\s*|'|"]:-/:===:confused
regex;[\s*|'|"][\s*|'|"]-\.-:===:bugged
regex;[\s*|'|"][\s*|'|"]>\.<:===:laughing
regex;[\s*|'|"][\s*|'|"]8-X:===:skull
regex;[\s*|'|"][\s*|'|"]>:\):===:evil smile
regex;[\s*|'|"][\s*|'|"]>:-\):===:evil smile
regex;[\s*|'|"][\s*|'|"]\\o/:===:Hurray
regex;[\s*|'|"][\s*|'|"]:/:===:confused
regex;[\s*|'|"][\s*|'|"]8\):===:smile with sunglasses
regex;[\s*|'|"]:D[\s*|'|"]:===:laugh
regex;[\s*|'|"];\)[\s*|'|"]:===:wink
regex;[\s*|'|"]XD[\s*|'|"]:===:LOL
regex;[\s*|'|"]:-\)[\s*|'|"]:===:smile
regex;[\s*|'|"]:\)[\s*|'|"]:===:smile
regex;[\s*|'|"]->[\s*|'|"]:===:arrow right
# example for arrow left
#(?:[ |^])(<-)(?:[ ,.!?$]):===:arrow left
# or
#([ |^])<-([ ,.!?$]):===:arrow left\2
[\s*|'|"]<-[\s*|'|"]:===:arrow left
[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile
regex;[\s*|'|"]<-[\s*|'|"]:===:arrow left
regex;[\s*|'|"][O|o][O|o][\s*|'|"]:===:WTF?
regex;[\s*|'|"]\^\^[\s*|'|"]:===:enjoy smile

View File

@ -39,9 +39,12 @@ class punctuationManager():
if customDict:
for key,item in customDict.items():
try:
resultText = re.sub(str(key), seperator + str(item) + seperator, resultText)
except:
resultText = resultText.replace(str(key),seperator + str(item) + seperator)
if item.upper().startswith('REGEX;') and (len(item) > 6):
resultText = re.sub(str(key), seperator + str(item[6:]) + seperator, resultText)
else:
resultText = resultText.replace(str(key),seperator + str(item) + seperator)
except Exception as e:
self.env['runtime']['debug'].writeDebugOut("useCustomDict replace:'" + key + "' with '" + item +"' failed:" + str(e),debug.debugLevel.ERROR, onAnyLevel=False)
return resultText
def usePunctuationDict(self, text, punctuationDict, punctuation):
resultText = str(text)