diff --git a/app.py b/app.py index b3b04bb..f1fc165 100644 --- a/app.py +++ b/app.py @@ -44,7 +44,7 @@ def ask_user(language, lex_refresh): lexica = click.prompt("\nAil-adeiladwch y lecsica y tro cyntaf i chi rhedeg y cod.\nDylsech ail-adeiladu hefyd os fu newidiadau i'r geiriaduron ers y tro diwethaf i chi rhedeg y cod..\n\n(Os nad ydych yn sicr, dewiswch [I] i ail-adeiladu - does dim i'w golli ond amser!)\n\nTeipiwch [I] i ail-adeiladu, neu [N] i rhedeg y cod heb ail-adeiladu.") else: lexica = "n" -b + else: output_name = click.prompt("\n\nPlease type a name for the output directory") if lex_refresh != "done": diff --git a/postagger/tokenizer.py b/postagger/tokenizer.py index 5b7acd0..8db579d 100644 --- a/postagger/tokenizer.py +++ b/postagger/tokenizer.py @@ -119,7 +119,7 @@ def sentences(self): def cg_output(self, cg_readings): """ Given a set of CG-formatted readings, run VISL CG-3 """ vislcg3_location = shutil.which("vislcg3") - cg_process = subprocess.Popen([vislcg3_location, '--soft-limit', '45', '--hard-limit', "100", "-B", "-v", '0', '-g', '{}/grammar/cy_grammar_2021'.format(os.path.dirname(os.path.abspath(__file__)))], stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE) + cg_process = subprocess.Popen([vislcg3_location, '--soft-limit', '45', '--hard-limit', "100", "--no-break", "-v", '0', '-g', '{}/grammar/cy_grammar_2021'.format(os.path.dirname(os.path.abspath(__file__)))], stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE) cg_output, cg_error = cg_process.communicate(input=cg_readings.encode("utf-8")) if b"Grammar could not be parsed" in cg_error: err_msg = cg_error.decode("utf-8") @@ -132,7 +132,7 @@ def cg_output(self, cg_readings): def cg_output_trace(self, cg_readings): """ Given a set of CG-formatted readings, run VISL CG-3 with trace turned on""" vislcg3_location = shutil.which("vislcg3") - cg_process = subprocess.Popen([vislcg3_location, '--soft-limit', '45', '--hard-limit', "100", "--trace", "-B", "-v", '0', '-g', '{}/grammar/cy_grammar_2021'.format(os.path.dirname(os.path.abspath(__file__)))], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) + cg_process = subprocess.Popen([vislcg3_location, '--soft-limit', '45', '--hard-limit', "100", "--trace", "--no-break", "-v", '0', '-g', '{}/grammar/cy_grammar_2021'.format(os.path.dirname(os.path.abspath(__file__)))], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) cg_output = cg_process.communicate(input=cg_readings.encode("utf-8"))[0] return cg_output.decode("utf-8")