From: <jen...@us...> - 2011-08-25 08:06:52
|
Revision: 3118 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3118&view=rev Author: jenslehmann Date: 2011-08-25 08:06:45 +0000 (Thu, 25 Aug 2011) Log Message: ----------- modified new CLI parser such that it does not require semicolons anymore Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java trunk/examples/family/father.conf trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java trunk/interfaces/src/main/java/org/dllearner/confparser2/ConfParser.java trunk/interfaces/src/main/java/org/dllearner/confparser2/conf2.jj Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-08-24 18:37:17 UTC (rev 3117) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-08-25 08:06:45 UTC (rev 3118) @@ -711,7 +711,7 @@ stop || (configurator.getMaxClassDescriptionTests() != 0 && (expressionTests >= configurator.getMaxClassDescriptionTests())) || (configurator.getMaxExecutionTimeInSeconds() != 0 && ((System.nanoTime() - nanoStartTime) >= (configurator.getMaxExecutionTimeInSeconds()*1000000000l))) || - (configurator.getTerminateOnNoiseReached() && (100*getCurrentlyBestAccuracy()>100-configurator.getNoisePercentage())); + (configurator.getTerminateOnNoiseReached() && (100*getCurrentlyBestAccuracy()>=100-configurator.getNoisePercentage())); } private void reset() { Modified: trunk/examples/family/father.conf =================================================================== --- trunk/examples/family/father.conf 2011-08-24 18:37:17 UTC (rev 3117) +++ trunk/examples/family/father.conf 2011-08-25 08:06:45 UTC (rev 3118) @@ -8,37 +8,38 @@ */ // knowledge source definition -ks.type = "KB file"; -ks.url = "father.kb"; +ks.type = "KB file" +ks.url = "father.kb" // ks.baseDir = "examples/family"; //Assuming running from parent directory of examples. // reasoner -reasoner.type = "fast instance checker"; -reasoner.reasonerComponent = component:embeddedReasoner; -reasoner.sources = {"component:ks"}; -embeddedReasoner.type = "org.dllearner.reasoning.OWLAPIReasoner"; -embeddedReasoner.sources = {"component:kbFile"}; +reasoner.type = "fast instance checker" +reasoner.reasonerComponent = component:embeddedReasoner +reasoner.sources = {"component:ks"} +embeddedReasoner.type = "org.dllearner.reasoning.OWLAPIReasoner" +embeddedReasoner.sources = {"component:kbFile"} // learning problem -lp.type = "posNegStandard"; -lp.positiveExamples = {"stefan","markus","bernd"}; -lp.negativeExamples = {"heinz","anna","gabi","michelle"}; +lp.type = "posNegStandard" +lp.positiveExamples = {"stefan","markus","bernd"} +lp.negativeExamples = {"heinz","anna","gabi","michelle"} // TODO: the stuff below is untested and just shows what it could look like // plug a reasoner into the learning problem -lp.reasoner = reasoner; +lp.reasoner = reasoner // create a refinement operator and configure it -op.type = "rho"; -op.useCardinalityRestrictions = true; +op.type = "rho" +op.useCardinalityRestrictions = true // create a heuristic and configure it -h.type = "multiheuristic"; -h.expansionPenaltyFactor = 0.2; +h.type = "multiheuristic" +h.expansionPenaltyFactor = 0.2 // create learning algorithm to run -alg.type = "ocel"; -alg.operator = component:op; -alg.learningProblem = component:lp; -alg.heuristic = component:h; +alg.type = "ocel" +alg.operator = component:op +alg.learningProblem = component:lp +alg.heuristic = component:h + Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-08-24 18:37:17 UTC (rev 3117) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-08-25 08:06:45 UTC (rev 3118) @@ -56,7 +56,7 @@ */ public static void main(String[] args) throws FileNotFoundException, ParseException { /** TODO Get conf file location from args */ - ConfParser parser = ConfParser.parseFile(new File("../test/newconf/test1.conf")); + ConfParser parser = ConfParser.parseFile(new File("../examples/family/father.conf")); List<ConfFileOption> options = parser.getConfOptions(); for(ConfFileOption option : options) { System.out.println(option); Modified: trunk/interfaces/src/main/java/org/dllearner/confparser2/ConfParser.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser2/ConfParser.java 2011-08-24 18:37:17 UTC (rev 3117) +++ trunk/interfaces/src/main/java/org/dllearner/confparser2/ConfParser.java 2011-08-25 08:06:45 UTC (rev 3118) @@ -285,7 +285,6 @@ } } } - jj_consume_token(CONF_END); if(containsSubOption) { if(isNumeric) if(isDouble) @@ -490,13 +489,13 @@ return false; } - private boolean jj_3_3() { - if (jj_scan_token(NEG_EX)) return true; + private boolean jj_3R_4() { + if (jj_scan_token(ID)) return true; return false; } - private boolean jj_3R_4() { - if (jj_scan_token(ID)) return true; + private boolean jj_3_3() { + if (jj_scan_token(NEG_EX)) return true; return false; } @@ -536,6 +535,11 @@ return false; } + private boolean jj_3R_20() { + if (jj_scan_token(ID)) return true; + return false; + } + private boolean jj_3R_15() { if (jj_3R_4()) return true; return false; @@ -546,11 +550,6 @@ return false; } - private boolean jj_3R_20() { - if (jj_scan_token(ID)) return true; - return false; - } - private boolean jj_3R_19() { Token xsp; xsp = jj_scanpos; @@ -589,13 +588,13 @@ return false; } - private boolean jj_3R_14() { - if (jj_3R_18()) return true; + private boolean jj_3R_16() { + if (jj_scan_token(NUMBER)) return true; return false; } - private boolean jj_3R_16() { - if (jj_scan_token(NUMBER)) return true; + private boolean jj_3R_14() { + if (jj_3R_18()) return true; return false; } Modified: trunk/interfaces/src/main/java/org/dllearner/confparser2/conf2.jj =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser2/conf2.jj 2011-08-24 18:37:17 UTC (rev 3117) +++ trunk/interfaces/src/main/java/org/dllearner/confparser2/conf2.jj 2011-08-25 08:06:45 UTC (rev 3118) @@ -195,7 +195,8 @@ "(" (tmp=String() | tmp=Id()) "," (tmp2=String() | tmp2=Id()) ")" {tuples.add(new StringTuple(tmp,tmp2));} "]" {isList=true;} - ) <CONF_END> + ) + // <CONF_END> { if(containsSubOption) { if(isNumeric) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |