keyword search

use a string searching algorithm, Aho–Corasick Automaton

License

License

Categories

Categories

KeY Data Data Formats Formal Verification Search Business Logic Libraries
GroupId

GroupId

com.zhixiangli
ArtifactId

ArtifactId

keyword-search
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

keyword search
use a string searching algorithm, Aho–Corasick Automaton
Project URL

Project URL

https://github.com/zhixiangli/keyword-search
Source Code Management

Source Code Management

https://github.com/zhixiangli/keyword-search

Download keyword-search

How to add to project

<!-- https://jarcasting.com/artifacts/com.zhixiangli/keyword-search/ -->
<dependency>
    <groupId>com.zhixiangli</groupId>
    <artifactId>keyword-search</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.zhixiangli/keyword-search/
implementation 'com.zhixiangli:keyword-search:0.0.1'
// https://jarcasting.com/artifacts/com.zhixiangli/keyword-search/
implementation ("com.zhixiangli:keyword-search:0.0.1")
'com.zhixiangli:keyword-search:jar:0.0.1'
<dependency org="com.zhixiangli" name="keyword-search" rev="0.0.1">
  <artifact name="keyword-search" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.zhixiangli', module='keyword-search', version='0.0.1')
)
libraryDependencies += "com.zhixiangli" % "keyword-search" % "0.0.1"
[com.zhixiangli/keyword-search "0.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
com.google.guava : guava jar 21.0

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

keyword-search

Keyword Search is implemented with Aho-Corasick Automaton, with a case of mobile detect.

Time Complexity: O(n), faster than other algorithms, such as indexOf().

Environmental Requirements

JDK 1.8+

Instructions

Add Dependency

<dependency>
	<groupId>com.zhixiangli</groupId>
	<artifactId>keyword-search</artifactId>
	<version>0.0.1</version>
</dependency>

Example

KeywordSearch keywordSearch = new KeywordSearch();
// [must] add all keyword at one time.
keywordSearch.addAll(new String[] {"a", "bc", "def"});
System.out.println(keywordSearch.contains("bef")); // false
System.out.println(keywordSearch.contains("bobcome")); // true

Versions

Version
0.0.1