- Home
- Archives
- 2026
- Vol. 5 Issue 2
- Article
TurboText: A Boundary-Aware Fuzzy Keyword Extraction and Replacement Library with Configurable Conflict Resolution
Authors
1 Independent Researcher, India.
Article Information
- Published In
- Volume 5, Issue 2 (2026)
- Published Online
- May-August 2026
- Pages
- 911-919
- Article Type
- Original Article
Abstract
View PDFMulti-keyword extraction from large text corpora is constantly observed in information retrieval, entity normalization, and controlled-vocabulary tagging. FlashText is the library most people reach for here — it gives O(N) extraction no matter how big the dictionary gets — but it has three gaps that get in the way in practice: fuzzy matching is not really usable at scale, overlap resolution is hardcoded to one greedy policy, and keyword metadata corrupts the replacement output. TurboText is a Python library built to close these three gaps, and is open-source and available on PyPI. The matching engine runs a bounded-edit frontier search, essentially a Levenshtein-aware trie walk that collapses back to a plain trie walk when the edit budget is zero, so exact and fuzzy matching are the same code path rather than two separate implementations. Both are Cython-compiled: exact matching goes through a packed transition-table automaton (FlatAC), and fuzzy matching keeps the frontier as flat array lists with cached child-char codes instead of a Python dictionary. A separate resolution layer sits on top and offers five overlap policies, including OPTIMAL_WEIGHTED, which uses weighted interval scheduling to select the provably best non-overlapping match set rather than a greedy one. At k=0, the Cython path is 1.5× faster than FlashText on a 1-million-word corpus. At k=1, TurboText is 8.8× faster than RapidFuzz, 41× faster than python-Levenshtein, and well over 160× faster than FuzzyWuzzy and jellyfish at 5,000 keywords. None of these comparison libraries return a character span or check a word boundary; they simply score a pair of strings and leave the rest to the caller. TurboText 0.3.0 is available at https://github.com/nishankmahore/TurboText under the MIT license.
Related Articles
Share Article
*Instagram doesn't support direct link sharing from web. Copy the link and share it in your Instagram story or post.