Go package guesses your language from three-letter chunks
A zero-dependency port of a Rust/JS language detector that uses trigram frequency tables to figure out what you're writing.

What it does
whatlanggo takes a string and tells you the language, the script (Latin, Cyrillic, Arabic, etc.), and a confidence score. It supports 84 languages and works entirely inside Go with no external dependencies. You can also blacklist or whitelist specific languages if you already have a hunch.
The interesting bit
The detection is based on trigram frequency models — essentially counting which three-character sequences appear and comparing them against precomputed tables. The reliability check uses a hyperbola-shaped threshold based on how many unique trigrams the text contains and how far ahead the top guess is from the runner-up. (There’s even a graph.)
Key highlights
- 84 languages supported; see the full list in
SUPPORTED_LANGUAGES.md - Zero external dependencies, pure Go
- Returns language, script, and confidence in one call
- Optional blacklist/whitelist for constraining guesses
- Derived from the Rust
whatlang-rsand JavaScriptfrancprojects
Caveats
- Requires Go 1.8 or higher (somewhat dated; unclear if newer versions are fully tested)
- The README notes it is “fast” but provides no benchmarks or comparative numbers
- Travis CI badge suggests older CI setup; project activity level is unclear
Verdict
Useful if you need lightweight language detection inside a Go service and don’t want to pull in heavy ML frameworks or call external APIs. Skip it if you need deep confidence calibration or active maintenance guarantees.