Skip to content

Suffix Arrays

Understanding LangCalc's efficient pattern matching.

What are Suffix Arrays?

Data structure for efficient substring search.

Implementation

See langcalc/data/suffix_array.py.

Performance

  • Memory: O(n)
  • Query: O(m log n)
  • 34× more efficient than hash-based n-grams

This page is under construction. See source code for implementation details.