Releases: robert-bor/aho-corasick
Releases · robert-bor/aho-corasick
Update build to support JDK 15
Changes:
- Add Maven Central repository to build file
- Update JUnit to 4.13.1
- Update Jacoco to 0.8.6 (introduces some JDK 15 support)
- Update Sonatype plugin to 1.6.8
- Update Maven compiler plugin to 3.8.1
- Update Maven Javadoc plugin to 3.2.0
- Update Maven source plugin to 3.0.1
- Remove junit-dep (was rolled into junit)
- Add Apache 2.0 License file
Support unicode characters
Changes:
- Fix unicode character issues
- Migrate to Java 8
- Fix IDE warnings
- Update version number to 0.6.1
Fix NullPointerException with firstMatch
Changes include:
-
When a
PayloadTrie
has no match, a call tofirstMatch
would trigger a NullPointerException. This change hasfirstMatch
returnnull
rather than throwing an uncaught exception. -
Increased version number to
0.6.0
withinpom.xml
and the README file.
Allow Payload with Keyword
Allow to ack emits
- Allow to ack emits (issue #53 / #55); implementing the interface
StatefulEmitHandler
(orAbstractStatefulDefaultHandler
) now opens up the methodsisOnlyWholeWords
,isOnlyWholeWordsWhiteSpaceSeparated
andisAllowOverlaps
on using an emit handler. Thanks to @Crystark for the PR and @DaveJarvis for the discussion.
Construct > Use
NOTE: contains API breaking changes!
- ThreadSafe operation (issue #16 #20 #21 and pull #19)
The Trie construction contained a lazy initialization for the error states. This sometimes resulted in NPEs when the Trie was used in parallel setups. The Trie is now constructed first, including the error states and then used. (thanks to @remen @valentijnscholten @sashavasko @mcarlsen @mattsheppard @venkatvizury)
Note that the API has changed! You must now use the following to construct a Trie:
Trie trie = Trie.builder()
.onlyWholeWords()
.addKeyword("sugar")
.build();
- Custom EmitHandler (issue #23)
It is possible to add your own EmitHandler on the lowest level of the algorithm (ie, the pure Aho-Corasick algorithm). Every emit will be pushed to your handler, meaning no internal collection will be constructed. (thanks to @burtonator) - Whole words including whitespace (issue #17)
Previously it was not possible to select for whole words including whitespaces. With this update, you can remove all matches which are not whole keywords including whitespaces. Just set onlyWholeWordsWhiteSpaceSeparated() on the builder. (thanks to @cteyton) - containsMatch and firstMatch (pull #14)
You can ask the Trie whether it contains any of the keywords, by calling containsMatch. You can also ask the Trie to return its firstMatch and then stop processing. (thanks to @rripken) - Case insensitivity extends to keywords (issue #12)
Setting the Trie to be case insensitive extends to the addition of keywords, which are lower-cased before being added to the Trie. (thanks to @dlutz2 and @yim1990) - Document reference (pull #18)
The reference to the PDF points to an existing document. This document is the basis for this humble library which but stands on the shoulders of giants. Be sure to read it if you want to understand the algorithm. (thanks to @SubOptimal)