Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. suffix

suffix

UnlicenseRust

A Rust library providing fast linear time and space suffix arrays with full Unicode support.

GitHubGitHub
281 stars30 forks0 contributors

What is suffix?

suffix is a Rust library for building and using suffix arrays—a compact data structure that enables fast substring searches and text analysis. It solves the problem of efficiently finding all occurrences of patterns in text, with specialized algorithms that offer linear time construction and querying. The library distinguishes itself by providing full Unicode support, making it suitable for processing modern multilingual text data.

Target Audience

Rust developers working on text processing, search engines, bioinformatics, or any application requiring efficient substring matching on large text corpora.

Value Proposition

Developers choose suffix for its combination of linear-time performance, Unicode correctness, and Rust's safety guarantees. Unlike byte-oriented alternatives, it properly handles UTF-8 text while maintaining competitive speed through optimized algorithms.

Overview

Fast suffix arrays for Rust (with Unicode support).

Use Cases

Best For

  • Building search engines that need fast substring matching across large documents
  • Bioinformatics applications requiring pattern matching in DNA/RNA sequences
  • Implementing text analysis tools for multilingual content
  • Creating efficient autocomplete or search-as-you-type features
  • Educational purposes for learning suffix array algorithms and data structures
  • Developing command-line text processing utilities with visualization capabilities

Not Ideal For

  • Applications requiring frequent text updates or dynamic content, as rebuilding the suffix array is costly
  • Projects needing built-in support for generalized suffix arrays across multiple documents, due to the library's current limitation
  • Small-scale scripts with minimal search needs, where standard library functions are simpler and sufficient

Pros & Cons

Pros

Linear-Time Construction

Uses the SA-IS algorithm for O(n) construction, making it efficient for large texts as shown in benchmarks comparing to naive O(n^2 log n) methods.

Full Unicode Support

Properly handles UTF-8 text, unlike byte-oriented implementations, ensuring correctness for multilingual data without manual encoding work.

Fast Query Performance

Benchmarks show up to 100x speedup for non-matching queries and rapid existence checks, optimizing search operations once the suffix array is built.

Visualization Tool

Includes the 'stree' command-line tool to generate suffix tree diagrams, aiding in debugging and educational use, as demonstrated with the banana example.

Cons

No Generalized Support

The library lacks built-in generalized suffix arrays, forcing developers to implement complex workarounds like manual offset management for multiple documents, as admitted in the README.

Construction Overhead

Building the suffix array requires significant time and memory, making it unsuitable for real-time applications or frequently changing text, despite the linear-time algorithm.

Rust-Only Solution

Limited to Rust projects with no cross-language bindings, which can be a barrier for teams using other programming languages or needing broader ecosystem integration.

Frequently Asked Questions

Quick Stats

Stars281
Forks30
Contributors0
Open Issues3
Last commit2 years ago
CreatedSince 2014

Tags

#unicode#search-algorithms#data-structures#text-processing#string-matching#rust

Built With

R
Rust

Included in

Rust56.6k
Auto-fetched 15 hours ago

Related Projects

ripgrep-allripgrep-all

rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc.

Stars9,765
Forks216
Last commit4 months ago
KreuzbergKreuzberg

A polyglot document intelligence framework with a Rust core. Extract text, metadata, images, and structured information from PDFs, Office documents, images, and 97+ formats. Available for Rust, Python, Ruby, Java, Go, PHP, Elixir, C#, R, C, TypeScript (Node/Bun/Wasm/Deno)- or use via CLI, REST API, or MCP server.

Stars8,691
Forks526
Last commit15 hours ago
grexgrex

A command-line tool and Rust library with Python bindings for generating regular expressions from user-provided test cases

Stars8,161
Forks196
Last commit4 months ago
MelodyMelody

Melody is a language that compiles to regular expressions and aims to be more readable and maintainable

Stars4,745
Forks57
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub