Locale Drift & Normalization

March 6, 2026 · View on GitHub

🧭 Quick Return to Map

You are in a sub-page of LanguageLocale.
To reorient, go back here:

Think of this page as a desk within a ward.
If you need the full triage and all prescriptions, return to the Emergency Room lobby.

A focused fix for locale-specific normalization bugs that break retrieval or cause answers to flip between runs. Use this page to align Unicode form, width, accents, digits, quotes, spaces, casing across ingest, index, query, and display. No infra change required.

Open these first

When to use this page

  • Same page looks identical to the eye, yet retrieval misses or ranks it differently.
  • Queries with accented vs unaccented forms return different snippets.
  • Half-width vs full-width characters change similarity scores.
  • Arabic-Indic digits or CJK punctuation break matches.
  • Smart quotes vs straight quotes fragment hits.
  • Turkish I or locale-aware casing flips λ between runs.
  • NBSP or narrow spaces split tokens unpredictably.

Core acceptance targets

  • ΔS(question, retrieved) ≤ 0.45 in the native locale, ≤ 0.50 after cross-locale normalization.
  • Coverage of target section ≥ 0.70 on three paraphrases.
  • λ remains convergent across three locale variants of the same question.
  • No analyzer drift between ingest and query paths in hybrid pipelines.

Symptoms → Likely cause → Open this

SymptomLikely causeOpen this
Visually identical text but no hitUnicode form mismatch NFD vs NFCRetrieval Playbook, OCR Parsing Checklist
Hits split between copies of the same docWidth folding not applied, full-width vs half-widthRetrieval Playbook
Accented vs plain query return different snippetsAccent folding policy inconsistentembedding-vs-semantic.md
Numbers in Arabic-Indic scripts never matchDigit class mismatch or analyzer not locale awaretokenizer_mismatch.md
Quotes or hyphens break phrase queriesSmart quotes, em/quasi hyphens, Unicode confusablesOCR Parsing Checklist
Same prompt, answers flip by localeCasing rules differ, tr locale I/i special case, λ unstablescript_mixing.md, rerankers.md
Token counts explode on CJKNBSP, narrow no-break, or ideographic space not normalizedRetrieval Playbook

60-second fix checklist

  1. Normalize at ingest and query Apply in this order: Unicode NFC, width fold, digit fold to ASCII, smart-punct to ASCII, collapse exotic spaces, then locale-aware casefold. Keep the original text for display.

  2. Dual-key storage Store both visual_text and search_text. Index BM25 on search_text. Keep visual_text for citations and display. Schema in Data Contracts.

  3. Embed both views when needed For high-variance locales, create embeddings for raw and normalized text. Track which path produced the hit inside the snippet payload. See guidance in embedding-vs-semantic.md.

  4. Align analyzers Ensure the same analyzer and token rules for ingest and query in hybrid retrieval. Verify with three paraphrases and two seeds. If λ flips, pin headers and apply a BBAM variance clamp.

  5. Gold set verification Run a 20-item multilingual gold set. Require ΔS ≤ 0.45 native and ≤ 0.50 normalized, coverage ≥ 0.70, λ convergent.


Minimal adapter spec

  • Payload must carry: locale, unicode_form, width_fold, digit_class, space_class, accent_fold, case_mode.
  • Snippet must include both visual_text and search_text plus normalization_trace.
  • Reject answers if citation visual_text and search_text disagree on offsets.

See schema patterns in Data Contracts and tracing in Retrieval Traceability.


Copy-paste prompt

You have TXT OS and the WFGY Problem Map loaded.

My bug smells like locale drift.
Question variants: {q_native, q_no_accents, q_width_folded}.
Traces: ΔS_native=..., ΔS_normalized=..., λ states across three variants.

Tell me:
1) which normalization step is missing and why,
2) the exact WFGY page to open,
3) the smallest change to push ΔS ≤ 0.45 native and ≤ 0.50 normalized,
4) a reproducible test with 3 paraphrases and 2 seeds.
Use BBMC/BBCR/BBAM when relevant.

🔗 Quick-Start Downloads (60 sec)

ToolLink3-Step Setup
WFGY 1.0 PDFEngine Paper1️⃣ Download · 2️⃣ Upload to your LLM · 3️⃣ Ask “Answer using WFGY + <your question>”
TXT OS (plain-text OS)TXTOS.txt1️⃣ Download · 2️⃣ Paste into any LLM chat · 3️⃣ Type “hello world” — OS boots instantly

Explore More

LayerPageWhat it’s for
⭐ ProofWFGY Recognition MapExternal citations, integrations, and ecosystem proof
⚙️ EngineWFGY 1.0Original PDF tension engine and early logic sketch (legacy reference)
⚙️ EngineWFGY 2.0Production tension kernel for RAG and agent systems
⚙️ EngineWFGY 3.0TXT based Singularity tension engine (131 S class set)
🗺️ MapProblem Map 1.0Flagship 16 problem RAG failure taxonomy and fix map
🗺️ MapProblem Map 2.0Global Debug Card for RAG and agent pipeline diagnosis
🗺️ MapProblem Map 3.0Global AI troubleshooting atlas and failure pattern map
🧰 AppTXT OS.txt semantic OS with fast bootstrap
🧰 AppBlah Blah BlahAbstract and paradox Q&A built on TXT OS
🧰 AppBlur Blur BlurText to image generation with semantic control
🏡 OnboardingStarter VillageGuided entry point for new users

If this repository helped, starring it improves discovery so more builders can find the docs and tools.
GitHub Repo stars