summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2019-10-23 17:59:07 +0200
committerMichael Stahl <michael.stahl@cib.de>2019-10-24 14:28:09 +0200
commit41c5fc0693d6ca4a0934d859ebb39659339e968d (patch)
tree2a73a042adebda0cbbaba22d83d259afc71b667d
parentc15c2a88896b1baab8d180607d66e1ba8befa70b (diff)
tdf#128341 use python3
Change-Id: Ic8deb039da037bd270c39da03f8697a9ab034ff0 Signed-off-by: Mattia Rizzolo <mattia@mapreri.org> Reviewed-on: https://gerrit.libreoffice.org/81410 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Michael Stahl <michael.stahl@cib.de>
-rwxr-xr-xcs_CZ/thesaurus/dictionary-to-thesaurus.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/cs_CZ/thesaurus/dictionary-to-thesaurus.py b/cs_CZ/thesaurus/dictionary-to-thesaurus.py
index ac4fe67..8a40056 100755
--- a/cs_CZ/thesaurus/dictionary-to-thesaurus.py
+++ b/cs_CZ/thesaurus/dictionary-to-thesaurus.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# coding=utf-8
#
# This file is part of the LibreOffice project.
@@ -61,8 +61,8 @@ def parse(filename, blacklistname):
meanings = {}
classification = {}
- match_ignore = re.compile('(\[neprav\.\]|\[vulg\.\])')
- match_cleanup = re.compile('(\[.*\]|\*|:.*)')
+ match_ignore = re.compile(r'(\[neprav\.\]|\[vulg\.\])')
+ match_cleanup = re.compile(r'(\[.*\]|\*|:.*)')
with open(filename, "r") as fp:
for line in fp:
@@ -172,7 +172,7 @@ def buildThesaurus(synonyms, meanings, classification):
output_lines.append((t, line[t]))
if len(output_lines) > 0:
- print word + '|' + str(len(output_lines))
+ print(word + '|' + str(len(output_lines)))
# those with existing classification are probably a better fit,
# put them to the front (even if we don't output the
@@ -182,9 +182,9 @@ def buildThesaurus(synonyms, meanings, classification):
# first pass only non-empty, 2nd pass only empty
if (i == 0 and t != '') or (i == 1 and t == ''):
if typ == '':
- print t + line
+ print(t + line)
else:
- print line
+ print(line)
def main(args):
@@ -194,7 +194,7 @@ def main(args):
(synonyms, meanings, classification) = parse(args[1], args[2])
- print "UTF-8"
+ print("UTF-8")
buildThesaurus(synonyms, meanings, classification)