/*for debugging only*/ public static void main(String[] args) { WordLemmaTag wLT = new WordLemmaTag(); wLT.setFromString("hunter/NN"); System.out.println(wLT.word()); System.out.println(wLT.lemma()); System.out.println(wLT.tag()); WordLemmaTag wLT2 = new WordLemmaTag(); wLT2.setFromString("bought/buy/V"); System.out.println(wLT2.word()); System.out.println(wLT2.lemma()); System.out.println(wLT2.tag()); WordLemmaTag wLT3 = new WordLemmaTag(); wLT2.setFromString("life"); System.out.println(wLT3.word()); System.out.println(wLT3.lemma()); System.out.println(wLT3.tag()); }
/** * The String is divided according to the divider character (usually, "/"). We assume that we can * always just divide on the rightmost divider character, rather than trying to parse up escape * sequences. If the divider character isn't found in the word, then the whole string becomes the * word, and lemma and tag are {@code null}. We assume that if only one divider character is * found, word and tag are present in the String, and lemma will be computed. * * @param labelStr The word that will go into the {@code WordLemmaTag} */ @Override public void setFromString(String labelStr) { setFromString(labelStr, DIVIDER); }