@Test public void testLemmatizeInsensitive() throws Exception { Lemmatizer dict = createDictionary(false); String[] toks = {"casa", "casa", "Casa"}; String[] tags = {"V", "NOUN", "PROP"}; String[] lemmas = dict.lemmatize(toks, tags); Assert.assertEquals("casar", lemmas[0]); Assert.assertEquals("casa", lemmas[1]); Assert.assertNull(lemmas[2]); }
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);  }