From 1f223e1c027fe1b39538871d11f8a723a3dbdd7f Mon Sep 17 00:00:00 2001 From: lupeterm Date: Mon, 2 Nov 2020 08:06:16 +0100 Subject: [PATCH] fixed last commit --- cnf_test.py | 2 +- tabular.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cnf_test.py b/cnf_test.py index d8f8f78..2b5cbec 100644 --- a/cnf_test.py +++ b/cnf_test.py @@ -473,7 +473,7 @@ def test_long_right_alternative(self): def print_grammar(rules): for key, value in rules.items(): - print( key +' --> ' + value) + print( str(key) +' --> ' + str(value)) print("\n") diff --git a/tabular.py b/tabular.py index a95e90d..16e3a46 100644 --- a/tabular.py +++ b/tabular.py @@ -38,7 +38,7 @@ def to_latex(table, word, start, rules, before): def grammar_to_latex(rules): table_string = '' for key, values in rules.items(): - table_string = table_string + key +' & \\rightarrow & '+values +' \\\ \n' + table_string = table_string + str(key) +' & \\rightarrow & '+str(values) +' \\\ \n' table_string = table_string.replace("'", "") table_string = table_string.replace(', ', ' \\mid ') table_string = table_string.replace('}', '')