@Test public void testPOSDictionarySensitive() throws Exception { TagDictionary dict = createDictionary(true); List<String> tags = Arrays.asList(dict.getTags("casa")); Assert.assertEquals(2, tags.size()); Assert.assertTrue(tags.contains("NOUN")); Assert.assertTrue(tags.contains("V")); tags = Arrays.asList(dict.getTags("Casa")); Assert.assertEquals(1, tags.size()); Assert.assertTrue(tags.contains("PROP")); }
@Override public String[] getTags(String word) { if (!isCaseSensitive) { word = word.toLowerCase(); } List<WordData> data = dictLookup.lookup(word); if (data != null && data.size() > 0) { List<String> tags = new ArrayList<>(data.size()); for (WordData aData : data) { tags.add(aData.getTag().toString()); } if (tags.size() > 0) return tags.toArray(new String[tags.size()]); return null; } return null; }
MorfologikTagDictionary implements TagDictionary { @Override public String[] getTags(String word) { if (!isCaseSensitive) { word = word.toLowerCase(); } List<WordData> data = dictLookup.lookup(word); if (data != null && data.size() > 0) { List<String> tags = new ArrayList<>(data.size()); for (WordData aData : data) { tags.add(aData.getTag().toString()); } if (tags.size() > 0) return tags.toArray(new String[tags.size()]); return null; } return null; } }
MorfologikTagDictionary implements TagDictionary { @Override public String[] getTags(String word) { if (!isCaseSensitive) { word = word.toLowerCase(); } List<WordData> data = dictLookup.lookup(word); if (data != null && data.size() > 0) { List<String> tags = new ArrayList<>(data.size()); for (WordData aData : data) { tags.add(aData.getTag().toString()); } if (tags.size() > 0) return tags.toArray(new String[tags.size()]); return null; } return null; } MorfologikTagDictionary(Dictionary dict);  MorfologikTagDictionary(Dictionary dict, boolean caseSensitive); }
MorfologikTagDictionary implements TagDictionary { @Override public String[] getTags(String word) { if (!isCaseSensitive) { word = word.toLowerCase(); } List<WordData> data = dictLookup.lookup(word); if (data != null && data.size() > 0) { List<String> tags = new ArrayList<>(data.size()); for (WordData aData : data) { tags.add(aData.getTag().toString()); } if (tags.size() > 0) return tags.toArray(new String[tags.size()]); return null; } return null; } MorfologikTagDictionary(Dictionary dict);  MorfologikTagDictionary(Dictionary dict, boolean caseSensitive); @Override String[] getTags(String word); }
MorfologikTagDictionary implements TagDictionary { @Override public String[] getTags(String word) { if (!isCaseSensitive) { word = word.toLowerCase(); } List<WordData> data = dictLookup.lookup(word); if (data != null && data.size() > 0) { List<String> tags = new ArrayList<>(data.size()); for (WordData aData : data) { tags.add(aData.getTag().toString()); } if (tags.size() > 0) return tags.toArray(new String[tags.size()]); return null; } return null; } MorfologikTagDictionary(Dictionary dict);  MorfologikTagDictionary(Dictionary dict, boolean caseSensitive); @Override String[] getTags(String word);  }