commit 1a05086dec25bd3468b4d8c66fdc65cb552e816d Author: vaydheesh Date: Sat Jun 15 20:26:02 2019 +0000 FIxed: Case of output for generation diff --git a/apertium/lttoolbox.py b/apertium/lttoolbox.py index 310a947..dabee9a 100644 --- a/apertium/lttoolbox.py +++ b/apertium/lttoolbox.py @@ -39,10 +39,10 @@ class LtProc: input_file.flush() lttoolbox.LtLocale.tryToSetLocale() fst = lttoolbox.FST() - fst.setDictionaryCaseMode(True) if not fst.valid(): raise ValueError('FST Invalid') if '-w' in self.command: + fst.setDictionaryCaseMode(True) fst.analyze(self.path, input_file.name, output_file.name) elif '-g' in self.command: fst.generate(self.path, input_file.name, output_file.name) diff --git a/apertium/utils.py b/apertium/utils.py index f6b5e55..93faefc 100644 --- a/apertium/utils.py +++ b/apertium/utils.py @@ -36,8 +36,8 @@ def execute_pipeline(inp: str, commands: List[List[str]]) -> str: end = inp.encode() for command in commands: if 'lt-proc' in command and ('-w' in command or '-g' in command): - ltp = lttoolbox.LtProc(command, end.decode()) - end = ltp.execute() + ltp = lttoolbox.LtProc(command, end.decode()) + end = ltp.execute() else: proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE) end, _ = proc.communicate(end)