formal-ai 0.182.0

Formal symbolic AI implementation with OpenAI-compatible APIs
Documentation
// @generated by `cargo run -p formal-ai --example issue_386_gen_arith_table`.
// DO NOT EDIT BY HAND. Edit the cardinal/operator meanings in
// data/seed/meanings-units.lino and data/seed/meanings-calculator.lino,
// then regenerate. Parity with the live seed is enforced by the
// `arithmetic_word_tables_match_seed` test in src/calculation.rs.
//
// These tables drive `normalize_expression` in src/arithmetic.rs, which is
// compiled into the wasm worker and so must stay no_std + alloc only.

// Single-word surfaces, mapped to the value surface of their meaning (a
// spelled digit or operator word to its numeral/symbol). Applied after the
// expression is split on whitespace. Sorted by surface for a stable diff.
pub(crate) static WORD_VALUE_TOKENS: &[(&str, &str)] = &[
    ("eight", "8"),
    ("five", "5"),
    ("four", "4"),
    ("minus", "-"),
    ("mod", "%"),
    ("modulo", "%"),
    ("nine", "9"),
    ("one", "1"),
    ("plus", "+"),
    ("seven", "7"),
    ("six", "6"),
    ("ten", "10"),
    ("three", "3"),
    ("times", "*"),
    ("two", "2"),
    ("zero", "0"),
    ("восемь", "8"),
    ("два", "2"),
    ("две", "2"),
    ("девять", "9"),
    ("десять", "10"),
    ("минус", "-"),
    ("ноль", "0"),
    ("нуль", "0"),
    ("один", "1"),
    ("одна", "1"),
    ("одно", "1"),
    ("плюс", "+"),
    ("пять", "5"),
    ("семь", "7"),
    ("три", "3"),
    ("умножить", "*"),
    ("умножь", "*"),
    ("четыре", "4"),
    ("шесть", "6"),
    ("आठ", "8"),
    ("एक", "1"),
    ("\u{941}णा", "*"),
    ("घटा", "-"),
    ("चार", "4"),
    ("छह", "6"),
    ("जोड\u{93c}", "+"),
    ("तीन", "3"),
    ("दस", "10"),
    ("दो", "2"),
    ("नौ", "9"),
    ("पा\u{901}", "5"),
    ("भाग", "/"),
    ("मॉड\u{94d}\u{942}लो", "%"),
    ("\u{942}\u{94d}", "0"),
    ("सात", "7"),
    ("", "1"),
    ("", "7"),
    ("", "3"),
    ("乘以", "*"),
    ("", "9"),
    ("", "2"),
    ("", "5"),
    ("", "8"),
    ("", "6"),
    ("减去", "-"),
    ("加上", "+"),
    ("", "10"),
    ("取模", "%"),
    ("", "4"),
    ("除以", "/"),
    ("", "0"),
];

// Multi-word operator phrases, mapped to their operator symbol and applied
// before tokenization. Longest first so a phrase is rewritten before any
// shorter phrase it contains ("разделить на" before "делить на").
pub(crate) static WORD_VALUE_PHRASES: &[(&str, &str)] = &[
    ("multiplied by", "*"),
    ("разделить на", "/"),
    ("умножить на", "*"),
    ("divided by", "/"),
    ("делить на", "/"),
    ("по модулю", "%"),
];