@@ -0,0 +1,1398 @@
+package pl.edu.icm.cermine.pubmed;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport org.w3c.dom.Node;%0Aimport org.w3c.dom.NodeList;%0A%0Apublic class StringTools %7B%0A%09public static List%3CString%3E tokenize(String text) %7B%0A%09%09List%3CString%3E roughRet = new ArrayList%3CString%3E(Arrays.asList(text.split(%22 %7C%5Cn%7C,%7C%5C%5C. %7C&%7C;%7C:%7C%5C%5C-%22)));%0A%09%09List%3CString%3E ret = new ArrayList%3CString%3E();%0A%09%09for(String candidate: roughRet) %7B%0A%09%09%09if(candidate.length() %3E 1) %7B%0A%09%09%09%09ret.add(candidate.toLowerCase());%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return ret;%0A%09%7D%0A%09%0A%09public static Integer tokLen(String text) %7B%0A%09%09return tokenize(text).size();%0A%09%7D%0A%09%0A%09public static String joinStrings(List%3CString%3E strings) %7B%0A%09%09StringBuilder ret = new StringBuilder();%0A%09%09for(String str: strings) %7B%0A%09%09%09if(str != null) %7B%0A%09%09%09%09ret.append(str).append(%22 %22);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return ret.toString();%0A%09%7D%0A%09%0A%09public static String joinStrings(List%3CString%3E strings, char delim) %7B%0A%09%09if(strings.size() == 0) %7B%0A%09%09%09return %22%22;%0A%09%09%7D else%09if(strings.size() == 1) %7B%0A%09%09%09return strings.get(0);%0A%09%09%7D else %7B%0A%09%09%09StringBuilder ret = new StringBuilder();%0A%09%09%09for(Integer partIdx = 0; partIdx %3C strings.size()-1; ++partIdx) %7B%0A%09%09%09%09ret.append(strings.get(partIdx)).append(delim);%0A%09%09%09%7D%0A%09%09%09ret.append(strings.get(strings.size()-1));%0A%09%09%09return ret.toString();%09%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static String joinStrings(String%5B%5D strings) %7B%0A%09%09return joinStrings(new ArrayList%3CString%3E(Arrays.asList(strings)));%0A%09%7D%0A%0A%7D%0A

add essential string algorithms used here