/** * Lookup lemma in a dictionary. Outputs "O" if not found. * * @param word * the token * @param postag * the postag * @return the lemma */ private String lemmatize(final String word, final String postag) { String lemma; final List<String> keys = this.getDictKeys(word, postag); // lookup lemma as value of the map final List<String> keyValues = this.dictMap.get(keys); if ( keyValues != null && !keyValues.isEmpty()) { lemma = keyValues.get(0); } else { lemma = "O"; } return lemma; }
/** * Lookup every lemma for a word,pos tag in a dictionary. Outputs "O" if not * found. * * @param word * the token * @param postag * the postag * @return every lemma */ private List<String> getAllLemmas(final String word, final String postag) { List<String> lemmasList = new ArrayList<>(); final List<String> keys = this.getDictKeys(word, postag); // lookup lemma as value of the map final List<String> keyValues = this.dictMap.get(keys); if (keyValues != null && !keyValues.isEmpty()) { lemmasList.addAll(keyValues); } else { lemmasList.add("O"); } return lemmasList; } }
/** * Lookup lemma in a dictionary. Outputs "O" if not found. * * @param word * the token * @param postag * the postag * @return the lemma */ private String lemmatize(final String word, final String postag) { String lemma; final List<String> keys = this.getDictKeys(word, postag); // lookup lemma as value of the map final List<String> keyValues = this.dictMap.get(keys); if ( keyValues != null && !keyValues.isEmpty()) { lemma = keyValues.get(0); } else { lemma = "O"; } return lemma; }
/** * Lookup lemma in a dictionary. Outputs "O" if not found. * * @param word * the token * @param postag * the postag * @return the lemma */ private String lemmatize(final String word, final String postag) { String lemma; final List<String> keys = this.getDictKeys(word, postag); // lookup lemma as value of the map final List<String> keyValues = this.dictMap.get(keys); if ( keyValues != null && !keyValues.isEmpty()) { lemma = keyValues.get(0); } else { lemma = "O"; } return lemma; }
/** * Lookup every lemma for a word,pos tag in a dictionary. Outputs "O" if not * found. * * @param word * the token * @param postag * the postag * @return every lemma */ private List<String> getAllLemmas(final String word, final String postag) { List<String> lemmasList = new ArrayList<>(); final List<String> keys = this.getDictKeys(word, postag); // lookup lemma as value of the map final List<String> keyValues = this.dictMap.get(keys); if (keyValues != null && !keyValues.isEmpty()) { lemmasList.addAll(keyValues); } else { lemmasList.add("O"); } return lemmasList; } }
/** * Lookup every lemma for a word,pos tag in a dictionary. Outputs "O" if not * found. * * @param word * the token * @param postag * the postag * @return every lemma */ private List<String> getAllLemmas(final String word, final String postag) { List<String> lemmasList = new ArrayList<>(); final List<String> keys = this.getDictKeys(word, postag); // lookup lemma as value of the map final List<String> keyValues = this.dictMap.get(keys); if (keyValues != null && !keyValues.isEmpty()) { lemmasList.addAll(keyValues); } else { lemmasList.add("O"); } return lemmasList; } }