@Test public void testCaseSensitiveDictionary() throws IOException { POSDictionary dict = loadDictionary("TagDictionaryCaseSensitive.xml"); Assert.assertArrayEquals(new String[]{"NNP"}, dict.getTags("McKinsey")); Assert.assertNull(dict.getTags("Mckinsey")); dict = serializeDeserializeDict(dict); Assert.assertArrayEquals(new String[]{"NNP"}, dict.getTags("McKinsey")); Assert.assertNull(dict.getTags("Mckinsey")); }
public String[] getTags(String word) { if (caseSensitive) { return dictionary.get(word); } else { return dictionary.get(StringUtil.toLowerCase(word)); } }
POSDictionary implements Iterable<String>, MutableTagDictionary, SerializableArtifact { public String[] getTags(String word) { if (caseSensitive) { return dictionary.get(word); } else { return dictionary.get(StringUtil.toLowerCase(word)); } } }
POSDictionary implements Iterable<String>, MutableTagDictionary, SerializableArtifact { public String[] getTags(String word) { if (caseSensitive) { return dictionary.get(word); } else { return dictionary.get(StringUtil.toLowerCase(word)); } } POSDictionary();  POSDictionary(boolean caseSensitive); }
POSDictionary implements Iterable<String>, MutableTagDictionary, SerializableArtifact { public String[] getTags(String word) { if (caseSensitive) { return dictionary.get(word); } else { return dictionary.get(StringUtil.toLowerCase(word)); } } POSDictionary();  POSDictionary(boolean caseSensitive); String[] getTags(String word); Iterator<String> iterator(); void serialize(OutputStream out); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static POSDictionary create(InputStream in); String[] put(String word, String... tags); boolean isCaseSensitive(); @Override Class<?> getArtifactSerializerClass(); }
POSDictionary implements Iterable<String>, MutableTagDictionary, SerializableArtifact { public String[] getTags(String word) { if (caseSensitive) { return dictionary.get(word); } else { return dictionary.get(StringUtil.toLowerCase(word)); } } POSDictionary();  POSDictionary(boolean caseSensitive); String[] getTags(String word); Iterator<String> iterator(); void serialize(OutputStream out); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static POSDictionary create(InputStream in); String[] put(String word, String... tags); boolean isCaseSensitive(); @Override Class<?> getArtifactSerializerClass();  }