0.1.27 • Published 2 years ago
@blackglory/aho-corasick v0.1.27
aho-corasick
A simple Node.js wrapper for Rust's daachorse.
It's faster than the fastest pure JS implementation I know of, and it eats less memory.
Install
npm install --save @blackglory/aho-corasick
# or
yarn add @blackglory/aho-corasickAPI
class AhoCorasick {
constructor(
patterns: string[]
, options: { caseSensitive: boolean }
)
isMatch(text: string): boolean
findAll(text: string): string[]
}Benchmark
The patterns come from the title of the Chinese Wikipedia. The samples come from the text of the Chinese Wikipedia.
| Compilation | Matching | |
|---|---|---|
| fastscan | 2351 op/s | 16.8 op/s |
| aho-corasick | 2348 op/s | 63.5 op/s |
The results of the benchmark are relative values, which will change according to different patterns and samples.
0.1.27
2 years ago
0.1.26
3 years ago
0.1.24
3 years ago
0.1.25
3 years ago
0.1.22
3 years ago
0.1.23
3 years ago
0.1.20
4 years ago
0.1.21
3 years ago
0.1.12
4 years ago
0.1.13
4 years ago
0.1.14
4 years ago
0.1.15
4 years ago
0.1.16
4 years ago
0.1.17
4 years ago
0.1.18
4 years ago
0.1.19
4 years ago
0.1.11
4 years ago
0.1.10
4 years ago
0.1.8
4 years ago
0.1.9
4 years ago
0.1.7
4 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago