Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

docs(readme): analyse() returns eight keys, not the three the page showed

Adeshina Lasisibf909880f95e
diff --git a/README.md b/README.md
index 41bafed4..f4769b93 100644
--- a/README.md
+++ b/README.md
@@ -660,9 +660,15 @@ Routing asks one question: *can the English checkpoint read this state?* The bui
```python
from laya.lang import analyse
analyse("Care este ora in Tokyo?")
-# {'script': 'latin', 'language': 'en', 'is_english': True} -> the English checkpoint
+# {'script': 'latin', 'script_profile': {'latin': 1.0}, 'language': 'en', 'is_english': True,
+# 'language_undecided': False, 'diacritic_rate': 0.0, 'non_latin_fraction': 0.0,
+# 'mixed_segment': None} -> the English checkpoint
```
+`is_english` is the key routing reads. `language_undecided` separates "read as English" from
+"carried no usable signal, so the default applies", and `mixed_segment` names the line or field
+that made a mostly-English state non-English (`None` when none did).
+
If you already run a language-identification model, hand routing the answer instead of relying on the heuristic. `lang_guess` takes a language code or a callable receiving the state, and is checked after an explicit `lang=` and before detection:
```python