Skip to content

Commit

Permalink
provide command line entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
apease committed Nov 22, 2024
1 parent 7614f61 commit 938dc19
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/java/com/articulate/sigma/trans/SUMOformulaToTPTPformula.java
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,6 @@ public static void testTptpParse3() {
public static void testTptpParse4() {

KBmanager.getMgr().initializeOnce();
KB kb = KBmanager.getMgr().getKB(KBmanager.getMgr().getPref("sumokbname"));

String teststr = "(=> (and (instance ?CELL HexaploidCell) (part ?N ?CELL) " +
"(instance ?N CellNucleus) (located ?COLL ?N) (instance ?COLL Collection) " +
Expand All @@ -591,10 +590,32 @@ public static void testTptpParse4() {
System.out.println(SUMOformulaToTPTPformula.tptpParseSUOKIFString(teststr, false));
}

/** ***************************************************************
*/
public static void showHelp() {

System.out.println("TPTP translation ");
System.out.println(" options:");
System.out.println(" -h - show this help screen");
System.out.println(" -t - run test");
System.out.println(" -g \"<formula>\" - generate TPTP from formula");
}

/** ***************************************************************
* A test method.
*/
public static void main(String[] args) {
testTptpParse4();

System.out.println("INFO in Graph.main()");
if (args != null && args.length > 1 && args[0].equals("-h")) {
showHelp();
} else if (args.length > 1 && args[0].equals("-g")) {
KBmanager.getMgr().initializeOnce();
Formula f = new Formula(args[1]);
String actual = StringUtil.removeEnclosingQuotes(args[1]);
System.out.println(SUMOformulaToTPTPformula.tptpParseSUOKIFString(actual, false));
} else {
testTptpParse4();
}
}
}

0 comments on commit 938dc19

Please sign in to comment.