No description
Find a file
Snider 9ea76af2b1 refactor: apply go fix modernizers for Go 1.26
Automated fixes: interface{} → any, range-over-int, t.Context(),
wg.Go(), strings.SplitSeq, strings.Builder, slices.Contains,
maps helpers, min/max builtins.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 21:00:16 +00:00
docs docs: graduate TODO/FINDINGS into production documentation 2026-02-20 15:01:55 +00:00
integration feat(calibrate): 1B vs 27B domain calibration tool 2026-02-20 13:51:11 +00:00
locales feat: add grammar table spec and French locale 2026-02-19 17:57:22 +00:00
reversal refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
.gitignore chore: add gitignore entries for IDE/build artifacts 2026-02-20 09:15:26 +00:00
calibrate.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
calibrate_test.go feat(calibrate): 1B vs 27B domain calibration tool 2026-02-20 13:51:11 +00:00
classify.go fix: address Virgil review — 5 fixes for classify pipeline 2026-02-20 00:44:35 +00:00
classify_test.go fix: address Virgil review — 5 fixes for classify pipeline 2026-02-20 00:44:35 +00:00
CLAUDE.md docs: graduate TODO/FINDINGS into production documentation 2026-02-20 15:01:55 +00:00
compose.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
compose_test.go test(i18n): add tests for 8 uncovered files, coverage 69.9% -> 86.6% 2026-02-20 02:09:08 +00:00
context.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
context_test.go test(i18n): add tests for 8 uncovered files, coverage 69.9% -> 86.6% 2026-02-20 02:09:08 +00:00
debug.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
debug_test.go test(i18n): add tests for 8 uncovered files, coverage 69.9% -> 86.6% 2026-02-20 02:09:08 +00:00
go.mod chore: bump go directive to 1.26.0 2026-02-22 20:33:48 +00:00
go.sum chore: go mod tidy for 1.26.0 2026-02-22 20:35:59 +00:00
grammar.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
grammar_test.go feat: add grammar table spec and French locale 2026-02-19 17:57:22 +00:00
handler.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
handler_test.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
hooks.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
hooks_test.go test(i18n): add tests for 8 uncovered files, coverage 69.9% -> 86.6% 2026-02-20 02:09:08 +00:00
i18n.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
i18n_test.go test(i18n): add tests for 8 uncovered files, coverage 69.9% -> 86.6% 2026-02-20 02:09:08 +00:00
language.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
language_test.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
loader.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
loader_test.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
localise.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
localise_test.go test(i18n): add tests for 8 uncovered files, coverage 69.9% -> 86.6% 2026-02-20 02:09:08 +00:00
numbers.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
numbers_test.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
README.md docs: add README with quick start and docs links 2026-02-20 15:11:20 +00:00
REVIEW.md review: post-implementation findings for dual-class disambiguation 2026-02-19 16:50:18 +00:00
service.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:16 +00:00
service_test.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
time.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
time_test.go test(i18n): add tests for 8 uncovered files, coverage 69.9% -> 86.6% 2026-02-20 02:09:08 +00:00
transform.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
transform_test.go test(i18n): add tests for 8 uncovered files, coverage 69.9% -> 86.6% 2026-02-20 02:09:08 +00:00
types.go feat: extend irregular verb coverage and add benchmarks 2026-02-19 17:41:29 +00:00
types_test.go feat: grammar-aware i18n module extracted from core 2026-02-16 19:51:27 +00:00
validate.go feat(validate): article and irregular verb validators using 1B model 2026-02-20 09:09:23 +00:00
validate_test.go feat(validate): article and irregular verb validators using 1B model 2026-02-20 09:09:23 +00:00

go-i18n

Grammar engine for Go. Provides forward composition primitives (PastTense, Gerund, Pluralize, Article, composite progress and label functions), a T() translation entry point with namespace key handlers, and a reversal engine that recovers base forms and grammatical roles from inflected text. The reversal package produces GrammarImprint feature vectors for semantic similarity scoring, builds reference domain distributions, performs anomaly detection, and includes a 1B model pre-sort pipeline for training data classification. Consumers bring their own translation keys; this library provides the grammatical machinery.

Module: forge.lthn.ai/core/go-i18n Licence: EUPL-1.2 Language: Go 1.25

Quick Start

import "forge.lthn.ai/core/go-i18n"

// Grammar primitives
fmt.Println(i18n.PastTense("delete"))   // "deleted"
fmt.Println(i18n.Gerund("build"))       // "building"
fmt.Println(i18n.Pluralize("file", 3))  // "files"

// Translation with auto-composed output
fmt.Println(i18n.T("i18n.progress.build"))  // "Building..."
fmt.Println(i18n.T("i18n.done.delete", "file"))  // "File deleted"

// Reversal: recover grammar from text
tokeniser := reversal.NewTokeniser()
tokens := tokeniser.Tokenise("deleted the files")
imprint := reversal.NewImprint(tokens)

Documentation

  • Architecture — grammar primitives, T() handlers, reversal engine, GrammarImprint, reference distributions, 1B pipeline
  • Development Guide — building, testing, grammar table structure (critical: do not flatten JSON)
  • Project History — completed phases and known limitations

Build & Test

go test ./...
go test -v ./reversal/
go test -bench=. ./...
go build ./...

Licence

European Union Public Licence 1.2 — see LICENCE for details.