@Test public void testLemmatizeMultiLemma() throws Exception { MorfologikLemmatizer dict = createDictionary(false); String[] toks = {"foi"}; String[] tags = {"V"}; List<List<String>> lemmas = dict.lemmatize(Arrays.asList(toks), Arrays.asList(tags)); Assert.assertTrue(lemmas.get(0).contains("ir")); Assert.assertTrue(lemmas.get(0).contains("ser")); }
private List<String> lemmatize(String word, String postag) { List<WordData> dictMap = dictLookup.lookup(word.toLowerCase()); Set<String> lemmas = new HashSet<>(); for (WordData wordData : dictMap) { if (Objects.equals(postag, asString(wordData.getTag()))) { lemmas.add(asString(wordData.getStem())); } } return Collections.unmodifiableList(new ArrayList<>(lemmas)); }
MorfologikLemmatizer implements Lemmatizer { private List<String> lemmatize(String word, String postag) { List<WordData> dictMap = dictLookup.lookup(word.toLowerCase()); Set<String> lemmas = new HashSet<>(); for (WordData wordData : dictMap) { if (Objects.equals(postag, asString(wordData.getTag()))) { lemmas.add(asString(wordData.getStem())); } } return Collections.unmodifiableList(new ArrayList<>(lemmas)); } }
MorfologikLemmatizer implements Lemmatizer { private List<String> lemmatize(String word, String postag) { List<WordData> dictMap = dictLookup.lookup(word.toLowerCase()); Set<String> lemmas = new HashSet<>(); for (WordData wordData : dictMap) { if (Objects.equals(postag, asString(wordData.getTag()))) { lemmas.add(asString(wordData.getStem())); } } return Collections.unmodifiableList(new ArrayList<>(lemmas)); } MorfologikLemmatizer(Path dictionaryPath);  MorfologikLemmatizer(Dictionary dictionary); }
MorfologikLemmatizer implements Lemmatizer { private List<String> lemmatize(String word, String postag) { List<WordData> dictMap = dictLookup.lookup(word.toLowerCase()); Set<String> lemmas = new HashSet<>(); for (WordData wordData : dictMap) { if (Objects.equals(postag, asString(wordData.getTag()))) { lemmas.add(asString(wordData.getStem())); } } return Collections.unmodifiableList(new ArrayList<>(lemmas)); } MorfologikLemmatizer(Path dictionaryPath);  MorfologikLemmatizer(Dictionary dictionary); @Override String[] lemmatize(String[] toks, String[] tags); List<List<String>> lemmatize(List<String> toks, List<String> tags); }
MorfologikLemmatizer implements Lemmatizer { private List<String> lemmatize(String word, String postag) { List<WordData> dictMap = dictLookup.lookup(word.toLowerCase()); Set<String> lemmas = new HashSet<>(); for (WordData wordData : dictMap) { if (Objects.equals(postag, asString(wordData.getTag()))) { lemmas.add(asString(wordData.getStem())); } } return Collections.unmodifiableList(new ArrayList<>(lemmas)); } MorfologikLemmatizer(Path dictionaryPath);  MorfologikLemmatizer(Dictionary dictionary); @Override String[] lemmatize(String[] toks, String[] tags); List<List<String>> lemmatize(List<String> toks, List<String> tags);  }