From: <seb...@us...> - 2012-04-23 16:27:59
|
Revision: 3652 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3652&view=rev Author: sebastianwtr Date: 2012-04-23 16:04:23 +0000 (Mon, 23 Apr 2012) Log Message: ----------- [tbsl exploration] changed some functions Modified Paths: -------------- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Index/Index_utils.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Index/SQLiteIndex.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/Setting.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/exploration_main.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/modules/LevenstheinModule.java Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Index/Index_utils.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Index/Index_utils.java 2012-04-21 15:10:29 UTC (rev 3651) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Index/Index_utils.java 2012-04-23 16:04:23 UTC (rev 3652) @@ -150,12 +150,12 @@ if(tmp1!=null){ result_List.add(tmp1); } - else{ + /*else{ /* * doesnt contains to much classes right now */ - ArrayList<String> tmp_List = new ArrayList<String>(); + /* ArrayList<String> tmp_List = new ArrayList<String>(); String[] array_tmp= string.split(" "); if(array_tmp.length>1){ @@ -163,7 +163,7 @@ } if(tmp_List!=null)for(String st : tmp_List){ if(st.contains("ontology")|| st.contains("yago"))result_List.add(st); - } + }*/ /*ArrayList<String> tmp_List = new ArrayList<String>(); @@ -175,7 +175,7 @@ } }*/ - } + //} if(tmp2!=null) { @@ -184,7 +184,7 @@ /* * if nothing is found, also try the like operator for each part of the string */ - else{ + /*else{ ArrayList<String> tmp_List = new ArrayList<String>(); String[] array_tmp= string.split(" "); for(String s : array_tmp){ @@ -194,7 +194,7 @@ } } - } + }*/ /* * also add String without the plural s at the end. Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Index/SQLiteIndex.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Index/SQLiteIndex.java 2012-04-21 15:10:29 UTC (rev 3651) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/Index/SQLiteIndex.java 2012-04-23 16:04:23 UTC (rev 3652) @@ -13,7 +13,9 @@ import java.sql.Statement; import java.util.ArrayList; +import org.dllearner.algorithm.tbsl.exploration.Utils.DebugMode; import org.dllearner.algorithm.tbsl.exploration.Utils.Levenshtein; +import org.dllearner.algorithm.tbsl.exploration.exploration_main.Setting; import org.dllearner.algorithm.tbsl.nlp.StanfordLemmatizer; public class SQLiteIndex { @@ -650,6 +652,8 @@ } public ArrayList<String> getListOfUriSpecialIndex(String string){ + + if(!Setting.isNewIndex())return null; string= string.toLowerCase(); String[] temp_list = string.split(" "); ArrayList<String> first_result=new ArrayList<String>(); @@ -696,8 +700,14 @@ return null; } + System.out.println(result.size() + " URI's over new Index were found!"); + try { + DebugMode.waitForButton(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } - return result; } Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/Setting.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/Setting.java 2012-04-21 15:10:29 UTC (rev 3651) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/Setting.java 2012-04-23 16:04:23 UTC (rev 3652) @@ -4,6 +4,7 @@ private static boolean waitModus; private static boolean debugModus; + private static boolean newIndex; public static boolean isWaitModus() { return waitModus; @@ -17,6 +18,12 @@ public static void setDebugModus(boolean debugModus) { Setting.debugModus = debugModus; } + public static boolean isNewIndex() { + return newIndex; + } + public static void setNewIndex(boolean newIndex) { + Setting.newIndex = newIndex; + } } Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/exploration_main.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/exploration_main.java 2012-04-21 15:10:29 UTC (rev 3651) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/exploration_main/exploration_main.java 2012-04-23 16:04:23 UTC (rev 3652) @@ -69,6 +69,7 @@ Setting.setWaitModus(false); Setting.setDebugModus(false); + Setting.setNewIndex(false); @@ -114,6 +115,18 @@ if(Setting.isDebugModus()) System.out.println("DebugModus is now online"); else System.out.println("DebugModus is now offline"); } + if(line.contains(":newIndex on")){ + Setting.setNewIndex(true); + startQuestioning=false; + if(Setting.isDebugModus()) System.out.println("newIndex is now online"); + else System.out.println("DebugModus is now offline"); + } + if(line.contains(":newIndex off")){ + Setting.setNewIndex(false); + startQuestioning=false; + if(Setting.isDebugModus()) System.out.println("newIndex is now online"); + else System.out.println("DebugModus is now offline"); + } Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/modules/LevenstheinModule.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/modules/LevenstheinModule.java 2012-04-21 15:10:29 UTC (rev 3651) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/exploration/modules/LevenstheinModule.java 2012-04-23 16:04:23 UTC (rev 3652) @@ -9,7 +9,7 @@ import org.dllearner.algorithm.tbsl.exploration.Utils.Levenshtein; public class LevenstheinModule { - private final static double LevenstheinMin=0.65; + private final static double LevenstheinMin=0.85; public static ArrayList<Hypothesis> doLevensthein(String variable, String property_to_compare_with, HashMap<String, String> properties) throws SQLException { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |