diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-07-20 14:07:35 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-07-20 20:25:17 +0200 |
commit | bdedc84127530fcf71c096ad572bd4306a40b26f (patch) | |
tree | 194bd6b26b495b252d907afef4c8e50dd53078b8 /ru_RU | |
parent | d4a80b15edc905f6e1213fa8d95300b8299fffec (diff) |
Fix "invalid escape sequence \w" Python exceptions
(Like
> Python exception: <class 'SyntaxError'>: invalid escape sequence \w (lightproof_impl_en.py, line 126), traceback follows
> File "instdir/program/pythonloader.py", line 133, in activate
> mod = self.getModuleFromUrl( locationUrl )
> File "instdir/program/pythonloader.py", line 101, in getModuleFromUrl
> exec(codeobject, mod.__dict__)
> File "instdir/share/extensions/dict-en/Lightproof.py", line 6, in <module>
> from lightproof_impl_en import locales
> File "instdir/program/uno.py", line 345, in _uno_import
> return _builtin_import(name, *optargs, **kwargs)
I noticed e.g. during UITest_writer_tests3.) Appears those suspicious escapes
were present ever since 2214a3731aaffc4a51d1c712dbee553a0ba35af0 "Hungarian
sentence checking", 95445a70a29c6a1166a19f483566f2c9cfc7563b "English sentence
checking", and c9cdf3fb4752e8b0c641a3aff15d554135beb0e7 "Add Russian grammar
checking + update English and Hungarian".
Change-Id: Ia2af7e0adb00b4737b22d460dd75fa47a4ae70d5
Reviewed-on: https://gerrit.libreoffice.org/c/dictionaries/+/99047
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'ru_RU')
-rw-r--r-- | ru_RU/pythonpath/lightproof_impl_ru_RU.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ru_RU/pythonpath/lightproof_impl_ru_RU.py b/ru_RU/pythonpath/lightproof_impl_ru_RU.py index 22eb59e..ffbf054 100644 --- a/ru_RU/pythonpath/lightproof_impl_ru_RU.py +++ b/ru_RU/pythonpath/lightproof_impl_ru_RU.py @@ -125,14 +125,14 @@ def suggest(rLoc, word): # get the nth word of the input string or None def word(s, n): - a = re.match("(?u)( [-.\w%%]+){" + str(n-1) + "}( [-.\w%%]+)", s) + a = re.match("(?u)( [-.\\w%%]+){" + str(n-1) + "}( [-.\\w%%]+)", s) if not a: return '' return a.group(2)[1:] # get the (-)nth word of the input string or None def wordmin(s, n): - a = re.search("(?u)([-.\w%%]+ )([-.\w%%]+ ){" + str(n-1) + "}$", s) + a = re.search("(?u)([-.\\w%%]+ )([-.\\w%%]+ ){" + str(n-1) + "}$", s) if not a: return '' return a.group(1)[:-1] |