diff options
| author | RncLsn <rnc.lsn@gmail.com> | 2015-08-03 16:16:16 +0100 |
|---|---|---|
| committer | RncLsn <rnc.lsn@gmail.com> | 2015-08-03 16:16:16 +0100 |
| commit | 02cf14060d3b9e722480e07ebfd32538bbb8e73b (patch) | |
| tree | 3cd3f97d8d211da31d39ac21688750390304a39a /src | |
| parent | 3d1c8553f61747b54a8304a39f401f9b77f8cf57 (diff) | |
| download | ACQuA-02cf14060d3b9e722480e07ebfd32538bbb8e73b.tar.gz ACQuA-02cf14060d3b9e722480e07ebfd32538bbb8e73b.zip | |
CLI option names.
Diffstat (limited to 'src')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/Pagoda.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/Pagoda.java b/src/uk/ac/ox/cs/pagoda/Pagoda.java index 08b2cba..da876b5 100644 --- a/src/uk/ac/ox/cs/pagoda/Pagoda.java +++ b/src/uk/ac/ox/cs/pagoda/Pagoda.java | |||
| @@ -23,11 +23,13 @@ import java.util.Map; | |||
| 23 | public class Pagoda implements Runnable { | 23 | public class Pagoda implements Runnable { |
| 24 | 24 | ||
| 25 | private static final String OPTION_ONTOLOGY = "o"; | 25 | private static final String OPTION_ONTOLOGY = "o"; |
| 26 | private static final String OPTION_DATA = "d"; | 26 | private static final String OPTION_DATA = "t"; |
| 27 | private static final String OPTION_QUERY = "q"; | 27 | private static final String OPTION_QUERY = "q"; |
| 28 | private static final String OPTION_ANSWER = "a"; | 28 | private static final String OPTION_ANSWER = "a"; |
| 29 | private static final String OPTION_CLASSIFY = "c"; | 29 | private static final String OPTION_CLASSIFY = "c"; |
| 30 | private static final String OPTION_HERMIT = "f"; | 30 | private static final String OPTION_HERMIT = "f"; |
| 31 | private static final String OPTION_SKOLEM = "s"; | ||
| 32 | private static final String OPTION_SKOLEM_DEPTH = "d"; | ||
| 31 | private final PagodaProperties properties; | 33 | private final PagodaProperties properties; |
| 32 | 34 | ||
| 33 | /** | 35 | /** |
| @@ -69,6 +71,16 @@ public class Pagoda implements Runnable { | |||
| 69 | .desc("Tell whether to call Hermit") | 71 | .desc("Tell whether to call Hermit") |
| 70 | .type(Boolean.class) | 72 | .type(Boolean.class) |
| 71 | .build()); | 73 | .build()); |
| 74 | options.addOption(Option.builder(OPTION_SKOLEM) | ||
| 75 | .argName(OPTION_SKOLEM) | ||
| 76 | .hasArg() | ||
| 77 | .desc("Tell if and how to apply Skolemisation") | ||
| 78 | .build()); | ||
| 79 | options.addOption(Option.builder(OPTION_SKOLEM_DEPTH) | ||
| 80 | .argName(OPTION_SKOLEM_DEPTH) | ||
| 81 | .hasArg() | ||
| 82 | .desc("Tell how deep to skolemise") | ||
| 83 | .build()); | ||
| 72 | 84 | ||
| 73 | CommandLineParser parser = new DefaultParser(); | 85 | CommandLineParser parser = new DefaultParser(); |
| 74 | try { | 86 | try { |
| @@ -82,6 +94,10 @@ public class Pagoda implements Runnable { | |||
| 82 | pagodaBuilder.classify(Boolean.parseBoolean(cmd.getOptionValue(OPTION_CLASSIFY))); | 94 | pagodaBuilder.classify(Boolean.parseBoolean(cmd.getOptionValue(OPTION_CLASSIFY))); |
| 83 | if(cmd.hasOption(OPTION_HERMIT)) | 95 | if(cmd.hasOption(OPTION_HERMIT)) |
| 84 | pagodaBuilder.hermit(Boolean.parseBoolean(cmd.getOptionValue(OPTION_HERMIT))); | 96 | pagodaBuilder.hermit(Boolean.parseBoolean(cmd.getOptionValue(OPTION_HERMIT))); |
| 97 | if(cmd.hasOption(OPTION_SKOLEM)) | ||
| 98 | pagodaBuilder.skolem(PagodaProperties.SkolemUpperBoundOptions.valueOf(cmd.getOptionValue(OPTION_SKOLEM))); | ||
| 99 | if(cmd.hasOption(OPTION_SKOLEM_DEPTH)) | ||
| 100 | pagodaBuilder.skolemDepth(Integer.parseInt(cmd.getOptionValue(OPTION_SKOLEM_DEPTH))); | ||
| 85 | 101 | ||
| 86 | pagodaBuilder.build().run(); | 102 | pagodaBuilder.build().run(); |
| 87 | } catch(ParseException exp) { | 103 | } catch(ParseException exp) { |
| @@ -105,6 +121,8 @@ public class Pagoda implements Runnable { | |||
| 105 | Utility.logInfo("Data files: " + properties.getDataPath()); | 121 | Utility.logInfo("Data files: " + properties.getDataPath()); |
| 106 | Utility.logInfo("Query files: " + properties.getQueryPath()); | 122 | Utility.logInfo("Query files: " + properties.getQueryPath()); |
| 107 | Utility.logInfo("Answer file: " + properties.getAnswerPath()); | 123 | Utility.logInfo("Answer file: " + properties.getAnswerPath()); |
| 124 | Utility.logInfo("Skolemisation: " + properties.getSkolemUpperBound()); | ||
| 125 | Utility.logInfo("Skolemisation depth: " + properties.getSkolemDepth()); | ||
| 108 | 126 | ||
| 109 | QueryReasoner pagoda = null; | 127 | QueryReasoner pagoda = null; |
| 110 | 128 | ||
| @@ -146,6 +164,7 @@ public class Pagoda implements Runnable { | |||
| 146 | statisticsFilename += "_" + ((properties.getSkolemUpperBound() == PagodaProperties.SkolemUpperBoundOptions.DISABLED) | 164 | statisticsFilename += "_" + ((properties.getSkolemUpperBound() == PagodaProperties.SkolemUpperBoundOptions.DISABLED) |
| 147 | ? "" : (properties.getSkolemUpperBound() == PagodaProperties.SkolemUpperBoundOptions.BEFORE_SUMMARISATION) | 165 | ? "" : (properties.getSkolemUpperBound() == PagodaProperties.SkolemUpperBoundOptions.BEFORE_SUMMARISATION) |
| 148 | ? "before" : "after"); | 166 | ? "before" : "after"); |
| 167 | statisticsFilename += "_" + properties.getSkolemDepth(); | ||
| 149 | statisticsFilename += ".json"; | 168 | statisticsFilename += ".json"; |
| 150 | statisticsFilename = FilenameUtils.concat(properties.getStatisticsDir().toString(), | 169 | statisticsFilename = FilenameUtils.concat(properties.getStatisticsDir().toString(), |
| 151 | statisticsFilename); | 170 | statisticsFilename); |
