High-performance keyword over-consideration component kfilter

Source: Internet
Author: User
Kfilter is a high-performance keyword filtering component. It provides a flexible filtering mechanism that can adapt to Case sensitivity, halfwidth, simplification, and delimiter processing. On an i7 computer, kfilter processes 6 K keywords. A single thread can search tens of millions of words per second.

Keyword Recognition

The key word processing of kfilter is very flexible. It does not strictly identify the keyword itself. The case, halfwidth, simplification, and separators of this keyword are all summarized into the recognition scope.

 

Kfilter also does some other work when dealing with numbers and English letters, mainly to prevent the kill. For example, Ava and Java are clearly not within the range of the keyword Av.

Use

Kfilter is easy to use. You only need to create a keyword object.

 

Keyword kW = New Keyword (); kW. Add ("Av"); kW. matchs ("Java ");

After adding a keyword, you can perform the matching operation,Keyword methods include ismatch, match, matchs, and replace. Mainly meet the needs of Usage

Ismatch

Used to detect whether a character isKeyword exists

Match

Obtain the first matching keyword.

Matchs

Obtain all matching keywords

Replace

Replace all matching items. Use keywork. replacedata to replace the character.

All keywork methods are thread-safe.

Performance

Although kfilter has a variety of matching modes, its performance is also excellent. In the e1230v2 CPU, the 6 K keyword can be searched for tens of millions of words per second. The retrieval structure is processed by means of a tree. Each character of a word is split into corresponding nodes.

Download[Note: commercial applications cannot be used without permission]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.