From: <jen...@us...> - 2011-11-18 10:26:58
|
Revision: 3417 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3417&view=rev Author: jenslehmann Date: 2011-11-18 10:26:51 +0000 (Fri, 18 Nov 2011) Log Message: ----------- fix which allows to use prefixes in fuzzy examples Modified Paths: -------------- trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java trunk/test/fuzzydll/fuzzytrains.conf Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java 2011-11-18 10:02:43 UTC (rev 3416) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java 2011-11-18 10:26:51 UTC (rev 3417) @@ -89,12 +89,15 @@ if (keyObject instanceof String) { String keyString = (String) keyObject; + // replace prefixes in the key + for (String prefix : prefixes.keySet()) { + key = keyString.replaceAll(prefix + ":", prefixes.get(prefix)); + } + // if the value is a string, we also replace prefixes there if (value instanceof String) { String valueString = (String) value; for (String prefix : prefixes.keySet()) { - value = valueString.replaceAll(prefix + ":", prefixes.get(prefix)); - key = keyString.replaceAll(prefix + ":", prefixes.get(prefix)); - + value = valueString.replaceAll(prefix + ":", prefixes.get(prefix)); } } } Modified: trunk/test/fuzzydll/fuzzytrains.conf =================================================================== --- trunk/test/fuzzydll/fuzzytrains.conf 2011-11-18 10:02:43 UTC (rev 3416) +++ trunk/test/fuzzydll/fuzzytrains.conf 2011-11-18 10:26:51 UTC (rev 3417) @@ -19,7 +19,7 @@ lp.type = "fuzzyPosNeg" lp.positiveExamples = { "ex:east1", "ex:east2" } lp.negativeExamples = { "ex:west6", "ex:west7" } -lp.fuzzyEx = [("http://www.example.com/fuzzyTrains.owl#east1",1.0),("http://www.example.com/fuzzyTrains.owl#east2",1.0),("http://www.example.com/fuzzyTrains.owl#west6",0.0),("http://www.example.com/fuzzyTrains.owl#west7",0.0)] +lp.fuzzyEx = [("ex:west6",0.0),("ex:west7",0.0)] // create learning algorithm to run alg.type = "Fuzzy CELOE" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |