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.
Python calibrationclassificationdecision-modelhuggingfacejevmodernbertmultilingualnlppythonpytorchroutingtyped-decisionszero-shot
feat(dotnet): add checkpoint router
kevin-gatimu1854b2ed79c1
diff --git a/laya-dotnet/src/Laya/LayaRouter.cs b/laya-dotnet/src/Laya/LayaRouter.csnew file mode 100644index 00000000..8c428eab--- /dev/null+++ b/laya-dotnet/src/Laya/LayaRouter.cs@@ -0,0 +1,518 @@+namespace Laya;++/// <summary>+/// The routing outcome: which checkpoint, why, and what was detected. Ports Python's+/// <c>RouteDecision</c> (a <c>dict</c> subclass there; a plain record here, since the .NET SDK+/// has no need to serialise it as a raw dictionary).+/// </summary>+/// <param name="Model">The checkpoint selected.</param>+/// <param name="Reason">+/// Human-readable explanation, byte-identical to Python's (including <c>%r</c>-style quoting and+/// half-even <c>%.0f%%</c> percentage formatting).+/// </param>+/// <param name="Detection">+/// The language/script detection behind the decision, or <see langword="null"/> when the model+/// was picked by an explicit <c>model</c>/<c>task</c>/<c>lang</c> argument instead.+/// </param>+/// <param name="Workflow">+/// The typed-decisions workflow the question ids matched, if any — reported even when+/// <see cref="LayaRouterOptions.AutoTaskDetection"/> is off and so played no part in the decision.+/// </param>+public sealed record RouteDecision(LayaCheckpoint Model, string Reason, LanguageAnalysis? Detection, string? Workflow);++/// <summary>Options for a <see cref="LayaRouter"/>.</summary>+public sealed class LayaRouterOptions+{+ /// <summary>+ /// Template used to build each checkpoint's <see cref="LayaEngine"/>: execution provider,+ /// thread counts, <see cref="LayaOptions.AllowDownload"/>, cache directory and HuggingFace+ /// token/repo are all taken from this template. <see cref="LayaOptions.Checkpoint"/> and+ /// <see cref="LayaOptions.ModelDirectory"/> on the template are ignored — the router always+ /// resolves each checkpoint through its own <see cref="LayaOptions.Checkpoint"/>-aware path+ /// (<c>LAYA_ONNX_ROOT</c>, cache, or download), the same way <see cref="LayaEngine.Create"/> does.+ /// </summary>+ public LayaOptions EngineOptions { get; set; } = new();++ /// <summary>+ /// How many checkpoints stay resident at once (least-recently-used is evicted). Default 1,+ /// matching Python. Raised automatically by <see cref="LayaRouter.Attach"/> and+ /// <see cref="LayaRouter.Preload"/> to fit what they load.+ /// </summary>+ public int MaxLoaded { get; set; } = 1;++ /// <summary>+ /// Checkpoint used when a state has no letters at all (script <c>"unknown"</c>). Default+ /// <see cref="LayaCheckpoint.English"/>, matching Python's default.+ /// </summary>+ public LayaCheckpoint Default { get; set; } = LayaCheckpoint.English;++ /// <summary>+ /// Whether <see cref="LayaRouter.Route"/> may pick <see cref="LayaCheckpoint.TypedDecisions"/>+ /// on its own when the question ids match one of the four typed-decisions workflow+ /// signatures. Default <see langword="false"/>: that checkpoint is fine-tuned on specific+ /// synthetic workflows and must never be a silent default.+ /// </summary>+ public bool AutoTaskDetection { get; set; }++ /// <summary>Whether every checkpoint should be built immediately when the router is constructed.</summary>+ public bool Preload { get; set; }+}++/// <summary>+/// Lazily loads Laya checkpoints and sends each request to the right one. Ports Python's+/// <c>Router</c>.+/// </summary>+/// <remarks>+/// <para>+/// <code>+/// using var router = new LayaRouter();+/// router.Predict(new { message = "Mein Konto wurde zweimal belastet" }, questions); // -> multilingual+/// router.Predict(new { message = "I was charged twice" }, questions); // -> english+/// router.Predict(state, questions, model: "typed-decisions"); // explicit+/// </code>+/// </para>+/// <para>+/// Checkpoints are downloaded/built on first use. <see cref="LayaRouterOptions.MaxLoaded"/> caps+/// how many stay resident (least-recently-used is evicted). For a server or a demo, prefer+/// <see cref="LayaRouterOptions.Preload"/> or <see cref="Preload"/>: a cold load costs seconds,+/// while detection costs microseconds, so anything that alternates languages at+/// <c>MaxLoaded=1</c> reloads on every request.+/// </para>+/// <para>+/// <b>Lifetime.</b> Unlike Python, which relies on the garbage collector to keep an evicted+/// checkpoint alive until nothing references it, .NET must dispose the underlying+/// <see cref="LayaEngine"/> explicitly. The router protects itself: a checkpoint evicted or+/// unloaded while a router-driven <see cref="Predict(object, QuestionSet)"/> call is still+/// running on it is disposed only once that call returns, never mid-inference. <see cref="Load"/>,+/// however, hands back a bare reference with no such protection — if you keep using it after the+/// router has evicted it (e.g. by loading more checkpoints than <c>MaxLoaded</c> allows), it may+/// already be disposed. Route requests through <see cref="Predict(object, QuestionSet)"/>, or use+/// <see cref="Attach"/> to hand the router an instance you own and will dispose yourself.+/// </para>+/// </remarks>+public sealed class LayaRouter : ILayaPredictor, IDisposable+{+ // Checkpoint keys people are likely to type, mapped to their canonical name. Matches+ // Python's _ALIASES exactly.+ private static readonly Dictionary<string, string> Aliases = new(StringComparer.Ordinal)+ {+ ["en"] = "english", ["laya"] = "english", ["default"] = "english",+ ["multi"] = "multilingual", ["ml"] = "multilingual", ["laya-multilingual"] = "multilingual",+ ["typed"] = "typed-decisions", ["typed_decisions"] = "typed-decisions",+ ["laya-typed-decisions"] = "typed-decisions", ["decisions"] = "typed-decisions",+ };++ // Question-id signatures of the four typed-decisions workflows, used only when+ // AutoTaskDetection is enabled. Order matches Python's _TYPED_DECISION_WORKFLOWS.+ private static readonly (string Workflow, string[] Ids)[] TypedDecisionWorkflows =+ [+ ("agent_trace_observability", ["action", "needs_review", "outcome", "risk", "urgency"]),+ ("customer_service", ["action", "category", "churn_risk", "needs_human", "urgency"]),+ ("invoice_processing", ["discrepancy_severity", "disposition", "duplicate", "matches_order", "urgency"]),+ ("security_incidents", ["credential_compromise", "disposition", "severity", "true_positive", "urgency"]),+ ];++ private static readonly LayaCheckpoint[] AllCheckpoints =+ [LayaCheckpoint.English, LayaCheckpoint.Multilingual, LayaCheckpoint.TypedDecisions];++ private sealed class Slot+ {+ public required ILayaPredictor Predictor { get; init; }+ public int Leases;+ public bool Retired;+ // False for an instance handed in via Attach: the router does not own its lifetime and+ // must never dispose it.+ public required bool OwnsDisposal { get; init; }+ }++ private readonly Func<LayaCheckpoint, ILayaPredictor> _engineFactory;+ private readonly Lock _lock = new();+ private readonly Dictionary<LayaCheckpoint, Slot> _slots = new();+ private readonly List<LayaCheckpoint> _order = []; // least-recently-used first+ private int _maxLoaded;+ private bool _disposed;++ /// <summary>Checkpoint used when a state has no letters at all.</summary>+ public LayaCheckpoint Default { get; }++ /// <summary>+ /// Whether <see cref="Route"/> may pick <see cref="LayaCheckpoint.TypedDecisions"/> on its+ /// own when the question ids match a typed-decisions workflow signature.+ /// </summary>+ public bool AutoTaskDetection { get; }++ /// <summary>Create a router that builds real <see cref="LayaEngine"/> instances on demand.</summary>+ public LayaRouter(LayaRouterOptions? options = null)+ : this(options, BuildDefaultFactory((options ?? new LayaRouterOptions()).EngineOptions))+ {+ }++ /// <summary>+ /// Test-only seam: builds checkpoints via <paramref name="engineFactory"/> instead of+ /// <see cref="LayaEngine.Create"/>, so LRU/attach/preload/unload behaviour can be exercised+ /// with fake predictors and no ONNX weights.+ /// </summary>+ internal LayaRouter(LayaRouterOptions? options, Func<LayaCheckpoint, ILayaPredictor> engineFactory)+ {+ ArgumentNullException.ThrowIfNull(engineFactory);+ options ??= new LayaRouterOptions();+ _engineFactory = engineFactory;+ _maxLoaded = Math.Max(1, options.MaxLoaded);+ Default = options.Default;+ AutoTaskDetection = options.AutoTaskDetection;+ if (options.Preload) Preload();+ }++ private static Func<LayaCheckpoint, ILayaPredictor> BuildDefaultFactory(LayaOptions template) => checkpoint =>+ LayaEngine.Create(new LayaOptions+ {+ Checkpoint = checkpoint,+ ExecutionProvider = template.ExecutionProvider,+ IntraOpThreads = template.IntraOpThreads,+ InterOpThreads = template.InterOpThreads,+ AllowDownload = template.AllowDownload,+ HuggingFaceRepo = template.HuggingFaceRepo,+ HuggingFaceToken = template.HuggingFaceToken,+ CacheDirectory = template.CacheDirectory,+ DownloadProgress = template.DownloadProgress,+ });++ // ── name resolution ──────────────────────────────────────────────────────++ /// <summary>+ /// Resolve a checkpoint name or alias (case-insensitive) to its <see cref="LayaCheckpoint"/>.+ /// </summary>+ /// <exception cref="ArgumentException">If <paramref name="name"/> matches no checkpoint or alias.</exception>+ public static LayaCheckpoint NormaliseName(string name)+ {+ ArgumentNullException.ThrowIfNull(name);+ var key = name.Trim().ToLowerInvariant();+ if (Aliases.TryGetValue(key, out var mapped)) key = mapped;+ return key switch+ {+ "english" => LayaCheckpoint.English,+ "multilingual" => LayaCheckpoint.Multilingual,+ "typed-decisions" => LayaCheckpoint.TypedDecisions,+ _ => throw new ArgumentException(+ $"unknown model '{name}'; choose one of english, multilingual, typed-decisions "+ + $"(or an alias: {string.Join(", ", Aliases.Keys.OrderBy(k => k, StringComparer.Ordinal))})",+ nameof(name)),+ };+ }++ /// <summary>+ /// Name of the typed-decisions workflow whose question ids these are, else+ /// <see langword="null"/>. Requires an exact id-set match, so an unrelated schema that+ /// happens to contain <c>"urgency"</c> is never captured.+ /// </summary>+ public static string? MatchTypedDecisionsWorkflow(QuestionSet? questions)+ {+ var ids = new HashSet<string>(questions?.Ids ?? [], StringComparer.Ordinal);+ foreach (var (workflow, signature) in TypedDecisionWorkflows)+ if (ids.SetEquals(signature)) return workflow;+ return null;+ }++ // ── routing ───────────────────────────────────────────────────────────────++ /// <summary>+ /// Decide which checkpoint to use, without loading or running anything.+ /// </summary>+ /// <remarks>+ /// Precedence: explicit <paramref name="model"/> > explicit <paramref name="task"/> >+ /// detected workflow (opt-in via <see cref="AutoTaskDetection"/>) > explicit+ /// <paramref name="lang"/> > detected script/language > <see cref="Default"/>.+ /// </remarks>+ public RouteDecision Route(+ object? state, QuestionSet? questions = null,+ string? model = null, string? task = null, string? lang = null)+ {+ if (model is not null)+ return new RouteDecision(NormaliseName(model), $"explicit model={PyRepr(model)}", null, null);++ if (task is not null)+ {+ var normalisedTaskSpelling = task.ToLowerInvariant().Replace("-", "_");+ var key = NormaliseName(normalisedTaskSpelling == "typed_decisions" ? "typed-decisions" : task);+ return new RouteDecision(key, $"explicit task={PyRepr(task)}", null, null);+ }++ var workflow = MatchTypedDecisionsWorkflow(questions);+ if (workflow is not null && AutoTaskDetection)+ return new RouteDecision(LayaCheckpoint.TypedDecisions,+ $"question ids match the {PyRepr(workflow)} typed-decisions workflow", null, workflow);++ if (lang is not null)+ {+ var primary = lang.ToLowerInvariant().Split('-')[0];+ var key = primary is "en" or "eng" or "english" ? LayaCheckpoint.English : LayaCheckpoint.Multilingual;+ return new RouteDecision(key, $"explicit lang={PyRepr(lang)}", null, workflow);+ }++ var det = LanguageDetection.Analyse(state);+ LayaCheckpoint model2;+ string reason;+ if (det.Script == "unknown")+ {+ model2 = Default;+ reason = $"no letters detected in state; using default ({CheckpointName(model2)})";+ }+ else if (det.Script != "latin")+ {+ model2 = LayaCheckpoint.Multilingual;+ reason = $"non-Latin script ({det.Script}, {FormatPercent0(det.NonLatinFraction)}% of letters); "+ + "the English checkpoint cannot read it";+ }+ else if (!det.IsEnglish)+ {+ model2 = LayaCheckpoint.Multilingual;+ reason = det.Language is { } identified+ ? $"Latin script but language looks like {PyRepr(identified)}, not English"+ // Unidentified Latin-script language: routed on the non-English letters alone,+ // because no stopword list here covers it.+ : $"Latin script, language not identified but {FormatPercent0(det.DiacriticRate)}% "+ + "non-English letters; not safe for the English checkpoint";+ }+ else+ {+ model2 = LayaCheckpoint.English;+ reason = "English Latin text";+ }+ return new RouteDecision(model2, reason, det, workflow);+ }++ private static string CheckpointName(LayaCheckpoint c) => LayaOptions.CheckpointSubfolder(c);++ /// <summary>Python's <c>%.0f%%</c>: half-even rounding to the nearest integer percent.</summary>+ private static string FormatPercent0(double fraction) =>+ Math.Round(100.0 * fraction, MidpointRounding.ToEven).ToString("0", System.Globalization.CultureInfo.InvariantCulture);++ /// <summary>Python's <c>%r</c> for a <see cref="string"/>: a quoted, escaped repr.</summary>+ private static string PyRepr(string s)+ {+ var hasSingle = s.Contains('\'');+ var hasDouble = s.Contains('"');+ var quote = hasSingle && !hasDouble ? '"' : '\'';+ var sb = new System.Text.StringBuilder(s.Length + 2);+ sb.Append(quote);+ foreach (var rune in s.EnumerateRunes())+ {+ if (rune.Value == quote) { sb.Append('\\').Append(quote); continue; }+ switch (rune.Value)+ {+ case '\\': sb.Append("\\\\"); break;+ case '\n': sb.Append("\\n"); break;+ case '\r': sb.Append("\\r"); break;+ case '\t': sb.Append("\\t"); break;+ default:+ if (rune.Value < 0x20 || rune.Value == 0x7f)+ sb.Append("\\x").Append(rune.Value.ToString("x2"));+ else+ sb.Append(rune.ToString());+ break;+ }+ }+ sb.Append(quote);+ return sb.ToString();+ }++ // ── loading ───────────────────────────────────────────────────────────────++ /// <summary>+ /// Return the predictor for <paramref name="name"/>, downloading and building it on first+ /// use. Concurrent callers share a single build instead of racing duplicates.+ /// </summary>+ /// <remarks>See the lifetime note on <see cref="LayaRouter"/>: the returned reference is not leased.</remarks>+ public ILayaPredictor Load(string name)+ {+ var key = NormaliseName(name);+ lock (_lock)+ {+ ThrowIfDisposed();+ var slot = FindOrBuild(key);+ Evict();+ return slot.Predictor;+ }+ }++ // Must be called with _lock held.+ private Slot FindOrBuild(LayaCheckpoint key)+ {+ if (_slots.TryGetValue(key, out var existing))+ {+ Touch(key);+ return existing;+ }+ var predictor = _engineFactory(key);+ var slot = new Slot { Predictor = predictor, OwnsDisposal = true };+ _slots[key] = slot;+ _order.Add(key);+ return slot;+ }++ // Must be called with _lock held.+ private void Touch(LayaCheckpoint key)+ {+ _order.Remove(key);+ _order.Add(key);+ }++ // Must be called with _lock held. Evicts down to _maxLoaded; a victim still leased (an+ // in-flight router-driven Predict) is marked retired instead of disposed immediately.+ private void Evict()+ {+ while (_order.Count > _maxLoaded)+ {+ var victim = _order[0];+ _order.RemoveAt(0);+ if (_slots.Remove(victim, out var slot)) RetireOrDispose(slot);+ }+ }++ // Must be called with _lock held.+ private static void RetireOrDispose(Slot slot)+ {+ slot.Retired = true;+ if (slot.Leases == 0 && slot.OwnsDisposal && slot.Predictor is IDisposable disposable) disposable.Dispose();+ }++ /// <summary>+ /// Register an already-built predictor under <paramref name="name"/> instead of loading a+ /// second copy. Useful when the process has a checkpoint loaded for other reasons.+ /// </summary>+ /// <remarks>+ /// The router never disposes an attached predictor — the caller keeps ownership. Raises+ /// <see cref="LayaRouterOptions.MaxLoaded"/> to fit whatever is now resident, so it is not+ /// immediately evicted.+ /// </remarks>+ public ILayaPredictor Attach(string name, ILayaPredictor predictor)+ {+ ArgumentNullException.ThrowIfNull(predictor);+ var key = NormaliseName(name);+ lock (_lock)+ {+ ThrowIfDisposed();+ if (_slots.TryGetValue(key, out var old)) RetireOrDispose(old);+ _slots[key] = new Slot { Predictor = predictor, OwnsDisposal = false };+ Touch(key);+ _maxLoaded = Math.Max(_maxLoaded, _slots.Count);+ }+ return predictor;+ }++ /// <summary>+ /// Download and build checkpoints up front so no request ever pays a model load.+ /// <see cref="LayaRouterOptions.MaxLoaded"/> is raised to fit whatever is preloaded.+ /// Omit <paramref name="names"/> to preload every checkpoint.+ /// </summary>+ public LayaRouter Preload(IEnumerable<string>? names = null)+ {+ var keys = names is null+ ? AllCheckpoints+ : names.Select(NormaliseName).ToArray();+ lock (_lock)+ {+ ThrowIfDisposed();+ _maxLoaded = Math.Max(_maxLoaded, Math.Max(keys.Length, _slots.Count));+ foreach (var key in keys)+ {+ if (_slots.ContainsKey(key)) continue; // an attached predictor is already built+ FindOrBuild(key);+ Evict();+ }+ }+ return this;+ }++ /// <summary>Free one checkpoint, or all of them when <paramref name="name"/> is omitted.</summary>+ public void Unload(string? name = null)+ {+ lock (_lock)+ {+ ThrowIfDisposed();+ if (name is null)+ {+ foreach (var slot in _slots.Values) RetireOrDispose(slot);+ _slots.Clear();+ _order.Clear();+ }+ else+ {+ var key = NormaliseName(name);+ if (_slots.Remove(key, out var slot)) RetireOrDispose(slot);+ _order.Remove(key);+ }+ }+ }++ /// <summary>Checkpoints currently resident, least-recently-used first.</summary>+ public IReadOnlyList<LayaCheckpoint> Loaded+ {+ get { lock (_lock) return [.. _order]; }+ }++ // ── running ───────────────────────────────────────────────────────────────++ /// <summary>Route with no explicit override, then answer every question in one forward pass.</summary>+ public LayaResult Predict(object? state, QuestionSet questions) => Predict(state, questions, null, null, null);++ /// <summary>+ /// Route, then answer every question in one forward pass on the chosen checkpoint. The+ /// result is the checkpoint's usual answer set, plus <see cref="LayaResult.Routing"/>+ /// recording the decision.+ /// </summary>+ public LayaResult Predict(+ object? state, QuestionSet questions,+ string? model = null, string? task = null, string? lang = null)+ {+ ArgumentNullException.ThrowIfNull(questions);+ var decision = Route(state, questions, model, task, lang);++ Slot slot;+ lock (_lock)+ {+ ThrowIfDisposed();+ slot = FindOrBuild(decision.Model);+ slot.Leases++;+ Evict();+ }+ try+ {+ // Inference runs outside the lock, exactly as Python's predict() calls+ // agent.system_one after load() has already returned and released the lock — so+ // concurrent predictions on a shared checkpoint are not serialised by the router.+ var result = slot.Predictor.Predict(state, questions);+ return result.WithRouting(decision);+ }+ finally+ {+ lock (_lock)+ {+ slot.Leases--;+ if (slot.Retired && slot.Leases == 0 && slot.OwnsDisposal && slot.Predictor is IDisposable disposable)+ disposable.Dispose();+ }+ }+ }++ private void ThrowIfDisposed() => ObjectDisposedException.ThrowIf(_disposed, this);++ /// <inheritdoc/>+ public void Dispose()+ {+ lock (_lock)+ {+ if (_disposed) return;+ _disposed = true;+ foreach (var slot in _slots.Values)+ {+ if (slot.Leases == 0 && slot.OwnsDisposal && slot.Predictor is IDisposable disposable)+ disposable.Dispose();+ else+ slot.Retired = true; // an in-flight Predict disposes it on release+ }+ _slots.Clear();+ _order.Clear();+ }+ }+}diff --git a/laya-dotnet/tests/Laya.Tests/LayaRouterTests.cs b/laya-dotnet/tests/Laya.Tests/LayaRouterTests.csnew file mode 100644index 00000000..a193c15d--- /dev/null+++ b/laya-dotnet/tests/Laya.Tests/LayaRouterTests.cs@@ -0,0 +1,479 @@+using System.Text.Json;++namespace Laya.Tests;++/// <summary>+/// Tier 1: routing decisions and checkpoint lifecycle, which needs no artifacts. The internal+/// engine-factory constructor stands in fake predictors for real <see cref="LayaEngine"/>+/// instances, so LRU/attach/preload/unload/eviction behaviour is exercised without ONNX weights.+/// Named cases mirror <c>tests/test_router.py</c>'s routing sections (script/is_english coverage+/// lives in <see cref="LanguageDetectionTests"/>); <see cref="EveryRouteProbeEntry"/> consumes+/// every entry of <c>golden/routing/route_probe.json</c>.+/// </summary>+public sealed class LayaRouterTests+{+ private sealed class FakePredictor(string name) : ILayaPredictor+ {+ public string Name { get; } = name;+ public int Calls;++ public LayaResult Predict(object? state, QuestionSet questions)+ {+ Interlocked.Increment(ref Calls);+ return new LayaResult(Name, [], new Dictionary<string, Answer>(StringComparer.Ordinal), new Usage(0, 0));+ }+ }++ private static LayaRouter NewFakeRouter(LayaRouterOptions? options = null) =>+ new(options, ck => new FakePredictor(CheckpointName(ck)));++ private static string CheckpointName(LayaCheckpoint c) => LayaOptions.CheckpointSubfolder(c);++ // ── workflow signatures ───────────────────────────────────────────────────++ public static readonly Dictionary<string, string[]> TypedDecisionWorkflowIds = new(StringComparer.Ordinal)+ {+ ["agent_trace_observability"] = ["action", "needs_review", "outcome", "risk", "urgency"],+ ["customer_service"] = ["action", "category", "churn_risk", "needs_human", "urgency"],+ ["invoice_processing"] = ["discrepancy_severity", "disposition", "duplicate", "matches_order", "urgency"],+ ["security_incidents"] = ["credential_compromise", "disposition", "severity", "true_positive", "urgency"],+ };++ [Theory]+ [MemberData(nameof(WorkflowCases))]+ public void MatchTypedDecisionsWorkflowMatchesExactIdSets(string workflow, string[] ids)+ {+ var questions = new QuestionSet();+ foreach (var id in ids) questions[id] = Question.Noul("x");+ Assert.Equal(workflow, LayaRouter.MatchTypedDecisionsWorkflow(questions));+ }++ public static IEnumerable<object[]> WorkflowCases() =>+ TypedDecisionWorkflowIds.Select(kv => new object[] { kv.Key, kv.Value });++ [Fact]+ public void WorkflowPartialOverlapMatchesNothing()+ {+ var qs = new QuestionSet { ["urgency"] = Question.Noul("x"), ["category"] = Question.Noul("x") };+ Assert.Null(LayaRouter.MatchTypedDecisionsWorkflow(qs));+ }++ [Fact]+ public void WorkflowSupersetMatchesNothing()+ {+ var qs = new QuestionSet();+ foreach (var id in TypedDecisionWorkflowIds["customer_service"]) qs[id] = Question.Noul("x");+ qs["extra"] = Question.Noul("x");+ Assert.Null(LayaRouter.MatchTypedDecisionsWorkflow(qs));+ }++ [Fact]+ public void WorkflowEmptyMatchesNothing() => Assert.Null(LayaRouter.MatchTypedDecisionsWorkflow(null));++ // ── name normalisation ────────────────────────────────────────────────────++ [Theory]+ [InlineData("en", LayaCheckpoint.English)]+ [InlineData("laya", LayaCheckpoint.English)]+ [InlineData("multi", LayaCheckpoint.Multilingual)]+ [InlineData("ML", LayaCheckpoint.Multilingual)]+ [InlineData("typed", LayaCheckpoint.TypedDecisions)]+ [InlineData("typed_decisions", LayaCheckpoint.TypedDecisions)]+ [InlineData("English", LayaCheckpoint.English)]+ // "convaiinnovations/laya".split("/")[-1] is literally the alias "laya", already covered above.+ public void NormaliseNameMatchesPython(string alias, LayaCheckpoint expected) =>+ Assert.Equal(expected, LayaRouter.NormaliseName(alias));++ [Fact]+ public void NormaliseNameUnknownThrows() =>+ Assert.Throws<ArgumentException>(() => LayaRouter.NormaliseName("nope"));++ // ── routing decisions ─────────────────────────────────────────────────────++ private static readonly QuestionSet GenericQuestions = new()+ {+ ["dept"] = Question.Choice("Which team?", ("billing", null), ("tech", null)),+ };++ private static QuestionSet TypedDecisionsQuestions() =>+ new(TypedDecisionWorkflowIds["customer_service"].Select(+ id => new KeyValuePair<string, Question>(id, Question.Noul("x"))));++ public sealed record RouteCase(string Label, object? State, string? Model, string? Task, string? Lang, LayaCheckpoint Expected);++ [Theory]+ [MemberData(nameof(RouteCases))]+ public void RouteMatchesPython(RouteCase c)+ {+ using var router = NewFakeRouter();+ var decision = router.Route(c.State, GenericQuestions, c.Model, c.Task, c.Lang);+ Assert.True(decision.Model == c.Expected, $"{c.Label}: got {decision.Model}, want {c.Expected}");+ }++ public static TheoryData<RouteCase> RouteCases() =>+ [+ new RouteCase("english text", new Dictionary<string, object?> { ["body"] = "I was charged twice, please refund." }, null, null, null, LayaCheckpoint.English),+ new RouteCase("armenian text", new Dictionary<string, object?> { ["body"] = "Հայերեն" }, null, null, null, LayaCheckpoint.Multilingual),+ new RouteCase("armenian explicit override", new Dictionary<string, object?> { ["body"] = "Հայերեն" }, "english", null, null, LayaCheckpoint.English),+ new RouteCase("hindi text", new Dictionary<string, object?> { ["body"] = "मुझसे दो बार शुल्क लिया गया" }, null, null, null, LayaCheckpoint.Multilingual),+ new RouteCase("explicit model", new Dictionary<string, object?> { ["body"] = "anything" }, "multilingual", null, null, LayaCheckpoint.Multilingual),+ new RouteCase("explicit model overrides script", new Dictionary<string, object?> { ["body"] = "मुझसे दो बार" }, "english", null, null, LayaCheckpoint.English),+ new RouteCase("explicit task", new Dictionary<string, object?> { ["body"] = "x" }, null, "typed_decisions", null, LayaCheckpoint.TypedDecisions),+ new RouteCase("explicit lang en", new Dictionary<string, object?> { ["body"] = "मुझसे दो बार" }, null, null, "en", LayaCheckpoint.English),+ new RouteCase("explicit lang de", new Dictionary<string, object?> { ["body"] = "hello there" }, null, null, "de", LayaCheckpoint.Multilingual),+ new RouteCase("empty state", new Dictionary<string, object?>(), null, null, null, LayaCheckpoint.English),+ new RouteCase("none state", null, null, null, null, LayaCheckpoint.English),+ ];++ [Fact]+ public void TypedDecisionsWorkflowIsNotUsedWhenAutoTaskDetectionIsOff()+ {+ using var router = NewFakeRouter();+ var decision = router.Route(new Dictionary<string, object?> { ["body"] = "I was charged twice" }, TypedDecisionsQuestions());+ Assert.Equal(LayaCheckpoint.English, decision.Model);+ Assert.Equal("customer_service", decision.Workflow); // reported even though it played no part+ }++ [Fact]+ public void AutoTaskDetectionIsOptIn()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { AutoTaskDetection = true });+ Assert.Equal(LayaCheckpoint.TypedDecisions,+ router.Route(new Dictionary<string, object?> { ["body"] = "I was charged twice" }, TypedDecisionsQuestions()).Model);+ Assert.Equal(LayaCheckpoint.English,+ router.Route(new Dictionary<string, object?> { ["body"] = "I was charged twice" }, GenericQuestions).Model);+ // explicit model still beats an auto-detected workflow+ Assert.Equal(LayaCheckpoint.Multilingual,+ router.Route("x", TypedDecisionsQuestions(), model: "multilingual").Model);+ }++ [Fact]+ public void DecisionPayloadShape()+ {+ using var router = NewFakeRouter();+ var d = router.Route(new Dictionary<string, object?> { ["body"] = "मुझसे दो बार शुल्क लिया गया" }, GenericQuestions);+ Assert.True(d.Reason.Length > 0);+ Assert.Equal("devanagari", d.Detection!.Script);+ Assert.Equal(LayaCheckpoint.Multilingual, d.Model);+ }++ [Fact]+ public void CustomDefaultOverride()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { Default = LayaCheckpoint.Multilingual });+ Assert.Equal(LayaCheckpoint.Multilingual, router.Route("12345", GenericQuestions).Model);+ }++ [Theory]+ [InlineData("Gătește-mi o rețetă de sarmale de post pentru mâine.")]+ [InlineData("Exportă APK-ul pentru Android și pune-l pe Drive ca să-l instalez.")]+ [InlineData("Klient został obciążony dwukrotnie i chce zwrot pieniędzy za fakturę")]+ [InlineData("Müşteriden iki kez ücret alındı ve para iadesi istiyor lütfen yardım")]+ public void UnknownLatinLanguageRoutesToMultilingual(string text)+ {+ using var router = NewFakeRouter();+ Assert.Equal(LayaCheckpoint.Multilingual, router.Route(text).Model);+ }++ [Fact]+ public void UndecidedReasonMentionsLettersNotAGuessedLanguage()+ {+ using var router = NewFakeRouter();+ var reason = router.Route("Müşteriden iki kez ücret alındı ve para iadesi istiyor").Reason;+ Assert.Contains("not identified", reason);+ }++ // ── LRU bookkeeping ───────────────────────────────────────────────────────++ [Fact]+ public void Cap1KeepsNewest()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 1 });+ router.Load("english");+ router.Load("multilingual");+ Assert.Equal([LayaCheckpoint.Multilingual], router.Loaded);+ }++ [Fact]+ public void Cap2EvictsOldest()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 2 });+ router.Load("english");+ router.Load("multilingual");+ router.Load("typed-decisions");+ Assert.Equal([LayaCheckpoint.Multilingual, LayaCheckpoint.TypedDecisions], router.Loaded);+ }++ [Fact]+ public void TouchProtectsFromEviction()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 2 });+ router.Load("english");+ router.Load("multilingual");+ router.Load("english"); // touch english+ router.Load("typed-decisions");+ Assert.Equal([LayaCheckpoint.English, LayaCheckpoint.TypedDecisions], [.. router.Loaded.OrderBy(c => c)]);+ }++ [Fact]+ public void UnloadOneAndAll()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 3 });+ router.Load("english");+ router.Load("multilingual");+ router.Unload("english");+ Assert.DoesNotContain(LayaCheckpoint.English, router.Loaded);+ router.Unload();+ Assert.Empty(router.Loaded);+ }++ // ── preload ───────────────────────────────────────────────────────────────++ [Fact]+ public void PreloadAllThreeStayResident()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 1 });+ router.Preload();+ Assert.Equal(+ new[] { LayaCheckpoint.English, LayaCheckpoint.Multilingual, LayaCheckpoint.TypedDecisions }.OrderBy(c => c),+ router.Loaded.OrderBy(c => c));+ }++ [Fact]+ public void PreloadRaisesMaxLoaded()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 1 });+ router.Preload(); // all three checkpoints+ Assert.Equal(3, router.Loaded.Count);+ // re-loading an already-resident checkpoint must not evict anything+ router.Load("english");+ Assert.Equal(3, router.Loaded.Count);+ }++ [Fact]+ public void PreloadSubsetStaysResidentAndTouchDoesNotEvict()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 1 });+ router.Preload(["english", "multilingual"]);+ router.Load("english"); // routing to an already-resident checkpoint must not evict anything+ Assert.Equal(+ new[] { LayaCheckpoint.English, LayaCheckpoint.Multilingual }.OrderBy(c => c),+ router.Loaded.OrderBy(c => c));+ }++ // ── attach ────────────────────────────────────────────────────────────────++ [Fact]+ public void AttachRegistersAndSurvivesALaterLoad()+ {+ // MaxLoaded=2 from construction, matching Python's `ra.max_loaded = max(ra.max_loaded, 2)`+ // before the second load: this port raises capacity only via LayaRouterOptions or an+ // Attach/Preload side effect, never through a bare mutable field.+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 2 });+ var sentinel = new FakePredictor("already-built");+ router.Attach("english", sentinel);+ Assert.Contains(LayaCheckpoint.English, router.Loaded);+ Assert.True(router.Loaded.Count >= 1); // max_loaded raised to hold it++ router.Load("multilingual");+ Assert.Equal(+ new[] { LayaCheckpoint.English, LayaCheckpoint.Multilingual }.OrderBy(c => c),+ router.Loaded.OrderBy(c => c));+ Assert.Same(sentinel, router.Load("english"));+ }++ [Fact]+ public void AttachAcceptsAliases()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 1 });+ router.Attach("en", new FakePredictor("x"));+ Assert.Contains(LayaCheckpoint.English, router.Loaded);+ }++ [Fact]+ public void AttachedPredictorIsNeverDisposedByTheRouter()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 1 });+ var disposable = new DisposableFake();+ router.Attach("english", disposable);+ router.Load("multilingual"); // evicts the attached english slot (max_loaded=1)+ router.Unload();+ Assert.False(disposable.Disposed);+ }++ private sealed class DisposableFake : ILayaPredictor, IDisposable+ {+ public bool Disposed { get; private set; }+ public LayaResult Predict(object? state, QuestionSet questions) =>+ new("fake", [], new Dictionary<string, Answer>(StringComparer.Ordinal), new Usage(0, 0));+ public void Dispose() => Disposed = true;+ }++ // ── eviction safety: a retired engine is disposed only after its in-flight Predict returns ──++ private sealed class SlowDisposable(ManualResetEventSlim releaseGate, SemaphoreSlim inPredict) : ILayaPredictor, IDisposable+ {+ public bool Disposed { get; private set; }++ public LayaResult Predict(object? state, QuestionSet questions)+ {+ inPredict.Release();+ releaseGate.Wait(TimeSpan.FromSeconds(10));+ Assert.False(Disposed); // never disposed while a predict call is still inside it+ return new LayaResult("fake", [], new Dictionary<string, Answer>(StringComparer.Ordinal), new Usage(0, 0));+ }++ public void Dispose() => Disposed = true;+ }++ [Fact]+ public async Task RetiredEngineIsDisposedOnlyAfterItsInFlightPredictReturns()+ {+ using var releaseGate = new ManualResetEventSlim(false);+ using var inPredict = new SemaphoreSlim(0);+ SlowDisposable? englishInstance = null;++ using var router = new LayaRouter(new LayaRouterOptions { MaxLoaded = 1 }, ck =>+ {+ if (ck == LayaCheckpoint.English) return englishInstance = new SlowDisposable(releaseGate, inPredict);+ return new FakePredictor(CheckpointName(ck));+ });++ var task = Task.Run(() => router.Predict("x", GenericQuestions, model: "english"));+ await inPredict.WaitAsync(TimeSpan.FromSeconds(10), TestContext.Current.CancellationToken);++ // With MaxLoaded=1, loading multilingual evicts (retires) the english slot while its+ // Predict call above is still blocked inside SlowDisposable.Predict.+ router.Load("multilingual");+ Assert.False(englishInstance!.Disposed);++ releaseGate.Set();+ await task.WaitAsync(TimeSpan.FromSeconds(10), TestContext.Current.CancellationToken);+ Assert.True(englishInstance.Disposed);+ }++ // ── thread safety (Python issue #95) ─────────────────────────────────────++ [Fact]+ public void EightConcurrentLoadsOfTheSameCheckpointBuildItOnce()+ {+ var built = 0;+ using var router = new LayaRouter(null, ck =>+ {+ Thread.Sleep(50); // widen the check-then-build window+ Interlocked.Increment(ref built);+ return new FakePredictor(CheckpointName(ck));+ });++ var results = new ILayaPredictor[8];+ Parallel.For(0, 8, i => results[i] = router.Load("english"));++ Assert.Equal(1, built);+ Assert.Single(results.Distinct());+ Assert.Equal([LayaCheckpoint.English], router.Loaded);+ }++ [Fact]+ public void ConcurrentHotPathLoadsOfAnAlreadyCachedModelStayConsistent()+ {+ using var router = NewFakeRouter(new LayaRouterOptions { MaxLoaded = 3 });+ router.Load("english"); // warm the cache++ Parallel.For(0, 20, _ => router.Load("english"));++ Assert.Equal([LayaCheckpoint.English], router.Loaded);+ }++ // ── Predict populates Routing ─────────────────────────────────────────────++ [Fact]+ public void PredictPopulatesRoutingOnTheResult()+ {+ using var router = NewFakeRouter();+ var result = router.Predict(new Dictionary<string, object?> { ["body"] = "Hola, necesito ayuda con mi factura por favor" }, GenericQuestions);+ Assert.NotNull(result.Routing);+ Assert.Equal(LayaCheckpoint.Multilingual, result.Routing!.Model);+ Assert.Equal("multilingual", result.Model); // the fake predictor names itself after the checkpoint+ }++ [Fact]+ public void DisposedRouterThrowsOnFurtherUse()+ {+ var router = NewFakeRouter();+ router.Dispose();+ Assert.Throws<ObjectDisposedException>(() => router.Load("english"));+ }++ // ── every recorded probe entry ────────────────────────────────────────────++ public static IEnumerable<object[]> RouteProbeCases()+ {+ using var doc = RoutingGoldenData.Load("route_probe.json");+ return [.. doc.RootElement.EnumerateArray().Select(e => new object[] { e.GetProperty("label").GetString()! })];+ }++ private static JsonElement FindRouteProbeEntry(string label)+ {+ using var doc = RoutingGoldenData.Load("route_probe.json");+ foreach (var e in doc.RootElement.EnumerateArray())+ if (e.GetProperty("label").GetString() == label)+ return JsonDocument.Parse(e.GetRawText()).RootElement;+ throw new InvalidOperationException($"no route_probe.json entry labelled '{label}'");+ }++ [Theory]+ [MemberData(nameof(RouteProbeCases))]+ public void EveryRouteProbeEntry(string label)+ {+ var e = FindRouteProbeEntry(label);+ var routeKwargs = e.GetProperty("route_kwargs");+ var routerKwargs = e.GetProperty("router_kwargs");++ var state = RoutingGoldenData.ToClr(routeKwargs.GetProperty("state"));+ QuestionSet? questions = null;+ if (routeKwargs.TryGetProperty("questions", out var q) && q.ValueKind != JsonValueKind.Null)+ questions = GoldenData.BuildQuestions(q);++ var model = OptString(routeKwargs, "model");+ var task = OptString(routeKwargs, "task");+ var lang = OptString(routeKwargs, "lang");++ var options = new LayaRouterOptions();+ if (routerKwargs.TryGetProperty("auto_task_detection", out var atd)) options.AutoTaskDetection = atd.GetBoolean();+ if (routerKwargs.TryGetProperty("default", out var def)) options.Default = LayaRouter.NormaliseName(def.GetString()!);+ // "models" and "standalone_repos" affect only the repo string, which RouteDecision does+ // not carry in this port (see golden/routing/meta.json's notes), so they are irrelevant+ // to the model selection under test here and are intentionally not applied.++ using var router = NewFakeRouter(options);+ var decision = router.Route(state, questions, model, task, lang);++ var want = e.GetProperty("decision");+ Assert.Equal(want.GetProperty("model").GetString(), CheckpointName(decision.Model));+ Assert.Equal(want.GetProperty("reason").GetString(), decision.Reason);++ var wantWorkflow = want.GetProperty("workflow");+ Assert.Equal(wantWorkflow.ValueKind == JsonValueKind.Null ? null : wantWorkflow.GetString(), decision.Workflow);++ var wantDetection = want.GetProperty("detection");+ if (wantDetection.ValueKind == JsonValueKind.Null)+ {+ Assert.Null(decision.Detection);+ }+ else+ {+ Assert.NotNull(decision.Detection);+ var got = decision.Detection!;+ Assert.Equal(wantDetection.GetProperty("script").GetString(), got.Script);+ Assert.Equal(wantDetection.GetProperty("language").ValueKind == JsonValueKind.Null+ ? null : wantDetection.GetProperty("language").GetString(), got.Language);+ Assert.Equal(wantDetection.GetProperty("is_english").GetBoolean(), got.IsEnglish);+ Assert.Equal(wantDetection.GetProperty("language_undecided").GetBoolean(), got.LanguageUndecided);+ Assert.Equal(wantDetection.GetProperty("diacritic_rate").GetDouble(), got.DiacriticRate, 1e-9);+ Assert.Equal(wantDetection.GetProperty("non_latin_fraction").GetDouble(), got.NonLatinFraction, 1e-9);+ }+ }++ private static string? OptString(JsonElement obj, string prop) =>+ obj.TryGetProperty(prop, out var v) && v.ValueKind != JsonValueKind.Null ? v.GetString() : null;+}diff --git a/laya-dotnet/tests/Laya.Tests/RouterEndToEndTests.cs b/laya-dotnet/tests/Laya.Tests/RouterEndToEndTests.csnew file mode 100644index 00000000..743f46f0--- /dev/null+++ b/laya-dotnet/tests/Laya.Tests/RouterEndToEndTests.cs@@ -0,0 +1,149 @@+namespace Laya.Tests;++/// <summary>+/// Tier 2: <see cref="LayaRouter"/> driving real checkpoints end to end. Needs the ONNX artifacts+/// for both the english and multilingual checkpoints (set <c>LAYA_ONNX_ROOT</c>); skipped+/// entirely otherwise, same convention as <see cref="PredictParityTests"/>.+/// </summary>+/// <remarks>+/// Joins <see cref="AllEnginesCollection"/> purely to run sequentially with the other+/// engine-loading test classes, never concurrently with them: the underlying native tokenizer+/// binding is not safe to construct from two threads at once for the same checkpoint, and this+/// class always builds its own fresh <see cref="LayaEngine"/> instances rather than sharing+/// <see cref="AllEnginesFixture"/>'s.+/// </remarks>+[Collection(AllEnginesCollection.Name)]+public sealed class RouterEndToEndTests+{+ private static void RequireEnglishAndMultilingual()+ {+ if (!TestArtifacts.For(LayaCheckpoint.English).HasModel+ || !TestArtifacts.For(LayaCheckpoint.Multilingual).HasModel)+ Assert.Skip("router end-to-end tests need both english and multilingual ONNX artifacts; "+ + "set LAYA_ONNX_ROOT to the parent of all checkpoints");+ }++ // Build each engine from the directory TestArtifacts found (the repo walk-up included), not+ // the router's default resolution, which only checks LAYA_ONNX_ROOT and the cache: otherwise the+ // skip check above can pass while the router still fails to find the artifacts.+ private static LayaRouter NewRouter() => new(new LayaRouterOptions { MaxLoaded = 1 }, checkpoint =>+ LayaEngine.Create(new LayaOptions+ {+ Checkpoint = checkpoint,+ ModelDirectory = TestArtifacts.For(checkpoint).Directory,+ }));++ [Fact]+ public void RoutesTheEnglishSampleToEnglishAndMatchesItsGolden()+ {+ RequireEnglishAndMultilingual();+ // MaxLoaded=1: this test only ever routes to one checkpoint, and each test method builds+ // its own router (disposed at the end of the method), so peak stays at one engine here.+ using var router = NewRouter();+ AssertRoutesAndMatchesGolden(router, LayaCheckpoint.English, "case_sample_app_english.json");+ }++ [Fact]+ public void RoutesTheHindiSampleToMultilingualAndMatchesItsGolden()+ {+ RequireEnglishAndMultilingual();+ using var router = NewRouter();+ AssertRoutesAndMatchesGolden(router, LayaCheckpoint.Multilingual, "case_sample_app_hindi.json");+ }++ private static void AssertRoutesAndMatchesGolden(LayaRouter router, LayaCheckpoint expectedCheckpoint, string file)+ {+ var golden = GoldenData.For(expectedCheckpoint);+ using var doc = golden.Load(file);+ var root = doc.RootElement;+ var state = GoldenData.ToClr(root.GetProperty("state"));+ var questions = GoldenData.BuildQuestions(root.GetProperty("questions"));++ var result = router.Predict(state, questions);++ Assert.NotNull(result.Routing);+ Assert.Equal(expectedCheckpoint, result.Routing!.Model);+ Assert.Equal(root.GetProperty("result").GetProperty("model").GetString(), result.Model);++ AssertMatchesRecordedAnswers(root.GetProperty("result").GetProperty("answers"), result);+ }++ private static void AssertMatchesRecordedAnswers(System.Text.Json.JsonElement answers, LayaResult result)+ {+ // Tolerances mirror PredictParityTests: 4-dp recorded values, so a rounding boundary is+ // 1e-4 wide; a score sums several such errors.+ const double probTolerance = 2e-4;+ const double scoreTolerance = 2e-3;++ foreach (var entry in answers.EnumerateObject())+ {+ var got = result[entry.Name];+ switch (got.Type)+ {+ case QuestionType.Choice:+ Assert.Equal(entry.Value.GetProperty("choice").GetString(), got.AsChoice().Choice);+ break;+ case QuestionType.Score:+ Assert.Equal(entry.Value.GetProperty("score").GetDouble(), got.AsScore().Score, scoreTolerance);+ break;+ case QuestionType.Noul:+ Assert.Equal(entry.Value.GetProperty("noul").GetDouble(), got.AsNoul().Probability, probTolerance);+ break;+ }+ Assert.Equal(entry.Value.GetProperty("confidence").GetDouble(), got.Confidence, probTolerance);+ }+ }++ [Fact]+ public void EightThreadsAlternatingCheckpointsWithMaxLoaded1StayConsistent()+ {+ RequireEnglishAndMultilingual();++ using var englishDoc = GoldenData.For(LayaCheckpoint.English).Load("case_sample_app_english.json");+ using var hindiDoc = GoldenData.For(LayaCheckpoint.Multilingual).Load("case_sample_app_hindi.json");+ var englishState = GoldenData.ToClr(englishDoc.RootElement.GetProperty("state"));+ var englishQuestions = GoldenData.BuildQuestions(englishDoc.RootElement.GetProperty("questions"));+ var hindiState = GoldenData.ToClr(hindiDoc.RootElement.GetProperty("state"));+ var hindiQuestions = GoldenData.BuildQuestions(hindiDoc.RootElement.GetProperty("questions"));++ // Ground truth comes from the golden files (already verified bit-for-bit by+ // PredictParityTests), not a second live inference pass: an extra router here would+ // transiently double the resident engine count, and the recorded answer is exactly what+ // a correct single-threaded call would produce anyway.+ var wantEnglish = englishDoc.RootElement.GetProperty("result").GetProperty("answers")+ .GetProperty("department").GetProperty("choice").GetString();+ var wantHindi = hindiDoc.RootElement.GetProperty("result").GetProperty("answers")+ .GetProperty("department").GetProperty("choice").GetString();++ // MaxLoaded=1 forces the router to evict and reload the other checkpoint on every+ // alternation, so at most one engine (plus a transient second one mid-handoff) is+ // resident at a time.+ using var router = NewRouter();+ var results = new (string Department, LayaCheckpoint Model)[8];+ var errors = new System.Collections.Concurrent.ConcurrentBag<Exception>();++ Parallel.For(0, results.Length, i =>+ {+ try+ {+ var isEnglish = i % 2 == 0;+ var result = router.Predict(+ isEnglish ? englishState : hindiState,+ isEnglish ? englishQuestions : hindiQuestions);+ results[i] = (result["department"].AsChoice().Choice, result.Routing!.Model);+ }+ catch (Exception ex)+ {+ errors.Add(ex);+ }+ });++ Assert.Empty(errors); // no use of a disposed engine, no other failure under eviction pressure+ for (var i = 0; i < results.Length; i++)+ {+ var isEnglish = i % 2 == 0;+ Assert.Equal(isEnglish ? LayaCheckpoint.English : LayaCheckpoint.Multilingual, results[i].Model);+ Assert.Equal(isEnglish ? wantEnglish : wantHindi, results[i].Department);+ }+ }+}diff --git a/laya-dotnet/tests/Laya.Tests/RoutingGoldenData.cs b/laya-dotnet/tests/Laya.Tests/RoutingGoldenData.csnew file mode 100644index 00000000..0349017f--- /dev/null+++ b/laya-dotnet/tests/Laya.Tests/RoutingGoldenData.cs@@ -0,0 +1,54 @@+using System.Text.Json;++namespace Laya.Tests;++/// <summary>+/// Access to the checkpoint-independent routing/language/email/shortlist parity vectors in+/// <c>golden/routing/</c>, recorded by <c>laya-dotnet/tools/dump_routing_golden.py</c> running the real+/// Python <c>laya.lang</c>/<c>laya.router</c>/<c>laya.email</c>/<c>laya.shortlist</c> modules —+/// no ONNX weights are needed for any of these files.+/// </summary>+/// <remarks>+/// Read from the source tree rather than copied to the output directory, same rationale as+/// <see cref="CheckpointGoldenData"/>: they are the reference, and a stale copy beside the test+/// binary would let a real divergence pass.+/// </remarks>+public static class RoutingGoldenData+{+ private static readonly Lazy<string?> DirectoryLazy = new(Locate);+ private static readonly Lazy<JsonDocument> MetaDoc = new(() => Load("meta.json"));++ /// <summary>Whether the routing golden directory was found.</summary>+ public static bool Available => DirectoryOrNull is not null;++ /// <summary>The routing golden directory, or <see langword="null"/> if none was found.</summary>+ public static string? DirectoryOrNull => DirectoryLazy.Value;++ /// <summary>+ /// The routing golden directory. Throws <see cref="DirectoryNotFoundException"/> if not found.+ /// </summary>+ public static string Directory => DirectoryOrNull+ ?? throw new DirectoryNotFoundException(+ $"no golden/routing data found above {AppContext.BaseDirectory}. "+ + "Run `python laya-dotnet/tools/dump_routing_golden.py` to generate it.");++ /// <summary>The recording environment: generator, laya version, and file counts.</summary>+ public static JsonElement Meta => MetaDoc.Value.RootElement;++ /// <summary>Parse one file under <c>golden/routing/</c>. The caller owns the returned document.</summary>+ public static JsonDocument Load(string fileName) =>+ JsonDocument.Parse(File.ReadAllBytes(Path.Combine(Directory, fileName)));++ /// <summary>A golden JSON value as the CLR object Python held when it recorded the case.</summary>+ public static object? ToClr(JsonElement element) => GoldenData.ToClr(element);++ private static string? Locate()+ {+ for (var dir = new DirectoryInfo(AppContext.BaseDirectory); dir is not null; dir = dir.Parent)+ {+ var candidate = Path.Combine(dir.FullName, "golden", "routing");+ if (File.Exists(Path.Combine(candidate, "meta.json"))) return candidate;+ }+ return null;+ }+}diff --git a/laya-dotnet/tests/Laya.Tests/golden/routing/email_probe.json b/laya-dotnet/tests/Laya.Tests/golden/routing/email_probe.jsonnew file mode 100644index 00000000..e2c1f27a--- /dev/null+++ b/laya-dotnet/tests/Laya.Tests/golden/routing/email_probe.json@@ -0,0 +1,395 @@+{+ "clean": [+ {+ "label": "inline_footer_no_blank_line",+ "body": "My account is locked.\nThis email is confidential and intended solely for the named addressee.\nPlease unlock it.",+ "max_chars": 3000,+ "result": "My account is locked. Please unlock it."+ },+ {+ "label": "inline_footer_no_terminal_punctuation",+ "body": "My account is locked\nThis email is confidential and intended solely for the named addressee.\nPlease unlock it.",+ "max_chars": 3000,+ "result": "Please unlock it."+ },+ {+ "label": "inline_footer_body_never_emptied",+ "body": "My account is locked. This email is confidential and intended solely for the named addressee.",+ "max_chars": 3000,+ "result": "My account is locked."+ },+ {+ "label": "standalone_footer_paragraph_dropped",+ "body": "My account is locked.\n\nThis email is confidential and intended solely for the named addressee.",+ "max_chars": 3000,+ "result": "My account is locked."+ },+ {+ "label": "wrapped_standalone_footer_dropped",+ "body": "My account is locked.\n\nThis email and any files transmitted with it are\nconfidential and intended solely for the named addressee.",+ "max_chars": 3000,+ "result": "My account is locked."+ },+ {+ "label": "received_in_error_footer_dropped",+ "body": "Please reopen ticket 4411.\n\nIf you have received this message in error, delete it.",+ "max_chars": 3000,+ "result": "Please reopen ticket 4411."+ },+ {+ "label": "quoted_history_removed",+ "body": "Thanks for the update.\nOn Mon, Sep 20, Bob wrote:\n> original text",+ "max_chars": 3000,+ "result": "Thanks for the update."+ },+ {+ "label": "signature_block_removed",+ "body": "Hi team,\nCan you confirm the refund?\nRegards,\nAlice",+ "max_chars": 3000,+ "result": "Hi team,\nCan you confirm the refund?"+ },+ {+ "label": "empty_body",+ "body": "",+ "max_chars": 3000,+ "result": ""+ },+ {+ "label": "quote_header_on_wrote_long_name",+ "body": "Please see below.\nOn Mon, Jan 5, 2026 at 3:00 PM, Bob Smith <[email protected]> wrote:\n> old text here",+ "max_chars": 3000,+ "result": "Please see below."+ },+ {+ "label": "quote_header_original_message",+ "body": "Approved.\n----- Original Message -----\nFrom: [email protected]\nSubject: Re: Invoice",+ "max_chars": 3000,+ "result": "Approved."+ },+ {+ "label": "quote_header_forwarded_message",+ "body": "See below for context.\n---------- Forwarded Message ----------\nFrom: [email protected]",+ "max_chars": 3000,+ "result": "See below for context."+ },+ {+ "label": "quote_header_underscores",+ "body": "My reply is above.\n________________________________\nFrom: [email protected]",+ "max_chars": 3000,+ "result": "My reply is above."+ },+ {+ "label": "quote_header_from_line",+ "body": "Confirmed, thanks.\nFrom: [email protected]\nSubject: Ticket 4411 update\nDate: today",+ "max_chars": 3000,+ "result": "Confirmed, thanks."+ },+ {+ "label": "quote_header_only_no_body_before_kept",+ "body": "On Mon, Jan 5, 2026, Bob wrote:\n> quoted only, no lines before it to break on",+ "max_chars": 3000,+ "result": "On Mon, Jan 5, 2026, Bob wrote:"+ },+ {+ "label": "quote_marker_gt_lines_stripped",+ "body": "My reply.\n> quoted line one\n> quoted line two\nMore of my reply.",+ "max_chars": 3000,+ "result": "My reply.\nMore of my reply."+ },+ {+ "label": "signature_dash_dash",+ "body": "Hi,\nPlease confirm.\n--\nAlice Smith\nSupport Team",+ "max_chars": 3000,+ "result": "Hi,\nPlease confirm."+ },+ {+ "label": "signature_best_regards",+ "body": "Hi,\nCan you confirm the refund?\nBest regards,\nAlice",+ "max_chars": 3000,+ "result": "Hi,\nCan you confirm the refund?"+ },+ {+ "label": "signature_kind_regards",+ "body": "Hi,\nCan you confirm the refund?\nKind regards,\nBob",+ "max_chars": 3000,+ "result": "Hi,\nCan you confirm the refund?"+ },+ {+ "label": "signature_warm_regards",+ "body": "Hi,\nCan you confirm the refund?\nWarm regards,\nCarol",+ "max_chars": 3000,+ "result": "Hi,\nCan you confirm the refund?"+ },+ {+ "label": "signature_many_thanks",+ "body": "Hi,\nCan you confirm the refund?\nMany thanks,\nDave",+ "max_chars": 3000,+ "result": "Hi,\nCan you confirm the refund?"+ },+ {+ "label": "signature_thanks",+ "body": "Hi,\nCan you confirm the refund?\nThanks,\nEve",+ "max_chars": 3000,+ "result": "Hi,\nCan you confirm the refund?"+ },+ {+ "label": "signature_thank_you",+ "body": "Hi,\nCan you confirm the refund?\nThank you,\nFrank",+ "max_chars": 3000,+ "result": "Hi,\nCan you confirm the refund?"+ },+ {+ "label": "signature_cheers",+ "body": "Hi,\nCan you confirm the refund?\nCheers,\nGrace",+ "max_chars": 3000,+ "result": "Hi,\nCan you confirm the refund?"+ },+ {+ "label": "signature_sincerely",+ "body": "Hi,\nCan you confirm the refund?\nSincerely,\nHeidi",+ "max_chars": 3000,+ "result": "Hi,\nCan you confirm the refund?"+ },+ {+ "label": "signature_sent_from_iphone",+ "body": "On the go, will follow up later.\nSent from my iPhone",+ "max_chars": 3000,+ "result": "On the go, will follow up later."+ },+ {+ "label": "signature_sent_from_android",+ "body": "Quick reply here.\nSent from my Android",+ "max_chars": 3000,+ "result": "Quick reply here."+ },+ {+ "label": "signature_too_early_kept_as_body",+ "body": "Thanks,\nfor looking into this.\nMy account is still locked after the reset.\nPlease escalate this to the on-call engineer today.\nRegards,\nIvan",+ "max_chars": 3000,+ "result": "Thanks,\nfor looking into this.\nMy account is still locked after the reset.\nPlease escalate this to the on-call engineer today."+ },+ {+ "label": "disclaimer_mid_paragraph_request_survives",+ "body": "My account is locked.\nThis email is confidential and intended solely for the named addressee.\nPlease unlock it.",+ "max_chars": 3000,+ "result": "My account is locked. Please unlock it."+ },+ {+ "label": "disclaimer_two_sentences_only_boilerplate_dropped",+ "body": "My account is locked. This email is confidential and intended solely for the named addressee. Please help urgently.",+ "max_chars": 3000,+ "result": "My account is locked. Please help urgently."+ },+ {+ "label": "disclaimer_across_two_paragraphs_only_its_own_paragraph_affected",+ "body": "Please reopen ticket 4411 as soon as you can.\n\nThis email and any attachments are confidential and intended solely for the addressee.\n\nIf you have received this message in error, please delete it.\n\nLet me know once it is done.",+ "max_chars": 3000,+ "result": "Please reopen ticket 4411 as soon as you can.\n\nLet me know once it is done."+ },+ {+ "label": "disclaimer_received_in_error_variant_2",+ "body": "Approve the refund please.\n\nIf you received this e-mail in error, notify the sender immediately.",+ "max_chars": 3000,+ "result": "Approve the refund please."+ },+ {+ "label": "crlf_line_endings",+ "body": "My account is locked.\r\nPlease unlock it.\r\nRegards,\r\nAlice",+ "max_chars": 3000,+ "result": "My account is locked.\nPlease unlock it."+ },+ {+ "label": "crlf_with_quote_header",+ "body": "Thanks for the update.\r\nOn Mon, Sep 20, Bob wrote:\r\n> original text",+ "max_chars": 3000,+ "result": "Thanks for the update."+ },+ {+ "label": "literal_backslash_n_becomes_newline",+ "body": "My account is locked.\\nPlease unlock it.\\nRegards,\\nAlice",+ "max_chars": 3000,+ "result": "My account is locked.\nPlease unlock it."+ },+ {+ "label": "literal_backslash_n_with_disclaimer",+ "body": "My account is locked.\\nThis email is confidential and intended solely for the named addressee.\\nPlease unlock it.",+ "max_chars": 3000,+ "result": "My account is locked. Please unlock it."+ },+ {+ "label": "mixed_real_and_literal_newlines",+ "body": "Line one.\nLine two.\\nLine three (literal escape).\nLine four.",+ "max_chars": 3000,+ "result": "Line one.\nLine two.\nLine three (literal escape).\nLine four."+ },+ {+ "label": "unicode_nbsp_not_collapsed",+ "body": "My account is locked.\nPlease unlock it.",+ "max_chars": 3000,+ "result": "My account is locked.\nPlease unlock it."+ },+ {+ "label": "unicode_em_space_and_ideographic_space",+ "body": "My account is locked.\nPlease unlock it.",+ "max_chars": 3000,+ "result": "My account is locked.\nPlease unlock it."+ },+ {+ "label": "unicode_whitespace_leading_trailing_stripped",+ "body": " My account is locked. \n Please unlock it. ",+ "max_chars": 3000,+ "result": "My account is locked.\n Please unlock it."+ },+ {+ "label": "unicode_zero_width_space_kept",+ "body": "Myaccount is locked.\nPleaseunlock it.",+ "max_chars": 3000,+ "result": "Myaccount is locked.\nPleaseunlock it."+ },+ {+ "label": "max_chars_tiny_cuts_mid_word",+ "body": "Please refund the duplicate charge on invoice 4411 today.",+ "max_chars": 10,+ "result": "Please ref"+ },+ {+ "label": "max_chars_default_no_truncation_needed",+ "body": "Short message that fits easily.",+ "max_chars": 3000,+ "result": "Short message that fits easily."+ },+ {+ "label": "max_chars_large_no_op",+ "body": "Please refund the duplicate charge on invoice 4411 today.",+ "max_chars": 100000,+ "result": "Please refund the duplicate charge on invoice 4411 today."+ },+ {+ "label": "max_chars_exact_boundary",+ "body": "01234567890123456789012345678901234567890123456789",+ "max_chars": 50,+ "result": "01234567890123456789012345678901234567890123456789"+ },+ {+ "label": "max_chars_one_over_boundary",+ "body": "01234567890123456789012345678901234567890123456789X",+ "max_chars": 50,+ "result": "01234567890123456789012345678901234567890123456789"+ },+ {+ "label": "kitchen_sink_quote_signature_disclaimer",+ "body": "Hi team,\n\nMy account was charged twice for the Pro plan this month and the refund has not arrived yet. Could you please look into this today?\n\nBest regards,\nPriya Sharma\nSent from my iPhone\n\nThis email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender.\n\nOn Tue, Sep 22, 2026 at 9:14 AM, Support <[email protected]> wrote:\n> Hi Priya, thanks for reaching out, we are looking into it.\n> - Support Team\n",+ "max_chars": 3000,+ "result": "Hi team,\n\nMy account was charged twice for the Pro plan this month and the refund has not arrived yet. Could you please look into this today?"+ }+ ],+ "state": [+ {+ "label": "basic_clean_true",+ "subject": "Locked out",+ "body": "My account is locked. This email is confidential and intended solely for the named addressee.",+ "sender": null,+ "clean": true,+ "extra": {},+ "result": {+ "subject": "Locked out",+ "body": "My account is locked."+ }+ },+ {+ "label": "basic_clean_false_keeps_raw_body",+ "subject": "Locked out",+ "body": "My account is locked.\nThis email is confidential and intended solely for the named addressee.",+ "sender": null,+ "clean": false,+ "extra": {},+ "result": {+ "subject": "Locked out",+ "body": "My account is locked.\nThis email is confidential and intended solely for the named addressee."+ }+ },+ {+ "label": "with_sender",+ "subject": "Refund request",+ "body": "Please refund invoice 4411.",+ "sender": "[email protected]",+ "clean": true,+ "extra": {},+ "result": {+ "subject": "Refund request",+ "body": "Please refund invoice 4411.",+ "from": "[email protected]"+ }+ },+ {+ "label": "subject_whitespace_stripped",+ "subject": " Refund request ",+ "body": "Please help.",+ "sender": null,+ "clean": true,+ "extra": {},+ "result": {+ "subject": "Refund request",+ "body": "Please help."+ }+ },+ {+ "label": "extra_fields_kept_when_not_none",+ "subject": "Ticket",+ "body": "Body text.",+ "sender": "[email protected]",+ "clean": true,+ "extra": {+ "priority": "high",+ "ticket_id": 4411+ },+ "result": {+ "subject": "Ticket",+ "body": "Body text.",+ "from": "[email protected]",+ "priority": "high",+ "ticket_id": 4411+ }+ },+ {+ "label": "extra_none_values_dropped",+ "subject": "Ticket",+ "body": "Body text.",+ "sender": null,+ "clean": true,+ "extra": {+ "nullable": null,+ "kept": "value"+ },+ "result": {+ "subject": "Ticket",+ "body": "Body text.",+ "kept": "value"+ }+ },+ {+ "label": "empty_subject_and_body",+ "subject": "",+ "body": "",+ "sender": null,+ "clean": true,+ "extra": {},+ "result": {+ "subject": "",+ "body": ""+ }+ },+ {+ "label": "hindi_subject_and_body",+ "subject": "सहायता चाहिए",+ "body": "मुझसे दो बार शुल्क लिया गया, कृपया रिफंड करें।",+ "sender": null,+ "clean": true,+ "extra": {},+ "result": {+ "subject": "सहायता चाहिए",+ "body": "मुझसे दो बार शुल्क लिया गया, कृपया रिफंड करें।"+ }+ }+ ]+}diff --git a/laya-dotnet/tests/Laya.Tests/golden/routing/hashing_embedder_probe.json b/laya-dotnet/tests/Laya.Tests/golden/routing/hashing_embedder_probe.jsonnew file mode 100644index 00000000..4f1525d2--- /dev/null+++ b/laya-dotnet/tests/Laya.Tests/golden/routing/hashing_embedder_probe.json@@ -0,0 +1,1520 @@+[+ {+ "text": "",+ "vector": [+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ -2.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0,+ 0.0+ ]+ },+ {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 @@+[+ {+ "label": "script/english",+ "state": "The customer was charged twice and wants a refund.",+ "state_text": "The customer was charged twice and wants a refund.",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 3,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "script/armenian",+ "state": "Հայերեն",+ "state_text": "Հայերեն",+ "detect_script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/armenian_uppercase",+ "state": "ՀԱՅԵՐԵՆ",+ "state_text": "ՀԱՅԵՐԵՆ",+ "detect_script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/armenian_punctuation_only",+ "state": "։֊",+ "state_text": "։֊",+ "detect_script": "unknown",+ "script_profile": {},+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "script/french",+ "state": "Le client a été facturé deux fois et demande un remboursement.",+ "state_text": "Le client a été facturé deux fois et demande un remboursement.",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "fr",+ "english_hits": 0,+ "diacritic_rate": 0.04838709677419355,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "fr",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0484,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "script/hindi",+ "state": "ग्राहक से दो बार शुल्क लिया गया और वह धनवापसी चाहता है।",+ "state_text": "ग्राहक से दो बार शुल्क लिया गया और वह धनवापसी चाहता है।",+ "detect_script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/japanese",+ "state": "お客様は二重に請求されたため返金を希望しています。",+ "state_text": "お客様は二重に請求されたため返金を希望しています。",+ "detect_script": "kana",+ "script_profile": {+ "kana": 0.5833333333333334,+ "han": 0.4166666666666667+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "kana",+ "script_profile": {+ "kana": 0.5833333333333334,+ "han": 0.4166666666666667+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/chinese",+ "state": "客户被重复扣款要求退款",+ "state_text": "客户被重复扣款要求退款",+ "detect_script": "han",+ "script_profile": {+ "han": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "han",+ "script_profile": {+ "han": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/korean",+ "state": "고객이 두 번 청구되어 환불을 원합니다",+ "state_text": "고객이 두 번 청구되어 환불을 원합니다",+ "detect_script": "hangul",+ "script_profile": {+ "hangul": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "hangul",+ "script_profile": {+ "hangul": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/arabic",+ "state": "تم خصم المبلغ مرتين من العميل ويريد استرداد الأموال",+ "state_text": "تم خصم المبلغ مرتين من العميل ويريد استرداد الأموال",+ "detect_script": "arabic",+ "script_profile": {+ "arabic": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "arabic",+ "script_profile": {+ "arabic": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/tamil",+ "state": "வாடிக்கையாளரிடம் இருமுறை கட்டணம் வசூலிக்கப்பட்டது",+ "state_text": "வாடிக்கையாளரிடம் இருமுறை கட்டணம் வசூலிக்கப்பட்டது",+ "detect_script": "tamil",+ "script_profile": {+ "tamil": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "tamil",+ "script_profile": {+ "tamil": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/russian",+ "state": "С клиента дважды сняли деньги и он хочет возврат",+ "state_text": "С клиента дважды сняли деньги и он хочет возврат",+ "detect_script": "cyrillic",+ "script_profile": {+ "cyrillic": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "cyrillic",+ "script_profile": {+ "cyrillic": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/thai",+ "state": "ลูกค้าถูกเรียกเก็บเงินสองครั้งและต้องการเงินคืน",+ "state_text": "ลูกค้าถูกเรียกเก็บเงินสองครั้งและต้องการเงินคืน",+ "detect_script": "thai",+ "script_profile": {+ "thai": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "thai",+ "script_profile": {+ "thai": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/greek",+ "state": "Ο πελάτης χρεώθηκε δύο φορές και θέλει επιστροφή χρημάτων",+ "state_text": "Ο πελάτης χρεώθηκε δύο φορές και θέλει επιστροφή χρημάτων",+ "detect_script": "greek",+ "script_profile": {+ "greek": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "greek",+ "script_profile": {+ "greek": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/hebrew",+ "state": "הלקוח חויב פעמיים ורוצה החזר כספי",+ "state_text": "הלקוח חויב פעמיים ורוצה החזר כספי",+ "detect_script": "hebrew",+ "script_profile": {+ "hebrew": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "hebrew",+ "script_profile": {+ "hebrew": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "script/empty",+ "state": "",+ "state_text": "",+ "detect_script": "unknown",+ "script_profile": {},+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "script/digits_only",+ "state": "12345 6789",+ "state_text": "12345 6789",+ "detect_script": "unknown",+ "script_profile": {},+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/plain_english",+ "state": "Please refund the duplicate charge on invoice 4411 today.",+ "state_text": "Please refund the duplicate charge on invoice 4411 today.",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 3,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/armenian",+ "state": "Հայերեն",+ "state_text": "Հայերեն",+ "detect_script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "is_english/english_short",+ "state": "refund me",+ "state_text": "refund me",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/hindi",+ "state": "ग्राहक से दो बार शुल्क लिया गया",+ "state_text": "ग्राहक से दो बार शुल्क लिया गया",+ "detect_script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "is_english/japanese",+ "state": "お客様は二重に請求されました",+ "state_text": "お客様は二重に請求されました",+ "detect_script": "kana",+ "script_profile": {+ "kana": 0.5714285714285714,+ "han": 0.42857142857142855+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "kana",+ "script_profile": {+ "kana": 0.5714285714285714,+ "han": 0.42857142857142855+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "is_english/russian",+ "state": "С клиента дважды сняли деньги",+ "state_text": "С клиента дважды сняли деньги",+ "detect_script": "cyrillic",+ "script_profile": {+ "cyrillic": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "cyrillic",+ "script_profile": {+ "cyrillic": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "is_english/french_long",+ "state": "Le client a été facturé deux fois et il demande un remboursement pour la facture qui a été payée le mois dernier avec la carte de crédit",+ "state_text": "Le client a été facturé deux fois et il demande un remboursement pour la facture qui a été payée le mois dernier avec la carte de crédit",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "fr",+ "english_hits": 0,+ "diacritic_rate": 0.051470588235294115,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "fr",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0515,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/german_long",+ "state": "Der Kunde wurde zweimal belastet und möchte eine Rückerstattung für die Rechnung die nicht korrekt ist und auch nicht bezahlt wurde",+ "state_text": "Der Kunde wurde zweimal belastet und möchte eine Rückerstattung für die Rechnung die nicht korrekt ist und auch nicht bezahlt wurde",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "de",+ "english_hits": 0,+ "diacritic_rate": 0.022900763358778626,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "de",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0229,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/romanian",+ "state": "Gătește-mi o rețetă de sarmale de post pentru mâine.",+ "state_text": "Gătește-mi o rețetă de sarmale de post pentru mâine.",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "ro",+ "english_hits": 0,+ "diacritic_rate": 0.09615384615384616,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "ro",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0962,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/romanian_invoice",+ "state": "Am fost taxat de două ori pentru factura din luna martie și vreau banii",+ "state_text": "Am fost taxat de două ori pentru factura din luna martie și vreau banii",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "ro",+ "english_hits": 0,+ "diacritic_rate": 0.028169014084507043,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "ro",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0282,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/polish",+ "state": "Klient został obciążony dwukrotnie i chce zwrot pieniędzy za fakturę",+ "state_text": "Klient został obciążony dwukrotnie i chce zwrot pieniędzy za fakturę",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 1,+ "diacritic_rate": 0.07352941176470588,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0735,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/czech",+ "state": "Zákazníkovi byla částka účtována dvakrát a žádá o vrácení peněz",+ "state_text": "Zákazníkovi byla částka účtována dvakrát a žádá o vrácení peněz",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.2222222222222222,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.2222,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/turkish",+ "state": "Müşteriden iki kez ücret alındı ve para iadesi istiyor lütfen yardım",+ "state_text": "Müşteriden iki kez ücret alındı ve para iadesi istiyor lütfen yardım",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.10294117647058823,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.1029,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/vietnamese",+ "state": "Khách hàng đã bị thu phí hai lần và muốn được hoàn tiền ngay",+ "state_text": "Khách hàng đã bị thu phí hai lần và muốn được hoàn tiền ngay",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.13333333333333333,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.1333,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/english_with_loanwords",+ "state": "We visited a cafe in Zurich and the naive assumption about the invoice was wrong, so please refund the duplicate charge",+ "state_text": "We visited a cafe in Zurich and the naive assumption about the invoice was wrong, so please refund the duplicate charge",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 8,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/undecided_turkish",+ "state": "Müşteriden iki kez ücret alındı ve para iadesi istiyor",+ "state_text": "Müşteriden iki kez ücret alındı ve para iadesi istiyor",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.09259259259259259,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0926,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/english_not_undecided",+ "state": "Please refund the duplicate charge on the invoice",+ "state_text": "Please refund the duplicate charge on the invoice",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 4,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/romanian_diacritics",+ "state": "Gătește-mi o rețetă de sarmale",+ "state_text": "Gătește-mi o rețetă de sarmale",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.13333333333333333,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.1333,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/no_diacritics",+ "state": "Please refund the duplicate charge today",+ "state_text": "Please refund the duplicate charge today",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 2,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/zero_tie_romanian",+ "state": "Cât e ora acum la Tokyo",+ "state_text": "Cât e ora acum la Tokyo",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.043478260869565216,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0435,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "is_english/known_gap_romanian_no_diacritics",+ "state": "Care este ora in Tokyo?",+ "state_text": "Care este ora in Tokyo?",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 1,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "latin_lang/english",+ "state": "The customer was charged twice and wants a refund for this invoice",+ "state_text": "The customer was charged twice and wants a refund for this invoice",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 5,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "latin_lang/french",+ "state": "Le client a ete facture deux fois et il demande un remboursement pour la facture",+ "state_text": "Le client a ete facture deux fois et il demande un remboursement pour la facture",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "fr",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "fr",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "latin_lang/german",+ "state": "Der Kunde wurde zweimal belastet und moechte eine Rueckerstattung fuer die Rechnung",+ "state_text": "Der Kunde wurde zweimal belastet und moechte eine Rueckerstattung fuer die Rechnung",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "de",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "de",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "latin_lang/spanish",+ "state": "El cliente fue cobrado dos veces y quiere que le devuelvan el dinero por la factura",+ "state_text": "El cliente fue cobrado dos veces y quiere que le devuelvan el dinero por la factura",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "es",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "latin_lang/too_short",+ "state": "refund",+ "state_text": "refund",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "latin_lang/long_english_stays_en",+ "state": "Please refund the duplicate charge on invoice 4411 today because we have been waiting for three days and nobody has replied to us",+ "state_text": "Please refund the duplicate charge on invoice 4411 today because we have been waiting for three days and nobody has replied to us",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 9,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "state_text/dict",+ "state": {+ "body": "charged twice",+ "n": 3+ },+ "state_text": "charged twice",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "state_text/nested",+ "state": {+ "a": {+ "b": [+ "deep"+ ]+ }+ },+ "state_text": "deep",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "state_text/list",+ "state": [+ "x",+ {+ "y": "z"+ }+ ],+ "state_text": "x z",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "state_text/none",+ "state": null,+ "state_text": "",+ "detect_script": "unknown",+ "script_profile": {},+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "state_text/keys_ignored",+ "state": {+ "subject": "नमस्ते",+ "body": "ग्राहक से दो बार शुल्क लिया गया"+ },+ "state_text": "नमस्ते ग्राहक से दो बार शुल्क लिया गया",+ "detect_script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "profile/armenian_pure",+ "state": "Հայերեն",+ "state_text": "Հայերեն",+ "detect_script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "profile/armenian_mixed_with_latin",+ "state": "Հայերեն abc",+ "state_text": "Հայերեն abc",+ "detect_script": "armenian",+ "script_profile": {+ "latin": 0.3,+ "armenian": 0.7+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "armenian",+ "script_profile": {+ "latin": 0.3,+ "armenian": 0.7+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.7+ }+ },+ {+ "label": "plain_ascii/es_1",+ "state": "El pedido llego roto y nadie responde cuando escribo al soporte",+ "state_text": "El pedido llego roto y nadie responde cuando escribo al soporte",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "es",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "plain_ascii/es_2",+ "state": "Quiero cancelar mi plan y pedir un reembolso",+ "state_text": "Quiero cancelar mi plan y pedir un reembolso",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "es",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "plain_ascii/es_3",+ "state": "La factura tiene un error en el importe total",+ "state_text": "La factura tiene un error en el importe total",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "es",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "plain_ascii/es_4",+ "state": "Necesito que me devuelvan el dinero de la compra duplicada",+ "state_text": "Necesito que me devuelvan el dinero de la compra duplicada",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "es",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "plain_ascii/it_1",+ "state": "Il cliente e stato addebitato due volte e vuole un rimborso",+ "state_text": "Il cliente e stato addebitato due volte e vuole un rimborso",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "it",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "it",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "plain_ascii/it_2",+ "state": "Voglio cancellare il mio abbonamento e chiedere un rimborso",+ "state_text": "Voglio cancellare il mio abbonamento e chiedere un rimborso",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "it",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "it",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "plain_ascii/it_3",+ "state": "La fattura contiene un errore nell importo totale",+ "state_text": "La fattura contiene un errore nell importo totale",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "it",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "it",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "plain_ascii/pt_1",+ "state": "O cliente foi cobrado duas vezes e quer o dinheiro de volta",+ "state_text": "O cliente foi cobrado duas vezes e quer o dinheiro de volta",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "pt",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "pt",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "plain_ascii/fr_1",+ "state": "Le client a ete facture deux fois et demande un remboursement",+ "state_text": "Le client a ete facture deux fois et demande un remboursement",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "fr",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "fr",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "plain_ascii/fr_2",+ "state": "Je ne peux pas acceder a mon compte et j ai besoin d aide",+ "state_text": "Je ne peux pas acceder a mon compte et j ai besoin d aide",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "fr",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "fr",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "accented/es",+ "state": "La facturación tiene un error y necesito una corrección urgente",+ "state_text": "La facturación tiene un error y necesito una corrección urgente",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "es",+ "english_hits": 0,+ "diacritic_rate": 0.031746031746031744,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0317,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "accented/it",+ "state": "La fattura è sbagliata, devo avere un rimborso per il pagamento",+ "state_text": "La fattura è sbagliata, devo avere un rimborso per il pagamento",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "it",+ "english_hits": 0,+ "diacritic_rate": 0.015873015873015872,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "it",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0159,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "accented/fr",+ "state": "La commande est arrivée cassée et personne ne répond au support",+ "state_text": "La commande est arrivée cassée et personne ne répond au support",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "fr",+ "english_hits": 0,+ "diacritic_rate": 0.047619047619047616,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "fr",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0476,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "romance_control/1",+ "state": "The customer was charged twice and wants a refund for this invoice",+ "state_text": "The customer was charged twice and wants a refund for this invoice",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 5,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "romance_control/2",+ "state": "Please cancel my subscription and refund the duplicate charge today",+ "state_text": "Please cancel my subscription and refund the duplicate charge today",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 3,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "romance_control/3",+ "state": "The report by Smith et al. shows the de facto standard, e.g. the LA office and Rio",+ "state_text": "The report by Smith et al. shows the de facto standard, e.g. the LA office and Rio",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 4,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "romance_control/4",+ "state": "Our MI5 and UN contacts discussed the DOS attack in LA last month",+ "state_text": "Our MI5 and UN contacts discussed the DOS attack in LA last month",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 3,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "romance_control/5",+ "state": "No refund was issued, so I am writing to you again about invoice 4411",+ "state_text": "No refund was issued, so I am writing to you again about invoice 4411",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 4,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "romance_control/6",+ "state": "no refund no reply",+ "state_text": "no refund no reply",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "romance_control/7",+ "state": "The son of the director filed a complaint about the duplicate invoice",+ "state_text": "The son of the director filed a complaint about the duplicate invoice",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 4,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "shared_words/names_nothing",+ "state": "Cât e ora acum la Tokyo",+ "state_text": "Cât e ora acum la Tokyo",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.043478260869565216,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0435,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "shared_words/distinctive_names_it",+ "state": "La fattura contiene un errore nell importo totale",+ "state_text": "La fattura contiene un errore nell importo totale",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "it",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "it",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "shared_words/shared_hits_still_count_es",+ "state": "La factura tiene un error en el importe total",+ "state_text": "La factura tiene un error en el importe total",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "es",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "all_scripts/greek",+ "state": "Γεια σου κόσμε, πώς είσαι σήμερα;",+ "state_text": "Γεια σου κόσμε, πώς είσαι σήμερα;",+ "detect_script": "greek",+ "script_profile": {+ "greek": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "greek",+ "script_profile": {+ "greek": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/cyrillic",+ "state": "Привет, как ты себя чувствуешь сегодня?",+ "state_text": "Привет, как ты себя чувствуешь сегодня?",+ "detect_script": "cyrillic",+ "script_profile": {+ "cyrillic": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "cyrillic",+ "script_profile": {+ "cyrillic": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/armenian",+ "state": "Բարեւ ձեզ, ինչպե՞ս եք այսօր",+ "state_text": "Բարեւ ձեզ, ինչպե՞ս եք այսօր",+ "detect_script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/hebrew",+ "state": "שלום, מה שלומך היום",+ "state_text": "שלום, מה שלומך היום",+ "detect_script": "hebrew",+ "script_profile": {+ "hebrew": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "hebrew",+ "script_profile": {+ "hebrew": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/arabic",+ "state": "مرحبا كيف حالك اليوم",+ "state_text": "مرحبا كيف حالك اليوم",+ "detect_script": "arabic",+ "script_profile": {+ "arabic": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "arabic",+ "script_profile": {+ "arabic": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/devanagari",+ "state": "नमस्ते आप कैसे हैं आज",+ "state_text": "नमस्ते आप कैसे हैं आज",+ "detect_script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/bengali",+ "state": "আমি ভালো আছি, আপনি কেমন আছেন",+ "state_text": "আমি ভালো আছি, আপনি কেমন আছেন",+ "detect_script": "bengali",+ "script_profile": {+ "bengali": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "bengali",+ "script_profile": {+ "bengali": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/gurmukhi",+ "state": "ਤੁਸੀਂ ਕਿਵੇਂ ਹੋ, ਮੈਂ ਠੀਕ ਹਾਂ",+ "state_text": "ਤੁਸੀਂ ਕਿਵੇਂ ਹੋ, ਮੈਂ ਠੀਕ ਹਾਂ",+ "detect_script": "gurmukhi",+ "script_profile": {+ "gurmukhi": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "gurmukhi",+ "script_profile": {+ "gurmukhi": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/gujarati",+ "state": "તમે કેમ છો, હું સારો છું",+ "state_text": "તમે કેમ છો, હું સારો છું",+ "detect_script": "gujarati",+ "script_profile": {+ "gujarati": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "gujarati",+ "script_profile": {+ "gujarati": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/oriya",+ "state": "ତୁମେ କେମିତି ଅଛ, ମୁଁ ଭଲ ଅଛି",+ "state_text": "ତୁମେ କେମିତି ଅଛ, ମୁଁ ଭଲ ଅଛି",+ "detect_script": "oriya",+ "script_profile": {+ "oriya": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "oriya",+ "script_profile": {+ "oriya": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/tamil",+ "state": "நீங்கள் எப்படி இருக்கிறீர்கள்",+ "state_text": "நீங்கள் எப்படி இருக்கிறீர்கள்",+ "detect_script": "tamil",+ "script_profile": {+ "tamil": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "tamil",+ "script_profile": {+ "tamil": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/telugu",+ "state": "మీరు ఎలా ఉన్నారు, నేను బాగున్నాను",+ "state_text": "మీరు ఎలా ఉన్నారు, నేను బాగున్నాను",+ "detect_script": "telugu",+ "script_profile": {+ "telugu": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "telugu",+ "script_profile": {+ "telugu": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/kannada",+ "state": "ನೀವು ಹೇಗಿದ್ದೀರಿ, ನಾನು ಚೆನ್ನಾಗಿದ್ದೇನೆ",+ "state_text": "ನೀವು ಹೇಗಿದ್ದೀರಿ, ನಾನು ಚೆನ್ನಾಗಿದ್ದೇನೆ",+ "detect_script": "kannada",+ "script_profile": {+ "kannada": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "kannada",+ "script_profile": {+ "kannada": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/malayalam",+ "state": "നിങ്ങൾക്ക് സുഖമാണോ, എനിക്ക് സുഖമാണ്",+ "state_text": "നിങ്ങൾക്ക് സുഖമാണോ, എനിക്ക് സുഖമാണ്",+ "detect_script": "malayalam",+ "script_profile": {+ "malayalam": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "malayalam",+ "script_profile": {+ "malayalam": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/sinhala",+ "state": "ඔබට කොහොමද, මට හොඳින්",+ "state_text": "ඔබට කොහොමද, මට හොඳින්",+ "detect_script": "sinhala",+ "script_profile": {+ "sinhala": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "sinhala",+ "script_profile": {+ "sinhala": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/thai",+ "state": "คุณเป็นอย่างไรบ้างวันนี้",+ "state_text": "คุณเป็นอย่างไรบ้างวันนี้",+ "detect_script": "thai",+ "script_profile": {+ "thai": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "thai",+ "script_profile": {+ "thai": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/lao",+ "state": "ສະບາຍດີ ທ່ານເປັນແນວໃດແດ່",+ "state_text": "ສະບາຍດີ ທ່ານເປັນແນວໃດແດ່",+ "detect_script": "lao",+ "script_profile": {+ "lao": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "lao",+ "script_profile": {+ "lao": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/tibetan",+ "state": "བཀྲ་ཤིས་བདེ་ལེགས་ཁྱེད་རང་ག་འདྲ་ཡོད",+ "state_text": "བཀྲ་ཤིས་བདེ་ལེགས་ཁྱེད་རང་ག་འདྲ་ཡོད",+ "detect_script": "tibetan",+ "script_profile": {+ "tibetan": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "tibetan",+ "script_profile": {+ "tibetan": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/myanmar",+ "state": "မင်္ဂလာပါ သင်နေကောင်းလား",+ "state_text": "မင်္ဂလာပါ သင်နေကောင်းလား",+ "detect_script": "myanmar",+ "script_profile": {+ "myanmar": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "myanmar",+ "script_profile": {+ "myanmar": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/georgian",+ "state": "გამარჯობა როგორ ხარ დღეს",+ "state_text": "გამარჯობა როგორ ხარ დღეს",+ "detect_script": "georgian",+ "script_profile": {+ "georgian": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "georgian",+ "script_profile": {+ "georgian": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/ethiopic",+ "state": "ሰላም እንዴት ነህ ዛሬ",+ "state_text": "ሰላም እንዴት ነህ ዛሬ",+ "detect_script": "ethiopic",+ "script_profile": {+ "ethiopic": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "ethiopic",+ "script_profile": {+ "ethiopic": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/khmer",+ "state": "សួស្តី តើអ្នកសុខសប្បាយទេ",+ "state_text": "សួស្តី តើអ្នកសុខសប្បាយទេ",+ "detect_script": "khmer",+ "script_profile": {+ "khmer": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "khmer",+ "script_profile": {+ "khmer": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/hangul",+ "state": "안녕하세요 오늘 기분이 어때요",+ "state_text": "안녕하세요 오늘 기분이 어때요",+ "detect_script": "hangul",+ "script_profile": {+ "hangul": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "hangul",+ "script_profile": {+ "hangul": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/kana",+ "state": "こんにちは、今日は元気ですか",+ "state_text": "こんにちは、今日は元気ですか",+ "detect_script": "kana",+ "script_profile": {+ "kana": 0.6923076923076923,+ "han": 0.3076923076923077+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "kana",+ "script_profile": {+ "kana": 0.6923076923076923,+ "han": 0.3076923076923077+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/han",+ "state": "你好,你今天过得怎么样",+ "state_text": "你好,你今天过得怎么样",+ "detect_script": "han",+ "script_profile": {+ "han": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "han",+ "script_profile": {+ "han": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "all_scripts/latin",+ "state": "Hello, how are you feeling today?",+ "state_text": "Hello, how are you feeling today?",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 2,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "tie/greek_then_cyrillic_1v1",+ "state": "ΑА",+ "state_text": "ΑА",+ "detect_script": "greek",+ "script_profile": {+ "greek": 0.5,+ "cyrillic": 0.5+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "greek",+ "script_profile": {+ "greek": 0.5,+ "cyrillic": 0.5+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "tie/cyrillic_then_greek_1v1",+ "state": "АΑ",+ "state_text": "АΑ",+ "detect_script": "cyrillic",+ "script_profile": {+ "cyrillic": 0.5,+ "greek": 0.5+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "cyrillic",+ "script_profile": {+ "cyrillic": 0.5,+ "greek": 0.5+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "tie/han_then_latin_1v1",+ "state": "中 a",+ "state_text": "中 a",+ "detect_script": "han",+ "script_profile": {+ "latin": 0.5,+ "han": 0.5+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "han",+ "script_profile": {+ "latin": 0.5,+ "han": 0.5+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.5+ }+ },+ {+ "label": "tie/latin_then_han_1v1",+ "state": "a 中",+ "state_text": "a 中",+ "detect_script": "han",+ "script_profile": {+ "latin": 0.5,+ "han": 0.5+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "han",+ "script_profile": {+ "latin": 0.5,+ "han": 0.5+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.5+ }+ },+ {+ "label": "tie/three_way_greek_cyrillic_armenian",+ "state": "ΑАԱ",+ "state_text": "ΑАԱ",+ "detect_script": "greek",+ "script_profile": {+ "greek": 0.3333333333333333,+ "cyrillic": 0.3333333333333333,+ "armenian": 0.3333333333333333+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "greek",+ "script_profile": {+ "greek": 0.3333333333333333,+ "cyrillic": 0.3333333333333333,+ "armenian": 0.3333333333333333+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "mixed/latin_han_arabic",+ "state": "invoice 中文 فاتورة refund",+ "state_text": "invoice 中文 فاتورة refund",+ "detect_script": "latin",+ "script_profile": {+ "latin": 0.6190476190476191,+ "han": 0.09523809523809523,+ "arabic": 0.2857142857142857+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 0.6190476190476191,+ "han": 0.09523809523809523,+ "arabic": 0.2857142857142857+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.381+ }+ },+ {+ "label": "mixed/devanagari_latin_majority_devanagari",+ "state": "ग्राहक से दो बार शुल्क लिया गया refund",+ "state_text": "ग्राहक से दो बार शुल्क लिया गया refund",+ "detect_script": "devanagari",+ "script_profile": {+ "latin": 0.2857142857142857,+ "devanagari": 0.7142857142857143+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "devanagari",+ "script_profile": {+ "latin": 0.2857142857142857,+ "devanagari": 0.7142857142857143+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.7143+ }+ },+ {+ "label": "mixed/latin_majority_devanagari_minor",+ "state": "Please refund the customer today ग्राहक",+ "state_text": "Please refund the customer today ग्राहक",+ "detect_script": "latin",+ "script_profile": {+ "latin": 0.875,+ "devanagari": 0.125+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 2,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 0.875,+ "devanagari": 0.125+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.125+ }+ },+ {+ "label": "latin_tie/fr_vs_de",+ "state": "être cette nicht sich",+ "state_text": "être cette nicht sich",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "fr",+ "english_hits": 0,+ "diacritic_rate": 0.047619047619047616,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "fr",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0476,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "latin_tie/de_vs_es",+ "state": "nicht sich el los",+ "state_text": "nicht sich el los",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "de",+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "de",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "latin_tie/es_vs_pt",+ "state": "está una dos tres o não está",+ "state_text": "está una dos tres o não está",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "es",+ "english_hits": 0,+ "diacritic_rate": 0.10714285714285714,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.1071,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "latin_tie/pt_vs_it",+ "state": "não está o della sono",+ "state_text": "não está o della sono",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "pt",+ "english_hits": 0,+ "diacritic_rate": 0.09523809523809523,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "pt",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0952,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "astral/emoji_only",+ "state": "😀🚀❤️",+ "state_text": "😀🚀❤️",+ "detect_script": "unknown",+ "script_profile": {},+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "astral/emoji_with_latin",+ "state": "refund please 😀 today",+ "state_text": "refund please 😀 today",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "astral/deseret_letter_alone",+ "state": "𐐀𐐁𐐂",+ "state_text": "𐐀𐐁𐐂",+ "detect_script": "unknown",+ "script_profile": {},+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "astral/deseret_mixed_with_latin",+ "state": "refund 𐐀 today",+ "state_text": "refund 𐐀 today",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "astral/mathematical_bold_letters",+ "state": "𝐀𝐁𝐂",+ "state_text": "𝐀𝐁𝐂",+ "detect_script": "unknown",+ "script_profile": {},+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "combining/devanagari_with_virama",+ "state": "ग्राहक",+ "state_text": "ग्राहक",+ "detect_script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "combining/latin_with_combining_acute",+ "state": "café résumé",+ "state_text": "café résumé",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "turkish_i/capital_i_with_dot",+ "state": "İstanbul",+ "state_text": "İstanbul",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "turkish_i/mixed_case",+ "state": "İYİ GÜNLER İstanbul'da",+ "state_text": "İYİ GÜNLER İstanbul'da",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.04,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.04,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "turkish_i/lowercase_dotless",+ "state": "ıstanbul",+ "state_text": "ıstanbul",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.125,+ "looks_non_english": true+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.125,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "numerics/ascii_digits_only",+ "state": "12345 67890",+ "state_text": "12345 67890",+ "detect_script": "unknown",+ "script_profile": {},+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "numerics/roman_numeral_nl",+ "state": "chapter Ⅷ begins",+ "state_text": "chapter Ⅷ begins",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "numerics/fullwidth_digits",+ "state": "123 refund",+ "state_text": "123 refund",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "numerics/mixed_digits_and_words",+ "state": "invoice 4411 was paid twice on 2024-01-05",+ "state_text": "invoice 4411 was paid twice on 2024-01-05",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 2,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "nesting/depth_6_kept",+ "state": {+ "a": {+ "b": {+ "c": {+ "d": {+ "e": {+ "f": "visible at depth 6"+ }+ }+ }+ }+ }+ },+ "state_text": "visible at depth 6",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "nesting/depth_7_dropped",+ "state": {+ "a": {+ "b": {+ "c": {+ "d": {+ "e": {+ "f": {+ "g": "invisible past depth 6"+ }+ }+ }+ }+ }+ }+ },+ "state_text": "",+ "detect_script": "unknown",+ "script_profile": {},+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "nesting/list_depth_7_dropped",+ "state": [+ [+ [+ [+ [+ [+ [+ "invisible list depth 7"+ ]+ ]+ ]+ ]+ ]+ ]+ ],+ "state_text": "",+ "detect_script": "unknown",+ "script_profile": {},+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "nesting/mixed_depth_boundary",+ "state": {+ "a": {+ "b": {+ "c": {+ "d": {+ "e": [+ "kept depth 6",+ {+ "f": "dropped depth 7"+ }+ ]+ }+ }+ }+ }+ },+ "state_text": "kept depth 6",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "long/ascii_over_4000",+ "state": "refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. ",+ "state_text": "refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund please. refund ple",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 266,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "long/multibyte_over_4000",+ "state": "退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 ",+ "state_text": "退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 退款请求 ",+ "detect_script": "han",+ "script_profile": {+ "han": 1.0+ },+ "latin_profile": {+ "language": null,+ "english_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "han",+ "script_profile": {+ "han": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate":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_hits": 0,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 0.9975,+ "han": 0.0025+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0025+ }+ },+ {+ "label": "long/english_over_1000",+ "state": "Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. ",+ "state_text": "Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. Please refund the duplicate charge on invoice 4411 today. ",+ "detect_script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "latin_profile": {+ "language": "en",+ "english_hits": 60,+ "diacritic_rate": 0.0,+ "looks_non_english": false+ },+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ }+]diff --git a/laya-dotnet/tests/Laya.Tests/golden/routing/meta.json b/laya-dotnet/tests/Laya.Tests/golden/routing/meta.jsonnew file mode 100644index 00000000..5cf9a90b--- /dev/null+++ b/laya-dotnet/tests/Laya.Tests/golden/routing/meta.json@@ -0,0 +1,17 @@+{+ "generator": "tools/dump_routing_golden.py",+ "laya_version": "0.3.6",+ "default_shortlist_k": 20,+ "notes": {+ "route_probe": "RouteDecision is serialized as {model, reason, detection, workflow}; 'repo' is intentionally omitted (not part of the ported RouteDecision).",+ "shortlist_probe": "Non-finite floats (NaN, +Inf, -Inf) inside a case's 'vectors' matrix are encoded as the JSON strings \"nan\", \"inf\", \"-inf\" because JSON has no native literal for them; a case with vectors=null is a k>=n passthrough case where embed_fn must never be called."+ },+ "counts": {+ "lang_probe": 134,+ "route_probe": 72,+ "email_probe_clean": 47,+ "email_probe_state": 8,+ "shortlist_probe": 22,+ "hashing_embedder_probe": 22+ }+}diff --git a/laya-dotnet/tests/Laya.Tests/golden/routing/route_probe.json b/laya-dotnet/tests/Laya.Tests/golden/routing/route_probe.jsonnew file mode 100644index 00000000..6d284165--- /dev/null+++ b/laya-dotnet/tests/Laya.Tests/golden/routing/route_probe.json@@ -0,0 +1,1947 @@+[+ {+ "label": "english_text",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "I was charged twice, please refund."+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "armenian_text",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "Հայերեն"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (armenian, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "armenian",+ "script_profile": {+ "armenian": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "armenian_explicit_override",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "Հայերեն"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ },+ "model": "english"+ },+ "decision": {+ "model": "english",+ "reason": "explicit model='english'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "hindi_text",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "मुझसे दो बार शुल्क लिया गया"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (devanagari, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "japanese_text",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "二重に請求されました"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (kana, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "kana",+ "script_profile": {+ "han": 0.4,+ "kana": 0.6+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "korean_text",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "두 번 청구되었습니다"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (hangul, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "hangul",+ "script_profile": {+ "hangul": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "arabic_text",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "تم خصم المبلغ مرتين"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (arabic, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "arabic",+ "script_profile": {+ "arabic": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "german_text",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "Der Kunde wurde zweimal belastet und moechte eine Rueckerstattung fuer die Rechnung die nicht korrekt ist"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'de', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "de",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "explicit_model",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "anything"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ },+ "model": "multilingual"+ },+ "decision": {+ "model": "multilingual",+ "reason": "explicit model='multilingual'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "explicit_model_overrides_script",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "मुझसे दो बार"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ },+ "model": "english"+ },+ "decision": {+ "model": "english",+ "reason": "explicit model='english'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "explicit_task",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "x"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ },+ "task": "typed_decisions"+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "explicit task='typed_decisions'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "explicit_lang_en",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "मुझसे दो बार"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ },+ "lang": "en"+ },+ "decision": {+ "model": "english",+ "reason": "explicit lang='en'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "explicit_lang_de",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "hello there"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ },+ "lang": "de"+ },+ "decision": {+ "model": "multilingual",+ "reason": "explicit lang='de'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "explicit_lang_eng_alias",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "hello"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ },+ "lang": "eng"+ },+ "decision": {+ "model": "english",+ "reason": "explicit lang='eng'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "explicit_lang_english_word",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "hello"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ },+ "lang": "English"+ },+ "decision": {+ "model": "english",+ "reason": "explicit lang='English'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "explicit_lang_en_us",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "hello"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ },+ "lang": "en-US"+ },+ "decision": {+ "model": "english",+ "reason": "explicit lang='en-US'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "explicit_lang_fr",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "hello"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ },+ "lang": "fr"+ },+ "decision": {+ "model": "multilingual",+ "reason": "explicit lang='fr'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "td_workflow_auto_off",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "I was charged twice"+ },+ "questions": {+ "action": {+ "type": "noul",+ "instructions": "x"+ },+ "category": {+ "type": "noul",+ "instructions": "x"+ },+ "churn_risk": {+ "type": "noul",+ "instructions": "x"+ },+ "needs_human": {+ "type": "noul",+ "instructions": "x"+ },+ "urgency": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": "customer_service"+ }+ },+ {+ "label": "empty_state",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {},+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "no letters detected in state; using default (english)",+ "detection": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "none_state",+ "router_kwargs": {},+ "route_kwargs": {+ "state": null,+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "no letters detected in state; using default (english)",+ "detection": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "no_questions_none",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "मुझसे दो बार"+ },+ "questions": null+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (devanagari, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "td_agent_trace_observability_auto_on",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "trace"+ },+ "questions": {+ "action": {+ "type": "noul",+ "instructions": "x"+ },+ "needs_review": {+ "type": "noul",+ "instructions": "x"+ },+ "outcome": {+ "type": "noul",+ "instructions": "x"+ },+ "risk": {+ "type": "noul",+ "instructions": "x"+ },+ "urgency": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "question ids match the 'agent_trace_observability' typed-decisions workflow",+ "detection": null,+ "workflow": "agent_trace_observability"+ }+ },+ {+ "label": "td_customer_service_auto_on",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "I was charged twice"+ },+ "questions": {+ "action": {+ "type": "noul",+ "instructions": "x"+ },+ "category": {+ "type": "noul",+ "instructions": "x"+ },+ "churn_risk": {+ "type": "noul",+ "instructions": "x"+ },+ "needs_human": {+ "type": "noul",+ "instructions": "x"+ },+ "urgency": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "question ids match the 'customer_service' typed-decisions workflow",+ "detection": null,+ "workflow": "customer_service"+ }+ },+ {+ "label": "td_invoice_processing_auto_on",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "invoice mismatch"+ },+ "questions": {+ "discrepancy_severity": {+ "type": "noul",+ "instructions": "x"+ },+ "disposition": {+ "type": "noul",+ "instructions": "x"+ },+ "duplicate": {+ "type": "noul",+ "instructions": "x"+ },+ "matches_order": {+ "type": "noul",+ "instructions": "x"+ },+ "urgency": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "question ids match the 'invoice_processing' typed-decisions workflow",+ "detection": null,+ "workflow": "invoice_processing"+ }+ },+ {+ "label": "td_security_incidents_auto_on",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "possible breach"+ },+ "questions": {+ "credential_compromise": {+ "type": "noul",+ "instructions": "x"+ },+ "disposition": {+ "type": "noul",+ "instructions": "x"+ },+ "severity": {+ "type": "noul",+ "instructions": "x"+ },+ "true_positive": {+ "type": "noul",+ "instructions": "x"+ },+ "urgency": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "question ids match the 'security_incidents' typed-decisions workflow",+ "detection": null,+ "workflow": "security_incidents"+ }+ },+ {+ "label": "td_auto_on_but_generic_questions",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "I was charged twice"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "td_explicit_beats_workflow",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "x"+ },+ "questions": {+ "action": {+ "type": "noul",+ "instructions": "x"+ },+ "category": {+ "type": "noul",+ "instructions": "x"+ },+ "churn_risk": {+ "type": "noul",+ "instructions": "x"+ },+ "needs_human": {+ "type": "noul",+ "instructions": "x"+ },+ "urgency": {+ "type": "noul",+ "instructions": "x"+ }+ },+ "model": "multilingual"+ },+ "decision": {+ "model": "multilingual",+ "reason": "explicit model='multilingual'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "td_near_miss_partial_overlap",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "x"+ },+ "questions": {+ "urgency": {+ "type": "noul",+ "instructions": "x"+ },+ "category": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "td_near_miss_superset",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "x"+ },+ "questions": {+ "action": {+ "type": "noul",+ "instructions": "x"+ },+ "category": {+ "type": "noul",+ "instructions": "x"+ },+ "churn_risk": {+ "type": "noul",+ "instructions": "x"+ },+ "needs_human": {+ "type": "noul",+ "instructions": "x"+ },+ "urgency": {+ "type": "noul",+ "instructions": "x"+ },+ "extra_field": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "td_near_miss_subset",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "x"+ },+ "questions": {+ "discrepancy_severity": {+ "type": "noul",+ "instructions": "x"+ },+ "disposition": {+ "type": "noul",+ "instructions": "x"+ },+ "duplicate": {+ "type": "noul",+ "instructions": "x"+ },+ "matches_order": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "td_near_miss_one_id_swapped",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "x"+ },+ "questions": {+ "credential_compromise": {+ "type": "noul",+ "instructions": "x"+ },+ "disposition": {+ "type": "noul",+ "instructions": "x"+ },+ "severity": {+ "type": "noul",+ "instructions": "x"+ },+ "true_positive": {+ "type": "noul",+ "instructions": "x"+ },+ "not_a_real_field": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "unknown_latin_romanian",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Gătește-mi o rețetă de sarmale de post pentru mâine."+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'ro', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "ro",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0962,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "unknown_latin_romanian_agent_request",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Exportă APK-ul pentru Android și pune-l pe Drive ca să-l instalez."+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'ro', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "ro",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0455,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "unknown_latin_polish",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Klient został obciążony dwukrotnie i chce zwrot pieniędzy za fakturę"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script, language not identified but 7% non-English letters; not safe for the English checkpoint",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0735,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "unknown_latin_turkish",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Müşteriden iki kez ücret alındı ve para iadesi istiyor lütfen yardım"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script, language not identified but 10% non-English letters; not safe for the English checkpoint",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.1029,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "unknown_latin_undecided_reason",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Müşteriden iki kez ücret alındı ve para iadesi istiyor"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script, language not identified but 9% non-English letters; not safe for the English checkpoint",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0926,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "english_still_english",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Please refund the duplicate charge on invoice 4411 today."+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "short_english_still_english",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "refund me"+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "plain_ascii_es_1",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "El pedido llego roto y nadie responde cuando escribo al soporte"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'es', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "plain_ascii_it_1",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Il cliente e stato addebitato due volte e vuole un rimborso"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'it', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "it",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "plain_ascii_pt_1",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "O cliente foi cobrado duas vezes e quer o dinheiro de volta"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'pt', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "pt",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "plain_ascii_fr_1",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Le client a ete facture deux fois et demande un remboursement"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'fr', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "fr",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "accented_es",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "La facturación tiene un error y necesito una corrección urgente"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'es', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0317,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "accented_it",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "La fattura è sbagliata, devo avere un rimborso per il pagamento"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'it', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "it",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0159,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "accented_fr",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "La commande est arrivée cassée et personne ne répond au support"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'fr', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "fr",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0476,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "romance_control_1",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "The customer was charged twice and wants a refund for this invoice"+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "romance_control_2",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Our MI5 and UN contacts discussed the DOS attack in LA last month"+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "shared_words_still_multilingual",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Cât e ora acum la Tokyo"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script, language not identified but 4% non-English letters; not safe for the English checkpoint",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0435,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "custom_default_multilingual",+ "router_kwargs": {+ "default": "multilingual"+ },+ "route_kwargs": {+ "state": "12345"+ },+ "decision": {+ "model": "multilingual",+ "reason": "no letters detected in state; using default (multilingual)",+ "detection": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "custom_default_typed_decisions",+ "router_kwargs": {+ "default": "typed-decisions"+ },+ "route_kwargs": {+ "state": ""+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "no letters detected in state; using default (typed-decisions)",+ "detection": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "custom_default_english_script_unknown",+ "router_kwargs": {+ "default": "english"+ },+ "route_kwargs": {+ "state": "12345 6789"+ },+ "decision": {+ "model": "english",+ "reason": "no letters detected in state; using default (english)",+ "detection": {+ "script": "unknown",+ "script_profile": {},+ "language": null,+ "is_english": true,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "bundle_default_hindi",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "m": "मुझसे दो बार"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (devanagari, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "standalone_opt_in_hindi",+ "router_kwargs": {+ "standalone_repos": true+ },+ "route_kwargs": {+ "state": {+ "m": "मुझसे दो बार"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (devanagari, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "standalone_english_unchanged",+ "router_kwargs": {+ "standalone_repos": true+ },+ "route_kwargs": {+ "state": {+ "m": "I was charged twice"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "local_path_override",+ "router_kwargs": {+ "models": {+ "english": "/tmp/en",+ "multilingual": "/tmp/ml"+ }+ },+ "route_kwargs": {+ "state": {+ "m": "मुझसे दो बार"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (devanagari, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "alias_en",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "en"+ },+ "decision": {+ "model": "english",+ "reason": "explicit model='en'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_laya",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "laya"+ },+ "decision": {+ "model": "english",+ "reason": "explicit model='laya'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_default",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "default"+ },+ "decision": {+ "model": "english",+ "reason": "explicit model='default'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_multi",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "multi"+ },+ "decision": {+ "model": "multilingual",+ "reason": "explicit model='multi'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_ml",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "ml"+ },+ "decision": {+ "model": "multilingual",+ "reason": "explicit model='ml'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_laya_multilingual",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "laya-multilingual"+ },+ "decision": {+ "model": "multilingual",+ "reason": "explicit model='laya-multilingual'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_typed",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "typed"+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "explicit model='typed'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_typed_decisions",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "typed_decisions"+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "explicit model='typed_decisions'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_laya_typed_decisions",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "laya-typed-decisions"+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "explicit model='laya-typed-decisions'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_decisions",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "decisions"+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "explicit model='decisions'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_uppercase_ML",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "ML"+ },+ "decision": {+ "model": "multilingual",+ "reason": "explicit model='ML'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_mixed_case_English",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "model": "English"+ },+ "decision": {+ "model": "english",+ "reason": "explicit model='English'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_via_task_typed_decisions_with_dash",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "task": "typed-decisions"+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "explicit task='typed-decisions'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "alias_via_task_typed_decisions_with_underscore",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "x",+ "task": "typed_decisions"+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "explicit task='typed_decisions'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "payload_shape_hindi",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "मुझसे दो बार शुल्क लिया गया"+ },+ "questions": {+ "dept": {+ "type": "choice",+ "instructions": "Which team?",+ "criteria": {+ "billing": null,+ "tech": null+ }+ }+ }+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (devanagari, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "payload_shape_armenian_non_latin_percent",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Հայերեն abc"+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (armenian, 70% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "armenian",+ "script_profile": {+ "latin": 0.3,+ "armenian": 0.7+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.7+ },+ "workflow": null+ }+ },+ {+ "label": "payload_shape_unidentified_latin_percent",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Müşteriden iki kez ücret alındı ve para iadesi istiyor"+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script, language not identified but 9% non-English letters; not safe for the English checkpoint",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0926,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ }+]diff --git a/laya-dotnet/tests/Laya.Tests/golden/routing/sample_inputs.json b/laya-dotnet/tests/Laya.Tests/golden/routing/sample_inputs.jsonnew file mode 100644index 00000000..c3cb120f--- /dev/null+++ b/laya-dotnet/tests/Laya.Tests/golden/routing/sample_inputs.json@@ -0,0 +1,508 @@+{+ "detection_states": [+ {+ "label": "english",+ "state": "The customer was charged twice this month and wants a refund.",+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "spanish_accent_stripped",+ "state": "El cliente fue cobrado dos veces y quiere que le devuelvan el dinero",+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "es",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "french",+ "state": "Le client a été facturé deux fois et demande un remboursement.",+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "fr",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0484,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "romanian",+ "state": "Am fost taxat de două ori pentru factura din luna martie și vreau banii",+ "analyse": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "ro",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0282,+ "non_latin_fraction": 0.0+ }+ },+ {+ "label": "hindi",+ "state": "ग्राहक से दो बार शुल्क लिया गया और वह धनवापसी चाहता है।",+ "analyse": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "arabic",+ "state": "تم خصم المبلغ مرتين من العميل ويريد استرداد الأموال",+ "analyse": {+ "script": "arabic",+ "script_profile": {+ "arabic": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "japanese",+ "state": "お客様は二重に請求されたため返金を希望しています。",+ "analyse": {+ "script": "kana",+ "script_profile": {+ "kana": 0.5833333333333334,+ "han": 0.4166666666666667+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ }+ },+ {+ "label": "dict_state",+ "state": {+ "subject": "Double charge",+ "body": "मुझसे दो बार शुल्क लिया गया"+ },+ "analyse": {+ "script": "devanagari",+ "script_profile": {+ "latin": 0.48,+ "devanagari": 0.52+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.52+ }+ }+ ],+ "routing_decisions": [+ {+ "label": "auto_english",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Please refund the duplicate charge on invoice 4411 today."+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "auto_hindi",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "मुझसे दो बार शुल्क लिया गया, कृपया रिफंड करें।"+ },+ "decision": {+ "model": "multilingual",+ "reason": "non-Latin script (devanagari, 100% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "devanagari",+ "script_profile": {+ "devanagari": 1.0+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 1.0+ },+ "workflow": null+ }+ },+ {+ "label": "auto_unknown_latin_romanian",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "Gătește-mi o rețetă de sarmale de post pentru mâine."+ },+ "decision": {+ "model": "multilingual",+ "reason": "Latin script but language looks like 'ro', not English",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "ro",+ "is_english": false,+ "language_undecided": false,+ "diacritic_rate": 0.0962,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ {+ "label": "explicit_model_multilingual",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "anything at all",+ "model": "multilingual"+ },+ "decision": {+ "model": "multilingual",+ "reason": "explicit model='multilingual'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "explicit_lang_de",+ "router_kwargs": {},+ "route_kwargs": {+ "state": "hello there",+ "lang": "de"+ },+ "decision": {+ "model": "multilingual",+ "reason": "explicit lang='de'",+ "detection": null,+ "workflow": null+ }+ },+ {+ "label": "workflow_opt_in_customer_service",+ "router_kwargs": {+ "auto_task_detection": true+ },+ "route_kwargs": {+ "state": {+ "body": "I was charged twice"+ },+ "questions": {+ "action": {+ "type": "noul",+ "instructions": "x"+ },+ "category": {+ "type": "noul",+ "instructions": "x"+ },+ "churn_risk": {+ "type": "noul",+ "instructions": "x"+ },+ "needs_human": {+ "type": "noul",+ "instructions": "x"+ },+ "urgency": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "typed-decisions",+ "reason": "question ids match the 'customer_service' typed-decisions workflow",+ "detection": null,+ "workflow": "customer_service"+ }+ },+ {+ "label": "workflow_opt_in_off_by_default",+ "router_kwargs": {},+ "route_kwargs": {+ "state": {+ "body": "I was charged twice"+ },+ "questions": {+ "action": {+ "type": "noul",+ "instructions": "x"+ },+ "category": {+ "type": "noul",+ "instructions": "x"+ },+ "churn_risk": {+ "type": "noul",+ "instructions": "x"+ },+ "needs_human": {+ "type": "noul",+ "instructions": "x"+ },+ "urgency": {+ "type": "noul",+ "instructions": "x"+ }+ }+ },+ "decision": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": "customer_service"+ }+ }+ ],+ "support_email": {+ "questions": {+ "department": {+ "type": "choice",+ "instructions": "Which department should handle this request?",+ "criteria": {+ "billing": "invoices, payments, refunds",+ "technical": "bugs, outages, system errors",+ "sales": "pricing, new contracts",+ "other": "everything else"+ }+ },+ "urgency": {+ "type": "score",+ "instructions": "How urgent is this request?",+ "criteria": [+ "not urgent",+ "soon",+ "critical deadline or blocking issue"+ ]+ },+ "churn_risk": {+ "type": "noul",+ "instructions": "Does the user threaten to cancel or leave?"+ },+ "refund_requested": {+ "type": "noul",+ "instructions": "Does the user explicitly request a refund?"+ }+ },+ "english_state": {+ "from": "[email protected]",+ "subject": "Duplicate charge on invoice #4411",+ "body": "Hi, we were billed twice for March. Please refund the duplicate today or we will cancel our plan."+ },+ "hindi_state": {+ "from": "[email protected]",+ "subject": "चालान में दोहरा शुल्क",+ "body": "मार्च का बिल दो बार लिया गया, कृपया रिफंड करें।"+ },+ "english_routing": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ },+ "hindi_routing": {+ "model": "multilingual",+ "reason": "non-Latin script (devanagari, 74% of letters); the English checkpoint cannot read it",+ "detection": {+ "script": "devanagari",+ "script_profile": {+ "latin": 0.2619047619047619,+ "devanagari": 0.7380952380952381+ },+ "language": null,+ "is_english": false,+ "language_undecided": true,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.7381+ },+ "workflow": null+ }+ },+ "raw_email": {+ "subject": "Re: Refund for invoice 4411",+ "sender": "[email protected]",+ "body": "Hi team,\n\nI was charged twice for the Pro plan this month and the second charge still has not been refunded. This is the third time I have written about it -- please resolve this today or I will need to cancel the account.\n\nBest regards,\nPriya Sharma\nSent from my iPhone\n\nThis email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender.\n\nOn Tue, Sep 22, 2026 at 9:14 AM, Support <[email protected]> wrote:\n> Hi Priya, thanks for reaching out, we are looking into it.\n> - Support Team\n",+ "cleaned_body": "Hi team,\n\nI was charged twice for the Pro plan this month and the second charge still has not been refunded. This is the third time I have written about it -- please resolve this today or I will need to cancel the account.",+ "state": {+ "subject": "Re: Refund for invoice 4411",+ "body": "Hi team,\n\nI was charged twice for the Pro plan this month and the second charge still has not been refunded. This is the third time I have written about it -- please resolve this today or I will need to cancel the account.",+ "from": "[email protected]"+ },+ "routing": {+ "model": "english",+ "reason": "English Latin text",+ "detection": {+ "script": "latin",+ "script_profile": {+ "latin": 1.0+ },+ "language": "en",+ "is_english": true,+ "language_undecided": false,+ "diacritic_rate": 0.0,+ "non_latin_fraction": 0.0+ },+ "workflow": null+ }+ },+ "banking_shortlist": {+ "state": "I tried to withdraw cash from the ATM but it kept the card and gave me no money.",+ "instructions": "What is the customer's banking intent?",+ "criteria": {+ "activate_my_card": "turn on a newly received card",+ "age_limit": "minimum or maximum age to use the service",+ "apple_pay_or_google_pay": "adding the card to a mobile wallet",+ "atm_support": "which ATMs the card works at",+ "automatic_top_up": "automatically topping up the balance",+ "balance_not_updated_after_bank_transfer": "a bank transfer is missing from the balance",+ "balance_not_updated_after_cheque_or_cash_deposit": "a deposit is missing from the balance",+ "beneficiary_not_allowed": "cannot add a payment recipient",+ "cancel_transfer": "wants to cancel a transfer already sent",+ "card_about_to_expire": "the card is close to its expiry date",+ "card_acceptance": "where the card is accepted",+ "card_arrival": "asking when a new card will arrive",+ "card_delivery_estimate": "asking how long delivery will take",+ "card_linking": "linking a card to the account",+ "card_not_working": "the card is declined or not working",+ "card_payment_fee_charged": "an unexpected fee was charged on a card payment",+ "card_payment_not_recognised": "a card payment the customer does not recognise",+ "card_payment_wrong_exchange_rate": "the exchange rate used was wrong",+ "card_swallowed": "the ATM kept the card",+ "cash_withdrawal_charge": "an unexpected charge for a cash withdrawal",+ "cash_withdrawal_not_recognised": "a cash withdrawal the customer does not recognise",+ "change_pin": "wants to change the PIN",+ "compromised_card": "the card may have been compromised",+ "contactless_not_working": "contactless payment is not working",+ "country_support": "which countries the service supports",+ "declined_card_payment": "a card payment was declined",+ "declined_cash_withdrawal": "a cash withdrawal was declined",+ "declined_transfer": "a transfer was declined",+ "direct_debit_payment_not_recognised": "a direct debit the customer does not recognise",+ "disposable_card_limits": "limits on a disposable virtual card",+ "edit_personal_details": "wants to edit name, address or other personal details",+ "exchange_charge": "a fee charged for currency exchange",+ "exchange_rate": "asking what the current exchange rate is",+ "exchange_via_app": "exchanging currency inside the app",+ "extra_charge_on_statement": "an unexplained extra charge on the statement",+ "failed_transfer": "a transfer failed",+ "fiat_currency_support": "which regular currencies are supported",+ "get_disposable_virtual_card": "wants a disposable virtual card",+ "get_physical_card": "wants a physical card",+ "getting_spare_card": "wants a spare or backup card"+ },+ "k": 20,+ "n": 40,+ "passthrough": false,+ "labels": [+ "card_swallowed",+ "compromised_card",+ "cash_withdrawal_not_recognised",+ "card_payment_not_recognised",+ "automatic_top_up",+ "card_linking",+ "atm_support",+ "direct_debit_payment_not_recognised",+ "card_payment_wrong_exchange_rate",+ "balance_not_updated_after_bank_transfer",+ "card_not_working",+ "declined_card_payment",+ "card_payment_fee_charged",+ "card_acceptance",+ "exchange_rate",+ "card_delivery_estimate",+ "activate_my_card",+ "balance_not_updated_after_cheque_or_cash_deposit",+ "card_about_to_expire",+ "country_support"+ ],+ "scores": [+ 0.5368900200020207,+ 0.5229341330248302,+ 0.4926179352570128,+ 0.4672093110356841,+ 0.4630985024104475,+ 0.4370994625491302,+ 0.37826231739982075,+ 0.36425922895521706,+ 0.347170429282197,+ 0.3320328885206982,+ 0.3300546962105677,+ 0.32050294323210465,+ 0.3154110908433172,+ 0.29833907794225273,+ 0.29153747948292086,+ 0.2862182802596687,+ 0.2750998671998696,+ 0.2737391010624727,+ 0.2667574502450347,+ 0.2631287408127802+ ]+ }+}diff --git a/laya-dotnet/tests/Laya.Tests/golden/routing/shortlist_probe.json b/laya-dotnet/tests/Laya.Tests/golden/routing/shortlist_probe.jsonnew file mode 100644index 00000000..67273532--- /dev/null+++ b/laya-dotnet/tests/Laya.Tests/golden/routing/shortlist_probe.json@@ -0,0 +1,790 @@+[+ {+ "label": "tie_cosine_keeps_earlier_label",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": "",+ "gamma": "mid",+ "delta": "same"+ },+ "k": 2,+ "instructions": null,+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ],+ [+ 0.6,+ 0.8+ ],+ [+ 1.0,+ 0.0+ ]+ ],+ "labels": [+ "alpha",+ "delta"+ ],+ "scores": [+ 1.0,+ 1.0+ ],+ "passthrough": false,+ "n": 4+ },+ {+ "label": "k1_is_earliest_max",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": "",+ "gamma": "mid",+ "delta": "same"+ },+ "k": 1,+ "instructions": null,+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ],+ [+ 0.6,+ 0.8+ ],+ [+ 1.0,+ 0.0+ ]+ ],+ "labels": [+ "alpha"+ ],+ "scores": [+ 1.0+ ],+ "passthrough": false,+ "n": 4+ },+ {+ "label": "k3_appends_next_cosine",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": "",+ "gamma": "mid",+ "delta": "same"+ },+ "k": 3,+ "instructions": null,+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ],+ [+ 0.6,+ 0.8+ ],+ [+ 1.0,+ 0.0+ ]+ ],+ "labels": [+ "alpha",+ "delta",+ "gamma"+ ],+ "scores": [+ 1.0,+ 1.0,+ 0.6+ ],+ "passthrough": false,+ "n": 4+ },+ {+ "label": "zero_query_keeps_original_order",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": "",+ "gamma": "mid",+ "delta": "same"+ },+ "k": 2,+ "instructions": null,+ "vectors": [+ [+ 0.0,+ 0.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ],+ [+ 0.6,+ 0.8+ ],+ [+ 3.0,+ 4.0+ ]+ ],+ "labels": [+ "alpha",+ "beta"+ ],+ "scores": [+ 0.0,+ 0.0+ ],+ "passthrough": false,+ "n": 4+ },+ {+ "label": "zero_option_vector_loses",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": null,+ "gamma": null+ },+ "k": 2,+ "instructions": null,+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 0.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ]+ ],+ "labels": [+ "beta",+ "alpha"+ ],+ "scores": [+ 1.0,+ 0.0+ ],+ "passthrough": false,+ "n": 3+ },+ {+ "label": "nan_vector_sorts_behind_finite_match",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": null+ },+ "k": 1,+ "instructions": null,+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ "nan",+ "nan"+ ],+ [+ 1.0,+ 0.0+ ]+ ],+ "labels": [+ "beta"+ ],+ "scores": [+ 1.0+ ],+ "passthrough": false,+ "n": 2+ },+ {+ "label": "positive_inf_and_negative_inf_both_zeroed",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": null,+ "gamma": null+ },+ "k": 2,+ "instructions": null,+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ "inf",+ "inf"+ ],+ [+ "-inf",+ 0.0+ ],+ [+ 1.0,+ 0.0+ ]+ ],+ "labels": [+ "gamma",+ "alpha"+ ],+ "scores": [+ 1.0,+ 0.0+ ],+ "passthrough": false,+ "n": 3+ },+ {+ "label": "nan_component_in_query_only_zeroes_that_component",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": null+ },+ "k": 1,+ "instructions": null,+ "vectors": [+ [+ "nan",+ 1.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ]+ ],+ "labels": [+ "beta"+ ],+ "scores": [+ 1.0+ ],+ "passthrough": false,+ "n": 2+ },+ {+ "label": "fully_nan_query_falls_back_to_order",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": null+ },+ "k": 1,+ "instructions": null,+ "vectors": [+ [+ "nan",+ "nan"+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ]+ ],+ "labels": [+ "alpha"+ ],+ "scores": [+ 0.0+ ],+ "passthrough": false,+ "n": 2+ },+ {+ "label": "k_equals_n_passthrough",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": "",+ "gamma": "mid",+ "delta": "same"+ },+ "k": 4,+ "instructions": null,+ "vectors": null,+ "labels": [+ "alpha",+ "beta",+ "gamma",+ "delta"+ ],+ "scores": null,+ "passthrough": true,+ "n": 4+ },+ {+ "label": "k_greater_than_n_passthrough",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": "",+ "gamma": "mid",+ "delta": "same"+ },+ "k": 20,+ "instructions": null,+ "vectors": null,+ "labels": [+ "alpha",+ "beta",+ "gamma",+ "delta"+ ],+ "scores": null,+ "passthrough": true,+ "n": 4+ },+ {+ "label": "k_equals_n_single_option_passthrough",+ "state": "pay me",+ "criteria": {+ "solo": "the only choice"+ },+ "k": 1,+ "instructions": null,+ "vectors": null,+ "labels": [+ "solo"+ ],+ "scores": null,+ "passthrough": true,+ "n": 1+ },+ {+ "label": "list_criteria_topk",+ "state": "pay me",+ "criteria": [+ "alpha",+ "beta",+ "gamma"+ ],+ "k": 2,+ "instructions": "Classify",+ "vectors": [+ [+ 0.0,+ 1.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ],+ [+ 0.0,+ 0.2+ ]+ ],+ "labels": [+ "beta",+ "gamma"+ ],+ "scores": [+ 1.0,+ 1.0+ ],+ "passthrough": false,+ "n": 3+ },+ {+ "label": "list_criteria_passthrough",+ "state": "hello",+ "criteria": [+ "alpha",+ "beta",+ "gamma"+ ],+ "k": 5,+ "instructions": "Which?",+ "vectors": null,+ "labels": [+ "alpha",+ "beta",+ "gamma"+ ],+ "scores": null,+ "passthrough": true,+ "n": 3+ },+ {+ "label": "dict_state_query",+ "state": {+ "text": "hi"+ },+ "criteria": [+ "alpha",+ "beta"+ ],+ "k": 1,+ "instructions": "Classify",+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ]+ ],+ "labels": [+ "alpha"+ ],+ "scores": [+ 1.0+ ],+ "passthrough": false,+ "n": 2+ },+ {+ "label": "zero_and_false_criteria_values",+ "state": "pay me",+ "criteria": {+ "zero": 0,+ "no": false,+ "bare": null,+ "named": {+ "desc": "payments"+ }+ },+ "k": 4,+ "instructions": null,+ "vectors": null,+ "labels": [+ "zero",+ "no",+ "bare",+ "named"+ ],+ "scores": null,+ "passthrough": true,+ "n": 4+ },+ {+ "label": "zero_and_false_criteria_ranked",+ "state": "pay me",+ "criteria": {+ "zero": 0,+ "no": false,+ "bare": null,+ "named": {+ "desc": "payments"+ }+ },+ "k": 2,+ "instructions": null,+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ],+ [+ 0.9,+ 0.1+ ],+ [+ 0.0,+ 1.0+ ]+ ],+ "labels": [+ "zero",+ "bare"+ ],+ "scores": [+ 1.0,+ 0.9938837346736189+ ],+ "passthrough": false,+ "n": 4+ },+ {+ "label": "dict_instructions",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": null+ },+ "k": 1,+ "instructions": {+ "task": "route",+ "hint": "Müller & co <urgent>"+ },+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ]+ ],+ "labels": [+ "alpha"+ ],+ "scores": [+ 1.0+ ],+ "passthrough": false,+ "n": 2+ },+ {+ "label": "list_instructions",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": null+ },+ "k": 1,+ "instructions": [+ "step one",+ "step two",+ 3+ ],+ "vectors": [+ [+ 0.0,+ 1.0+ ],+ [+ 0.0,+ 1.0+ ],+ [+ 1.0,+ 0.0+ ]+ ],+ "labels": [+ "alpha"+ ],+ "scores": [+ 1.0+ ],+ "passthrough": false,+ "n": 2+ },+ {+ "label": "numeric_instructions",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": null+ },+ "k": 1,+ "instructions": 42,+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ]+ ],+ "labels": [+ "alpha"+ ],+ "scores": [+ 1.0+ ],+ "passthrough": false,+ "n": 2+ },+ {+ "label": "empty_string_instructions_same_as_none",+ "state": "pay me",+ "criteria": {+ "alpha": null,+ "beta": null+ },+ "k": 1,+ "instructions": "",+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ]+ ],+ "labels": [+ "alpha"+ ],+ "scores": [+ 1.0+ ],+ "passthrough": false,+ "n": 2+ },+ {+ "label": "many_options_k5_of_10",+ "state": "I need help exporting invoices to a spreadsheet",+ "criteria": {+ "topic_00": "detailed description number 0 for this support topic",+ "topic_01": "detailed description number 1 for this support topic",+ "topic_02": "detailed description number 2 for this support topic",+ "topic_03": "detailed description number 3 for this support topic",+ "topic_04": "detailed description number 4 for this support topic",+ "topic_05": "detailed description number 5 for this support topic",+ "topic_06": "detailed description number 6 for this support topic",+ "topic_07": "detailed description number 7 for this support topic",+ "topic_08": "detailed description number 8 for this support topic",+ "topic_09": "detailed description number 9 for this support topic"+ },+ "k": 5,+ "instructions": "Pick the single best matching category.",+ "vectors": [+ [+ 1.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ],+ [+ 1.0,+ 2.0+ ],+ [+ 2.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ],+ [+ 1.0,+ 2.0+ ],+ [+ 2.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ],+ [+ 1.0,+ 2.0+ ],+ [+ 2.0,+ 0.0+ ],+ [+ 0.0,+ 1.0+ ]+ ],+ "labels": [+ "topic_02",+ "topic_05",+ "topic_08",+ "topic_01",+ "topic_04"+ ],+ "scores": [+ 1.0,+ 1.0,+ 1.0,+ 0.4472135954999579,+ 0.4472135954999579+ ],+ "passthrough": false,+ "n": 10+ }+]diff --git a/laya-dotnet/tools/dump_routing_golden.py b/laya-dotnet/tools/dump_routing_golden.pynew file mode 100644index 00000000..b14cc02b--- /dev/null+++ b/laya-dotnet/tools/dump_routing_golden.py@@ -0,0 +1,404 @@+"""Record golden vectors for the router/language/email/shortlist port (Phase A).++Pure Python, no model weights and no ONNX session: everything this script touches --+`laya.lang`, `laya.router.Router.route` (never `.load`/`.predict`), `laya.email` and+`laya.shortlist.shortlist_choice` -- is dependency-free Python plus NumPy. It reads its input+corpus from `laya-dotnet/tools/routing_cases.py` and writes one JSON file per probe to+`laya-dotnet/tests/Laya.Tests/golden/routing/`:++ lang_probe.json lang.analyse / detect_script / script_profile /+ latin_profile / state_text, for every LANG_STATES entry.+ route_probe.json Router.route() decisions (model, reason, detection,+ workflow -- `repo` is intentionally omitted: the ported+ RouteDecision has no Repo field) for every ROUTE_CASES entry.+ email_probe.json clean_email_body and email_state for every EMAIL_CLEAN_CASES /+ EMAIL_STATE_CASES entry.+ shortlist_probe.json shortlist_choice(labels, scores, passthrough) for every+ SHORTLIST_CASES entry, with the exact positional embedding+ matrix each case used (so a port needs no embedder to check+ its ranking/cosine/tie-break logic against this file). NaN/Inf+ values in a matrix are written as the strings "nan"/"inf"/+ "-inf" (see meta.json) because JSON has no literal for them.+ hashing_embedder_probe.json Exact laya-dotnet/tools/hashing_embedder.embed() vectors for a fixed probe+ list of strings, including non-ASCII and astral input.+ sample_inputs.json The combined routing sample's fixed inputs (detection states,+ routing-decision examples, support questions/emails, a raw+ email, and the banking shortlist demo), plus the+ Python-computed outputs a sample or test can check itself+ against with no model loaded.+ meta.json Generator/version info and per-file entry counts.++Usage:+ laya-dotnet/tools/dump_routing_golden.py # writes routing/ next to the checkpoint goldens+ laya-dotnet/tools/dump_routing_golden.py --force # overwrite files whose content differs+ laya-dotnet/tools/dump_routing_golden.py --out DIR # write elsewhere (rare; testing only)++Refuses to overwrite an existing golden file whose content would change unless `--force` is+given -- a content diff, not a mtime check, so re-running with no corpus changes is always a+silent no-op.+"""+import argparse+import json+import math+import os+import sys++TOOLS = os.path.dirname(os.path.abspath(__file__))+REPO = os.path.dirname(os.path.dirname(TOOLS))+sys.path.insert(0, REPO)+sys.path.insert(0, TOOLS)++from routing_cases import ( # noqa: E402+ EMAIL_CLEAN_CASES,+ EMAIL_STATE_CASES,+ LANG_STATES,+ ROUTE_CASES,+ SAMPLE_BANKING_CRITERIA,+ SAMPLE_BANKING_INSTRUCTIONS,+ SAMPLE_BANKING_STATE,+ SAMPLE_DETECTION_STATES,+ SAMPLE_RAW_EMAIL_BODY,+ SAMPLE_RAW_EMAIL_SENDER,+ SAMPLE_RAW_EMAIL_SUBJECT,+ SAMPLE_ROUTING_DECISIONS,+ SAMPLE_SUPPORT_EMAIL_EN,+ SAMPLE_SUPPORT_EMAIL_HI,+ SAMPLE_SUPPORT_QUESTIONS,+ SHORTLIST_CASES,+)++import hashing_embedder # noqa: E402++from laya.email import clean_email_body, email_state # noqa: E402+from laya.lang import analyse, detect_script, latin_profile, script_profile, state_text # noqa: E402+from laya.router import Router # noqa: E402+from laya.shortlist import DEFAULT_SHORTLIST_K, shortlist_choice # noqa: E402++OUT_DIR_DEFAULT = os.path.join(REPO, "laya-dotnet", "tests", "Laya.Tests", "golden", "routing")++# ~20+ strings for hashing_embedder_probe.json: ASCII, accents, full case mapping, CJK,+# Cyrillic, Arabic, Devanagari, astral (emoji and a script with no astral-BMP equivalent),+# whitespace-only, and a long repeated run to exercise bucket collisions.+HASHING_EMBEDDER_PROBE_STRINGS = [+ "",+ "a",+ "hello",+ "Hello World",+ "HELLO WORLD",+ "café",+ "naïve résumé Müller",+ "İstanbul",+ "ıstanbul",+ "我这个月被重复扣款了两次",+ "こんにちは世界",+ "안녕하세요",+ "тест русского текста",+ "مرحبا بالعالم",+ "नमस्ते दुनिया",+ "\U0001F600\U0001F680",+ "refund \U0001F600 today",+ "\U00010400\U00010401",+ " ",+ "a" * 50,+ "The quick brown fox jumps over the lazy dog",+ "refund!! invoice #4411 @ $99.99 (urgent)",+]+++def _encode_floats(value):+ """Recursively replace non-finite floats with the sentinel strings "nan"/"inf"/"-inf",+ since JSON has no literal for them (Python's json module would otherwise emit the+ non-standard bareword `NaN`/`Infinity`, which most other languages' JSON parsers reject).+ Everything else passes through unchanged."""+ if isinstance(value, float):+ if math.isnan(value):+ return "nan"+ if math.isinf(value):+ return "inf" if value > 0 else "-inf"+ return value+ if isinstance(value, list):+ return [_encode_floats(v) for v in value]+ if isinstance(value, dict):+ return {k: _encode_floats(v) for k, v in value.items()}+ return value+++def dump(obj, path: str, force: bool) -> str:+ """Write `obj` as pretty JSON to `path`. Refuses to overwrite a file whose content would+ change unless `force` is set. Returns "written", "unchanged" or "refused"."""+ new_text = json.dumps(obj, ensure_ascii=False, indent=2, sort_keys=False, allow_nan=False) + "\n"+ if os.path.exists(path):+ with open(path, encoding="utf-8", newline="\n") as f:+ old_text = f.read()+ if old_text == new_text:+ return "unchanged"+ if not force:+ raise SystemExit(+ "refusing to overwrite %s: its content would change and --force was not given.\n"+ "Re-run with --force if this change is intended." % path+ )+ os.makedirs(os.path.dirname(path), exist_ok=True)+ with open(path, "w", encoding="utf-8", newline="\n") as f:+ f.write(new_text)+ print(" wrote %-28s %8.1f KB" % (os.path.basename(path), os.path.getsize(path) / 1024.0))+ return "written"+++# ============================================================================ lang_probe+def build_lang_probe():+ out = []+ for label, state in LANG_STATES:+ text = state_text(state)+ out.append({+ "label": label,+ "state": state,+ "state_text": text,+ "detect_script": detect_script(text),+ "script_profile": script_profile(text),+ "latin_profile": latin_profile(text),+ "analyse": analyse(state),+ })+ return out+++# ============================================================================ route_probe+def _decision_payload(decision):+ """RouteDecision -> {model, reason, detection, workflow}. `repo` is intentionally+ dropped: the ported RouteDecision type has no Repo field (see the porting plan)."""+ return {+ "model": decision["model"],+ "reason": decision["reason"],+ "detection": decision["detection"],+ "workflow": decision["workflow"],+ }+++def build_route_probe():+ out = []+ for label, router_kwargs, route_kwargs in ROUTE_CASES:+ router = Router(**router_kwargs)+ decision = router.route(**route_kwargs)+ out.append({+ "label": label,+ "router_kwargs": router_kwargs,+ "route_kwargs": route_kwargs,+ "decision": _decision_payload(decision),+ })+ return out+++# ============================================================================ email_probe+def build_email_probe():+ clean = []+ for label, body, max_chars in EMAIL_CLEAN_CASES:+ clean.append({+ "label": label,+ "body": body,+ "max_chars": max_chars,+ "result": clean_email_body(body, max_chars),+ })+ state = []+ for label, subject, body, sender, clean_flag, extra in EMAIL_STATE_CASES:+ state.append({+ "label": label,+ "subject": subject,+ "body": body,+ "sender": sender,+ "clean": clean_flag,+ "extra": extra,+ "result": email_state(subject, body, sender, clean_flag, **extra),+ })+ return {"clean": clean, "state": state}+++# ============================================================================ shortlist_probe+class _Boom:+ """embed_fn stand-in for a passthrough case: raising proves shortlist_choice never calls+ it when k >= n, exactly like laya-dotnet/tools/routing_cases.py's SHORTLIST_CASES expects."""++ def __call__(self, texts):+ raise AssertionError("embed_fn must not be called when k >= n (passthrough)")+++def _matrix_embed_fn(vectors):+ import numpy as np++ def embed_fn(texts):+ if len(texts) != len(vectors):+ raise AssertionError(+ "case's embed_fn called with %d texts, expected %d (vectors length)"+ % (len(texts), len(vectors))+ )+ return np.array(vectors, dtype=np.float64)++ return embed_fn+++def build_shortlist_probe():+ out = []+ for case in SHORTLIST_CASES:+ vectors = case["vectors"]+ embed_fn = _Boom() if vectors is None else _matrix_embed_fn(vectors)+ labels, scores, passthrough, n = _rank_with_metadata(+ case["state"], case["criteria"], embed_fn, case["k"], case["instructions"]+ )+ out.append({+ "label": case["label"],+ "state": case["state"],+ "criteria": case["criteria"],+ "k": case["k"],+ "instructions": case["instructions"],+ "vectors": _encode_floats(vectors) if vectors is not None else None,+ "labels": labels,+ "scores": scores,+ "passthrough": passthrough,+ "n": n,+ })+ return out+++def _rank_with_metadata(state, criteria, embed_fn, k, instructions):+ """shortlist_choice only returns labels; re-derive passthrough/n/scores the same way+ predict_shortlist does, by calling the private _rank directly (still the real code path,+ just the one that also reports the metadata the golden needs)."""+ from laya.shortlist import _rank++ labels, scores, passthrough, n = _rank(state, criteria, embed_fn, k, instructions)+ # Cross-check against the public function so the golden can never silently diverge from+ # what a caller of shortlist_choice actually gets.+ public_labels = shortlist_choice(state, criteria, embed_fn, k=k, instructions=instructions)+ if list(labels) != list(public_labels):+ raise SystemExit(+ "internal inconsistency: _rank labels %r != shortlist_choice labels %r for case"+ % (labels, public_labels)+ )+ return list(labels), scores, passthrough, n+++# ============================================================================ hashing_embedder_probe+def build_hashing_embedder_probe():+ vecs = hashing_embedder.embed(HASHING_EMBEDDER_PROBE_STRINGS)+ return [+ {"text": s, "vector": [float(x) for x in vecs[i]]}+ for i, s in enumerate(HASHING_EMBEDDER_PROBE_STRINGS)+ ]+++# ============================================================================ sample_inputs+def build_sample_inputs():+ detection = []+ for label, state in SAMPLE_DETECTION_STATES:+ detection.append({"label": label, "state": state, "analyse": analyse(state)})++ routing = []+ for label, router_kwargs, route_kwargs in SAMPLE_ROUTING_DECISIONS:+ router = Router(**router_kwargs)+ decision = router.route(**route_kwargs)+ routing.append({+ "label": label,+ "router_kwargs": router_kwargs,+ "route_kwargs": route_kwargs,+ "decision": _decision_payload(decision),+ })++ support_email = {+ "questions": SAMPLE_SUPPORT_QUESTIONS,+ "english_state": SAMPLE_SUPPORT_EMAIL_EN,+ "hindi_state": SAMPLE_SUPPORT_EMAIL_HI,+ "english_routing": _decision_payload(Router().route(SAMPLE_SUPPORT_EMAIL_EN, SAMPLE_SUPPORT_QUESTIONS)),+ "hindi_routing": _decision_payload(Router().route(SAMPLE_SUPPORT_EMAIL_HI, SAMPLE_SUPPORT_QUESTIONS)),+ }++ cleaned_body = clean_email_body(SAMPLE_RAW_EMAIL_BODY)+ raw_email = {+ "subject": SAMPLE_RAW_EMAIL_SUBJECT,+ "sender": SAMPLE_RAW_EMAIL_SENDER,+ "body": SAMPLE_RAW_EMAIL_BODY,+ "cleaned_body": cleaned_body,+ "state": email_state(SAMPLE_RAW_EMAIL_SUBJECT, SAMPLE_RAW_EMAIL_BODY, SAMPLE_RAW_EMAIL_SENDER),+ "routing": _decision_payload(Router().route(+ email_state(SAMPLE_RAW_EMAIL_SUBJECT, SAMPLE_RAW_EMAIL_BODY, SAMPLE_RAW_EMAIL_SENDER)+ )),+ }++ banking_k = 20+ banking_labels, banking_scores, banking_passthrough, banking_n = _rank_with_metadata(+ SAMPLE_BANKING_STATE, SAMPLE_BANKING_CRITERIA, hashing_embedder.embed,+ banking_k, SAMPLE_BANKING_INSTRUCTIONS,+ )+ banking = {+ "state": SAMPLE_BANKING_STATE,+ "instructions": SAMPLE_BANKING_INSTRUCTIONS,+ "criteria": SAMPLE_BANKING_CRITERIA,+ "k": banking_k,+ "n": banking_n,+ "passthrough": banking_passthrough,+ "labels": banking_labels,+ "scores": banking_scores,+ }++ return {+ "detection_states": detection,+ "routing_decisions": routing,+ "support_email": support_email,+ "raw_email": raw_email,+ "banking_shortlist": banking,+ }+++def main() -> int:+ ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)+ ap.add_argument("--out", default=OUT_DIR_DEFAULT, help="output directory (default: %s)" % OUT_DIR_DEFAULT)+ ap.add_argument("--force", action="store_true", help="overwrite files whose content would change")+ args = ap.parse_args()++ out_dir = os.path.abspath(args.out)++ lang_probe = build_lang_probe()+ route_probe = build_route_probe()+ email_probe = build_email_probe()+ shortlist_probe = build_shortlist_probe()+ hashing_probe = build_hashing_embedder_probe()+ sample_inputs = build_sample_inputs()++ meta = {+ "generator": "tools/dump_routing_golden.py",+ "laya_version": __import__("laya").__version__,+ "default_shortlist_k": DEFAULT_SHORTLIST_K,+ "notes": {+ "route_probe": "RouteDecision is serialized as {model, reason, detection, workflow}; "+ "'repo' is intentionally omitted (not part of the ported RouteDecision).",+ "shortlist_probe": "Non-finite floats (NaN, +Inf, -Inf) inside a case's 'vectors' matrix "+ "are encoded as the JSON strings \"nan\", \"inf\", \"-inf\" because JSON "+ "has no native literal for them; a case with vectors=null is a k>=n "+ "passthrough case where embed_fn must never be called.",+ },+ "counts": {+ "lang_probe": len(lang_probe),+ "route_probe": len(route_probe),+ "email_probe_clean": len(email_probe["clean"]),+ "email_probe_state": len(email_probe["state"]),+ "shortlist_probe": len(shortlist_probe),+ "hashing_embedder_probe": len(hashing_probe),+ },+ }++ results = {}+ results["lang_probe.json"] = dump(lang_probe, os.path.join(out_dir, "lang_probe.json"), args.force)+ results["route_probe.json"] = dump(route_probe, os.path.join(out_dir, "route_probe.json"), args.force)+ results["email_probe.json"] = dump(email_probe, os.path.join(out_dir, "email_probe.json"), args.force)+ results["shortlist_probe.json"] = dump(shortlist_probe, os.path.join(out_dir, "shortlist_probe.json"), args.force)+ results["hashing_embedder_probe.json"] = dump(+ hashing_probe, os.path.join(out_dir, "hashing_embedder_probe.json"), args.force+ )+ results["sample_inputs.json"] = dump(sample_inputs, os.path.join(out_dir, "sample_inputs.json"), args.force)+ results["meta.json"] = dump(meta, os.path.join(out_dir, "meta.json"), args.force)++ print("\nrouting golden vectors -> %s" % out_dir)+ for name, status in results.items():+ print(" %-28s %s" % (name, status))+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/laya-dotnet/tools/routing_cases.py b/laya-dotnet/tools/routing_cases.pynew file mode 100644index 00000000..068059e1--- /dev/null+++ b/laya-dotnet/tools/routing_cases.py@@ -0,0 +1,772 @@+"""Probe corpus for the routing/language/email/shortlist golden vectors.++Consumed only by `laya-dotnet/tools/dump_routing_golden.py`, which runs every entry through the real+`laya.lang` / `laya.router` / `laya.email` / `laya.shortlist` code paths and records+whatever Python actually produces. Nothing in this module is itself a golden value -- it is+the *input* side only, chosen to hit the parity pitfalls documented in the porting plan+(Unicode code-point iteration, `str.lower()`/`isalpha()` semantics, `max()` tie order,+`round()` half-even, quote/signature/disclaimer regexes, cosine edge cases).++Four sections, one per probe file:+ LANG_STATES -> lang_probe.json (lang.analyse / detect_script / script_profile /+ latin_profile / state_text)+ ROUTE_CASES -> route_probe.json (router.Router.route)+ EMAIL_CASES -> email_probe.json (email.clean_email_body / email_state)+ SHORTLIST_CASES -> shortlist_probe.json (shortlist.shortlist_choice)++Plus the single source of truth for the combined routing sample's own fixed inputs+(SAMPLE_* below), so the samples can be diffed against a Python-recorded+golden the same way the existing `Laya.Sample` is.+"""++# ============================================================================ lang_probe+#+# label -> state, fed to `lang.analyse(state)` and `lang.state_text(state)` directly, and to+# `detect_script`/`script_profile`/`latin_profile` via `state_text(state)` (dump script's job,+# not this module's -- these three take plain text, not a full state).++LANG_STATES = [+ # ---- straight from tests/test_router.py SCRIPTS (script detection) ----+ ("script/english", "The customer was charged twice and wants a refund."),+ ("script/armenian", "Հայերեն"),+ ("script/armenian_uppercase", "ՀԱՅԵՐԵՆ"),+ ("script/armenian_punctuation_only", "։֊"),+ ("script/french", "Le client a été facturé deux fois et demande un remboursement."),+ ("script/hindi", "ग्राहक से दो बार शुल्क लिया गया और वह धनवापसी चाहता है।"),+ ("script/japanese", "お客様は二重に請求されたため返金を希望しています。"),+ ("script/chinese", "客户被重复扣款要求退款"),+ ("script/korean", "고객이 두 번 청구되어 환불을 원합니다"),+ ("script/arabic", "تم خصم المبلغ مرتين من العميل ويريد استرداد الأموال"),+ ("script/tamil", "வாடிக்கையாளரிடம் இருமுறை கட்டணம் வசூலிக்கப்பட்டது"),+ ("script/russian", "С клиента дважды сняли деньги и он хочет возврат"),+ ("script/thai", "ลูกค้าถูกเรียกเก็บเงินสองครั้งและต้องการเงินคืน"),+ ("script/greek", "Ο πελάτης χρεώθηκε δύο φορές και θέλει επιστροφή χρημάτων"),+ ("script/hebrew", "הלקוח חויב פעמיים ורוצה החזר כספי"),+ ("script/empty", ""),+ ("script/digits_only", "12345 6789"),++ # ---- straight from tests/test_router.py is_english checks ----+ ("is_english/plain_english", "Please refund the duplicate charge on invoice 4411 today."),+ ("is_english/armenian", "Հայերեն"),+ ("is_english/english_short", "refund me"),+ ("is_english/hindi", "ग्राहक से दो बार शुल्क लिया गया"),+ ("is_english/japanese", "お客様は二重に請求されました"),+ ("is_english/russian", "С клиента дважды сняли деньги"),+ ("is_english/french_long", "Le client a été facturé deux fois et il demande un remboursement pour la "+ "facture qui a été payée le mois dernier avec la carte de crédit"),+ ("is_english/german_long", "Der Kunde wurde zweimal belastet und möchte eine Rückerstattung für die "+ "Rechnung die nicht korrekt ist und auch nicht bezahlt wurde"),+ ("is_english/romanian", "Gătește-mi o rețetă de sarmale de post pentru mâine."),+ ("is_english/romanian_invoice", "Am fost taxat de două ori pentru factura din luna martie și vreau banii"),+ ("is_english/polish", "Klient został obciążony dwukrotnie i chce zwrot pieniędzy za fakturę"),+ ("is_english/czech", "Zákazníkovi byla částka účtována dvakrát a žádá o vrácení peněz"),+ ("is_english/turkish", "Müşteriden iki kez ücret alındı ve para iadesi istiyor lütfen yardım"),+ ("is_english/vietnamese", "Khách hàng đã bị thu phí hai lần và muốn được hoàn tiền ngay"),+ ("is_english/english_with_loanwords", "We visited a cafe in Zurich and the naive assumption about the "+ "invoice was wrong, so please refund the duplicate charge"),+ ("is_english/undecided_turkish", "Müşteriden iki kez ücret alındı ve para iadesi istiyor"),+ ("is_english/english_not_undecided", "Please refund the duplicate charge on the invoice"),+ ("is_english/romanian_diacritics", "Gătește-mi o rețetă de sarmale"),+ ("is_english/no_diacritics", "Please refund the duplicate charge today"),+ ("is_english/zero_tie_romanian", "Cât e ora acum la Tokyo"),+ ("is_english/known_gap_romanian_no_diacritics", "Care este ora in Tokyo?"),++ # ---- latin language guess ----+ ("latin_lang/english", "The customer was charged twice and wants a refund for this invoice"),+ ("latin_lang/french", "Le client a ete facture deux fois et il demande un remboursement pour la facture"),+ ("latin_lang/german", "Der Kunde wurde zweimal belastet und moechte eine Rueckerstattung fuer die Rechnung"),+ ("latin_lang/spanish", "El cliente fue cobrado dos veces y quiere que le devuelvan el dinero por la factura"),+ ("latin_lang/too_short", "refund"),+ ("latin_lang/long_english_stays_en",+ "Please refund the duplicate charge on invoice 4411 today because we have been waiting "+ "for three days and nobody has replied to us"),++ # ---- state flattening ----+ ("state_text/dict", {"body": "charged twice", "n": 3}),+ ("state_text/nested", {"a": {"b": ["deep"]}}),+ ("state_text/list", ["x", {"y": "z"}]),+ ("state_text/none", None),+ ("state_text/keys_ignored", {"subject": "नमस्ते", "body": "ग्राहक से दो बार शुल्क लिया गया"}),++ # ---- workflow/profile edge cases from tests ----+ ("profile/armenian_pure", "Հայերեն"),+ ("profile/armenian_mixed_with_latin", "Հայերեն abc"),++ # ---- plain-ASCII Romance (#172): accent-stripped states must still route non-English ----+ ("plain_ascii/es_1", "El pedido llego roto y nadie responde cuando escribo al soporte"),+ ("plain_ascii/es_2", "Quiero cancelar mi plan y pedir un reembolso"),+ ("plain_ascii/es_3", "La factura tiene un error en el importe total"),+ ("plain_ascii/es_4", "Necesito que me devuelvan el dinero de la compra duplicada"),+ ("plain_ascii/it_1", "Il cliente e stato addebitato due volte e vuole un rimborso"),+ ("plain_ascii/it_2", "Voglio cancellare il mio abbonamento e chiedere un rimborso"),+ ("plain_ascii/it_3", "La fattura contiene un errore nell importo totale"),+ ("plain_ascii/pt_1", "O cliente foi cobrado duas vezes e quer o dinheiro de volta"),+ ("plain_ascii/fr_1", "Le client a ete facture deux fois et demande un remboursement"),+ ("plain_ascii/fr_2", "Je ne peux pas acceder a mon compte et j ai besoin d aide"),+ ("accented/es", "La facturación tiene un error y necesito una corrección urgente"),+ ("accented/it", "La fattura è sbagliata, devo avere un rimborso per il pagamento"),+ ("accented/fr", "La commande est arrivée cassée et personne ne répond au support"),+ ("romance_control/1", "The customer was charged twice and wants a refund for this invoice"),+ ("romance_control/2", "Please cancel my subscription and refund the duplicate charge today"),+ ("romance_control/3", "The report by Smith et al. shows the de facto standard, e.g. the LA office and Rio"),+ ("romance_control/4", "Our MI5 and UN contacts discussed the DOS attack in LA last month"),+ ("romance_control/5", "No refund was issued, so I am writing to you again about invoice 4411"),+ ("romance_control/6", "no refund no reply"),+ ("romance_control/7", "The son of the director filed a complaint about the duplicate invoice"),+ ("shared_words/names_nothing", "Cât e ora acum la Tokyo"),+ ("shared_words/distinctive_names_it", "La fattura contiene un errore nell importo totale"),+ ("shared_words/shared_hits_still_count_es", "La factura tiene un error en el importe total"),++ # ---- all 25 non-Latin scripts recognised by _SCRIPT_RANGES, plus a couple more Latin ----+ ("all_scripts/greek", "Γεια σου κόσμε, πώς είσαι σήμερα;"),+ ("all_scripts/cyrillic", "Привет, как ты себя чувствуешь сегодня?"),+ ("all_scripts/armenian", "Բարեւ ձեզ, ինչպե՞ս եք այսօր"),+ ("all_scripts/hebrew", "שלום, מה שלומך היום"),+ ("all_scripts/arabic", "مرحبا كيف حالك اليوم"),+ ("all_scripts/devanagari", "नमस्ते आप कैसे हैं आज"),+ ("all_scripts/bengali", "আমি ভালো আছি, আপনি কেমন আছেন"),+ ("all_scripts/gurmukhi", "ਤੁਸੀਂ ਕਿਵੇਂ ਹੋ, ਮੈਂ ਠੀਕ ਹਾਂ"),+ ("all_scripts/gujarati", "તમે કેમ છો, હું સારો છું"),+ ("all_scripts/oriya", "ତୁମେ କେମିତି ଅଛ, ମୁଁ ଭଲ ଅଛି"),+ ("all_scripts/tamil", "நீங்கள் எப்படி இருக்கிறீர்கள்"),+ ("all_scripts/telugu", "మీరు ఎలా ఉన్నారు, నేను బాగున్నాను"),+ ("all_scripts/kannada", "ನೀವು ಹೇಗಿದ್ದೀರಿ, ನಾನು ಚೆನ್ನಾಗಿದ್ದೇನೆ"),+ ("all_scripts/malayalam", "നിങ്ങൾക്ക് സുഖമാണോ, എനിക്ക് സുഖമാണ്"),+ ("all_scripts/sinhala", "ඔබට කොහොමද, මට හොඳින්"),+ ("all_scripts/thai", "คุณเป็นอย่างไรบ้างวันนี้"),+ ("all_scripts/lao", "ສະບາຍດີ ທ່ານເປັນແນວໃດແດ່"),+ ("all_scripts/tibetan", "བཀྲ་ཤིས་བདེ་ལེགས་ཁྱེད་རང་ག་འདྲ་ཡོད"),+ ("all_scripts/myanmar", "မင်္ဂလာပါ သင်နေကောင်းလား"),+ ("all_scripts/georgian", "გამარჯობა როგორ ხარ დღეს"),+ ("all_scripts/ethiopic", "ሰላም እንዴት ነህ ዛሬ"),+ ("all_scripts/khmer", "សួស្តី តើអ្នកសុខសប្បាយទេ"),+ ("all_scripts/hangul", "안녕하세요 오늘 기분이 어때요"),+ ("all_scripts/kana", "こんにちは、今日は元気ですか"),+ ("all_scripts/han", "你好,你今天过得怎么样"),+ ("all_scripts/latin", "Hello, how are you feeling today?"),++ # ---- mixed scripts / ties (max() tie order: first-inserted key wins; latin is always+ # inserted last, so it never wins a tie against a script that appeared) ----+ ("tie/greek_then_cyrillic_1v1", "ΑА"), # expect "greek" (first seen)+ ("tie/cyrillic_then_greek_1v1", "АΑ"), # expect "cyrillic" (first seen)+ ("tie/han_then_latin_1v1", "中 a"), # expect "han" (latin inserted last)+ ("tie/latin_then_han_1v1", "a 中"), # expect "han" still (order in text ignored for latin)+ ("tie/three_way_greek_cyrillic_armenian", "ΑАԱ"), # 1-1-1, expect "greek" (first)+ ("mixed/latin_han_arabic", "invoice 中文 فاتورة refund"),+ ("mixed/devanagari_latin_majority_devanagari", "ग्राहक से दो बार शुल्क लिया गया refund"),+ ("mixed/latin_majority_devanagari_minor", "Please refund the customer today ग्राहक"),++ # ---- latin_profile ties: _STOP dict order is en, fr, de, es, pt, it, nl, ro; a tied+ # score picks the first-iterated language among those with real (non-shared) evidence ----+ ("latin_tie/fr_vs_de", "être cette nicht sich"), # expect "fr" (fr before de)+ ("latin_tie/de_vs_es", "nicht sich el los"), # expect "de" (de before es)+ ("latin_tie/es_vs_pt", "está una dos tres o não está"),+ ("latin_tie/pt_vs_it", "não está o della sono"),++ # ---- astral characters (outside the BMP): emoji is not alphabetic and is dropped from+ # every count; a letter outside every _SCRIPT_RANGES bucket (Deseret, astral) is+ # alphabetic but also silently dropped from counts (neither latin nor any script) ----+ ("astral/emoji_only", "\U0001F600\U0001F680\U00002764\U0000FE0F"),+ ("astral/emoji_with_latin", "refund please \U0001F600 today"),+ ("astral/deseret_letter_alone", "\U00010400\U00010401\U00010402"), # Deseret, no matching script bucket+ ("astral/deseret_mixed_with_latin", "refund \U00010400 today"),+ ("astral/mathematical_bold_letters", "\U0001D400\U0001D401\U0001D402"), # Mathematical Bold A B C++ # ---- combining marks: Python str.isalpha() is Unicode category L* only, so a combining+ # mark (Mn) like the Devanagari virama is NOT counted as alphabetic; a port whose+ # "is letter" check includes marks (e.g. Rust char::is_alphabetic) will disagree ----+ ("combining/devanagari_with_virama", "ग्राहक"), # contains U+094D VIRAMA (Mn)+ ("combining/latin_with_combining_acute", "café résumé"), # decomposed é++ # ---- Turkish dotted capital I: str.lower() maps İ -> 2 code points ("i" + combining dot) ----+ ("turkish_i/capital_i_with_dot", "İstanbul"),+ ("turkish_i/mixed_case", "İYİ GÜNLER İstanbul'da"),+ ("turkish_i/lowercase_dotless", "ıstanbul"),++ # ---- digits / numerics: `\w` (used by `_WORD`) = isalnum() + '_', which is letters and+ # numeric No/Nl categories, not marks; digits (Nd) are explicitly excluded by `\d` ----+ ("numerics/ascii_digits_only", "12345 67890"),+ ("numerics/roman_numeral_nl", "chapter Ⅷ begins"), # U+2167 ROMAN NUMERAL EIGHT (Nl)+ ("numerics/fullwidth_digits", "123 refund"), # fullwidth 123 (Nd)+ ("numerics/mixed_digits_and_words", "invoice 4411 was paid twice on 2024-01-05"),++ # ---- nested dict/list states deeper than the _iter_text depth-6 cutoff ----+ ("nesting/depth_6_kept", {"a": {"b": {"c": {"d": {"e": {"f": "visible at depth 6"}}}}}}),+ ("nesting/depth_7_dropped", {"a": {"b": {"c": {"d": {"e": {"f": {"g": "invisible past depth 6"}}}}}}}),+ ("nesting/list_depth_7_dropped", [[[[[[["invisible list depth 7"]]]]]]]),+ ("nesting/mixed_depth_boundary",+ {"a": {"b": {"c": {"d": {"e": ["kept depth 6", {"f": "dropped depth 7"}]}}}}}),++ # ---- >4000-char inputs: state_text's default max_chars=4000 slice is per code point ----+ ("long/ascii_over_4000",+ "refund please. " * 400), # 16 * 400 = 6400 chars+ ("long/multibyte_over_4000",+ "退款请求 " * 1000), # 5 chars * 1000 = 5000 code points, multi-byte in UTF-8+ ("long/mixed_script_over_4000_boundary_near_switch",+ ("a" * 3990) + "客户被重复扣款要求退款" * 5), # ascii run crosses the 4000 cut into Han++ # ---- English control long enough to stay decisively English despite length ----+ ("long/english_over_1000",+ "Please refund the duplicate charge on invoice 4411 today. " * 20),+]+++# ============================================================================ route_probe+#+# Each entry: (label, router_kwargs, route_kwargs). `router_kwargs` builds the `Router`+# (state that survives across the whole case: `default`, `auto_task_detection`,+# `standalone_repos`, `models` override); `route_kwargs` is passed straight to `.route(...)`+# (state, questions, model=, task=, lang=). Router() with no models loads nothing -- `.route`+# never touches the network or the filesystem.++Q_GENERIC = {"dept": {"type": "choice", "instructions": "Which team?",+ "criteria": {"billing": None, "tech": None}}}++_TD_IDS = {+ "agent_trace_observability": ["action", "needs_review", "outcome", "risk", "urgency"],+ "customer_service": ["action", "category", "churn_risk", "needs_human", "urgency"],+ "invoice_processing": ["discrepancy_severity", "disposition", "duplicate", "matches_order", "urgency"],+ "security_incidents": ["credential_compromise", "disposition", "severity", "true_positive", "urgency"],+}+++def _td_questions(ids):+ return {i: {"type": "noul", "instructions": "x"} for i in ids}+++ROUTE_CASES = [+ # ---- default router, precedence ladder ----+ ("english_text", {}, {"state": {"body": "I was charged twice, please refund."}, "questions": Q_GENERIC}),+ ("armenian_text", {}, {"state": {"body": "Հայերեն"}, "questions": Q_GENERIC}),+ ("armenian_explicit_override", {}, {"state": {"body": "Հայերեն"}, "questions": Q_GENERIC, "model": "english"}),+ ("hindi_text", {}, {"state": {"body": "मुझसे दो बार शुल्क लिया गया"}, "questions": Q_GENERIC}),+ ("japanese_text", {}, {"state": {"body": "二重に請求されました"}, "questions": Q_GENERIC}),+ ("korean_text", {}, {"state": {"body": "두 번 청구되었습니다"}, "questions": Q_GENERIC}),+ ("arabic_text", {}, {"state": {"body": "تم خصم المبلغ مرتين"}, "questions": Q_GENERIC}),+ ("german_text", {}, {"state": {"body": "Der Kunde wurde zweimal belastet und moechte eine Rueckerstattung "+ "fuer die Rechnung die nicht korrekt ist"}, "questions": Q_GENERIC}),+ ("explicit_model", {}, {"state": {"body": "anything"}, "questions": Q_GENERIC, "model": "multilingual"}),+ ("explicit_model_overrides_script", {}, {"state": {"body": "मुझसे दो बार"}, "questions": Q_GENERIC, "model": "english"}),+ ("explicit_task", {}, {"state": {"body": "x"}, "questions": Q_GENERIC, "task": "typed_decisions"}),+ ("explicit_lang_en", {}, {"state": {"body": "मुझसे दो बार"}, "questions": Q_GENERIC, "lang": "en"}),+ ("explicit_lang_de", {}, {"state": {"body": "hello there"}, "questions": Q_GENERIC, "lang": "de"}),+ ("explicit_lang_eng_alias", {}, {"state": {"body": "hello"}, "questions": Q_GENERIC, "lang": "eng"}),+ ("explicit_lang_english_word", {}, {"state": {"body": "hello"}, "questions": Q_GENERIC, "lang": "English"}),+ ("explicit_lang_en_us", {}, {"state": {"body": "hello"}, "questions": Q_GENERIC, "lang": "en-US"}),+ ("explicit_lang_fr", {}, {"state": {"body": "hello"}, "questions": Q_GENERIC, "lang": "fr"}),+ ("td_workflow_auto_off", {}, {"state": {"body": "I was charged twice"}, "questions": _td_questions(_TD_IDS["customer_service"])}),+ ("empty_state", {}, {"state": {}, "questions": Q_GENERIC}),+ ("none_state", {}, {"state": None, "questions": Q_GENERIC}),+ ("no_questions_none", {}, {"state": {"body": "मुझसे दो बार"}, "questions": None}),++ # ---- auto_task_detection opt-in, all four workflow signatures ----+ ("td_agent_trace_observability_auto_on", {"auto_task_detection": True},+ {"state": {"body": "trace"}, "questions": _td_questions(_TD_IDS["agent_trace_observability"])}),+ ("td_customer_service_auto_on", {"auto_task_detection": True},+ {"state": {"body": "I was charged twice"}, "questions": _td_questions(_TD_IDS["customer_service"])}),+ ("td_invoice_processing_auto_on", {"auto_task_detection": True},+ {"state": {"body": "invoice mismatch"}, "questions": _td_questions(_TD_IDS["invoice_processing"])}),+ ("td_security_incidents_auto_on", {"auto_task_detection": True},+ {"state": {"body": "possible breach"}, "questions": _td_questions(_TD_IDS["security_incidents"])}),+ ("td_auto_on_but_generic_questions", {"auto_task_detection": True},+ {"state": {"body": "I was charged twice"}, "questions": Q_GENERIC}),+ ("td_explicit_beats_workflow", {"auto_task_detection": True},+ {"state": {"body": "x"}, "questions": _td_questions(_TD_IDS["customer_service"]), "model": "multilingual"}),+ # near-miss id sets: must NOT match any workflow even with auto_task_detection on+ ("td_near_miss_partial_overlap", {"auto_task_detection": True},+ {"state": {"body": "x"}, "questions": {"urgency": {"type": "noul", "instructions": "x"},+ "category": {"type": "noul", "instructions": "x"}}}),+ ("td_near_miss_superset", {"auto_task_detection": True},+ {"state": {"body": "x"}, "questions": _td_questions(_TD_IDS["customer_service"] + ["extra_field"])}),+ ("td_near_miss_subset", {"auto_task_detection": True},+ {"state": {"body": "x"}, "questions": _td_questions(_TD_IDS["invoice_processing"][:-1])}),+ ("td_near_miss_one_id_swapped", {"auto_task_detection": True},+ {"state": {"body": "x"},+ "questions": _td_questions(_TD_IDS["security_incidents"][:-1] + ["not_a_real_field"])}),++ # ---- unknown-Latin routing (#35): scripts with no stopword list, on the diacritic signal ----+ ("unknown_latin_romanian", {}, {"state": "Gătește-mi o rețetă de sarmale de post pentru mâine."}),+ ("unknown_latin_romanian_agent_request", {}, {"state": "Exportă APK-ul pentru Android și pune-l pe Drive ca să-l instalez."}),+ ("unknown_latin_polish", {}, {"state": "Klient został obciążony dwukrotnie i chce zwrot pieniędzy za fakturę"}),+ ("unknown_latin_turkish", {}, {"state": "Müşteriden iki kez ücret alındı ve para iadesi istiyor lütfen yardım"}),+ ("unknown_latin_undecided_reason", {}, {"state": "Müşteriden iki kez ücret alındı ve para iadesi istiyor"}),+ ("english_still_english", {}, {"state": "Please refund the duplicate charge on invoice 4411 today."}),+ ("short_english_still_english", {}, {"state": "refund me"}),++ # ---- plain-ASCII Romance / accented forms (#172) ----+ ("plain_ascii_es_1", {}, {"state": "El pedido llego roto y nadie responde cuando escribo al soporte"}),+ ("plain_ascii_it_1", {}, {"state": "Il cliente e stato addebitato due volte e vuole un rimborso"}),+ ("plain_ascii_pt_1", {}, {"state": "O cliente foi cobrado duas vezes e quer o dinheiro de volta"}),+ ("plain_ascii_fr_1", {}, {"state": "Le client a ete facture deux fois et demande un remboursement"}),+ ("accented_es", {}, {"state": "La facturación tiene un error y necesito una corrección urgente"}),+ ("accented_it", {}, {"state": "La fattura è sbagliata, devo avere un rimborso per il pagamento"}),+ ("accented_fr", {}, {"state": "La commande est arrivée cassée et personne ne répond au support"}),+ ("romance_control_1", {}, {"state": "The customer was charged twice and wants a refund for this invoice"}),+ ("romance_control_2", {}, {"state": "Our MI5 and UN contacts discussed the DOS attack in LA last month"}),+ ("shared_words_still_multilingual", {}, {"state": "Cât e ora acum la Tokyo"}),++ # ---- custom default ----+ ("custom_default_multilingual", {"default": "multilingual"}, {"state": "12345"}),+ ("custom_default_typed_decisions", {"default": "typed-decisions"}, {"state": ""}),+ ("custom_default_english_script_unknown", {"default": "english"}, {"state": "12345 6789"}),++ # ---- bundle vs standalone repos, local override ----+ ("bundle_default_hindi", {}, {"state": {"m": "मुझसे दो बार"}, "questions": Q_GENERIC}),+ ("standalone_opt_in_hindi", {"standalone_repos": True}, {"state": {"m": "मुझसे दो बार"}, "questions": Q_GENERIC}),+ ("standalone_english_unchanged", {"standalone_repos": True}, {"state": {"m": "I was charged twice"}, "questions": Q_GENERIC}),+ ("local_path_override", {"models": {"english": "/tmp/en", "multilingual": "/tmp/ml"}},+ {"state": {"m": "मुझसे दो बार"}, "questions": Q_GENERIC}),++ # ---- every alias, as an explicit `model=` (normalise_name feeds straight into RouteDecision) ----+ ("alias_en", {}, {"state": "x", "model": "en"}),+ ("alias_laya", {}, {"state": "x", "model": "laya"}),+ ("alias_default", {}, {"state": "x", "model": "default"}),+ ("alias_multi", {}, {"state": "x", "model": "multi"}),+ ("alias_ml", {}, {"state": "x", "model": "ml"}),+ ("alias_laya_multilingual", {}, {"state": "x", "model": "laya-multilingual"}),+ ("alias_typed", {}, {"state": "x", "model": "typed"}),+ ("alias_typed_decisions", {}, {"state": "x", "model": "typed_decisions"}),+ ("alias_laya_typed_decisions", {}, {"state": "x", "model": "laya-typed-decisions"}),+ ("alias_decisions", {}, {"state": "x", "model": "decisions"}),+ ("alias_uppercase_ML", {}, {"state": "x", "model": "ML"}),+ ("alias_mixed_case_English", {}, {"state": "x", "model": "English"}),+ ("alias_via_task_typed_decisions_with_dash", {}, {"state": "x", "task": "typed-decisions"}),+ ("alias_via_task_typed_decisions_with_underscore", {}, {"state": "x", "task": "typed_decisions"}),++ # ---- decision payload shape (repo string, reason text, detection dict) ----+ ("payload_shape_hindi", {}, {"state": {"body": "मुझसे दो बार शुल्क लिया गया"}, "questions": Q_GENERIC}),+ ("payload_shape_armenian_non_latin_percent", {}, {"state": "Հայերեն abc"}),+ ("payload_shape_unidentified_latin_percent", {}, {"state": "Müşteriden iki kez ücret alındı ve para iadesi istiyor"}),+]+++# ============================================================================ email_probe++_DISCLAIMER_TEXT = "This email is confidential and intended solely for the named addressee."++EMAIL_CLEAN_CASES = [+ # ---- straight from tests/test_email.py ----+ ("inline_footer_no_blank_line", "My account is locked.\n%s\nPlease unlock it." % _DISCLAIMER_TEXT, 3000),+ ("inline_footer_no_terminal_punctuation", "My account is locked\n%s\nPlease unlock it." % _DISCLAIMER_TEXT, 3000),+ ("inline_footer_body_never_emptied", "My account is locked. %s" % _DISCLAIMER_TEXT, 3000),+ ("standalone_footer_paragraph_dropped", "My account is locked.\n\n%s" % _DISCLAIMER_TEXT, 3000),+ ("wrapped_standalone_footer_dropped",+ "My account is locked.\n\nThis email and any files transmitted with it are\n"+ "confidential and intended solely for the named addressee.", 3000),+ ("received_in_error_footer_dropped",+ "Please reopen ticket 4411.\n\nIf you have received this message in error, delete it.", 3000),+ ("quoted_history_removed", "Thanks for the update.\nOn Mon, Sep 20, Bob wrote:\n> original text", 3000),+ ("signature_block_removed", "Hi team,\nCan you confirm the refund?\nRegards,\nAlice", 3000),+ ("empty_body", "", 3000),++ # ---- quote header variants (each _QUOTE_HEADERS pattern) ----+ ("quote_header_on_wrote_long_name",+ "Please see below.\nOn Mon, Jan 5, 2026 at 3:00 PM, Bob Smith <[email protected]> wrote:\n> old text here", 3000),+ ("quote_header_original_message",+ "Approved.\n----- Original Message -----\nFrom: [email protected]\nSubject: Re: Invoice", 3000),+ ("quote_header_forwarded_message",+ "See below for context.\n---------- Forwarded Message ----------\nFrom: [email protected]", 3000),+ ("quote_header_underscores",+ "My reply is above.\n________________________________\nFrom: [email protected]", 3000),+ ("quote_header_from_line",+ "Confirmed, thanks.\nFrom: [email protected]\nSubject: Ticket 4411 update\nDate: today", 3000),+ ("quote_header_only_no_body_before_kept",+ "On Mon, Jan 5, 2026, Bob wrote:\n> quoted only, no lines before it to break on", 3000),+ ("quote_marker_gt_lines_stripped",+ "My reply.\n> quoted line one\n> quoted line two\nMore of my reply.", 3000),++ # ---- signature marker variants, at various positions ----+ ("signature_dash_dash", "Hi,\nPlease confirm.\n--\nAlice Smith\nSupport Team", 3000),+ ("signature_best_regards", "Hi,\nCan you confirm the refund?\nBest regards,\nAlice", 3000),+ ("signature_kind_regards", "Hi,\nCan you confirm the refund?\nKind regards,\nBob", 3000),+ ("signature_warm_regards", "Hi,\nCan you confirm the refund?\nWarm regards,\nCarol", 3000),+ ("signature_many_thanks", "Hi,\nCan you confirm the refund?\nMany thanks,\nDave", 3000),+ ("signature_thanks", "Hi,\nCan you confirm the refund?\nThanks,\nEve", 3000),+ ("signature_thank_you", "Hi,\nCan you confirm the refund?\nThank you,\nFrank", 3000),+ ("signature_cheers", "Hi,\nCan you confirm the refund?\nCheers,\nGrace", 3000),+ ("signature_sincerely", "Hi,\nCan you confirm the refund?\nSincerely,\nHeidi", 3000),+ ("signature_sent_from_iphone", "On the go, will follow up later.\nSent from my iPhone", 3000),+ ("signature_sent_from_android", "Quick reply here.\nSent from my Android", 3000),+ ("signature_too_early_kept_as_body",+ # A "Thanks," line inside the first 60% of a short body is not treated as a signature+ # cutoff by the search window (range starts at max(1, int(len(lines)*0.6), len(lines)-8)));+ # this pins that boundary behaviour rather than assuming it.+ "Thanks,\nfor looking into this.\nMy account is still locked after the reset.\n"+ "Please escalate this to the on-call engineer today.\nRegards,\nIvan", 3000),++ # ---- disclaimers inside and across paragraphs ----+ ("disclaimer_mid_paragraph_request_survives",+ "My account is locked.\n%s\nPlease unlock it." % _DISCLAIMER_TEXT, 3000),+ ("disclaimer_two_sentences_only_boilerplate_dropped",+ "My account is locked. %s Please help urgently." % _DISCLAIMER_TEXT, 3000),+ ("disclaimer_across_two_paragraphs_only_its_own_paragraph_affected",+ "Please reopen ticket 4411 as soon as you can.\n\n"+ "This email and any attachments are confidential and intended solely for the addressee.\n\n"+ "If you have received this message in error, please delete it.\n\n"+ "Let me know once it is done.", 3000),+ ("disclaimer_received_in_error_variant_2",+ "Approve the refund please.\n\nIf you received this e-mail in error, notify the sender immediately.", 3000),++ # ---- CRLF and literal backslash-n ----+ ("crlf_line_endings", "My account is locked.\r\nPlease unlock it.\r\nRegards,\r\nAlice", 3000),+ ("crlf_with_quote_header", "Thanks for the update.\r\nOn Mon, Sep 20, Bob wrote:\r\n> original text", 3000),+ ("literal_backslash_n_becomes_newline",+ "My account is locked.\\nPlease unlock it.\\nRegards,\\nAlice", 3000),+ ("literal_backslash_n_with_disclaimer",+ "My account is locked.\\n%s\\nPlease unlock it." % _DISCLAIMER_TEXT, 3000),+ ("mixed_real_and_literal_newlines",+ "Line one.\nLine two.\\nLine three (literal escape).\nLine four.", 3000),++ # ---- Unicode whitespace: `[ \\t]+` in clean_email_body only collapses ASCII space/tab, not+ # general Unicode whitespace; `.strip()` on paragraphs strips all Unicode whitespace ----+ ("unicode_nbsp_not_collapsed",+ "My account is locked.\nPlease unlock it.", 3000),+ ("unicode_em_space_and_ideographic_space",+ "My account is locked.\nPlease unlock it.", 3000),+ ("unicode_whitespace_leading_trailing_stripped",+ " My account is locked. \n Please unlock it. ", 3000),+ ("unicode_zero_width_space_kept",+ "Myaccount is locked.\nPleaseunlock it.", 3000),++ # ---- max_chars variants (default 3000, and non-default) ----+ ("max_chars_tiny_cuts_mid_word", "Please refund the duplicate charge on invoice 4411 today.", 10),+ ("max_chars_default_no_truncation_needed", "Short message that fits easily.", 3000),+ ("max_chars_large_no_op", "Please refund the duplicate charge on invoice 4411 today.", 100000),+ ("max_chars_exact_boundary",+ "0123456789" * 5, 50), # exactly 50 chars input, max_chars=50 -> no truncation+ ("max_chars_one_over_boundary",+ "0123456789" * 5 + "X", 50), # 51 chars, max_chars=50 -> drop last char++ # ---- long, multi-paragraph, everything at once (kitchen sink) ----+ ("kitchen_sink_quote_signature_disclaimer",+ "Hi team,\n\n"+ "My account was charged twice for the Pro plan this month and the refund has not "+ "arrived yet. Could you please look into this today?\n\n"+ "Best regards,\n"+ "Priya Sharma\n"+ "Sent from my iPhone\n\n"+ "This email and any files transmitted with it are confidential and intended solely "+ "for the use of the individual or entity to whom they are addressed. If you have "+ "received this email in error please notify the sender.\n\n"+ "On Tue, Sep 22, 2026 at 9:14 AM, Support <[email protected]> wrote:\n"+ "> Hi Priya, thanks for reaching out, we are looking into it.\n"+ "> - Support Team\n", 3000),+]++EMAIL_STATE_CASES = [+ # (label, subject, body, sender, clean, extra)+ ("basic_clean_true", "Locked out", "My account is locked. %s" % _DISCLAIMER_TEXT, None, True, {}),+ ("basic_clean_false_keeps_raw_body", "Locked out", "My account is locked.\n%s" % _DISCLAIMER_TEXT, None, False, {}),+ ("with_sender", "Refund request", "Please refund invoice 4411.", "[email protected]", True, {}),+ ("subject_whitespace_stripped", " Refund request ", "Please help.", None, True, {}),+ ("extra_fields_kept_when_not_none", "Ticket", "Body text.", "[email protected]", True, {"priority": "high", "ticket_id": 4411}),+ ("extra_none_values_dropped", "Ticket", "Body text.", None, True, {"nullable": None, "kept": "value"}),+ ("empty_subject_and_body", "", "", None, True, {}),+ ("hindi_subject_and_body", "सहायता चाहिए", "मुझसे दो बार शुल्क लिया गया, कृपया रिफंड करें।", None, True, {}),+]+++# ============================================================================ shortlist_probe+#+# Each entry supplies a positional embedding matrix directly (query vector first, then one+# vector per criteria item in order) rather than a text-keyed table, so the golden dump needs+# no embedder at all: `embed_fn` for these cases is just "return this matrix, in this order",+# and the dump script asserts it is called with exactly `len(vectors)` texts when `vectors`+# is not None. A case with `vectors=None` asserts k >= n passthrough: embed_fn must not be+# called at all (checked by the dump script raising if it is).++SHORTLIST_CASES = [+ # ---- deterministic top-k, ties keep the earlier label ----+ {+ "label": "tie_cosine_keeps_earlier_label",+ "state": "pay me", "criteria": {"alpha": None, "beta": "", "gamma": "mid", "delta": "same"},+ "k": 2, "instructions": None,+ "vectors": [[1.0, 0.0], [1.0, 0.0], [0.0, 1.0], [0.6, 0.8], [1.0, 0.0]],+ },+ {+ "label": "k1_is_earliest_max",+ "state": "pay me", "criteria": {"alpha": None, "beta": "", "gamma": "mid", "delta": "same"},+ "k": 1, "instructions": None,+ "vectors": [[1.0, 0.0], [1.0, 0.0], [0.0, 1.0], [0.6, 0.8], [1.0, 0.0]],+ },+ {+ "label": "k3_appends_next_cosine",+ "state": "pay me", "criteria": {"alpha": None, "beta": "", "gamma": "mid", "delta": "same"},+ "k": 3, "instructions": None,+ "vectors": [[1.0, 0.0], [1.0, 0.0], [0.0, 1.0], [0.6, 0.8], [1.0, 0.0]],+ },+ # ---- zero query vector: every cosine is 0, earliest labels win ----+ {+ "label": "zero_query_keeps_original_order",+ "state": "pay me", "criteria": {"alpha": None, "beta": "", "gamma": "mid", "delta": "same"},+ "k": 2, "instructions": None,+ "vectors": [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [0.6, 0.8], [3.0, 4.0]],+ },+ # ---- zero option vector loses to a real match ----+ {+ "label": "zero_option_vector_loses",+ "state": "pay me", "criteria": {"alpha": None, "beta": None, "gamma": None},+ "k": 2, "instructions": None,+ "vectors": [[1.0, 0.0], [0.0, 0.0], [1.0, 0.0], [0.0, 1.0]],+ },+ # ---- NaN / inf: non-finite embeddings become 0 (np.nan_to_num), so they never outrank a+ # finite match, but inf-vs-inf or nan-vs-nan still tie at 0 and fall back to order ----+ {+ "label": "nan_vector_sorts_behind_finite_match",+ "state": "pay me", "criteria": {"alpha": None, "beta": None},+ "k": 1, "instructions": None,+ "vectors": [[1.0, 0.0], [float("nan"), float("nan")], [1.0, 0.0]],+ },+ {+ "label": "positive_inf_and_negative_inf_both_zeroed",+ "state": "pay me", "criteria": {"alpha": None, "beta": None, "gamma": None},+ "k": 2, "instructions": None,+ "vectors": [[1.0, 0.0], [float("inf"), float("inf")], [float("-inf"), 0.0], [1.0, 0.0]],+ },+ {+ # nan_to_num zeroes only the NaN component, not the whole vector: [nan, 1.0] becomes+ # [0.0, 1.0], a real unit vector, so this is NOT the same as a zero query -- it still+ # picks a winner (beta) rather than falling back to insertion order.+ "label": "nan_component_in_query_only_zeroes_that_component",+ "state": "pay me", "criteria": {"alpha": None, "beta": None},+ "k": 1, "instructions": None,+ "vectors": [[float("nan"), 1.0], [1.0, 0.0], [0.0, 1.0]],+ },+ {+ # Every component of the query is NaN, so nan_to_num zeroes the whole vector: this IS+ # a true zero query, and falls back to insertion order like zero_query_keeps_original_order.+ "label": "fully_nan_query_falls_back_to_order",+ "state": "pay me", "criteria": {"alpha": None, "beta": None},+ "k": 1, "instructions": None,+ "vectors": [[float("nan"), float("nan")], [1.0, 0.0], [0.0, 1.0]],+ },+ # ---- k >= n passthrough: embed_fn must not be called ----+ {+ "label": "k_equals_n_passthrough",+ "state": "pay me", "criteria": {"alpha": None, "beta": "", "gamma": "mid", "delta": "same"},+ "k": 4, "instructions": None, "vectors": None,+ },+ {+ "label": "k_greater_than_n_passthrough",+ "state": "pay me", "criteria": {"alpha": None, "beta": "", "gamma": "mid", "delta": "same"},+ "k": 20, "instructions": None, "vectors": None,+ },+ {+ "label": "k_equals_n_single_option_passthrough",+ "state": "pay me", "criteria": {"solo": "the only choice"},+ "k": 1, "instructions": None, "vectors": None,+ },+ # ---- list criteria (positional labels, value=None each) ----+ {+ "label": "list_criteria_topk",+ "state": "pay me", "criteria": ["alpha", "beta", "gamma"],+ "k": 2, "instructions": "Classify",+ "vectors": [[0.0, 1.0], [1.0, 0.0], [0.0, 1.0], [0.0, 0.2]],+ },+ {+ "label": "list_criteria_passthrough",+ "state": "hello", "criteria": ["alpha", "beta", "gamma"],+ "k": 5, "instructions": "Which?", "vectors": None,+ },+ # ---- dict state serialisation through query text (informational only: matrix is positional) ----+ {+ "label": "dict_state_query",+ "state": {"text": "hi"}, "criteria": ["alpha", "beta"],+ "k": 1, "instructions": "Classify",+ "vectors": [[1.0, 0.0], [1.0, 0.0], [0.0, 1.0]],+ },+ # ---- 0 and False are real criterion values (not "no description") ----+ {+ "label": "zero_and_false_criteria_values",+ "state": "pay me", "criteria": {"zero": 0, "no": False, "bare": None, "named": {"desc": "payments"}},+ "k": 4, "instructions": None, "vectors": None, # k == n -> passthrough, but exercises render text+ },+ {+ "label": "zero_and_false_criteria_ranked",+ "state": "pay me", "criteria": {"zero": 0, "no": False, "bare": None, "named": {"desc": "payments"}},+ "k": 2, "instructions": None,+ "vectors": [[1.0, 0.0], [1.0, 0.0], [0.0, 1.0], [0.9, 0.1], [0.0, 1.0]],+ },+ # ---- non-string instructions: dict / list / number, run through json.dumps(ensure_ascii=False) ----+ {+ "label": "dict_instructions",+ "state": "pay me", "criteria": {"alpha": None, "beta": None},+ "k": 1, "instructions": {"task": "route", "hint": "Müller & co <urgent>"},+ "vectors": [[1.0, 0.0], [1.0, 0.0], [0.0, 1.0]],+ },+ {+ "label": "list_instructions",+ "state": "pay me", "criteria": {"alpha": None, "beta": None},+ "k": 1, "instructions": ["step one", "step two", 3],+ "vectors": [[0.0, 1.0], [0.0, 1.0], [1.0, 0.0]],+ },+ {+ "label": "numeric_instructions",+ "state": "pay me", "criteria": {"alpha": None, "beta": None},+ "k": 1, "instructions": 42,+ "vectors": [[1.0, 0.0], [1.0, 0.0], [0.0, 1.0]],+ },+ {+ "label": "empty_string_instructions_same_as_none",+ "state": "pay me", "criteria": {"alpha": None, "beta": None},+ "k": 1, "instructions": "",+ "vectors": [[1.0, 0.0], [1.0, 0.0], [0.0, 1.0]],+ },+ # ---- many options, mid-range k (mirrors the checkpoint end-to-end case's shape at n=40) ----+ {+ "label": "many_options_k5_of_10",+ "state": "I need help exporting invoices to a spreadsheet",+ "criteria": {"topic_%02d" % i: "detailed description number %d for this support topic" % i for i in range(10)},+ "k": 5, "instructions": "Pick the single best matching category.",+ "vectors": [[1.0, 0.0]] + [[float(i % 3), float((i + 1) % 3)] for i in range(10)],+ },+]+++# ============================================================================ sample inputs+#+# Single source of truth for the combined routing sample (Laya.Routing / laya-routing), so+# both languages' samples read the same fixed content and their stdout can be diffed.++# Section 1: ~8 detection states (English, accent-stripped Spanish, French, Romanian, Hindi,+# Arabic, Japanese, a dict state).+SAMPLE_DETECTION_STATES = [+ ("english", "The customer was charged twice this month and wants a refund."),+ ("spanish_accent_stripped", "El cliente fue cobrado dos veces y quiere que le devuelvan el dinero"),+ ("french", "Le client a été facturé deux fois et demande un remboursement."),+ ("romanian", "Am fost taxat de două ori pentru factura din luna martie și vreau banii"),+ ("hindi", "ग्राहक से दो बार शुल्क लिया गया और वह धनवापसी चाहता है।"),+ ("arabic", "تم خصم المبلغ مرتين من العميل ويريد استرداد الأموال"),+ ("japanese", "お客様は二重に請求されたため返金を希望しています。"),+ ("dict_state", {"subject": "Double charge", "body": "मुझसे दो बार शुल्क लिया गया"}),+]++# Section 2: routing-decision examples, including explicit model/lang and opt-in workflow+# detection, with no engine loaded (Route only).+SAMPLE_ROUTING_DECISIONS = [+ ("auto_english", {}, {"state": "Please refund the duplicate charge on invoice 4411 today."}),+ ("auto_hindi", {}, {"state": "मुझसे दो बार शुल्क लिया गया, कृपया रिफंड करें।"}),+ ("auto_unknown_latin_romanian", {}, {"state": "Gătește-mi o rețetă de sarmale de post pentru mâine."}),+ ("explicit_model_multilingual", {}, {"state": "anything at all", "model": "multilingual"}),+ ("explicit_lang_de", {}, {"state": "hello there", "lang": "de"}),+ ("workflow_opt_in_customer_service", {"auto_task_detection": True},+ {"state": {"body": "I was charged twice"},+ "questions": _td_questions(_TD_IDS["customer_service"])}),+ ("workflow_opt_in_off_by_default", {},+ {"state": {"body": "I was charged twice"},+ "questions": _td_questions(_TD_IDS["customer_service"])}),+]++# Section 3: an English and a Hindi support email, same support questions, run through+# Router.predict (engine loaded, MaxLoaded=2).+SAMPLE_SUPPORT_QUESTIONS = {+ "department": {+ "type": "choice",+ "instructions": "Which department should handle this request?",+ "criteria": {+ "billing": "invoices, payments, refunds",+ "technical": "bugs, outages, system errors",+ "sales": "pricing, new contracts",+ "other": "everything else",+ },+ },+ "urgency": {+ "type": "score",+ "instructions": "How urgent is this request?",+ "criteria": ["not urgent", "soon", "critical deadline or blocking issue"],+ },+ "churn_risk": {+ "type": "noul",+ "instructions": "Does the user threaten to cancel or leave?",+ },+ "refund_requested": {+ "type": "noul",+ "instructions": "Does the user explicitly request a refund?",+ },+}++SAMPLE_SUPPORT_EMAIL_EN = {+ "from": "[email protected]",+ "subject": "Duplicate charge on invoice #4411",+ "body": "Hi, we were billed twice for March. Please refund the duplicate today "+ "or we will cancel our plan.",+}++# Written as escapes deliberately (see laya-dotnet/tools/sample_cases.py's note on the same pitfall): a+# hand-retyped Devanagari string is an easy place to silently swap one similar-looking+# character for another and produce a "parity bug" that is really a transcription error.+SAMPLE_SUPPORT_EMAIL_HI = {+ "from": "[email protected]",+ "subject": "चालान में दोहरा "+ "शुल्क",+ "body": "मार्च का बिल "+ "दो बार लिया गया, "+ "कृपया रिफंड करें।",+}++# Section 4: a raw email with quoted history, signature and disclaimer, run through+# LayaEmail.CleanBody -> LayaEmail.State -> LayaPresets.Email() through the router.+SAMPLE_RAW_EMAIL_SUBJECT = "Re: Refund for invoice 4411"+SAMPLE_RAW_EMAIL_SENDER = "[email protected]"+SAMPLE_RAW_EMAIL_BODY = (+ "Hi team,\n\n"+ "I was charged twice for the Pro plan this month and the second charge still has "+ "not been refunded. This is the third time I have written about it -- please "+ "resolve this today or I will need to cancel the account.\n\n"+ "Best regards,\n"+ "Priya Sharma\n"+ "Sent from my iPhone\n\n"+ "This email and any files transmitted with it are confidential and intended "+ "solely for the use of the individual or entity to whom they are addressed. If "+ "you have received this email in error please notify the sender.\n\n"+ "On Tue, Sep 22, 2026 at 9:14 AM, Support <[email protected]> wrote:\n"+ "> Hi Priya, thanks for reaching out, we are looking into it.\n"+ "> - Support Team\n"+)++# Section 5: a 40-intent banking choice question through LayaShortlist.Predict with the+# hashing embedder (demo only).+SAMPLE_BANKING_STATE = "I tried to withdraw cash from the ATM but it kept the card and gave me no money."+SAMPLE_BANKING_INSTRUCTIONS = "What is the customer's banking intent?"+SAMPLE_BANKING_CRITERIA = {+ "activate_my_card": "turn on a newly received card",+ "age_limit": "minimum or maximum age to use the service",+ "apple_pay_or_google_pay": "adding the card to a mobile wallet",+ "atm_support": "which ATMs the card works at",+ "automatic_top_up": "automatically topping up the balance",+ "balance_not_updated_after_bank_transfer": "a bank transfer is missing from the balance",+ "balance_not_updated_after_cheque_or_cash_deposit": "a deposit is missing from the balance",+ "beneficiary_not_allowed": "cannot add a payment recipient",+ "cancel_transfer": "wants to cancel a transfer already sent",+ "card_about_to_expire": "the card is close to its expiry date",+ "card_acceptance": "where the card is accepted",+ "card_arrival": "asking when a new card will arrive",+ "card_delivery_estimate": "asking how long delivery will take",+ "card_linking": "linking a card to the account",+ "card_not_working": "the card is declined or not working",+ "card_payment_fee_charged": "an unexpected fee was charged on a card payment",+ "card_payment_not_recognised": "a card payment the customer does not recognise",+ "card_payment_wrong_exchange_rate": "the exchange rate used was wrong",+ "card_swallowed": "the ATM kept the card",+ "cash_withdrawal_charge": "an unexpected charge for a cash withdrawal",+ "cash_withdrawal_not_recognised": "a cash withdrawal the customer does not recognise",+ "change_pin": "wants to change the PIN",+ "compromised_card": "the card may have been compromised",+ "contactless_not_working": "contactless payment is not working",+ "country_support": "which countries the service supports",+ "declined_card_payment": "a card payment was declined",+ "declined_cash_withdrawal": "a cash withdrawal was declined",+ "declined_transfer": "a transfer was declined",+ "direct_debit_payment_not_recognised": "a direct debit the customer does not recognise",+ "disposable_card_limits": "limits on a disposable virtual card",+ "edit_personal_details": "wants to edit name, address or other personal details",+ "exchange_charge": "a fee charged for currency exchange",+ "exchange_rate": "asking what the current exchange rate is",+ "exchange_via_app": "exchanging currency inside the app",+ "extra_charge_on_statement": "an unexplained extra charge on the statement",+ "failed_transfer": "a transfer failed",+ "fiat_currency_support": "which regular currencies are supported",+ "get_disposable_virtual_card": "wants a disposable virtual card",+ "get_physical_card": "wants a physical card",+ "getting_spare_card": "wants a spare or backup card",+}