Skip to content
@go-ruby-did-you-mean

go-ruby-did-you-mean

go-ruby-did-you-mean

go-ruby-did-you-mean

Ruby's did_you_mean matcher in pure Go — Jaro–Winkler & Levenshtein spelling suggestions, MRI byte-exact, no cgo.

🌐 Website · 📚 Documentation

Docs License: BSD-3-Clause Go 1.26.4+ Coverage 100%


go-ruby-did-you-mean is a pure-Go (no cgo) reimplementation of the matcher at the heart of Ruby's did_you_mean standard library — MRI's DidYouMean::SpellChecker#correct and the two string-distance metrics it ranks with, Jaro–Winkler and Levenshtein. Given a mistyped word and a dictionary it returns Ruby's exact ranked list of spelling suggestions — a faithful, byte-for-byte port of upstream spell_checker.rb, jaro_winkler.rb and levenshtein.rb, without any Ruby runtime. It is a standalone, reusable module — a sibling of go-ruby-yaml, go-ruby-regexp and go-ruby-erb — and the did_you_mean matcher for go-embedded-ruby.

Repositories

Repo What it is
did-you-mean the library: Ruby's did_you_mean in pure Go
docs MkDocs Material documentation, versioned with mike, served at /docs/
go-ruby-did-you-mean.github.io the Hugo landing page
brand logos and brand assets

Principles

  • Pure Go, zero cgo. Cross-compiles and embeds anywhere; a static binary by default.
  • Extracted from rbgo, reusable by anyone. A standalone library that rbgo binds as a native module, the same pattern as go-ruby-regexp and go-ruby-erb.
  • MRI byte-exact. Output matches reference Ruby exactly, validated by a differential oracle against the ruby binary.
  • Standalone & reusable. No dependency on the Ruby runtime; the dependency runs the other way.
  • 100% test coverage is the target, enforced as a CI gate.

Status

Complete — MRI byte-exact. Faithful, line-for-line port of Ruby's DidYouMean::SpellChecker#correct: normalization, the Jaro–Winkler filter and ranking, the Levenshtein mistype filter, and the misspell fallback, with both metrics comparing Unicode code points. Validated by a differential oracle against the system ruby — every ranked array reproduced byte-for-byte. Differential-tested against MRI at 100% coverage, gofmt + go vet clean, CI green across the six 64-bit Go targets (amd64, arm64, riscv64, loong64, ppc64le, s390x) and three operating systems. It is bound into the go-embedded-ruby (rbgo) ecosystem as a native module.

BSD-3-Clause.

Popular repositories Loading

  1. did-you-mean did-you-mean Public

    Pure-Go MRI-compatible Ruby did-you-mean, CGO=0 — bound by go-embedded-ruby/rbgo

    Go

  2. brand brand Public

    Brand assets — logos & icons

  3. .github .github Public

    Organization profile

  4. go-ruby-did-you-mean.github.io go-ruby-did-you-mean.github.io Public

    Landing page

    HTML

  5. docs docs Public

    Documentation

    Go

Repositories

Showing 5 of 5 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…