Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
4 changes: 2 additions & 2 deletions postagger/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")

Expand Down