OK
AJAX error!

Les forumsGrammalecte[PATCH] remove profanity

[PATCH] remove profanity

Bonjour,

Dans le cadre de la mise en paquet de grammalecte pour Debian, voici un patch enlevant les profanités dans le code source du logiciel. Ce patch est appliqué au paquet, l'idéal étant de l'intégrer directement dans le code source de grammalecte pour les futures version.

diff --git a/gc_core/py/lang_core/tests_core.py b/gc_core/py/lang_core/tests_core.py
index 1d76cda..0995e26 100644
--- a/gc_core/py/lang_core/tests_core.py
+++ b/gc_core/py/lang_core/tests_core.py
@@ -50,8 +50,7 @@ def perf (sVersion, sResultFile=""):
hDst.write("\n")


-def _fuckBackslashUTF8 (s):
- "fuck that shit"
+def _BackslashUTF8 (s):
return s.replace("\u2019", "'").replace("\u2013", "–").replace("\u2014", "—")


@@ -99,7 +98,7 @@ class TestGrammarChecking (unittest.TestCase):
# tests
if sExpectedErrors != sFoundErrors:
print("\n# Line num: " + sLineNum + \
- "\n> to check: " + _fuckBackslashUTF8(sTextToCheck) + \
+ "\n> to check: " + _BackslashUTF8(sTextToCheck) + \
"\n expected: " + sExpectedErrors + \
"\n found: " + sFoundErrors + \
"\n errors: \n" + sListErr)
@@ -107,7 +106,7 @@ class TestGrammarChecking (unittest.TestCase):
elif sExceptedSuggs:
if not self._checkSuggestions(sExceptedSuggs, sFoundSuggs):
print("\n# Line num: " + sLineNum + \
- "\n> to check: " + _fuckBackslashUTF8(sTextToCheck) + \
+ "\n> to check: " + _BackslashUTF8(sTextToCheck) + \
"\n expected: " + sExceptedSuggs + \
"\n found: " + sFoundSuggs + \
"\n errors: \n" + sListErr)
le 25 mai 2021 à 16:55

Notification par e-mail    0