robert-bor/aho-corasick — pull request #9 by IVANOPT (2014-08-26 06:03:06+00:00)
Title: ensure dulplicate emit added problems

Hi, i find that aho-corasick load text again and again.
Examples below :
```
@RequestMapping(value = "/mss/redis", produces = "application/json")
@ResponseBody
public Collection redis() {
// return multipleStringSearchService.ahocorasickMethod("matchest",
// "anjuke_prop", "anjuke, community");
return ahocorasickMethod("matchest", "anjuke_prop", "anjuke, community");
}

public Collection ahocorasickMethod(String method, String dicname,
String text) {
Trie trie = METHODS.get(method);
Set allKeys = redisService.getAllKeys(dicname);
for (String key : allKeys) {
trie.addKeyword(key);
}
// return new HashSet(trie.parseText(text));
return trie.parseText(text);
}
```
i got the result :
```
[
{
start : 0,
end : 5,
keyword : "anjuke"
}
{
start : 8,
end : 16,
keyword : "community"
}
]
```
Then i refreshed the web, i got the belowing :
```
[
{
start : 0,
end : 5,
keyword : "anjuke"
}
{
start : 0,
end : 5,
keyword : "anjuke"
}
{
start : 8,
end : 16,
keyword : "community"
}
{
start : 8,
end : 16,
keyword : "community"
}
]
```
i suppose that in Trie.java, method 'storeEmits' makes 'Collection emits' on RAM, but i've not found out the principle.
i fixed it on the commits 'ensure dulplicate emit added problems', i hope we can make it better.