Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Machine Learning
  3. go-ngram

go-ngram

MITGo

A Unicode-aware, append-only n-gram index library for Go with memory-efficient string pooling.

GitHubGitHub
114 stars16 forks0 contributors

What is go-ngram?

go-ngram is a Go library for creating n-gram indexes, which break text into overlapping character sequences to enable fast search and similarity matching. It solves the problem of efficient text indexing and retrieval in Go applications, particularly where memory usage and performance are critical.

Target Audience

Go developers building applications that require text search, autocomplete, or similarity detection, such as search engines, data processing pipelines, or NLP tools.

Value Proposition

Developers choose go-ngram for its focus on memory efficiency through string pooling, Unicode support, and a simple, append-only API that avoids complex document management overhead.

Overview

Ngram index for golang

Use Cases

Best For

  • Implementing autocomplete or search suggestions in Go applications
  • Building text similarity or fuzzy matching systems
  • Creating lightweight full-text search indexes without external dependencies
  • Processing and indexing multilingual text with Unicode support
  • Optimizing memory usage in text-heavy Go services
  • Developing NLP or information retrieval tools in Go

Not Ideal For

  • Applications requiring data deletion or frequent updates, due to its strict append-only design
  • Projects needing built-in document management or advanced search features, as it only provides raw indexing without higher-level abstractions
  • Systems that depend on NLP smoothing techniques like Laplace, which are listed as TODO and not yet implemented
  • Large-scale distributed search engines requiring out-of-the-box scalability, replication, or complex querying

Pros & Cons

Pros

Unicode Text Handling

Supports international characters beyond ASCII, enabling reliable indexing of multilingual text as highlighted in the README.

Memory and GC Optimization

Uses string pooling and compression to reduce memory overhead and garbage collection pressure, making it efficient for text-heavy applications.

Simple, Flexible API

Application agnostic with no built-in document model, allowing developers to integrate it into various use cases without unnecessary complexity.

Append-Only Consistency

Prevents data deletion, ensuring a consistent index structure and avoiding fragmentation issues, which simplifies maintenance.

Cons

Immutable Data Limitation

The append-only design means data cannot be deleted, forcing workarounds like versioning or external filtering for dynamic datasets.

Incomplete NLP Features

Lacks smoothing functions (e.g., Laplace) mentioned in the TODO, limiting its usefulness for advanced text processing tasks without custom implementation.

Minimal Abstraction Overhead

Users must build document management and search logic from scratch, as it provides only basic n-gram indexing without out-of-the-box search capabilities.

Frequently Asked Questions

Quick Stats

Stars114
Forks16
Contributors0
Open Issues0
Last commit10 years ago
CreatedSince 2014

Tags

#append-only#go-library#text-indexing#full-text-search#unicode-support#memory-optimization

Built With

G
Go

Included in

Machine Learning72.2k
Auto-fetched 9 hours ago

Related Projects

HuggingFace TransformersHuggingFace Transformers

🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

Stars164,972
Forks34,486
Last commit15 hours ago
jiebajieba

结巴中文分词

Stars35,145
Forks6,683
Last commit2 years ago
spacyspacy

💫 Industrial-strength Natural Language Processing (NLP) in Python

Stars33,882
Forks4,722
Last commit15 days ago
HaystackHaystack

Open-source AI orchestration framework for building context-engineered, production-ready LLM applications. Design modular pipelines and agent workflows with explicit control over retrieval, routing, memory, and generation. Built for scalable agents, RAG, multimodal applications, semantic search, and conversational systems.

Stars26,446
Forks3,098
Last commit21 hours 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