arXiv · 2601.03271
Optimizing Exact String Matching via Statistical Anchoring
Abstract
In this work, we propose an enhancement to the Boyer-Moore-Horspool algorithm tailored for natural language text. The approach involves preprocessing the search pattern to identify its statistically least frequent character, referred to as the "anchor." During the search, verification is first performed at this high-entropy position, allowing the algorithm to quickly discard non-matching windows. This fail-fast strategy reduces unnecessary comparisons, improving overall efficiency. Our implementation shows that incorporating basic linguistic statistics into classical pattern-matching techniques can boost performance without increasing complexity to the shift heuristics.
Explore related subjects
Keep this discovery
Omar Garraoui. 2025-12-21. Optimizing Exact String Matching via Statistical Anchoring. https://arxiv.org/abs/2601.03271
Cite the original work for its findings. Save a collection to share your selection of sources.