Clean up comments, update maven, require Java 8 for building

This commit is contained in:
Dave Jarvis 2020-06-11 18:22:13 -07:00
parent 26268ae012
commit 00a6a3a9f3
11 changed files with 42 additions and 31 deletions

21
pom.xml
View File

@ -1,4 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -9,7 +11,7 @@
<name>Aho-CoraSick algorithm for efficient string matching</name> <name>Aho-CoraSick algorithm for efficient string matching</name>
<description>Java library for efficient string matching against a large set of keywords</description> <description>Java library for efficient string matching against a large set of keywords</description>
<inceptionYear>2014</inceptionYear> <inceptionYear>2014</inceptionYear>
<url>http://ahocorasick.org</url> <url>https://github.com/robert-bor/aho-corasick</url>
<distributionManagement> <distributionManagement>
<snapshotRepository> <snapshotRepository>
@ -46,12 +48,17 @@
<organization>42</organization> <organization>42</organization>
</developer> </developer>
<developer> <developer>
<name></name> <name>Daniel Beck</name>
<organization>neoSearch UG (haftungsbeschränkt)</organization>
</developer>
<developer>
<name>Dave Jarvis</name>
<organization>White Magic Software, Ltd.</organization>
</developer> </developer>
</developers> </developers>
<properties> <properties>
<java.version>1.7</java.version> <java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.10</junit.version> <junit.version>4.10</junit.version>
@ -111,6 +118,9 @@
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
<configuration>
<source>8</source>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
@ -147,7 +157,7 @@
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.7.201606060606</version> <version>0.8.5</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@ -166,5 +176,4 @@
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -2,10 +2,10 @@ package org.ahocorasick.interval;
public interface Intervalable extends Comparable { public interface Intervalable extends Comparable {
public int getStart(); int getStart();
public int getEnd(); int getEnd();
public int size(); int size();
} }

View File

@ -1,10 +1,9 @@
package org.ahocorasick.trie; package org.ahocorasick.trie;
/** /**
* Payload holds the matched keyword and some payload-data. * Contains the matched keyword and some payload data.
* *
* @author Daniel Beck * @author Daniel Beck
*
* @param <T> The type of the wrapped payload data. * @param <T> The type of the wrapped payload data.
*/ */
public class Payload<T> implements Comparable<Payload<T>> { public class Payload<T> implements Comparable<Payload<T>> {

View File

@ -4,11 +4,10 @@ import org.ahocorasick.interval.Interval;
import org.ahocorasick.interval.Intervalable; import org.ahocorasick.interval.Intervalable;
/** /**
* PayloadEmit contains a matched term and its associated payload data. * Contains a matched term and its associated payload data.
* *
* @param <T> Type of the wrapped payload-data. * @param <T> Type of the wrapped payload-data.
* @author Daniel Beck * @author Daniel Beck
*
*/ */
public class PayloadEmit<T> extends Interval implements Intervalable { public class PayloadEmit<T> extends Interval implements Intervalable {

View File

@ -1,10 +1,11 @@
package org.ahocorasick.trie; package org.ahocorasick.trie;
/*** /***
* PayloadFragmentToken holds a text ("the fragment"). * Container for a token ("the fragment") that can emit a type of payload.
* <p> * <p>
* It does not matches a search term - so its <code>isMatch</code>-method * This token indicates a matching search term was not found, so
* returns always false. <code>getEmits</code> returns not Emits. * {@link #isMatch()} always returns {@code false}.
* </p>
* *
* @author Daniel Beck * @author Daniel Beck
* *

View File

@ -1,10 +1,11 @@
package org.ahocorasick.trie; package org.ahocorasick.trie;
/** /**
* PayloadMatchToken holds a text ("the fragment") an emits some output. * Container for a token ("the fragment") that can emit a type of payload.
* <p> * <p>
* It matches a search term - so its <code>isMatch</code>-method returns always * This token indicates a matching search term was found, so {@link #isMatch()}
* true.. * always returns {@code true}.
* </p>
* *
* @author Daniel Beck * @author Daniel Beck
* *

View File

@ -2,7 +2,7 @@ package org.ahocorasick.trie;
/*** /***
* PayloadToken holds a text ("the fragment") an emits some output. If * PayloadToken holds a text ("the fragment") an emits some output. If
* <code>isMatch</code> returns true, the token matched a search term. * {@link #isMatch()} returns {@code true}, the token matched a search term.
* *
* @author Daniel Beck * @author Daniel Beck
* *
@ -20,8 +20,8 @@ public abstract class PayloadToken<T> {
} }
/** /**
* Return true if a search term matched. * Return {@code true} if a search term matched.
* @return true if this is a match * @return {@code true} if this is a match
*/ */
public abstract boolean isMatch(); public abstract boolean isMatch();

View File

@ -17,15 +17,16 @@ import org.ahocorasick.util.ListElementRemoval;
import org.ahocorasick.util.ListElementRemoval.RemoveElementPredicate; import org.ahocorasick.util.ListElementRemoval.RemoveElementPredicate;
/** /**
* A trie implementation, based on the Aho-Corasick white paper, Bell * A trie implementation that carries a payload. See {@link Trie} for
* technologies: http://cr.yp.to/bib/1975/aho.pdf * details on usage.
* <p>
* *
* <p>
* The payload trie adds the possibility to specify emitted payloads for each * The payload trie adds the possibility to specify emitted payloads for each
* added keyword. * added keyword.
* </p>
* *
* @author Daniel Beck * @author Daniel Beck
* @param <T> The type of the supplied of the payload * @param <T> The type of the supplied of the payload.
*/ */
public class PayloadTrie<T> { public class PayloadTrie<T> {

View File

@ -10,8 +10,8 @@ import org.ahocorasick.trie.handler.PayloadEmitDelegateHandler;
import org.ahocorasick.trie.handler.StatefulEmitHandler; import org.ahocorasick.trie.handler.StatefulEmitHandler;
/** /**
* Based on the Aho-Corasick white paper, Bell technologies: * Based on the <a href="http://cr.yp.to/bib/1975/aho.pdf">Aho-Corasick white
* http://cr.yp.to/bib/1975/aho.pdf * paper</a>, from Bell technologies.
* *
* @author Robert Bor * @author Robert Bor
*/ */

View File

@ -4,7 +4,8 @@ import org.ahocorasick.trie.Emit;
import org.ahocorasick.trie.PayloadEmit; import org.ahocorasick.trie.PayloadEmit;
/** /**
* Convenience wrapper class that delegates every method to a EmitHandler. * Convenience wrapper class that delegates every method to an
* instance of {@link EmitHandler}.
*/ */
public class PayloadEmitDelegateHandler implements PayloadEmitHandler<String> { public class PayloadEmitDelegateHandler implements PayloadEmitHandler<String> {

View File

@ -9,7 +9,7 @@ import org.ahocorasick.trie.PayloadEmit;
/** /**
* Convenience wrapper class that delegates every method to a * Convenience wrapper class that delegates every method to a
* StatefullPayloadEmitHandler. * {@link StatefulPayloadEmitHandler}.
*/ */
public class StatefulPayloadEmitDelegateHandler implements StatefulPayloadEmitHandler<String> { public class StatefulPayloadEmitDelegateHandler implements StatefulPayloadEmitHandler<String> {