From 5a31c50ce396d5aedda011bbcbdad11c95795276 Mon Sep 17 00:00:00 2001 From: "b.madran" Date: Tue, 25 Nov 2025 19:53:11 +0000 Subject: [PATCH 1/2] small bug fixes --- app.py | 2 +- postagger/tokenizer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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..5189de3 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") From 6025da8d8ba0f2b131f882c29c26461d05c343f9 Mon Sep 17 00:00:00 2001 From: "b.madran" Date: Wed, 26 Nov 2025 11:22:34 +0000 Subject: [PATCH 2/2] flag renamed --- postagger/tokenizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postagger/tokenizer.py b/postagger/tokenizer.py index 5189de3..8db579d 100644 --- a/postagger/tokenizer.py +++ b/postagger/tokenizer.py @@ -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")