Skip to content

Commit

Permalink
minor modification
Browse files Browse the repository at this point in the history
  • Loading branch information
kmineshima committed Dec 17, 2018
1 parent 4bcbf3b commit 0eed262
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/convert_formulas.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from nltk.sem.drt import *
from nltk2drs import convert_to_drs
from nltk2normal import remove_true
from nltk2tptp import convert_to_tptp_proof
from logic_parser import lexpr

Expand All @@ -35,7 +36,7 @@ def main(args = None):
parser.add_argument("sem", help="XML input filename with semantics")

parser.add_argument("--format", nargs='?', type=str, default="drs",
choices=["fol", "drs", "drsbox", "tptp"],
choices=["fol", "drs", "notrue", "drsbox", "tptp"],
help="Output format (default: drs).")

ARGS = parser.parse_args()
Expand All @@ -56,6 +57,8 @@ def main(args = None):
results = [convert_to_drs(lexpr(formula)) for formula in formulas]
if ARGS.format == "fol":
results = [convert_to_drs(lexpr(formula)).fol() for formula in formulas]
if ARGS.format == "notrue":
results = [remove_true(lexpr(formula)) for formula in formulas]
if ARGS.format == "tptp":
inference = [lexpr(f) for f in formulas]
results = convert_to_tptp_proof(inference)
Expand Down

0 comments on commit 0eed262

Please sign in to comment.