Fast string search (indexOf) using the Boyer-Moore
algorithm. Incorporate this class into your own Java
programs to rapidly search strings.
use:
import com.mindprod.Boyer.Boyer;
...
Boyer b = new Boyer("dogcatwombat");
int where = b.indexOf("cat");
or
int where = Boyer.indexOf("dogcatwombat","cat");
Boyer-Moore is about twice as fast as String.indexOf when
the string you are searching in is 2K or over and the
pattern you are searching for is 4 characters or longer.
String.indexOf is particularly slow when the pattern begins
with a common letter such as "e". Boyer-Moore is fastest
when the pattern is long and composed only of uncommon
letters, e.g. "z" or "^". If you use a char[] instead of
String for your text to be searched, it will run an
additional 33% faster.
Boyer automatically reverts to String.indexOf when that
would be faster.
Keywords: Boyer-Moore, string search, search, indexOf, Java, fast string search, string handling
|
Click to enlarge
|
Related programs in Web Development - Java & JavaScript |
Mihov ASCII Master
Show ASCII value of any key pressed in decimal or hex!
|
PDFComponent.com Java PDF Library
PDFComponent.com Java PDF Library to generate, merge, split PDF
|
Web2Map
Internet Recherche Manager with offlinereader, fulltextsearch, archiving,...
|
jQuery Horizontal Menu Style 05
Create jQuery Horizontal Menu for your Website with beautiful effects easily!
|
Web Site Robot
Easy to use web site builder with blog, shopping cart, online photo album
|
ImageGrabDummy!
Download and view mass images from the web by keyword or url.
|
Database Assistant
Manipulate data from a variety of databases including Oracle, SQL Server, et al
|
1st TurboRun Internet
Too many favorites? Not a problem anymore! Open any favorite web site instantly!
|
Advanced LAN Scanner
Advanced LAN Scanner is a fast and easy-to-use multithreaded LAN scanner.
|
Shetty Search
a free web searching software, no banner ads
|
|