// Universal solver implementation for the demo worker.
//
// Every reasoning path here mirrors the Rust `FormalAiEngine` in
// `src/solver.rs` so the website, CLI, Telegram bot, library, and HTTP server
// all produce the same answers for the same prompts. The answer the user
// sees is always a projection of an append-only event log — there is no
// hardcoded prompt→answer table.
//
// All multilingual phrases, concept summaries, and the tool registry are
// loaded from `seed/*.lino` files at startup via `seed_loader.js`. Editing a
// `.lino` file is enough to retune the agent — no JavaScript change required.
function currentAssetVersion() {
try {
const search = self.location && self.location.search;
const match = search && /[?&]v=([^&]+)/.exec(search);
return match ? decodeURIComponent(match[1].replace(/\+/g, " ")) : "";
} catch (_error) {
return "";
}
}
function withAssetVersion(url) {
const version = currentAssetVersion();
if (!version) return url;
return `${url}${url.includes("?") ? "&" : "?"}v=${encodeURIComponent(
version,
)}`;
}
try {
importScripts(withAssetVersion("seed_loader.js"));
} catch (_error) {
// Seed loader is optional: tests that mock the worker may exclude it.
}
let wasm;
let mode = "wasm worker";
// Hard-coded fallbacks. These are only used if `seed/*.lino` fails to load,
// e.g. when the worker runs from a `file://` URL. The shipped GitHub Pages
// build always fetches the seed successfully.
const FALLBACK_IDENTITY_ANSWER =
"I am formal-ai, a deterministic symbolic AI implementation that answers from local Links Notation rules and OpenAI-compatible API shapes. I do not perform neural inference in this demo.";
const FALLBACK_ASSISTANT_NAME_ANSWER =
"I'm formal AI, and currently I don't have a name. But you can name me as you like.";
const FALLBACK_GREETING_ANSWER = "Hi, how may I help you?";
const FALLBACK_TEST_STATUS_ANSWER = "Test passed. I'm here.";
const FALLBACK_COURTESY_RESPONSE_ANSWER =
"Glad to hear it. What would you like to do next?";
const FALLBACK_COURTESY_ACKNOWLEDGEMENTS = [
"Glad to hear it.",
"You're welcome.",
];
const FALLBACK_COURTESY_FOLLOW_UPS = [
"What would you like to do next?",
"Do you want to discuss something else?",
];
const FALLBACK_UNKNOWN_ANSWER =
"I don't know how to answer that yet. I cannot answer that from local links rules yet. To inspect what I can do, send `List behavior rules`, then `Show behavior rule unknown`. To teach this dialog a response, send: When I say `your prompt`, answer `your answer`. If this still needs a shared Links Notation seed fact or links rule after those checks, use Report issue with the reasoning trace, or export memory to keep a dialog-local rule durable.";
const FALLBACK_CLARIFICATION_ANSWER =
"I'm sorry for the confusion. I am formal-ai, a deterministic symbolic AI. I can answer greetings, identity questions, concept lookups (what is X?), arithmetic, and parameterized program templates. If you'd like to ask about something specific, try one of those or add a fact in Links Notation.";
// Mutable runtime tables — populated from seed at init(). Each entry is
// `{ text, variants }` so the worker can return either the canonical phrase
// (for deterministic tests and tool calls) or a random variant (for greeting
// randomisation introduced in issue #27). Courtesy responses can also carry
// separated acknowledgement and follow-up fragments for issue #160.
let MULTILINGUAL_ANSWERS = {
greeting: {
en: { text: FALLBACK_GREETING_ANSWER, variants: [FALLBACK_GREETING_ANSWER] },
},
farewell: {
en: { text: "Goodbye! Feel free to return any time.", variants: ["Goodbye! Feel free to return any time."] },
},
test_status: {
en: { text: FALLBACK_TEST_STATUS_ANSWER, variants: [FALLBACK_TEST_STATUS_ANSWER] },
},
courtesy_response: {
en: {
text: FALLBACK_COURTESY_RESPONSE_ANSWER,
variants: [FALLBACK_COURTESY_RESPONSE_ANSWER],
acknowledgements: FALLBACK_COURTESY_ACKNOWLEDGEMENTS,
followUps: FALLBACK_COURTESY_FOLLOW_UPS,
},
},
identity: {
en: { text: FALLBACK_IDENTITY_ANSWER, variants: [FALLBACK_IDENTITY_ANSWER] },
},
assistant_name: {
en: {
text: FALLBACK_ASSISTANT_NAME_ANSWER,
variants: [FALLBACK_ASSISTANT_NAME_ANSWER],
},
},
clarification: {
en: {
text: FALLBACK_CLARIFICATION_ANSWER,
variants: [FALLBACK_CLARIFICATION_ANSWER],
},
},
unknown: {
en: { text: FALLBACK_UNKNOWN_ANSWER, variants: [FALLBACK_UNKNOWN_ANSWER] },
},
};
let CONCEPTS = [];
let CONCEPT_CONTEXTS = [];
let FACTS = [];
let PROJECTS = [];
let BRAINSTORM_SEEDS = {
triggers: [
"brainstorm",
"give me five ideas",
"give me 5 ideas",
"give me ten ideas",
"give me 10 ideas",
"suggest five",
"suggest 5",
"suggest ten",
"suggest 10",
],
categories: [
{
slug: "project_ideas",
intent: "brainstorm_project_ideas",
detectionKeywords: [],
items: [
"A local Links Notation notebook with searchable traces.",
"A deterministic code-review checklist generator.",
"A multilingual prompt-variation test corpus.",
"A CLI that converts issue requirements into traceable tests.",
"A source-cache inspector for reproducible agent runs.",
"A changelog-fragment consistency checker.",
"A prompt-matrix generator for four-language smoke tests.",
"A Wikidata anchor verifier for local seed records.",
"A trace viewer that groups events by solver phase.",
"A small offline issue-to-test planning tool.",
],
},
],
};
let PERSONA_SEEDS = {
triggers: ["pretend you are", "act as", "roleplay", "explain like you are"],
defaultPersona: "requested persona",
bodyTemplate:
"Roleplay frame recorded for <persona>. I will keep the persona explicit and factual: <body>",
fallbackBody:
"relativity says measurements of space and time depend on the observer's motion, while the laws of physics stay consistent.",
personas: [
{ displayName: "Albert Einstein", aliases: ["einstein"], wikidata: "Q937" },
{ displayName: "Ada Lovelace", aliases: ["ada lovelace"], wikidata: "Q7259" },
{ displayName: "teacher", aliases: ["teacher"], wikidata: "" },
],
topics: [
{
slug: "algorithm",
detectionKeywords: ["algorithm", "algorithms"],
body:
"an algorithm is a precise sequence of steps, so a reliable explanation names the inputs, the ordered operations, and the expected result.",
},
{
slug: "time_dilation",
detectionKeywords: ["time dilation"],
body:
"time dilation means clocks can measure different elapsed times when observers move differently or sit in different gravitational fields.",
},
],
};
let TOOLS = [];
let SEED_RAW = {};
let AGENT_INFO = {};
let LANGUAGE_RULES = [
{ language: "ru", start: 0x0400, end: 0x04ff },
{ language: "hi", start: 0x0900, end: 0x097f },
{ language: "zh", start: 0x4e00, end: 0x9fff },
];
let PROMPT_PATTERNS = [];
// Intent routing rules loaded from `seed/intent-routing.lino` at init time.
// `intents` mirror `seed::IntentRoute` from the Rust crate, so the browser
// and the Rust solver behave identically when classifying prompts. The
// fallback below mirrors the contents of `data/seed/intent-routing.lino`
// so the worker remains functional even when the `.lino` fetch fails (for
// example when the demo is opened from `file://`).
let INTENT_ROUTING = {
intents: [
{
id: "intent_greeting",
slug: "greeting",
responseLink: "response:greeting",
keywords: [
"hi",
"hello",
"hey",
"привет",
"здравствуйте",
"шалом",
"नमस्ते",
"नमस्कार",
"सलाम",
"हाय",
"你好",
"您好",
"嗨",
"哈喽",
],
phrases: [
"how are you",
"how are you doing",
"how do you do",
"how is it going",
"how s it going",
"how are things",
"шабат шалом",
"как дела",
"как твои дела",
"как ваши дела",
"как у тебя дела",
"как у вас дела",
"привет как дела",
"здравствуйте как ваши дела",
"как поживаешь",
"как вы поживаете",
"राम राम",
"कैसे हो",
"आप कैसे हैं",
"तुम कैसे हो",
"क्या हाल है",
"आपका क्या हाल है",
"सब कैसा चल रहा है",
"早上好",
"早安",
"你好吗",
"你还好吗",
"你怎么样",
"您怎么样",
"最近怎么样",
"过得怎么样",
],
tokens: ["greet"],
combos: [],
},
{
id: "intent_farewell",
slug: "farewell",
responseLink: "response:farewell",
keywords: [
"bye",
"goodbye",
"пока",
"ciao",
"tschüss",
"再见",
"拜拜",
"回见",
"अलविदा",
"विदा",
"बाय",
"टाटा",
],
phrases: ["до свидания", "досвидания", "改天见", "后会有期", "फिर मिलेंगे"],
tokens: [],
combos: [],
},
{
id: "intent_courtesy_response",
slug: "courtesy_response",
responseLink: "response:courtesy_response",
keywords: ["thanks", "спасибо", "благодарю", "धन्यवाद", "शुक्रिया", "谢谢"],
phrases: [
"thank you",
"i am fine thank you",
"i am fine thanks",
"i m fine thank you",
"i m fine thanks",
"i am good thank you",
"i am good thanks",
"i m good thank you",
"i m good thanks",
"fine thank you",
"fine thanks",
"good thank you",
"good thanks",
"doing well thank you",
"doing well thanks",
"у меня все хорошо спасибо",
"у меня всё хорошо спасибо",
"все хорошо спасибо",
"всё хорошо спасибо",
"хорошо спасибо",
"нормально спасибо",
"ого чето начал соображать",
"ого чёто начал соображать",
"ого чё то начал соображать",
"ого что то начал соображать",
"मैं ठीक हूँ धन्यवाद",
"ठीक हूँ धन्यवाद",
"मैं अच्छा हूँ धन्यवाद",
"我很好谢谢",
"我很好 谢谢",
"好的谢谢",
"好的 谢谢",
],
tokens: [],
combos: [],
},
{
id: "intent_test_status",
slug: "test_status",
responseLink: "response:test_status",
keywords: [
"test",
"ping",
"pong",
"testing",
"тест",
"пинг",
"टेस्ट",
"परीक्षण",
"测试",
"測試",
],
phrases: [
"test passed",
"testing 123",
"are you there",
"you there",
"i m here",
"i am here",
"я здесь",
"тест пройден",
"ты здесь",
"вы здесь",
"परीक्षण सफल रहा",
"मैं यहाँ हूँ",
"मैं यहां हूं",
"क्या आप वहाँ हैं",
"क्या आप वहां हैं",
"测试通过",
"測試通過",
"我在这里",
"我在這裡",
"你在吗",
"您在吗",
"你在嗎",
"您在嗎",
],
tokens: [],
combos: [
["test", "passed"],
["test", "here"],
["testing", "123"],
["ping", "test"],
["тест", "пройден"],
["тест", "здесь"],
["परीक्षण", "सफल"],
],
},
{
id: "intent_assistant_name",
slug: "assistant_name",
responseLink: "response:assistant_name",
keywords: [],
phrases: [
"what is your name",
"what s your name",
"what's your name",
"do you have a name",
"what should i call you",
"как твое имя",
"как твоё имя",
"как тебя зовут",
"у тебя есть имя",
"आपका नाम क्या है",
"तुम्हारा नाम क्या है",
"你叫什么名字",
"您叫什么名字",
"你的名字是什么",
"你有名字吗",
],
tokens: [],
combos: [
["what", "your", "name"],
["you", "have", "name"],
["call", "you"],
["как", "тебя", "зовут"],
],
},
{
id: "intent_identity",
slug: "identity",
responseLink: "response:identity",
keywords: [],
phrases: [
"who are you",
"what are you",
"who is formal ai",
"what is formal ai",
"who is formalai",
"what is formalai",
"tell me about yourself",
"introduce yourself",
"let s get acquainted",
"lets get acquainted",
"let us get acquainted",
"let s get to know each other",
"кто ты",
"что ты",
"расскажи о себе",
"расскажи мне о себе",
"расскажи про себя",
"опиши себя",
"представься",
"давай знакомиться",
"давай познакомимся",
"давайте познакомимся",
"तुम कौन हो",
"तू कौन है",
"आप कौन हैं",
"अपना परिचय दो",
"अपने बारे में बताओ",
"चलो परिचय करते हैं",
"आइए परिचय करें",
"चलो एक दूसरे को जानें",
"你是谁",
"您是谁",
"你是什么",
"介绍一下你自己",
"告诉我你自己",
"你是誰",
"我们认识一下吧",
"认识一下吧",
"让我们认识一下",
],
tokens: [],
combos: [
["who", "you"],
["what", "you"],
["tell", "yourself"],
["introduce", "yourself"],
["let", "s", "acquainted"],
["lets", "acquainted"],
["let", "us", "acquainted"],
["know", "each", "other"],
["кто", "ты"],
["что", "ты"],
["расскажи", "себе"],
["опиши", "себя"],
["давай", "знакомиться"],
["давай", "познакомимся"],
["давайте", "познакомимся"],
["चलो", "परिचय"],
["आइए", "परिचय"],
["who", "formal", "ai"],
["what", "formal", "ai"],
],
},
],
articlePrefixes: ["the ", "a ", "an "],
tracePrefixes: ["answer_", "trace_"],
};
function fallbackEntry(intent) {
if (intent === "greeting") {
return { text: FALLBACK_GREETING_ANSWER, variants: [FALLBACK_GREETING_ANSWER] };
}
if (intent === "courtesy_response") {
return {
text: FALLBACK_COURTESY_RESPONSE_ANSWER,
variants: [FALLBACK_COURTESY_RESPONSE_ANSWER],
acknowledgements: FALLBACK_COURTESY_ACKNOWLEDGEMENTS,
followUps: FALLBACK_COURTESY_FOLLOW_UPS,
};
}
if (intent === "identity") {
return { text: FALLBACK_IDENTITY_ANSWER, variants: [FALLBACK_IDENTITY_ANSWER] };
}
if (intent === "assistant_name") {
return {
text: FALLBACK_ASSISTANT_NAME_ANSWER,
variants: [FALLBACK_ASSISTANT_NAME_ANSWER],
};
}
if (intent === "test_status") {
return { text: FALLBACK_TEST_STATUS_ANSWER, variants: [FALLBACK_TEST_STATUS_ANSWER] };
}
if (intent === "clarification") {
return {
text: FALLBACK_CLARIFICATION_ANSWER,
variants: [FALLBACK_CLARIFICATION_ANSWER],
};
}
return { text: FALLBACK_UNKNOWN_ANSWER, variants: [FALLBACK_UNKNOWN_ANSWER] };
}
function normalizeEntry(value, intent) {
if (value && typeof value === "object" && typeof value.text === "string") {
const variants =
Array.isArray(value.variants) && value.variants.length > 0
? value.variants
: [value.text];
const acknowledgements = Array.isArray(value.acknowledgements)
? value.acknowledgements.filter(Boolean)
: [];
const followUps = Array.isArray(value.followUps)
? value.followUps.filter(Boolean)
: [];
return {
text: value.text,
variants: variants,
acknowledgements: acknowledgements,
followUps: followUps,
};
}
if (typeof value === "string") {
return {
text: value,
variants: [value],
acknowledgements: [],
followUps: [],
};
}
return fallbackEntry(intent);
}
function responseEntryFor(intent, language) {
const table = MULTILINGUAL_ANSWERS[intent] || {};
const raw = table[language] || table.en || fallbackEntry(intent);
return normalizeEntry(raw, intent);
}
function answerFor(intent, language, options) {
const opts = options || {};
const entry = responseEntryFor(intent, language);
if (opts.randomize && Array.isArray(entry.variants) && entry.variants.length > 1) {
const idx = Math.floor(Math.random() * entry.variants.length);
return entry.variants[idx] || entry.text;
}
return entry.text;
}
function normalizeAssistantNamePreference(value) {
return String(value || "")
.replace(/[\r\n\t]+/g, " ")
.replace(/\s+/g, " ")
.trim()
.replace(/^[`"']+|[`"']+$/g, "")
.trim()
.slice(0, 64);
}
function assistantNameAnswer(language, preferences) {
const name = normalizeAssistantNamePreference(
preferences && preferences.assistantName,
);
if (!name) return answerFor("assistant_name", language);
if (language === "ru") {
return `Меня зовут ${name}. Я formal AI.`;
}
if (language === "hi") {
return `मेरा नाम ${name} है। मैं formal AI हूँ।`;
}
if (language === "zh") {
return `我的名字是 ${name}。我是 formal AI。`;
}
return `My name is ${name}. I'm formal AI.`;
}
// Mirrors `src/engine.rs::UNKNOWN_OPENERS_*`. The first entry of each pool
// equals the opener already embedded in the seed text so the "with-variations"
// answer is a strict superset of the seed. Different prompts get different
// openers; the same prompt always picks the same one (FNV-1a hash, mirrored
// from `stableBehaviorRuleId`).
const UNKNOWN_OPENERS_BY_LANGUAGE = {
en: [
"I don't know how to answer that yet.",
"I didn't understand you.",
"I'm not sure how to respond to that yet.",
"I haven't learned to answer that yet.",
"That one is new to me.",
],
ru: [
"Я пока не знаю, как ответить на это.",
"Я тебя не понял.",
"Я не уверен, как на это ответить.",
"Я ещё не научился отвечать на это.",
"Это для меня новое.",
],
hi: [
"मुझे अभी इसका उत्तर देना नहीं आता।",
"मैं समझ नहीं पाया।",
"मुझे यकीन नहीं है कि कैसे उत्तर दूँ।",
"मैंने अभी तक यह उत्तर देना नहीं सीखा।",
"यह मेरे लिए नया है।",
],
zh: [
"我还不知道如何回答这个问题。",
"我不太明白你说的意思。",
"我不确定该如何回答。",
"我还没有学会回答这个问题。",
"这对我来说是新的。",
],
};
function unknownOpenersFor(language) {
return UNKNOWN_OPENERS_BY_LANGUAGE[language] || UNKNOWN_OPENERS_BY_LANGUAGE.en;
}
function selectUnknownOpener(prompt, language) {
const fromWasm = wasmSelectUnknownOpener(prompt, language);
if (fromWasm) return fromWasm;
const pool = unknownOpenersFor(language);
const trimmed = String(prompt || "").trim();
if (trimmed === "") return pool[0];
const id = stableBehaviorRuleId("unknown_opener", trimmed);
const hex = id.split("_").pop() || "0";
let value;
try {
value = BigInt(`0x${hex}`);
} catch (_err) {
value = 0n;
}
const index = Number(value % BigInt(pool.length));
return pool[index] || pool[0];
}
function stripLeadingUnknownOpener(text, language) {
const trimmed = String(text || "").trimStart();
const openers = unknownOpenersFor(language);
for (const known of openers) {
if (trimmed.startsWith(known)) {
return trimmed.slice(known.length).trimStart();
}
}
for (const separator of [". ", "。", "। "]) {
const idx = trimmed.indexOf(separator);
if (idx >= 0) {
return trimmed.slice(idx + separator.length).trimStart();
}
}
return trimmed;
}
function unknownAnswerWithVariation(prompt, language) {
const seedText = answerFor("unknown", language);
const opener = selectUnknownOpener(prompt, language);
const body = stripLeadingUnknownOpener(seedText, language);
if (!body) return opener;
return `${opener} ${body}`;
}
function numericPreference(value, fallback, min, max) {
const parsed = Number(value);
if (!Number.isFinite(parsed)) return fallback;
return Math.min(max, Math.max(min, parsed));
}
function pickVariant(values, randomize) {
if (!Array.isArray(values) || values.length === 0) return "";
if (!randomize || values.length === 1) return values[0];
return values[Math.floor(Math.random() * values.length)] || values[0];
}
function includeFollowUpQuestion(probability, randomize) {
if (probability <= 0) return false;
if (probability >= 1) return true;
if (!randomize) return probability >= 0.5;
return Math.random() < probability;
}
function courtesyResponseFor(language, preferences) {
const prefs = preferences || {};
const entry = responseEntryFor("courtesy_response", language);
const temperature = numericPreference(prefs.temperature, 0.7, 0, 1);
const followUpProbability = numericPreference(
prefs.followUpProbability,
0.75,
0,
1,
);
const randomize = temperature > 0;
const acknowledgements =
entry.acknowledgements.length > 0 ? entry.acknowledgements : [entry.text];
const followUps = entry.followUps;
const acknowledgement = pickVariant(acknowledgements, randomize);
const includeFollowUp =
followUps.length > 0 &&
includeFollowUpQuestion(followUpProbability, randomize);
return {
content: includeFollowUp
? `${acknowledgement} ${pickVariant(followUps, randomize)}`
: acknowledgement,
temperature: temperature,
randomize: randomize,
followUpProbability: followUpProbability,
followUpIncluded: includeFollowUp,
};
}
function definitionFusionByDefault(preferences) {
const value = preferences && preferences.definitionFusion;
if (value === true) return true;
if (value === false) return false;
const normalized = String(value || "").trim().toLowerCase();
return ["auto", "on", "true", "1", "merge", "fusion"].includes(normalized);
}
// Language detection and prompt normalization are owned by the Rust core
// (`src/web_engine_core.rs`) and exposed to the worker through the WASM
// exports `engine_detect_language` and `engine_normalize_prompt`. The JS
// branches below are pre-WASM fallbacks used during init() and on browsers
// that could not instantiate the worker — they must stay byte-for-byte
// compatible with the Rust path so the offline trace and the live answer
// agree (PR #134 feedback 4489651616).
function detectLanguage(prompt) {
const text = String(prompt || "");
const fromWasm = wasmDetectLanguage(text);
if (fromWasm !== null) {
if (fromWasm === "unknown") {
return AGENT_INFO.default_language || "en";
}
return fromWasm;
}
for (const ch of text) {
const code = ch.codePointAt(0);
for (const rule of LANGUAGE_RULES) {
if (
rule.language !== "en" &&
code >= rule.start &&
code <= rule.end
) {
return rule.language;
}
}
}
if (/[a-zA-Z]/.test(text)) return "en";
return AGENT_INFO.default_language || "en";
}
// Issue #324: the user can choose which language drives responses. The default
// ("last_message") answers in the detected language of the current message
// (fixing the Russian-prompt/English-answer bug). "preferred" pins responses to
// an explicitly selected language and "ui" follows the UI-language preference.
// Both fall back to the detected language when their source is "auto"/unset so
// the deterministic default behavior is never lost.
const RESPONSE_LANGUAGE_MODES = ["last_message", "preferred", "ui"];
function isKnownResponseLanguage(slug) {
return slug === "en" || slug === "ru" || slug === "hi" || slug === "zh";
}
function responseLanguageFor(detected, preferences, userContext) {
const prefs = preferences || {};
const mode = RESPONSE_LANGUAGE_MODES.includes(prefs.responseLanguage)
? prefs.responseLanguage
: "last_message";
if (mode === "preferred" && isKnownResponseLanguage(prefs.preferredLanguage)) {
return prefs.preferredLanguage;
}
if (mode === "ui") {
if (isKnownResponseLanguage(prefs.uiLanguage)) return prefs.uiLanguage;
// "auto" UI language follows the browser; fall back to the detected
// message language when no concrete browser language is supplied.
// `browserLanguages` may arrive as an array or a comma-joined string
// (see `collectUserContext` in app.js).
const raw = userContext ? userContext.browserLanguages : null;
const browser = Array.isArray(raw)
? raw
: typeof raw === "string"
? raw.split(",")
: [];
for (const tag of browser) {
const slug = String(tag || "").slice(0, 2).toLowerCase();
if (isKnownResponseLanguage(slug)) return slug;
}
}
return detected;
}
// CONCEPTS is populated from `seed/concepts.lino` at init() time.
function normalizePrompt(prompt) {
const text = String(prompt || "");
const fromWasm = wasmNormalizePrompt(text);
if (fromWasm !== null) return fromWasm;
// Keep letters, numbers and every Unicode mark (category M): Devanagari
// matras, the nukta and the virama are marks, so a bare \p{L}\p{N} filter
// would strip them and corrupt Hindi words (issue #312). Mark-awareness via
// \p{M} mirrors the Rust `normalize_prompt`, which keeps `is_alphanumeric()`
// characters plus its script-combining-mark ranges. Crucially it does NOT
// keep the whole U+0900–U+097F block: Indic punctuation such as the danda
// "।" (U+0964) is category Po, so both sides collapse it to a space. The
// boundary-aware role matcher (issue #386) depends on that parity — a
// retained danda would defeat the whole-token match for phrases like
// "अपना परिचय दो।".
return text
.toLowerCase()
.replace(/[^\p{L}\p{N}\p{M}]+/gu, " ")
.trim();
}
function normalizeConceptTerm(value) {
let lower = String(value || "").toLowerCase();
for (const prefix of ["the ", "a ", "an "]) {
if (lower.startsWith(prefix)) {
lower = lower.slice(prefix.length);
break;
}
}
return lower.trim().replace(/[?.!,;:]+$/g, "").trim();
}
function recordMatchesTerm(record, normalized) {
return (
normalizeConceptTerm(record.term) === normalized ||
normalizeConceptTerm(record.slug) === normalized ||
(Array.isArray(record.aliases) &&
record.aliases.some(
(alias) => normalizeConceptTerm(alias) === normalized,
))
);
}
function recordMatchesQueryTerm(record, normalized, contextNormalized) {
if (recordMatchesTerm(record, normalized)) return true;
if (!contextNormalized) return false;
return recordMatchesTerm(record, `${normalized} ${contextNormalized}`);
}
function contextRecordMatches(contextRecord, contextNormalized) {
if (!contextRecord) return false;
if (
Array.isArray(contextRecord.aliases) &&
contextRecord.aliases.some(
(alias) => normalizeConceptTerm(alias) === contextNormalized,
)
) {
return true;
}
return (
Array.isArray(contextRecord.labels) &&
contextRecord.labels.some(
(label) => normalizeConceptTerm(label.text) === contextNormalized,
)
);
}
function resolveContextRecord(contextNormalized) {
if (!contextNormalized) return null;
for (const record of CONCEPT_CONTEXTS) {
if (contextRecordMatches(record, contextNormalized)) return record;
}
return null;
}
function recordHasContext(record, contextNormalized) {
if (
Array.isArray(record.contexts) &&
record.contexts.some(
(candidate) => normalizeConceptTerm(candidate) === contextNormalized,
)
) {
return true;
}
// Registry fallback: resolve the user-supplied context through the
// concept-contexts registry and see whether the resolved record's slug is
// referenced by the concept's `contextLinks` list. Matches the Rust
// ranker (src/concepts.rs::record_has_context).
const contextRecord = resolveContextRecord(contextNormalized);
if (contextRecord && Array.isArray(record.contextLinks)) {
return record.contextLinks.some(
(slug) => String(slug).trim() === contextRecord.slug,
);
}
return false;
}
function localizedConceptFor(record, language) {
if (!record || !Array.isArray(record.localized)) return null;
return (
record.localized.find((loc) => loc && loc.language === language) ||
record.localized.find((loc) => loc && loc.language === "en") ||
null
);
}
function contextLabelFor(contextRecord, language) {
if (!contextRecord || !Array.isArray(contextRecord.labels)) {
return null;
}
const exact = contextRecord.labels.find(
(label) => label && label.language === language,
);
if (exact && exact.text) return exact.text;
const english = contextRecord.labels.find(
(label) => label && label.language === "en",
);
if (english && english.text) return english.text;
return contextRecord.slug || null;
}
function rankConceptForPair(termRaw, contextRaw) {
const normalized = normalizeConceptTerm(termRaw);
if (!normalized) return null;
const contextNormalized = contextRaw ? normalizeConceptTerm(contextRaw) : "";
const termMatches = CONCEPTS.filter((record) =>
recordMatchesQueryTerm(record, normalized, contextNormalized),
);
if (termMatches.length === 0) return null;
if (contextNormalized) {
const ctxHit = termMatches.find((record) =>
recordHasContext(record, contextNormalized),
);
if (ctxHit) {
return {
record: ctxHit,
contextMatch: true,
context: contextNormalized,
};
}
}
// No context match: prefer records with no contexts declared.
termMatches.sort((a, b) => {
const ac = (Array.isArray(a.contexts) && a.contexts.length > 0) ? 1 : 0;
const bc = (Array.isArray(b.contexts) && b.contexts.length > 0) ? 1 : 0;
return ac - bc;
});
return {
record: termMatches[0],
contextMatch: false,
context: contextNormalized || null,
};
}
function lookupConceptQuery(query) {
if (!query) return null;
const direct = rankConceptForPair(query.term, query.context);
if (query.context) {
const reversed = rankConceptForPair(query.context, query.term);
if (reversed && (!direct || (!direct.contextMatch && reversed.contextMatch))) {
return reversed;
}
}
return direct || null;
}
function lookupConcept(term) {
const hit = lookupConceptQuery({ term: term, context: null });
return hit ? hit.record : null;
}
// Default concept-lookup patterns when seed/prompt-patterns.lino is missing.
// Sorted longest-first so "what is a " beats "what is " when both match.
const DEFAULT_CONCEPT_SUFFIXES = [
" का अर्थ बताओ",
" क्या होता है",
" क्या है",
" कौन हैं",
" कौन है",
"的意思是什么",
"是什么意思",
"是甚麼",
"是什么",
"是誰",
"是谁",
];
const DEFAULT_CONCEPT_PREFIXES = [
"what is a ",
"what is an ",
"what is the ",
"what is ",
"what's a ",
"what's an ",
"what's the ",
"what's ",
"what do ",
"what does ",
"tell me about ",
"tell me what ",
"define ",
"explain ",
"describe ",
"who is ",
"who was ",
"что такое ",
"что это ",
"что означает слово ",
"кто такой ",
"кто такая ",
"кто это ",
"расскажи о ",
"расскажи про ",
"назови ",
"опиши ",
"объясни ",
"什么是",
"甚麼是",
"请解释",
"请说说",
"介绍一下",
];
function conceptPatternsByKind(kind) {
const matches = PROMPT_PATTERNS.filter(
(p) => p && p.intent === "concept_lookup" && p.kind === kind && p.text,
).map((p) => p.text);
// Sort longest-first so more specific patterns win.
matches.sort((a, b) => b.length - a.length);
if (matches.length > 0) return matches;
if (kind === "suffix") return DEFAULT_CONCEPT_SUFFIXES;
if (kind === "prefix") return DEFAULT_CONCEPT_PREFIXES;
return [];
}
function splitTermAndContext(bodyOriginal, bodyLower) {
const delimiters = conceptPatternsByKind("context_delimiter");
for (const delimiter of delimiters) {
const idx = bodyLower.indexOf(delimiter);
if (idx >= 0) {
const term = bodyLower.slice(0, idx).trim();
const context = bodyLower.slice(idx + delimiter.length).trim();
const termOriginal = bodyOriginal.slice(0, idx).trim();
const contextOriginal = bodyOriginal
.slice(idx + delimiter.length)
.trim();
if (term && context) {
return {
term: term,
context: context,
termOriginal: termOriginal || term,
contextOriginal: contextOriginal || context,
};
}
}
}
return {
term: bodyLower,
context: null,
termOriginal: bodyOriginal || bodyLower,
contextOriginal: null,
};
}
function stripLeadingRequest(input) {
const lower = input.toLowerCase();
const prefixes = [
"please tell me,",
"please tell me",
"tell me,",
"tell me",
];
const questionStarts = ["who ", "what ", "what's ", "who's "];
for (const prefix of prefixes) {
if (!lower.startsWith(prefix)) continue;
const rest = input.slice(prefix.length).trimStart();
const restLower = rest.toLowerCase();
if (
questionStarts.some((questionStart) =>
restLower.startsWith(questionStart),
)
) {
return rest;
}
}
return input;
}
function extractInvertedWhoIs(input, lower) {
if (!lower.startsWith("who ") || !lower.endsWith(" is")) return null;
const body = input.slice("who ".length, input.length - " is".length).trim();
if (!body) return null;
const normalized = body.toLowerCase();
if (["is", "was", "are"].includes(normalized)) return null;
return body;
}
function cleanMechanismFragment(value) {
return String(value || "")
.trim()
.replace(/^[`"'«»<>()\[\]{}]+/u, "")
.replace(/[`"'«»<>()\[\]{}]+$/u, "")
.replace(/[??。.!,,;:]+$/u, "")
.trim();
}
// Trim optional detail/politeness modifiers from a candidate subject and reject
// it outright when it is a non-referential subject. The modifier tails carry
// ROLE_DETAIL_MODIFIER (suffix surfaces, stripped in declaration order); the
// rejection set carries ROLE_NON_REFERENTIAL_SUBJECT (bare surfaces match the
// whole candidate, prefix surfaces match a candidate that begins with the
// literal before the … slot). Mirrors clean_mechanism_subject in
// src/solver_handler_how.rs — no per-language modifier or pronoun array here.
function cleanMechanismSubject(value) {
let clean = cleanMechanismFragment(value);
for (const form of roleWordForms(ROLE_DETAIL_MODIFIER)) {
const suffix = form.after;
const lower = clean.toLowerCase();
if (lower.endsWith(suffix)) {
clean = cleanMechanismFragment(clean.slice(0, clean.length - suffix.length));
}
}
const lower = clean.toLowerCase();
const nonReferential = roleWordForms(ROLE_NON_REFERENTIAL_SUBJECT).some((form) => {
if (form.slot === "bare") return lower === form.text;
if (form.slot === "prefix") return lower.startsWith(form.before);
return false;
});
if (!clean || nonReferential) {
return null;
}
return clean;
}
// Strip a trailing mechanism predicate so a prefix match such as "how does X
// work" yields the bare subject "X". The predicate tails carry
// ROLE_MECHANISM_PREDICATE (suffix surfaces); they are tried in declaration
// order and the first match wins. Mirrors strip_mechanism_tail in
// src/solver_handler_how.rs — no per-language tail array here.
function stripMechanismTail(subject) {
let clean = cleanMechanismSubject(subject);
if (!clean) return null;
const lower = clean.toLowerCase();
for (const form of roleWordForms(ROLE_MECHANISM_PREDICATE)) {
const suffix = form.after;
if (lower.endsWith(suffix)) {
clean = cleanMechanismSubject(clean.slice(0, clean.length - suffix.length));
break;
}
}
return clean;
}
function mechanismSubjectAfterPrefix(original, lower, prefix) {
if (!lower.startsWith(prefix)) return null;
return cleanMechanismSubject(original.slice(prefix.length));
}
function mechanismSubjectBeforeSuffix(original, lower, suffix) {
if (!lower.endsWith(suffix)) return null;
return cleanMechanismSubject(original.slice(0, -suffix.length));
}
function mechanismSubjectBetween(original, lower, prefix, suffixes) {
if (!lower.startsWith(prefix)) return null;
for (const suffix of suffixes) {
if (!lower.endsWith(suffix)) continue;
const end = original.length - suffix.length;
if (end <= prefix.length) return null;
return cleanMechanismSubject(original.slice(prefix.length, end));
}
return null;
}
function extractHowItWorksSubject(input, lowerInput) {
const original = cleanMechanismFragment(input);
if (!original) return null;
const lower = cleanMechanismFragment(lowerInput || original.toLowerCase())
.toLowerCase();
// The affixes are the slot-marked surface forms of the mechanism_inquiry
// meaning (data/seed/meanings-how.lino, embedded in MEANINGS_LINO): the
// position of the … marker classifies each form, so the matching strategy is
// derived from the data, not from a hardcoded per-language list. Bucket order
// — prefix, then circumfix, then suffix — and within-bucket declaration order
// mirror extract_how_it_works_subject in src/solver_handler_how.rs (#386).
// Suffix surfaces are end-anchored and script-disjoint across languages, so
// the cross-language declaration order does not change which one matches.
const forms = roleWordForms(ROLE_MECHANISM_INQUIRY);
for (const form of forms) {
if (form.slot !== "prefix") continue;
const subject = mechanismSubjectAfterPrefix(original, lower, form.before);
if (subject) return stripMechanismTail(subject);
}
for (const form of forms) {
if (form.slot !== "circumfix") continue;
const subject = mechanismSubjectBetween(original, lower, form.before, [
form.after,
]);
if (subject) return subject;
}
for (const form of forms) {
if (form.slot !== "suffix") continue;
const subject = mechanismSubjectBeforeSuffix(original, lower, form.after);
if (subject) return subject;
}
return null;
}
function cleanMeaningCandidate(value) {
const cleaned = String(value || "")
.trim()
.replace(/^[«»"“”‘’'`]+|[«»"“”‘’'`]+$/gu, "")
.trim();
if (!cleaned) return null;
if (/^(?:it|that|this|word|the word|mean|means|meaning|i)$/iu.test(cleaned)) {
return null;
}
return cleaned;
}
function extractMeaningQuestionBody(original, lower) {
for (const prefix of [
"what is the meaning of ",
"what's the meaning of ",
"what is meaning of ",
"meaning of ",
]) {
if (lower.startsWith(prefix)) {
return cleanMeaningCandidate(original.slice(prefix.length));
}
}
for (const suffix of [" mean", " means", " meaning"]) {
if (!lower.endsWith(suffix)) continue;
const stem = original.slice(0, -suffix.length).trim();
const stemLower = stem.toLowerCase();
for (const prefix of [
"what does the word ",
"what does ",
"what do ",
"what did ",
"what is the word ",
"what is ",
"what's ",
"what i ",
]) {
if (stemLower.startsWith(prefix)) {
return cleanMeaningCandidate(stem.slice(prefix.length));
}
}
}
return null;
}
function extractConceptQuery(prompt) {
let trimmedRaw = String(prompt || "")
.trim()
.replace(/[?。.!!,,;:]+$/g, "")
.trim();
if (!trimmedRaw) return null;
trimmedRaw = stripLeadingRequest(trimmedRaw);
const suffixes = conceptPatternsByKind("suffix");
for (const suffix of suffixes) {
if (trimmedRaw.endsWith(suffix)) {
return finalizeConceptBody(
trimmedRaw.slice(0, -suffix.length).trim(),
);
}
}
const lower = trimmedRaw.toLowerCase();
const meaningBody = extractMeaningQuestionBody(trimmedRaw, lower);
if (meaningBody) return finalizeConceptBody(meaningBody);
const invertedWhoBody = extractInvertedWhoIs(trimmedRaw, lower);
if (invertedWhoBody) return finalizeConceptBody(invertedWhoBody);
const howItWorksSubject = extractHowItWorksSubject(trimmedRaw, lower);
if (howItWorksSubject) return finalizeConceptBody(howItWorksSubject);
const prefixes = conceptPatternsByKind("prefix");
let body = null;
for (const prefix of prefixes) {
if (lower.startsWith(prefix)) {
body = trimmedRaw.slice(prefix.length);
break;
}
}
if (!body) return null;
return finalizeConceptBody(body);
}
function extractConceptTerm(prompt) {
const query = extractConceptQuery(prompt);
return query ? query.term : null;
}
function cleanWikipediaArticleQuestionTerm(value) {
return String(value || "")
.trim()
.replace(/^[«»"“”‘’'`「」『』]+|[«»"“”‘’'`「」『』]+$/gu, "")
.replace(/[?!.。!?।]+$/gu, "")
.replace(/\s+/g, " ")
.trim();
}
function hasWikipediaArticleQuestionShape(value) {
const lower = String(value || "").toLowerCase();
if (!/(?:wikipedia|wiki|википед|维基百科|維基百科|विकिपीडिया)/u.test(lower)) return false;
const hasArticleWord = /(?:article|page|стать[ьяеию]|страниц|条目|條目|页面|頁面|文章|लेख|पृष्ठ)/u.test(lower);
if (!hasArticleWord) return false;
return /(?:is there|does .*have|exist|available|есть|существ|имеет|найд|назв|有|存在|有没有|是否有|吗|嗎|क्या|है|मौजूद)/u.test(lower);
}
function extractWikipediaArticleQuestionTerm(prompt) {
const raw = cleanWikipediaArticleQuestionTerm(prompt);
if (!raw || !hasWikipediaArticleQuestionShape(raw)) return null;
const dashMatch = raw.match(/^(.+?)\s+[-—–:]\s+(.+)$/u);
if (dashMatch && hasWikipediaArticleQuestionShape(dashMatch[2])) {
return cleanWikipediaArticleQuestionTerm(dashMatch[1]);
}
for (const pattern of [
/^(?:is|are)\s+there\s+(?:an?\s+)?(?:wikipedia|wiki)\s+(?:article|page)\s+(?:about|on|for)\s+(.+)$/iu,
/^does\s+(?:wikipedia|wiki)\s+have\s+(?:an?\s+)?(?:article|page)\s+(?:about|on|for)\s+(.+)$/iu,
/^(?:есть|существует|имеется)\s+(?:ли\s+)?(?:в\s+)?(?:русскоязычной\s+)?википедии\s+(?:отдельная\s+)?(?:статья|страница)\s+(?:о|об|про|с\s+названием)\s+(.+)$/iu,
/^(?:есть|существует|имеется)\s+(?:ли\s+)?(?:отдельная\s+)?(?:статья|страница)\s+(?:в\s+)?(?:русскоязычной\s+)?википедии\s+(?:о|об|про|с\s+названием)\s+(.+)$/iu,
/^(?:维基百科|維基百科)(?:上)?(?:有|存在)(?:关于|關於|名为|名為)?\s*(.+?)\s*(?:的)?(?:条目|條目|文章|页面|頁面)(?:吗|嗎)?$/iu,
/^(.+?)\s*(?:在)?(?:维基百科|維基百科)(?:上)?(?:有|存在)(?:这样(?:的)?|這樣(?:的)?|一篇)?(?:条目|條目|文章|页面|頁面)(?:吗|嗎)?$/iu,
/^(?:क्या\s+)?(?:विकिपीडिया|wiki)\s+(?:पर|में)\s+(.+?)\s+(?:के\s+बारे\s+में\s+)?(?:लेख|पृष्ठ)\s+(?:है|मौजूद\s+है)$/iu,
/^(?:क्या\s+)?(.+?)\s+(?:के\s+बारे\s+में\s+)?(?:विकिपीडिया|wiki)\s+(?:पर|में)\s+(?:ऐसा\s+)?(?:लेख|पृष्ठ)\s+(?:है|मौजूद\s+है)$/iu,
]) {
const match = raw.match(pattern);
if (match) return cleanWikipediaArticleQuestionTerm(match[1]);
}
const trailingRussian = raw.match(/^(.+?)\s+(?:есть|существует|имеется)\s+(?:ли\s+)?(?:такая\s+)?(?:статья|страница)\s+(?:в\s+)?(?:русскоязычной\s+)?википедии$/iu);
if (trailingRussian) return cleanWikipediaArticleQuestionTerm(trailingRussian[1]);
const trailingHindi = raw.match(/^(.+?)\s+(?:के\s+बारे\s+में\s+)?(?:विकिपीडिया|wiki)\s+(?:पर|में)\s+(?:ऐसा\s+)?(?:लेख|पृष्ठ)\s+(?:है|मौजूद\s+है)$/iu);
if (trailingHindi) return cleanWikipediaArticleQuestionTerm(trailingHindi[1]);
const trailingChinese = raw.match(/^(.+?)\s*(?:在)?(?:维基百科|維基百科)(?:上)?(?:有|存在)(?:这样(?:的)?|這樣(?:的)?|一篇)?(?:条目|條目|文章|页面|頁面)(?:吗|嗎)?$/iu);
if (trailingChinese) return cleanWikipediaArticleQuestionTerm(trailingChinese[1]);
return null;
}
function refineWikipediaArticleQuestionLookup(term, language) {
const exactTerm = cleanWikipediaArticleQuestionTerm(term);
const query = {
exactTerm,
lookupTerm: exactTerm,
contextOriginal: "",
};
const lower = exactTerm.toLowerCase();
if (
(language === "ru" || /[а-яё]/iu.test(exactTerm)) &&
/\s(?:в|на)\s+(?:предложени[еяию]|предложениях|словосочетани[еяию]|словосочетаниях)$/iu.test(lower)
) {
query.lookupTerm = cleanWikipediaArticleQuestionTerm(
exactTerm.replace(/\s(?:в|на)\s+(?:предложени[еяию]|предложениях|словосочетани[еяию]|словосочетаниях)$/iu, ""),
);
query.contextOriginal = "грамматика";
}
if (
(language === "en" || /^[\p{ASCII}\s]+$/u.test(exactTerm)) &&
/\s+in\s+(?:a\s+)?sentences?$/iu.test(lower)
) {
query.lookupTerm = cleanWikipediaArticleQuestionTerm(
exactTerm.replace(/\s+in\s+(?:a\s+)?sentences?$/iu, ""),
);
query.contextOriginal = "grammar";
}
if (language === "hi" || /[\u0900-\u097f]/u.test(exactTerm)) {
const prefix = exactTerm.match(/^(?:वाक्य|वाक्यों)\s+में\s+(.+)$/u);
const suffix = exactTerm.match(/^(.+?)\s+(?:वाक्य|वाक्यों)\s+में$/u);
const match = prefix || suffix;
if (match) {
query.lookupTerm = cleanWikipediaArticleQuestionTerm(match[1]);
query.contextOriginal = "व्याकरण";
}
}
if (language === "zh" || /[\u3400-\u9fff]/u.test(exactTerm)) {
const prefix = exactTerm.match(/^(?:句子中(?:的)?|句子里(?:的)?|句中的)(.+)$/u);
const suffix = exactTerm.match(/^(.+?)(?:在)?句子(?:中|里)$/u);
const match = prefix || suffix;
if (match) {
query.lookupTerm = cleanWikipediaArticleQuestionTerm(match[1]);
query.contextOriginal = "语法";
}
}
return query;
}
// Issue #21: render a percent-encoded URL in its readable IRI form for
// display, while leaving the original encoded form available as the href.
// `decodeURI` keeps reserved URI delimiters (`; / ? : @ & = + $ , #`) intact,
// so query strings are preserved; malformed escapes fall back to the original
// string.
function humanizeUrl(url) {
if (typeof url !== "string" || url.length === 0) return url;
if (!url.includes("%")) return url;
try {
return decodeURI(url);
} catch (_error) {
return url;
}
}
// Render a source URL as a Markdown link [human](encoded) when humanization
// changes anything, or the bare URL otherwise.
function renderSourceLink(source) {
const human = humanizeUrl(source);
return human === source ? source : `[${human}](${source})`;
}
function finalizeConceptBody(body) {
let originalBase = String(body || "")
.trim()
.replace(/[?。.!!,,;:]+$/g, "")
.trim();
if (!originalBase) return null;
let original = originalBase;
let lower = original.toLowerCase();
// Strip trailing "mean"/"stand for" markers shared across English idioms.
// The lowercased view drives matching while the original-case view is kept
// so downstream Wikipedia URL lookups preserve Cyrillic capitalization
// (see docs/case-studies/issue-27/README.md).
for (const suffix of [" mean", " stand for"]) {
if (lower.endsWith(suffix)) {
original = original.slice(0, -suffix.length).trim();
lower = lower.slice(0, -suffix.length).trim();
break;
}
}
if (!lower) return null;
return splitTermAndContext(original, lower);
}
function tokenizeArithmetic(input) {
const tokens = [];
let i = 0;
while (i < input.length) {
const ch = input[i];
if (ch === " " || ch === "\t" || ch === "_" || ch === ",") {
i += 1;
continue;
}
if (ch === "+") {
tokens.push({ kind: "+" });
i += 1;
} else if (ch === "-" || ch === "−") {
tokens.push({ kind: "-" });
i += 1;
} else if (ch === "*" || ch === "×" || ch === "·") {
tokens.push({ kind: "*" });
i += 1;
} else if (ch === "/" || ch === "÷") {
tokens.push({ kind: "/" });
i += 1;
} else if (ch === "%") {
tokens.push({ kind: "%" });
i += 1;
} else if (ch === "^") {
tokens.push({ kind: "^" });
i += 1;
} else if (ch === "(") {
tokens.push({ kind: "(" });
i += 1;
} else if (ch === ")") {
tokens.push({ kind: ")" });
i += 1;
} else if ((ch >= "0" && ch <= "9") || ch === ".") {
let j = i;
while (
j < input.length &&
((input[j] >= "0" && input[j] <= "9") || input[j] === ".")
) {
j += 1;
}
const slice = input.slice(i, j);
const value = Number(slice);
if (Number.isNaN(value)) {
throw new Error("unparseable");
}
tokens.push({ kind: "num", value });
i = j;
} else {
throw new Error("unparseable");
}
}
return tokens;
}
// Issue #386: the spelled-operator and cardinal-number vocabularies are no
// longer literal arrays here. They live in the seed meanings — the
// arithmetic_operation operators (addition, subtraction, multiplication,
// division, modulo) and the cardinal_number digits (zero, один, 三, …) — and
// are read by role through the lexicon, exactly as the Rust solver does
// (contains_word_operator / contains_spelled_arithmetic in src/calculation.rs).
// These role names mirror the constants in src/seed/roles.rs.
const ROLE_ARITHMETIC_OPERATOR_WORD = "arithmetic_operator_word";
const ROLE_CARDINAL_NUMBER_WORD = "cardinal_number_word";
const ROLE_CALCULATION_REQUEST_CUE = "calculation_request_cue";
const ROLE_CALCULATION_RESULT_QUERY_CUE = "calculation_result_query_cue";
const ROLE_POLITENESS_CUE = "politeness_cue";
const ROLE_QUANTITY_CONVERSION_CUE = "quantity_conversion_cue";
const ROLE_CALCULATION_DOMAIN_TERM = "calculation_domain_term";
const ROLE_MATH_FUNCTION_NAME = "math_function_name";
// Issue #386: the spelled digit/operator → value normalization tables, derived
// from the seed at runtime exactly as the Rust solver derives them
// (Lexicon::arithmetic_normalization_tables in src/seed/meanings.rs, materialized
// into src/arithmetic_word_tables.rs for the no_std wasm worker). A cardinal or
// operator meaning carries its script-independent value surface as the one word
// form with no alphabetic character — the numeral "2", the symbol "+" — and every
// spelled surface (any language) maps onto it. Multi-word surfaces ("divided by",
// "разделить на") are returned as `phrases`, rewritten before tokenization and
// ordered longest-first so a phrase applies before any shorter phrase it
// contains; single words ("two", "плюс") are returned as `tokens`, mapped after
// the whitespace split. Cached because the lexicon never changes at runtime.
let cachedArithmeticTables = null;
function arithmeticNormalizationTables() {
if (cachedArithmeticTables) return cachedArithmeticTables;
const isValueSurface = (word) => !/\p{Alphabetic}/u.test(word);
const tokens = [];
const phrases = [];
for (const role of [ROLE_CARDINAL_NUMBER_WORD, ROLE_ARITHMETIC_OPERATOR_WORD]) {
for (const meaning of meaningsWithRole(role)) {
// The value surface is the one word form with no alphabetic character: the
// numeral for a cardinal, the symbol for an operator. Spelled surfaces in
// every language map onto it.
const value = meaning.words.find((word) => isValueSurface(word));
if (value === undefined) continue;
for (const word of meaning.words) {
if (word === value || isValueSurface(word)) continue;
const entry = [word, value];
if (/\s/u.test(word)) phrases.push(entry);
else tokens.push(entry);
}
}
}
const cmpStr = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
const dedupe = (pairs) =>
pairs.filter(
(pair, index) =>
index === 0 ||
pair[0] !== pairs[index - 1][0] ||
pair[1] !== pairs[index - 1][1],
);
// tokens.sort() in Rust orders tuples by surface then value; phrases sort by
// descending code-point count (longest first), then surface ascending.
tokens.sort((a, b) => cmpStr(a[0], b[0]) || cmpStr(a[1], b[1]));
phrases.sort(
(a, b) => [...b[0]].length - [...a[0]].length || cmpStr(a[0], b[0]),
);
cachedArithmeticTables = { tokens: dedupe(tokens), phrases: dedupe(phrases) };
return cachedArithmeticTables;
}
const PERCENT_OF_CURRENCY_CODES = new Map([
["$", "USD"],
["€", "EUR"],
["¥", "JPY"],
["₹", "INR"],
["₽", "RUB"],
]);
const DEFAULT_CURRENCY_RATES = new Map([
["USD:EUR", 0.92],
["USD:GBP", 0.79],
["USD:JPY", 148.5],
["USD:CHF", 0.88],
["USD:CNY", 7.25],
["USD:RUB", 89.5],
["USD:INR", 86.5],
["USD:CLF", 0.022],
["USD:VND", 25810.0],
["USD:KZT", 470.0],
["EUR:USD", 1.087],
["EUR:GBP", 0.86],
["EUR:JPY", 161.5],
["EUR:CHF", 0.96],
["GBP:USD", 1.27],
["GBP:EUR", 1.16],
]);
const USD_RUB_RATE_EXPRESSION = "1 USD in RUB";
// Issue #386: the canonical ISO 4217 code is the recognizer's output, so it
// stays in code; only the recognition vocabulary lives in the seed. Mirrors the
// role -> code mapping the Rust calculator handlers resolve from the same roles.
function currencyCodeForRole(role) {
if (role === ROLE_CURRENCY_USD_REFERENCE) return "USD";
if (role === ROLE_CURRENCY_EUR_REFERENCE) return "EUR";
if (role === ROLE_CURRENCY_RUB_REFERENCE) return "RUB";
return "";
}
// Issue #386: currency vocabulary is seed data, not a hardcoded declension list.
// Walk the three currency reference roles (USD, then EUR, then RUB — the
// original recognizer's priority) and return the ISO code of the first role a
// surface matches. The matching strategy follows the surface's script, the same
// split surfacePresent already makes: Latin surfaces (the ISO codes and English
// terms, enumerated singular and plural) and CJK/Devanagari surfaces match the
// whole token exactly, so unrelated words like "rubbish" are rejected just as
// the original exact-match list rejected them; Cyrillic surfaces are stems
// matched by prefix, so every Russian declension (доллар… , руб…) is caught
// from доллар / руб without listing each inflected form. The calculator regexes
// only ever feed this Latin or Cyrillic tokens.
function currencyCodeFromWord(value) {
const lower = String(value || "").toLowerCase();
if (!lower) return "";
for (const role of [
ROLE_CURRENCY_USD_REFERENCE,
ROLE_CURRENCY_EUR_REFERENCE,
ROLE_CURRENCY_RUB_REFERENCE,
]) {
for (const word of wordsForRole(role)) {
if (!word) continue;
// Cyrillic block is U+0400-U+04FF; Latin sorts below it and CJK/Devanagari
// above, so the first codepoint tells us which matching strategy to use.
const head = word.charCodeAt(0);
const isCyrillic = head >= 0x0400 && head <= 0x04ff;
if (isCyrillic ? lower.startsWith(word) : lower === word) {
return currencyCodeForRole(role);
}
}
}
return "";
}
function defaultCurrencyRate(from, to) {
if (from === to) return 1;
const direct = DEFAULT_CURRENCY_RATES.get(`${from}:${to}`);
if (direct) return direct;
const inverse = DEFAULT_CURRENCY_RATES.get(`${to}:${from}`);
if (inverse) return 1 / inverse;
if (from !== "USD" && to !== "USD") {
const fromUsd = defaultCurrencyRate(from, "USD");
const usdTo = defaultCurrencyRate("USD", to);
if (fromUsd && usdTo) return fromUsd * usdTo;
}
return null;
}
// Issue #386: the trailing currency word in an "N% of M <currency>" expression
// is seed data, not a hardcoded English list. Build the alternation from the
// same three currency reference roles currencyCodeFromWord resolves, so the
// recognizer captures exactly what the resolver understands — the ISO codes,
// the English singular/plural forms, and the Cyrillic/CJK/Devanagari names all
// come straight from the seed instead of the old usd|eur|rub|dollars?… literal.
// Longest-first under the trailing `$` anchor so "dollars" is preferred over
// "dollar"; each surface is regex-escaped. Cached because the seed is immutable
// for the worker's lifetime (matching the lazy, post-init access pattern
// currencyCodeFromWord uses, which keeps the ROLE_* consts out of the TDZ).
let percentOfExpressionRegexCache = null;
function percentOfExpressionRegex() {
if (percentOfExpressionRegexCache) return percentOfExpressionRegexCache;
const surfaces = [];
const seen = new Set();
for (const role of [
ROLE_CURRENCY_USD_REFERENCE,
ROLE_CURRENCY_EUR_REFERENCE,
ROLE_CURRENCY_RUB_REFERENCE,
]) {
for (const word of wordsForRole(role)) {
const surface = String(word || "").toLowerCase();
if (!surface || seen.has(surface)) continue;
seen.add(surface);
surfaces.push(surface);
}
}
surfaces.sort((a, b) => b.length - a.length || (a < b ? -1 : a > b ? 1 : 0));
const alternation = surfaces
.map((surface) => surface.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))
.join("|");
percentOfExpressionRegexCache = new RegExp(
`^([+-]?\\d+(?:\\.\\d+)?)\\s*%\\s+of\\s+([$€¥₹₽])?\\s*([+-]?\\d+(?:\\.\\d+)?)(?:\\s*(${alternation}))?$`,
"i",
);
return percentOfExpressionRegexCache;
}
function evaluatePercentOfExpression(expression) {
const match = String(expression || "")
.trim()
.match(percentOfExpressionRegex());
if (!match) return null;
const percent = Number(match[1]);
const amount = Number(match[3]);
if (!Number.isFinite(percent) || !Number.isFinite(amount)) return null;
const currency =
PERCENT_OF_CURRENCY_CODES.get(match[2] || "") ||
currencyCodeFromWord(match[4]);
const result = formatArithmeticResult((amount * percent) / 100);
return currency ? `${result} ${currency}` : result;
}
function evaluateCurrencyConversionExpression(expression) {
const match = String(expression || "")
.trim()
.match(
/^([+-]?\d+(?:[.,]\d+)?)\s+(.+?)\s+(?:in|as|to|в|во|к)\s+(.+)$/iu,
);
if (!match) return null;
const amount = Number(match[1].replace(",", "."));
if (!Number.isFinite(amount)) return null;
const from = currencyCodeFromWord(match[2].trim());
const to = currencyCodeFromWord(match[3].trim());
if (!from || !to) return null;
const rate = defaultCurrencyRate(from, to);
if (!rate) return null;
return `${formatArithmeticResult(amount * rate)} ${to}`;
}
function usdRubRateDetail() {
const rate = defaultCurrencyRate("USD", "RUB");
if (!rate) return "";
return `Exchange rate: 1 USD = ${formatArithmeticResult(rate)} RUB (source: default (hardcoded), date: unknown)`;
}
function evaluateUsdRubRateBasis() {
const wasmResult = wasmEvaluateArithmetic(USD_RUB_RATE_EXPRESSION);
if (wasmResult && wasmResult.ok) {
return {
formatted: wasmResult.value,
backend: "wasm",
detail: usdRubRateDetail(),
};
}
const currencyConversionResult = evaluateCurrencyConversionExpression(
USD_RUB_RATE_EXPRESSION,
);
if (currencyConversionResult === null) return null;
return {
formatted: currencyConversionResult,
backend: "js-currency",
detail: usdRubRateDetail(),
};
}
// Issue #386: recognise the USD/RUB rate-basis question by *meaning*, not by a
// hardcoded per-language word list. The surface forms live once in
// data/seed/meanings-calculator.lino and are queried by semantic role, matched
// as raw substrings — the JS mirror of mentions_role_raw and of
// asks_for_usd_rate_basis in src/solver_handlers/calculator_rate.rs.
//
// A prompt references US dollars (an exchange_rate between currencies AND the
// us_dollar currency) when both currency roles are present.
function mentionsUsdRate(normalized) {
return (
lexiconMentionsRoleSubstring(ROLE_EXCHANGE_RATE_REFERENCE, normalized) &&
lexiconMentionsRoleSubstring(ROLE_CURRENCY_USD_REFERENCE, normalized)
);
}
// A prompt asks what the assistant uses as the basis for a calculation when the
// calculation_basis role is present (the question side of "which rate do you
// use for calculations").
function mentionsRateCalculationBasis(normalized) {
return lexiconMentionsRoleSubstring(ROLE_CALCULATION_BASIS_REFERENCE, normalized);
}
function tryCalculatorRateBasis(normalized, language) {
if (!mentionsUsdRate(normalized) || !mentionsRateCalculationBasis(normalized)) {
return null;
}
const evaluation = evaluateUsdRubRateBasis();
if (!evaluation) {
const content =
language === "ru"
? "Я распознал вопрос о курсе USD/RUB для расчетов, но калькулятор не смог его вычислить."
: "I recognized this as a question about the USD/RUB rate used for calculations, but the calculator could not evaluate it.";
return {
intent: "calculation_error",
content,
confidence: 0.3,
evidence: ["calculation_error:USD/RUB"],
};
}
const calculationBody = `${USD_RUB_RATE_EXPRESSION} = ${evaluation.formatted}`;
let content;
if (language === "ru") {
content = `При расчетах валюты я использую link-calculator. Для USD/RUB он возвращает: ${calculationBody}.`;
} else if (language === "hi") {
content = `मुद्रा गणनाओं के लिए मैं link-calculator का उपयोग करता हूं। USD/RUB के लिए वह लौटाता है: ${calculationBody}.`;
} else if (language === "zh") {
content = `货币计算时我使用 link-calculator。USD/RUB 返回: ${calculationBody}.`;
} else {
content = `For currency calculations I use link-calculator. For USD/RUB it returns: ${calculationBody}.`;
}
if (evaluation.detail) {
let details = "Calculator rate details";
if (language === "ru") {
details = "Детали курса от калькулятора";
} else if (language === "hi") {
details = "कैलकुलेटर दर विवरण";
} else if (language === "zh") {
details = "计算器汇率详情";
}
content += `\n\n${details}: ${evaluation.detail}`;
}
return {
intent: "calculation",
content,
confidence: 1.0,
evidence: [
`calculation:${calculationBody}`,
`calculation_backend:${evaluation.backend}`,
"calculation_rate_basis:USD/RUB",
],
};
}
// Rewrite "N% of M" percentage-of phrases into explicit arithmetic the parser
// can evaluate: "8% of 500" -> "( 8 * 500 / 100 )". Mirrors the Rust
// `rewrite_percent_of` helper so the JS fallback agrees with the WASM worker:
// "55 * 8% of 500" evaluates to 2200 (issue #334). A bare `%` not followed by
// "of" is left untouched so it still parses as the modulo operator.
function rewritePercentOf(expression) {
const isNumber = (token) => token.length > 0 && /^[0-9.]+$/.test(token);
const tokens = String(expression).split(/\s+/).filter(Boolean);
const out = [];
let index = 0;
while (index < tokens.length) {
let percent = null;
let consumed = 0;
const token = tokens[index];
if (token.endsWith("%") && isNumber(token.slice(0, -1))) {
percent = token.slice(0, -1);
consumed = 1;
} else if (isNumber(token) && tokens[index + 1] === "%") {
percent = token;
consumed = 2;
}
const after = index + consumed;
if (
percent !== null &&
tokens[after] === "of" &&
tokens[after + 1] !== undefined &&
isNumber(tokens[after + 1])
) {
out.push("(", percent, "*", tokens[after + 1], "/", "100", ")");
index = after + 2;
continue;
}
out.push(token);
index += 1;
}
return out.join(" ");
}
function normalizeArithmeticWords(expression) {
const { tokens, phrases } = arithmeticNormalizationTables();
const lower = String(expression).toLowerCase();
// Multi-word operator phrases first, longest-first (the table is pre-sorted),
// each padded with spaces so it only rewrites on a token boundary — exactly as
// the Rust normalize_expression does before it splits on whitespace.
let padded = ` ${lower} `;
for (const [phrase, value] of phrases) {
padded = padded.replaceAll(` ${phrase} `, ` ${value} `);
}
const tokenMap = new Map(tokens);
const mapped = padded
.split(/\s+/)
.filter(Boolean)
.map((token) => tokenMap.get(token) || token)
.join(" ");
return rewritePercentOf(mapped);
}
function evaluateArithmetic(expression) {
const normalized = normalizeArithmeticWords(expression);
const tokens = tokenizeArithmetic(normalized);
if (tokens.length === 0) {
throw new Error("empty");
}
let cursor = 0;
const peek = () => tokens[cursor];
const advance = () => tokens[cursor++];
function parsePrimary() {
const tok = advance();
if (!tok) throw new Error("unparseable");
if (tok.kind === "num") return tok.value;
if (tok.kind === "(") {
const inner = parseAdditive();
const close = advance();
if (!close || close.kind !== ")") throw new Error("unbalanced");
return inner;
}
throw new Error("unparseable");
}
function parsePower() {
let left = parsePrimary();
const tok = peek();
if (tok && tok.kind === "^") {
advance();
left = Math.pow(left, parseUnary());
if (!Number.isFinite(left)) throw new Error("overflow");
}
return left;
}
function parseUnary() {
const tok = peek();
if (tok && tok.kind === "-") {
advance();
return -parseUnary();
}
if (tok && tok.kind === "+") {
advance();
return parseUnary();
}
return parsePower();
}
function parseMultiplicative() {
let left = parseUnary();
while (true) {
const tok = peek();
if (!tok || (tok.kind !== "*" && tok.kind !== "/" && tok.kind !== "%")) {
break;
}
const op = tok.kind;
advance();
const right = parseUnary();
if (op === "*") {
left = left * right;
} else if (right === 0) {
throw new Error("division by zero");
} else if (op === "/") {
left = left / right;
} else {
left = left % right;
}
if (!Number.isFinite(left)) throw new Error("overflow");
}
return left;
}
function parseAdditive() {
let left = parseMultiplicative();
while (true) {
const tok = peek();
if (!tok || (tok.kind !== "+" && tok.kind !== "-")) break;
const isPlus = tok.kind === "+";
advance();
const right = parseMultiplicative();
left = isPlus ? left + right : left - right;
if (!Number.isFinite(left)) throw new Error("overflow");
}
return left;
}
const value = parseAdditive();
if (cursor !== tokens.length) {
throw new Error("unparseable");
}
return value;
}
function formatArithmeticResult(value) {
if (!Number.isFinite(value)) return "non-finite";
if (Math.abs(value % 1) === 0 && Math.abs(value) < 1e15) {
return value.toFixed(0);
}
const rendered = value.toFixed(10);
const trimmed = rendered.replace(/0+$/, "").replace(/\.$/, "");
return trimmed === "" || trimmed === "-" ? "0" : trimmed;
}
function parseLinearExpression(input) {
let position = 0;
let variable = null;
function peek() {
return input[position] || "";
}
function skipWhitespace() {
while (/\s/.test(peek())) position += 1;
}
function consume(expected) {
if (peek() === expected) {
position += 1;
return true;
}
return false;
}
function constant(value) {
return { coefficient: 0, constant: value };
}
function variableValue() {
return { coefficient: 1, constant: 0 };
}
function hasVariable(value) {
return Math.abs(value.coefficient) > Number.EPSILON;
}
function add(left, right) {
return {
coefficient: left.coefficient + right.coefficient,
constant: left.constant + right.constant,
};
}
function subtract(left, right) {
return {
coefficient: left.coefficient - right.coefficient,
constant: left.constant - right.constant,
};
}
function multiply(left, right) {
if (hasVariable(left) && hasVariable(right)) {
throw new Error("non-linear equation");
}
if (hasVariable(left)) {
return {
coefficient: left.coefficient * right.constant,
constant: left.constant * right.constant,
};
}
if (hasVariable(right)) {
return {
coefficient: right.coefficient * left.constant,
constant: right.constant * left.constant,
};
}
return constant(left.constant * right.constant);
}
function divide(left, right) {
if (hasVariable(right)) throw new Error("variable denominator");
if (Math.abs(right.constant) <= Number.EPSILON) throw new Error("division by zero");
return {
coefficient: left.coefficient / right.constant,
constant: left.constant / right.constant,
};
}
function parseExpression() {
let value = parseTerm();
while (true) {
skipWhitespace();
if (consume("+")) {
value = add(value, parseTerm());
} else if (consume("-") || consume("−")) {
value = subtract(value, parseTerm());
} else {
return value;
}
}
}
function parseTerm() {
let value = parseFactor();
while (true) {
skipWhitespace();
if (consume("*") || consume("×") || consume("·")) {
value = multiply(value, parseFactor());
} else if (consume("/") || consume("÷")) {
value = divide(value, parseFactor());
} else {
return value;
}
}
}
function parseFactor() {
skipWhitespace();
if (consume("+")) return parseFactor();
if (consume("-") || consume("−")) {
const value = parseFactor();
return { coefficient: -value.coefficient, constant: -value.constant };
}
if (consume("(")) {
const value = parseExpression();
skipWhitespace();
if (!consume(")")) throw new Error("unbalanced parentheses");
return value;
}
if (/[0-9.]/.test(peek())) return parseNumber();
if (/\p{L}/u.test(peek())) return parseVariable();
throw new Error("expression could not be parsed");
}
function parseNumber() {
const start = position;
let hasDigit = false;
let hasDot = false;
while (/[0-9.]/.test(peek())) {
if (peek() === ".") {
if (hasDot) break;
hasDot = true;
} else {
hasDigit = true;
}
position += 1;
}
if (!hasDigit) throw new Error("expression could not be parsed");
const value = Number(input.slice(start, position));
if (!Number.isFinite(value)) throw new Error("expression could not be parsed");
return constant(value);
}
function parseVariable() {
const start = position;
while (/[\p{L}_]/u.test(peek())) position += 1;
const name = input.slice(start, position);
if (!name) throw new Error("expression could not be parsed");
if (variable && variable !== name) throw new Error("multiple variables");
variable = name;
return variableValue();
}
const value = parseExpression();
skipWhitespace();
if (position !== input.length) throw new Error("expression could not be parsed");
return { value, variable };
}
function solveLinearEquation(expression) {
const parts = String(expression).split("=");
if (parts.length !== 2) throw new Error("expression could not be parsed");
const left = parseLinearExpression(parts[0]);
const right = parseLinearExpression(parts[1]);
const variable = left.variable || right.variable;
if (!variable || (left.variable && right.variable && left.variable !== right.variable)) {
throw new Error("expression could not be parsed");
}
const coefficient = left.value.coefficient - right.value.coefficient;
if (Math.abs(coefficient) <= Number.EPSILON) {
throw new Error("expression could not be parsed");
}
const value = (right.value.constant - left.value.constant) / coefficient;
return `${variable} = ${formatArithmeticResult(value)}`;
}
function hasArithmeticWordOperator(expression) {
// Issue #386: the spelled operators come from the arithmetic_operation
// meanings (addition, subtraction, multiplication, division, modulo) by
// role, not a literal array. Each surface is matched as a whole token — CJK
// surfaces as a substring — the boundary contract the former space-padded
// `.includes` checks enforced. The match goes through the *spelled* query so
// a meaning's value surface (the operator symbol "+") stays neutral here and
// is caught by the symbol parser instead, mirroring contains_word_operator in
// src/calculation.rs.
return lexiconMentionsRoleSpelled(
ROLE_ARITHMETIC_OPERATOR_WORD,
String(expression).toLowerCase(),
);
}
function hasSpelledArithmetic(expression) {
// Issue #386: the cardinal number words come from the cardinal_number
// meanings by role, not a literal array. Pure-numeral surfaces ("10") are
// skipped — a bare digit run is handled by the numeric parser — and each
// spelled surface is matched as a space-bounded whole token, mirroring
// contains_spelled_arithmetic in src/calculation.rs.
const lower = ` ${String(expression).toLowerCase()} `;
const hasNumberWord = roleWordForms(ROLE_CARDINAL_NUMBER_WORD).some((form) => {
if (
[...form.text].every(
(character) => character >= "0" && character <= "9",
)
) {
return false;
}
return lower.includes(` ${form.text} `);
});
return hasNumberWord && hasArithmeticWordOperator(expression);
}
// Issue #334 step 2: the website demo's second agent step was "calculate the
// 10th Fibonacci number and multiply it by 8% of 500. Show me the code and the
// final result." It is not a calculator expression, but it reduces to one once
// the symbolic Fibonacci reference is resolved (F(10) = 55), the spelled-out
// operator is rewritten to `*`, and the trailing instruction sentence is
// dropped — yielding `55 * 8% of 500` = 2200. The helpers below mirror
// `fibonacci_value`, `parse_ordinal`, `bare_word`, `resolve_fibonacci_references`,
// `split_sentences` and `normalize_word_problem` in `src/calculation.rs`.
function fibonacciValue(n) {
if (n === 0) return 0;
let previous = 0;
let current = 1;
for (let step = 1; step < n; step += 1) {
const next = previous + current;
previous = current;
current = next;
}
return current;
}
const ORDINAL_WORDS = {
first: 1,
second: 2,
third: 3,
fourth: 4,
fifth: 5,
sixth: 6,
seventh: 7,
eighth: 8,
ninth: 9,
tenth: 10,
};
// Lowercased, punctuation-trimmed view of a token for keyword comparisons.
function trimNonAlnum(token) {
return String(token || "")
.replace(/^[^\p{L}\p{N}]+/u, "")
.replace(/[^\p{L}\p{N}]+$/u, "");
}
function bareWord(token) {
return trimNonAlnum(token).toLowerCase();
}
// Parse a leading ordinal/cardinal token such as "10th", "10", "3rd" or the
// spelled-out "tenth" into its numeric value. Returns null for anything else.
function parseOrdinal(token) {
const trimmed = trimNonAlnum(token);
if (!trimmed) return null;
const digits = (trimmed.match(/^[0-9]+/) || [""])[0];
if (digits) {
const suffix = trimmed.slice(digits.length);
if (suffix === "" || ["st", "nd", "rd", "th"].includes(suffix)) {
return Number.parseInt(digits, 10);
}
return null;
}
const value = ORDINAL_WORDS[trimmed.toLowerCase()];
return value === undefined ? null : value;
}
// Replace "(the) N-th Fibonacci number" references with their numeric value.
function resolveFibonacciReferences(text) {
if (!text.toLowerCase().includes("fibonacci")) return text;
const tokens = text.split(/\s+/).filter(Boolean);
const out = [];
let index = 0;
while (index < tokens.length) {
const n = parseOrdinal(tokens[index]);
if (
n !== null &&
tokens[index + 1] !== undefined &&
bareWord(tokens[index + 1]) === "fibonacci"
) {
// Drop a determiner we already emitted ("the 10th" -> "55").
if (out.length > 0 && bareWord(out[out.length - 1]) === "the") {
out.pop();
}
out.push(String(fibonacciValue(n)));
index += 2;
// Absorb a trailing "number" / "term" / "sequence" noun.
const noun = tokens[index] !== undefined ? bareWord(tokens[index]) : "";
if (noun === "number" || noun === "term" || noun === "sequence") {
index += 1;
}
continue;
}
out.push(tokens[index]);
index += 1;
}
return out.join(" ");
}
// Split text into sentences on a period that ends a sentence (followed by
// whitespace or the end of the string). A period flanked by digits ("3.14") is
// kept inside its sentence so decimals are never broken apart.
function splitSentences(text) {
const chars = Array.from(String(text || ""));
const sentences = [];
let current = "";
for (let i = 0; i < chars.length; i += 1) {
const ch = chars[i];
const next = chars[i + 1];
if (ch === "." && (next === undefined || /\s/.test(next))) {
const sentence = current.trim();
if (sentence) sentences.push(sentence);
current = "";
continue;
}
current += ch;
}
const last = current.trim();
if (last) sentences.push(last);
return sentences;
}
function wordProblemWords(sentence) {
return String(sentence || "")
.split(/[^\p{L}\p{N}]+/u)
.filter(Boolean)
.map((token) => token.toLowerCase());
}
function parseWordProblemInteger(token) {
const text = String(token || "").toLowerCase();
if (/^[+-]?\d+$/.test(text)) return Number.parseInt(text, 10);
const numbers = {
zero: 0,
one: 1,
a: 1,
an: 1,
two: 2,
three: 3,
four: 4,
five: 5,
six: 6,
seven: 7,
eight: 8,
nine: 9,
ten: 10,
eleven: 11,
twelve: 12,
thirteen: 13,
fourteen: 14,
fifteen: 15,
sixteen: 16,
seventeen: 17,
eighteen: 18,
nineteen: 19,
twenty: 20,
};
return Object.prototype.hasOwnProperty.call(numbers, text) ? numbers[text] : null;
}
function canonicalBoxId(token) {
const cleaned = trimNonAlnum(token).toUpperCase();
return cleaned && cleaned.length <= 3 ? cleaned : "";
}
function parseDeclaredBoxCount(words) {
if (
words.length >= 4 &&
words[0] === "i" &&
words[1] === "have" &&
(words[3] === "box" || words[3] === "boxes")
) {
const count = parseWordProblemInteger(words[2]);
return Number.isInteger(count) ? count : null;
}
return null;
}
function parseBoxRule(words) {
let index = words[0] === "if" ? 1 : 0;
if (words[index] !== "box" || words[index + 2] !== "has") return null;
const target = canonicalBoxId(words[index + 1]);
if (!target) return null;
index += 3;
if (
words[index] === "twice" &&
words[index + 1] === "as" &&
words[index + 2] === "many" &&
words[index + 4] === "as" &&
words[index + 5] === "box"
) {
const source = canonicalBoxId(words[index + 6]);
if (!source) return null;
return {
target,
rule: { kind: "multiple", factor: 2, source },
item: words[index + 3] || "",
};
}
const value = parseWordProblemInteger(words[index]);
if (!Number.isInteger(value)) return null;
if (
words[index + 1] === "more" &&
words[index + 3] === "than" &&
words[index + 4] === "box"
) {
const source = canonicalBoxId(words[index + 5]);
if (!source) return null;
return {
target,
rule: { kind: "add", source, addend: value },
item: words[index + 2] || "",
};
}
return {
target,
rule: { kind: "known", value },
item: words[index + 1] || "",
};
}
function resolveBoxValue(id, rules, memo, stack, reasoningSteps, resultLabel) {
if (memo.has(id)) return memo.get(id);
if (stack.includes(id)) return null;
const rule = rules.get(id);
if (!rule) return null;
stack.push(id);
let value = null;
if (rule.kind === "known") {
value = rule.value;
reasoningSteps.push(`Box ${id} = ${value} ${resultLabel}.`);
} else if (rule.kind === "multiple") {
const sourceValue = resolveBoxValue(
rule.source,
rules,
memo,
stack,
reasoningSteps,
resultLabel,
);
if (!Number.isFinite(sourceValue)) return null;
value = sourceValue * rule.factor;
reasoningSteps.push(
`Box ${id} = ${rule.factor} * ${sourceValue} = ${value} ${resultLabel}.`,
);
} else if (rule.kind === "add") {
const sourceValue = resolveBoxValue(
rule.source,
rules,
memo,
stack,
reasoningSteps,
resultLabel,
);
if (!Number.isFinite(sourceValue)) return null;
value = sourceValue + rule.addend;
reasoningSteps.push(
`Box ${id} = ${sourceValue} + ${rule.addend} = ${value} ${resultLabel}.`,
);
}
stack.pop();
if (!Number.isFinite(value)) return null;
memo.set(id, value);
return value;
}
function normalizeBoxTotalProblem(text) {
const lower = String(text || "").toLowerCase();
if (
!lower.includes("box") ||
!lower.includes("how many") ||
!lower.includes("total") ||
(!lower.includes("twice as many") &&
!(lower.includes("more") && lower.includes("than")))
) {
return null;
}
let declaredCount = null;
let resultLabel = "";
const rules = new Map();
for (const sentence of splitSentences(text)) {
const words = wordProblemWords(sentence);
if (words.length === 0) continue;
if (declaredCount === null) {
declaredCount = parseDeclaredBoxCount(words);
}
const parsed = parseBoxRule(words);
if (!parsed) continue;
if (parsed.item && parsed.item !== "box" && parsed.item !== "boxes") {
resultLabel = parsed.item;
}
rules.set(parsed.target, parsed.rule);
}
if (rules.size < 2) return null;
if (declaredCount !== null && rules.size < declaredCount) return null;
const label = resultLabel || "items";
const memo = new Map();
const reasoningSteps = [];
const ids = Array.from(rules.keys()).sort();
for (const id of ids) {
if (
!Number.isFinite(
resolveBoxValue(id, rules, memo, [], reasoningSteps, label),
)
) {
return null;
}
}
const values = ids.map((id) => memo.get(id));
if (values.some((value) => !Number.isFinite(value))) return null;
const expression = values.join(" + ");
reasoningSteps.push(`Total = ${expression} ${label}.`);
return { expression, reasoningSteps, resultLabel: label };
}
// Rewrite a natural-language "word problem" into a calculator expression, or
// return null when no rewrite applies so callers fall through unchanged.
function normalizeWordProblemDetailed(expression) {
const trimmed = String(expression || "").trim();
if (!trimmed) return null;
const boxProblem = normalizeBoxTotalProblem(trimmed);
if (boxProblem) return boxProblem;
// Keep only sentence fragments that carry arithmetic content, dropping pure
// instruction clauses such as "Show me the code and the final result".
const arithmetic = splitSentences(trimmed).filter(
(sentence) => sentence && (/[0-9]/.test(sentence) || sentence.includes("%")),
);
if (arithmetic.length === 0) return null;
let working = resolveFibonacciReferences(arithmetic.join(". "));
// Rewrite spelled-out operators the calculator does not accept. Longer phrases
// come first so "and multiply it by" wins over "multiply by".
const operatorPhrases = [
[" and multiply it by ", " * "],
[" and multiply by ", " * "],
[" multiply it by ", " * "],
[" multiplied by ", " * "],
[" multiply by ", " * "],
[" and divide it by ", " / "],
[" and divide by ", " / "],
[" divide it by ", " / "],
[" divided by ", " / "],
[" divide by ", " / "],
];
for (const [phrase, symbol] of operatorPhrases) {
const position = working.toLowerCase().indexOf(phrase);
if (position !== -1) {
working =
working.slice(0, position) + symbol + working.slice(position + phrase.length);
}
}
working = working.split(/\s+/).filter(Boolean).join(" ");
if (!working || working.toLowerCase() === trimmed.toLowerCase()) return null;
return { expression: working, reasoningSteps: [], resultLabel: "" };
}
// Issue #386: the calculator-domain signal set is rebuilt from three seed roles
// instead of a 62-entry literal array, so the router reasons over the same
// self-describing lexicon every other handler reads. Each surface is shaped into
// a match pattern by its script and role, mirroring calculator_domain_signals in
// src/calculation.rs:
//
// - math_function_name ("sqrt", "sin", "логарифм", "对数", …): an ASCII name gains
// only a leading space so it still fires when glued to its argument's
// parenthesis ("sqrt(16)"); a non-ASCII name matches as a raw substring because
// those scripts have no inter-word spaces.
// - calculation_domain_term (currencies and measurement units: "usd", "kg",
// "ms", "доллар", "公斤", "месяцев", …): an ASCII surface matches as a whole
// token (leading and trailing space) so a short code like "ms" never fires
// inside "items" nor "mb" inside "number"; a non-ASCII surface matches as a raw
// substring.
// - quantity_conversion_cue, CJK members only ("换成", …): the Chinese conversion
// verbs match as raw substrings; the Latin cues ("to", "into") are excluded
// here because they are far too common to mark a calculation on their own.
//
// The caller pads the lowercased expression with surrounding spaces and tests
// includes against each signal, so the set — not its order — decides.
function calculatorDomainSignals() {
const signals = [];
for (const surface of wordsForRole(ROLE_MATH_FUNCTION_NAME)) {
signals.push(isAsciiText(surface) ? ` ${surface}` : surface);
}
for (const surface of wordsForRole(ROLE_CALCULATION_DOMAIN_TERM)) {
signals.push(isAsciiText(surface) ? ` ${surface} ` : surface);
}
for (const surface of wordsForRole(ROLE_QUANTITY_CONVERSION_CUE)) {
if (containsCjk(surface)) {
signals.push(surface);
}
}
return signals;
}
function extractArithmeticExpression(prompt) {
const trimmed = String(prompt || "").trim();
if (!trimmed) return null;
const interpretations = [];
// Issue #386: the leading calculation cues come from the calculation_request
// meaning by role, not a literal array. Each bare surface is rebuilt into a
// strip prefix following its script — space-delimited scripts gain a trailing
// space so a cue strips only on a word boundary ("calculate" never eats the
// start of "calculated"), while CJK surfaces strip as-is because those
// scripts have no inter-word spaces. wordsForRole preserves declaration
// order, and the Chinese cues are stored longest first, so a more specific
// cue strips before a shorter one it contains. Mirrors
// strip_calculation_wrappers in src/calculation.rs.
const prefixes = wordsForRole(ROLE_CALCULATION_REQUEST_CUE).map((surface) =>
containsCjk(surface) ? surface : `${surface} `,
);
let working = trimmed;
let changed = true;
while (changed) {
changed = false;
const stripped = stripKnownPrefix(working, prefixes);
if (stripped) {
working = stripped.value;
if (stripped.interpretation) interpretations.push(stripped.interpretation);
changed = true;
}
}
working = working.replace(/[?.!]+$/g, "").trim();
// Issue #386: the trailing calculation cues come from the
// calculation_result_query and politeness meanings by role, not a literal
// array of regexes. Each surface is rebuilt into a strip suffix following its
// script — CJK surfaces strip as-is because those scripts have no inter-word
// spaces; a pure-symbol surface like the equals sign strips both bare and on a
// word boundary (so a compact "2*2+2=" is recognised); every other surface
// gains a leading space so the cue strips only on a word boundary. Mirrors
// calculation_wrapper_suffixes in src/calculation.rs.
const suffixes = [];
for (const role of [ROLE_CALCULATION_RESULT_QUERY_CUE, ROLE_POLITENESS_CUE]) {
for (const surface of wordsForRole(role)) {
if (containsCjk(surface)) {
suffixes.push(surface);
} else if (!/\p{L}/u.test(surface)) {
suffixes.push(` ${surface}`);
suffixes.push(surface);
} else {
suffixes.push(` ${surface}`);
}
}
}
changed = true;
while (changed) {
changed = false;
for (const suffix of suffixes) {
// Mirror strip_suffix_case_insensitive in src/calculation.rs: a
// case-insensitive endsWith followed by trimming the trailing whitespace.
if (working.toLowerCase().endsWith(suffix)) {
working = working.slice(0, working.length - suffix.length).trim();
changed = true;
break;
}
}
}
if (!working) return null;
// Issue #334 step 2: rewrite a natural-language word problem into a calculator
// expression ("the 10th Fibonacci number and multiply it by 8% of 500. Show me
// the code ..." -> "55 * 8% of 500") before the symbolic checks below run.
const wordProblem = normalizeWordProblemDetailed(working);
let reasoningSteps = [];
let resultLabel = "";
if (wordProblem) {
working = wordProblem.expression;
reasoningSteps = Array.isArray(wordProblem.reasoningSteps)
? wordProblem.reasoningSteps
: [];
resultLabel = wordProblem.resultLabel || "";
}
const workingLower = working.toLowerCase();
const hasLetter = /\p{L}/u.test(working);
const hasSymbolic = /[+*/%^=×·÷−$€¥₹₽]/.test(working) || (!hasLetter && /-/.test(working));
const hasWordOperator = hasArithmeticWordOperator(working);
const hasSpelled = hasSpelledArithmetic(working);
const hasPercentOf = evaluatePercentOfExpression(working) !== null;
const hasWord =
hasWordOperator ||
calculatorDomainSignals().some((signal) => ` ${workingLower} `.includes(signal));
const hasDigit = /[0-9]/.test(working);
if (!hasDigit && !hasSpelled) return null;
if (!hasSymbolic && !hasWord && hasLetter) return null;
const extracted = { expression: working, interpretations, reasoningSteps, resultLabel };
if (hasPercentOf) return extracted;
if (evaluateCurrencyConversionExpression(working) !== null) {
return extracted;
}
const allowed = /^[0-9+\-*/%().=\s_×·÷−,a-zA-Z]+$/;
if (!allowed.test(working) && !hasWordOperator) return null;
return extracted;
}
function extractFencedBlock(text, languages) {
const fence = "```";
let cursor = 0;
while (true) {
const open = text.indexOf(fence, cursor);
if (open === -1) return null;
const infoStart = open + fence.length;
const newlineRel = text.indexOf("\n", infoStart);
const infoEnd = newlineRel === -1 ? text.length : newlineRel;
const info = text.slice(infoStart, infoEnd).trim().toLowerCase();
const bodyStart = Math.min(infoEnd + 1, text.length);
const closeRel = text.indexOf(fence, bodyStart);
if (closeRel === -1) return null;
const body = text.slice(bodyStart, closeRel).replace(/\n+$/, "");
if (info === "" || languages.some((lang) => info === lang)) {
return body;
}
cursor = closeRel + fence.length;
}
}
function extractJavaScriptProgram(prompt) {
const lower = String(prompt || "").toLowerCase();
const asksToRun =
lower.includes("run this javascript") ||
lower.includes("run this js") ||
lower.includes("execute this javascript") ||
lower.includes("execute this js") ||
lower.includes("run the following javascript") ||
lower.includes("run the following js") ||
lower.includes("evaluate this javascript") ||
lower.includes("evaluate this js");
if (!asksToRun) return null;
const fenced = extractFencedBlock(prompt, ["javascript", "js"]);
if (fenced !== null) return fenced;
const backticks = prompt.match(/`([^`]+)`/);
if (backticks) return backticks[1];
const quoted = prompt.match(/"([^"]+)"/);
return quoted ? quoted[1] : null;
}
// Look up an intent route by id (e.g. "intent_greeting"). Returns `null`
// when the routing table is empty (no `.lino` seed) so callers can decide
// whether to fall back to legacy hardcoded matching.
function findIntentRoute(id) {
if (!INTENT_ROUTING || !Array.isArray(INTENT_ROUTING.intents)) return null;
for (const route of INTENT_ROUTING.intents) {
if (route && route.id === id) return route;
}
return null;
}
function tokensOf(normalized) {
return normalized ? normalized.split(/\s+/).filter(Boolean) : [];
}
function tokenContains(normalized, expected) {
return tokensOf(normalized).includes(String(expected || ""));
}
// Match a normalized prompt against an intent route using the same
// semantics as `src/engine.rs::matches_intent_route`:
// - `keywords` / `phrases`: exact whole-prompt match
// - `tokens`: any whitespace-separated token equals the value
// - `combos`: every combo entry must appear as a token
function matchesIntentRoute(normalized, rawPrompt, id) {
const route = findIntentRoute(id);
if (!route) return false;
const fromWasm = wasmMatchIntentRoute(normalized, rawPrompt, route);
if (fromWasm !== null) return fromWasm;
const raw = String(rawPrompt || "")
.toLowerCase()
.replace(/[?。.!!,,;:]+$/g, "")
.trim();
if (route.keywords && route.keywords.some((kw) => kw === normalized || kw === raw)) {
return true;
}
if (route.phrases && route.phrases.some((ph) => ph === normalized || ph === raw)) {
return true;
}
if (route.tokens && route.tokens.some((tok) => tokenContains(normalized, tok))) {
return true;
}
if (
route.combos &&
route.combos.some(
(combo) =>
Array.isArray(combo) &&
combo.length > 0 &&
combo.every((tok) => tokenContains(normalized, tok)),
)
) {
return true;
}
return false;
}
function isIdentityPrompt(normalized, rawPrompt) {
if (repositoryFromPrompt(rawPrompt)) return false;
return matchesIntentRoute(normalized, rawPrompt, "intent_identity");
}
function isAssistantNamePrompt(normalized, rawPrompt) {
return matchesIntentRoute(normalized, rawPrompt, "intent_assistant_name");
}
function isGreetingPrompt(normalized, rawPrompt) {
return matchesIntentRoute(normalized, rawPrompt, "intent_greeting");
}
function isFarewellPrompt(normalized, rawPrompt) {
return matchesIntentRoute(normalized, rawPrompt, "intent_farewell");
}
function isTestStatusPrompt(normalized, rawPrompt) {
return matchesIntentRoute(normalized, rawPrompt, "intent_test_status");
}
function isCourtesyResponsePrompt(normalized, rawPrompt) {
return matchesIntentRoute(normalized, rawPrompt, "intent_courtesy_response");
}
function isPunctuationOnlyPrompt(prompt) {
const trimmed = String(prompt || "").trim();
return /^[.!?…。?!]+$/.test(trimmed);
}
function stableBehaviorRuleId(prefix, value) {
const fromWasm = wasmStableId(prefix, value);
if (fromWasm) return fromWasm;
let hash = 0xcbf29ce484222325n;
const sourceBytes = new TextEncoder().encode(String(value || ""));
for (const byte of sourceBytes) {
hash ^= BigInt(byte);
hash = BigInt.asUintN(64, hash * 0x100000001b3n);
}
return `${prefix}_${hash.toString(16).padStart(16, "0")}`;
}
function extractQuotedPhrase(text) {
const source = String(text || "");
const pairs = [
['"', '"'],
["'", "'"],
["`", "`"],
["«", "»"],
];
for (const [open, close] of pairs) {
const start = source.indexOf(open);
if (start === -1) continue;
const end = source.indexOf(close, start + open.length);
if (end !== -1) return source.slice(start + open.length, end);
}
return null;
}
// Issue #386 translation roles — mirror the ROLE_TRANSLATION_* constants in
// src/seed/roles.rs. Each role's slot-marked surface words live in
// data/seed/meanings-translation.lino (embedded in MEANINGS_LINO above); the
// detection and extraction helpers ask the lexicon for those forms by meaning,
// slot, and script instead of hardcoding a per-language phrase list. This is
// the JS mirror of src/translation/language_markers.rs and
// src/translation/prompt.rs.
const ROLE_TRANSLATION_SOURCE_MARKER = "translation_source_marker";
const ROLE_TRANSLATION_TARGET_MARKER = "translation_target_marker";
const ROLE_TRANSLATION_TARGET_DIRECTION = "translation_target_direction";
const ROLE_TRANSLATION_UNQUOTED_FRAME = "translation_unquoted_frame";
const ROLE_TRANSLATION_INTO_MARKER = "translation_into_marker";
const ROLE_TRANSLATION_OBJECT_MARKER = "translation_object_marker";
// The ISO 639-1 code of the language_* meaning that defines a marker. Mirrors
// language_code in src/translation/language_markers.rs: the surface *names* of
// each language live in the seed; only this slug -> code bridge stays in code.
function translationLanguageCode(meaning) {
for (const slug of meaning.definedBy) {
if (slug === "language_english") return "en";
if (slug === "language_russian") return "ru";
if (slug === "language_hindi") return "hi";
if (slug === "language_chinese") return "zh";
}
return null;
}
// The first marker meaning of `role` (in declaration order) any of whose
// surface words is a substring of `normalized` reports its language. Plain
// substring matching — not the boundary-aware surfacePresent — is intentional
// and mirrors detect_marker_language in src/translation/language_markers.rs: a
// CJK marker like 从中文 has no word spaces, and a Cyrillic marker like
// "с английского" must match inside a longer sentence.
function detectTranslationMarkerLanguage(role, normalized) {
for (const meaning of meaningsWithRole(role)) {
if (meaning.words.some((word) => normalized.includes(word))) {
const code = translationLanguageCode(meaning);
if (code) return code;
}
}
return null;
}
let cachedTranslationMarkers = null;
// Project the translation-extraction markers out of the meaning lexicon, once.
// Each field is a semantic role narrowed to the slot and script its strategy
// needs, in declaration order — the code names a role and a shape, never a
// surface word. Mirrors markers() in src/translation/prompt.rs.
function translationMarkers() {
if (cachedTranslationMarkers) return cachedTranslationMarkers;
const scriptForms = (role, script) =>
roleWordForms(role)
.filter((form) => script(form.text))
.map((form) => form.text);
const bareScriptForms = (role, script) =>
roleWordForms(role)
.filter((form) => form.slot === "bare" && script(form.text))
.map((form) => form.before);
cachedTranslationMarkers = {
circumfixFrames: roleWordForms(ROLE_TRANSLATION_UNQUOTED_FRAME)
.filter((form) => form.slot === "circumfix")
.map((form) => [form.before, form.after]),
hindiVerbStems: bareScriptForms(
ROLE_TRANSLATION_UNQUOTED_FRAME,
containsDevanagari,
),
hindiTargetMarkers: scriptForms(
ROLE_TRANSLATION_INTO_MARKER,
containsDevanagari,
),
hindiObjectMarkers: scriptForms(
ROLE_TRANSLATION_OBJECT_MARKER,
containsDevanagari,
),
chineseCommandPrefixes: scriptForms(
ROLE_TRANSLATION_OBJECT_MARKER,
containsCjk,
),
chineseCommandMarkers: scriptForms(
ROLE_TRANSLATION_INTO_MARKER,
containsCjk,
),
chineseTranslatePrefixes: bareScriptForms(
ROLE_TRANSLATION_UNQUOTED_FRAME,
containsCjk,
),
chineseTargetMarkers: scriptForms(
ROLE_TRANSLATION_TARGET_DIRECTION,
containsCjk,
),
};
return cachedTranslationMarkers;
}
// Issue #216: extract the surface from unquoted translation prompts such as
// `translate apple to russian`, `переведи яблоко на английский`,
// `apple का हिंदी में अनुवाद करो`, or `把 apple 翻译成中文`. Returns null when
// the prompt already contains a quoted fragment or does not match a supported
// verb + target-marker pattern. Issue #386: every marker is now projected from
// the lexicon by role/slot/script — translationMarkers() above — so this code
// names the *shape* of each frame, never its words.
function extractUnquotedTranslationSurface(text) {
const source = String(text || "").trim();
const trimmed = source.replace(/[.!?。]+$/u, "");
const lower = trimmed.toLowerCase();
const markers = translationMarkers();
for (const [prefix, marker] of markers.circumfixFrames) {
const extracted = extractBetweenPrefixAndMarker(
trimmed,
lower,
prefix,
marker,
);
if (extracted) return extracted;
}
const hindi = extractHindiUnquotedTranslationSurface(trimmed, lower);
if (hindi) return hindi;
return extractChineseUnquotedTranslationSurface(trimmed, lower);
}
// The surface that sits between a circumfix frame's prefix and its trailing
// marker (e.g. "translate " … " to "). Mirrors extract_between_prefix_and_marker
// in src/translation/prompt.rs.
function extractBetweenPrefixAndMarker(original, lower, prefix, marker) {
if (!lower.startsWith(prefix)) return null;
const afterPrefix = lower.slice(prefix.length);
const markerIndex = afterPrefix.indexOf(marker);
if (markerIndex === -1) return null;
return cleanUnquotedTranslationSurface(
original.slice(prefix.length, prefix.length + markerIndex),
);
}
function cleanUnquotedTranslationSurface(candidate) {
const cleaned = String(candidate || "").trim();
if (!cleaned || /["'«»`“”‘’]/u.test(cleaned)) return null;
return cleaned;
}
// Head-final Hindi: "<surface> <object-marker> <target> में अनुवाद". Gated on a
// Devanagari translate stem (अनुवाद); the target markers and object markers are
// the Devanagari forms of the into-marker and object-marker roles. Mirrors
// extract_hindi_unquoted_surface in src/translation/prompt.rs.
function extractHindiUnquotedTranslationSurface(original, lower) {
const markers = translationMarkers();
if (!markers.hindiVerbStems.some((stem) => lower.includes(stem))) return null;
for (const targetMarker of markers.hindiTargetMarkers) {
const targetIndex = lower.indexOf(targetMarker);
if (targetIndex === -1) continue;
const beforeTarget = lower.slice(0, targetIndex);
for (const surfaceMarker of markers.hindiObjectMarkers) {
const surfaceEnd = beforeTarget.lastIndexOf(surfaceMarker);
if (surfaceEnd !== -1) {
return cleanUnquotedTranslationSurface(original.slice(0, surfaceEnd));
}
}
}
return null;
}
function firstMarkerOffset(text, markers) {
let best = null;
for (const marker of markers) {
const offset = text.indexOf(marker);
if (offset !== -1 && (best === null || offset < best)) best = offset;
}
return best;
}
// Head-initial Chinese: a command prefix (把/将) + command marker (翻译成 …), or a
// bare translate stem (翻译/翻譯) + target marker (成/为/到). Both prefix sets and
// marker sets are the Han forms of the object-marker / into-marker / unquoted-
// frame / target-direction roles. Mirrors extract_chinese_unquoted_surface in
// src/translation/prompt.rs.
function extractChineseUnquotedTranslationSurface(original, lower) {
const markers = translationMarkers();
for (const prefix of markers.chineseCommandPrefixes) {
if (!lower.startsWith(prefix)) continue;
const rest = lower.slice(prefix.length);
const markerIndex = firstMarkerOffset(rest, markers.chineseCommandMarkers);
if (markerIndex !== null) {
return cleanUnquotedTranslationSurface(
original.slice(prefix.length, prefix.length + markerIndex),
);
}
}
for (const prefix of markers.chineseTranslatePrefixes) {
if (!lower.startsWith(prefix)) continue;
const rest = lower.slice(prefix.length);
const markerIndex = firstMarkerOffset(rest, markers.chineseTargetMarkers);
if (markerIndex !== null) {
return cleanUnquotedTranslationSurface(
original.slice(prefix.length, prefix.length + markerIndex),
);
}
}
return null;
}
function escapeBehaviorRuleValue(value) {
return String(value || "")
.replaceAll("\\", "\\\\")
.replaceAll('"', '\\"')
.replaceAll("\n", "\\n");
}
function behaviorRuleRecords() {
const greeting = answerFor("greeting", "en");
const farewell = answerFor("farewell", "en");
const identity = answerFor("identity", "en");
const assistantName = answerFor("assistant_name", "en");
return [
{
id: "rule_greeting",
topic: "greetings",
intent: "greeting",
label: "Greeting rule",
matches: "`Hi`, `Hello`, `Hey`, and multilingual greeting seed phrases",
response: greeting,
source: "data/seed/intent-routing.lino + multilingual responses",
whenThen: `When the user says \`Hi\`, \`Hello\`, or \`Hey\` then respond with \`${greeting}\`.`,
},
{
id: "rule_farewell",
topic: "farewells",
intent: "farewell",
label: "Farewell rule",
matches: "`bye`, `goodbye`, `poka`, and multilingual farewell seed phrases",
response: farewell,
source: "data/seed/intent-routing.lino + multilingual responses",
whenThen: `When the user says \`bye\`, \`goodbye\`, or \`пока\` then respond with \`${farewell}\`.`,
},
{
id: "rule_identity",
topic: "identity",
intent: "identity",
label: "Identity rule",
matches: "`Who are you?`, `Кто ты?`, and equivalent identity prompts",
response: identity,
source: "data/seed/identity.lino + multilingual responses",
whenThen: `When the user asks \`Who are you?\` or \`Кто ты?\` then respond with \`${identity}\`.`,
},
{
id: "rule_assistant_name",
topic: "assistant_name",
intent: "assistant_name",
label: "Assistant name rule",
matches: "`What is your name?`, `Как твое имя?`, and equivalent name prompts",
response: assistantName,
source: "data/seed/intent-routing.lino + multilingual responses",
whenThen: `When the user asks \`What is your name?\` or \`Как твое имя?\` then respond with \`${assistantName}\`, unless the assistant name setting is configured.`,
},
{
id: "rule_capabilities",
topic: "capabilities",
intent: "capabilities",
label: "Capabilities rule",
matches: "`What can you do?`, `Что ты умеешь?`, and equivalent capability prompts",
response: "Lists the supported symbolic chat capabilities.",
source: "src/solver_handlers/user_intent.rs",
whenThen:
"When the user asks `What can you do?` or `Что ты умеешь?` then respond with the multilingual capability listing.",
},
{
id: "rule_write_program",
topic: "write_program",
intent: "write_program",
label: "Program template rule",
// Built from the live catalog so the advertised tasks stay in lock-step
// with `WRITE_PROGRAM_TASKS` (mirrors `supported_program_tasks` on the
// Rust side, issue #330).
matches:
"`write_program(language, task)` with languages " +
`${Object.keys(WRITE_PROGRAM_LANGUAGES).join(", ")} and tasks ` +
`${Object.keys(WRITE_PROGRAM_TASKS).join(", ")}`,
response: "Returns a minimal program from the parameterized template catalog.",
source: "data/seed/hello-world-programs.lino + src/coding/catalog.rs",
whenThen:
"When the user requests a program with supported `language` and `task` parameters then respond with the matching template through the single `write_program` intent.",
},
{
id: "rule_unknown",
topic: "unknown_fallback",
intent: "unknown",
label: "Unknown fallback rule",
matches: "Any prompt that no earlier rule or handler can answer",
response: answerFor("unknown", "en"),
source: "data/seed/multilingual-responses.lino",
whenThen:
"When no earlier rule or handler matches the prompt then respond with the multilingual unknown-intent guide (`List behavior rules`, `Show behavior rule`, `When I say … answer …`, `Report issue`, `Export memory`).",
},
];
}
const BEHAVIOR_RULE_TOPIC_ORDER = [
"greetings",
"farewells",
"identity",
"assistant_name",
"capabilities",
"write_program",
"unknown_fallback",
];
function localizedText(language, values) {
return values[language] || values.en;
}
function behaviorRuleTopicLabel(topic, language) {
switch (topic) {
case "greetings":
return localizedText(language, {
en: "Greetings",
ru: "Приветствия",
hi: "अभिवादन",
zh: "问候",
});
case "farewells":
return localizedText(language, {
en: "Farewells",
ru: "Прощания",
hi: "विदाई",
zh: "告别",
});
case "identity":
return localizedText(language, {
en: "Identity",
ru: "Идентичность",
hi: "पहचान",
zh: "身份",
});
case "assistant_name":
return localizedText(language, {
en: "Assistant name",
ru: "Имя ассистента",
hi: "सहायक का नाम",
zh: "助手名称",
});
case "capabilities":
return localizedText(language, {
en: "Capabilities",
ru: "Возможности",
hi: "क्षमताएँ",
zh: "能力",
});
case "write_program":
return localizedText(language, {
en: "Program templates",
ru: "Шаблоны программ",
hi: "Program templates",
zh: "程序模板",
});
case "unknown_fallback":
return localizedText(language, {
en: "Unknown fallback",
ru: "Резервный ответ",
hi: "अज्ञात अनुरोध का वैकल्पिक उत्तर",
zh: "未知请求回退",
});
default:
return localizedText(language, {
en: "Other",
ru: "Другое",
hi: "अन्य",
zh: "其他",
});
}
}
function behaviorRuleTopicOrder(topic) {
const index = BEHAVIOR_RULE_TOPIC_ORDER.indexOf(topic);
return index === -1 ? BEHAVIOR_RULE_TOPIC_ORDER.length : index;
}
function behaviorRuleListIntro(language) {
return localizedText(language, {
en: "Behavior rules I can inspect in this dialog (grouped by topic, each shown as a `When X then Y` statement):",
ru: "Правила поведения, которые я могу показать в этом диалоге (сгруппированы по темам; каждое показано как инструкция `Когда X тогда Y`):",
hi: "व्यवहार नियम जिन्हें मैं इस संवाद में दिखा सकता हूँ (विषय के अनुसार समूहित; हर नियम `जब X तब Y` कथन के रूप में है):",
zh: "我可以查看的行为规则(按主题分组;每条都显示为 `当 X 时 Y` 语句):",
});
}
function runtimeRulesHeading(language) {
return localizedText(language, {
en: "Dialog-local rules taught in this conversation",
ru: "Правила, изученные в этом диалоге",
hi: "इस संवाद में सिखाए गए स्थानीय नियम",
zh: "本对话中学到的局部规则",
});
}
function behaviorRuleListFooter(language) {
if (language === "ru") {
return [
"",
"Прочитать одно правило можно командой `Покажи правило unknown` или `Покажи правило rule_greeting`.",
"Научить этот диалог можно так: ``Когда `ваш запрос` тогда `ваш ответ` ``. Другие формы: ``Когда я скажу `ваш запрос`, ответь `ваш ответ` ``; ``Если я спрошу `ваш запрос`, ответь `ваш ответ` ``; ``Когда `ваш запрос` делай `ваш ответ` ``.",
"Многоязычные формы: английская ``When `X` then `Y` ``, хинди ``जब `X` तब `Y` ``, китайская ``当 `X` 时 `Y` ``.",
"Запись добавляется только в конец: экспортируйте память, чтобы сохранить сообщение с правилом вместе с диалогом.",
];
}
if (language === "hi") {
return [
"",
"एक नियम पढ़ने के लिए `Show behavior rule unknown` या `Show behavior rule rule_greeting` भेजें.",
"इस संवाद को सिखाएँ: ``जब `आपका प्रश्न` तब `आपका उत्तर` ``. अन्य रूप: ``When I say `your prompt`, answer `your answer` ``; ``If I ask `your prompt`, reply `your answer` ``; ``जब `आपका प्रश्न` तो `आपका उत्तर` ``.",
"बहुभाषी रूप: रूसी ``Когда `X` тогда `Y` ``, अंग्रेज़ी ``When `X` then `Y` ``, चीनी ``当 `X` 时 `Y` ``.",
"लेखन केवल append-only है: नियम संदेश को संवाद के साथ रखने के लिए memory export करें.",
];
}
if (language === "zh") {
return [
"",
"要读取一条规则,请发送 `Show behavior rule unknown` 或 `Show behavior rule rule_greeting`。",
"可以这样教当前对话:``当 `你的提示` 时 `你的回答` ``。等价形式:``When I say `your prompt`, answer `your answer` ``;``If I ask `your prompt`, reply `your answer` ``;``当 `你的提示` 则 `你的回答` ``。",
"多语言形式:俄语 ``Когда `X` тогда `Y` ``,印地语 ``जब `X` तब `Y` ``,英语 ``When `X` then `Y` ``。",
"写入是 append-only:导出 memory 可把这条规则消息随对话一起保存。",
];
}
return [
"",
"Read one with `Show behavior rule unknown` or `Show behavior rule rule_greeting`.",
"Teach this dialog with: ``When `your prompt` then `your answer` ``. Equivalent forms: ``When I say `your prompt`, answer `your answer` ``; ``If I ask `your prompt`, reply `your answer` ``; ``When `your prompt` do `your answer` ``.",
"Multilingual forms: Russian ``Когда `X` тогда `Y` `` / ``Когда `X` делай `Y` ``, Hindi ``जब `X` तब `Y` ``, Chinese ``当 `X` 时 `Y` ``.",
"The write is append-only: export memory to preserve the rule message with the dialog.",
];
}
function localizedRuleResponse(rule, language) {
if (rule.id === "rule_write_program") {
return localizedText(language, {
en: "Returns a minimal program from the parameterized template catalog.",
ru: "Возвращает минимальную программу из параметризованного каталога шаблонов.",
hi: "parameterized template catalog से minimal program लौटाता है.",
zh: "从参数化模板目录返回一个最小程序。",
});
}
switch (rule.id) {
case "rule_greeting":
return answerFor("greeting", language);
case "rule_farewell":
return answerFor("farewell", language);
case "rule_identity":
return answerFor("identity", language);
case "rule_assistant_name":
return localizedText(language, {
en: "Returns the assistant-name answer; browser surfaces can override it from the assistant name setting.",
ru: "Возвращает ответ об имени ассистента; браузерные поверхности могут переопределить его настройкой имени ассистента.",
hi: "assistant-name उत्तर लौटाता है; browser surfaces assistant name setting से इसे बदल सकते हैं.",
zh: "返回助手名称回答;浏览器界面可通过助手名称设置覆盖它。",
});
case "rule_capabilities":
return localizedText(language, {
en: "Lists the supported symbolic chat capabilities.",
ru: "Перечисляет поддерживаемые возможности символьного чата.",
hi: "समर्थित symbolic chat क्षमताओं को सूचीबद्ध करता है.",
zh: "列出支持的符号聊天能力。",
});
case "rule_unknown":
return answerFor("unknown", language);
default:
return rule.response;
}
}
function localizedRuleLabel(rule, language) {
if (rule.id === "rule_write_program") {
return localizedText(language, {
en: "Program template rule",
ru: "Правило шаблона программы",
hi: "Program template rule",
zh: "程序模板规则",
});
}
const labels = {
rule_greeting: {
en: "Greeting rule",
ru: "Правило приветствия",
hi: "अभिवादन नियम",
zh: "问候规则",
},
rule_farewell: {
en: "Farewell rule",
ru: "Правило прощания",
hi: "विदाई नियम",
zh: "告别规则",
},
rule_identity: {
en: "Identity rule",
ru: "Правило идентичности",
hi: "पहचान नियम",
zh: "身份规则",
},
rule_assistant_name: {
en: "Assistant name rule",
ru: "Правило имени ассистента",
hi: "सहायक नाम नियम",
zh: "助手名称规则",
},
rule_capabilities: {
en: "Capabilities rule",
ru: "Правило возможностей",
hi: "क्षमता नियम",
zh: "能力规则",
},
rule_unknown: {
en: "Unknown fallback rule",
ru: "Резервное правило для неизвестного запроса",
hi: "अज्ञात अनुरोध का वैकल्पिक नियम",
zh: "未知请求回退规则",
},
};
return labels[rule.id] ? localizedText(language, labels[rule.id]) : rule.label;
}
function localizedRuleMatches(rule, language) {
if (rule.id === "rule_write_program") {
return localizedText(language, {
en: "`write_program(language, task)` with supported languages and tasks",
ru: "`write_program(language, task)` с поддерживаемыми языками и задачами",
hi: "supported languages और tasks वाला `write_program(language, task)`",
zh: "带受支持语言和任务的 `write_program(language, task)`",
});
}
const matches = {
rule_greeting: {
en: "`Hi`, `Hello`, `Hey`, and multilingual greeting seed phrases",
ru: "`Hi`, `Hello`, `Hey` и многоязычные seed-фразы приветствия",
hi: "`Hi`, `Hello`, `Hey` और बहुभाषी greeting seed phrases",
zh: "`Hi`、`Hello`、`Hey` 以及多语言问候 seed 短语",
},
rule_farewell: {
en: "`bye`, `goodbye`, `poka`, and multilingual farewell seed phrases",
ru: "`bye`, `goodbye`, `poka` и многоязычные seed-фразы прощания",
hi: "`bye`, `goodbye`, `poka` और बहुभाषी farewell seed phrases",
zh: "`bye`、`goodbye`、`poka` 以及多语言告别 seed 短语",
},
rule_identity: {
en: "`Who are you?`, `Кто ты?`, and equivalent identity prompts",
ru: "`Who are you?`, `Кто ты?` и равнозначные вопросы об идентичности",
hi: "`Who are you?`, `Кто ты?` और समान identity prompts",
zh: "`Who are you?`、`Кто ты?` 以及等价身份提示",
},
rule_assistant_name: {
en: "`What is your name?`, `Как тебя зовут?`, and equivalent name prompts",
ru: "`What is your name?`, `Как тебя зовут?` и равнозначные вопросы об имени",
hi: "`What is your name?`, `Как тебя зовут?` और समान name prompts",
zh: "`What is your name?`、`Как тебя зовут?` 以及等价名称提示",
},
rule_capabilities: {
en: "`What can you do?`, `Что ты умеешь?`, and equivalent capability prompts",
ru: "`What can you do?`, `Что ты умеешь?` и равнозначные вопросы о возможностях",
hi: "`What can you do?`, `Что ты умеешь?` और समान capability prompts",
zh: "`What can you do?`、`Что ты умеешь?` 以及等价能力提示",
},
rule_unknown: {
en: "Any prompt that no earlier rule or handler can answer",
ru: "Любой запрос, на который не ответило более раннее правило или обработчик",
hi: "कोई भी prompt जिसका उत्तर पहले का rule या handler नहीं दे सकता",
zh: "任何前面的规则或处理器无法回答的提示",
},
};
return matches[rule.id] ? localizedText(language, matches[rule.id]) : rule.matches;
}
function localizedRuleWhenThen(rule, language) {
if (rule.id === "rule_write_program") {
if (language === "ru") {
return "Когда пользователь просит программу с поддерживаемыми параметрами `language` и `task`, ответь соответствующим шаблоном через единое намерение `write_program`.";
}
if (language === "hi") {
return "जब उपयोगकर्ता supported `language` और `task` parameters वाला program माँगे, तब single `write_program` intent से matching template दें.";
}
if (language === "zh") {
return "当用户请求带受支持 `language` 和 `task` 参数的程序时,通过单个 `write_program` 意图选择匹配模板。";
}
return rule.whenThen;
}
const response = localizedRuleResponse(rule, language);
if (rule.id === "rule_greeting") {
if (language === "ru") return `Когда пользователь говорит \`Hi\`, \`Hello\`, \`Hey\` или многоязычную фразу приветствия, ответь \`${response}\`.`;
if (language === "hi") return `जब उपयोगकर्ता \`Hi\`, \`Hello\`, \`Hey\` या बहुभाषी greeting phrase कहे, तब \`${response}\` उत्तर दें.`;
if (language === "zh") return `当用户说 \`Hi\`、\`Hello\`、\`Hey\` 或多语言问候短语时,回答 \`${response}\`。`;
}
if (rule.id === "rule_farewell") {
if (language === "ru") return `Когда пользователь говорит \`bye\`, \`goodbye\`, \`poka\` или многоязычную фразу прощания, ответь \`${response}\`.`;
if (language === "hi") return `जब उपयोगकर्ता \`bye\`, \`goodbye\`, \`poka\` या बहुभाषी farewell phrase कहे, तब \`${response}\` उत्तर दें.`;
if (language === "zh") return `当用户说 \`bye\`、\`goodbye\`、\`poka\` 或多语言告别短语时,回答 \`${response}\`。`;
}
if (rule.id === "rule_identity") {
if (language === "ru") return `Когда пользователь спрашивает \`Who are you?\` или \`Кто ты?\`, ответь \`${response}\`.`;
if (language === "hi") return `जब उपयोगकर्ता \`Who are you?\` या \`Кто ты?\` पूछे, तब \`${response}\` उत्तर दें.`;
if (language === "zh") return `当用户问 \`Who are you?\` 或 \`Кто ты?\` 时,回答 \`${response}\`。`;
}
if (rule.id === "rule_assistant_name") {
if (language === "ru") return "Когда пользователь спрашивает `What is your name?` или `Как тебя зовут?`, ответь сообщением об имени ассистента; если поверхность поддерживает настройку имени, включи настроенное имя.";
if (language === "hi") return "जब उपयोगकर्ता `What is your name?` या `Как тебя зовут?` पूछे, तब assistant-name उत्तर दें; अगर surface में assistant-name setting है, तो configured name शामिल करें.";
if (language === "zh") return "当用户问 `What is your name?` 或 `Как тебя зовут?` 时,回答助手名称;如果界面有助手名称设置,则包含配置的名称。";
}
if (rule.id === "rule_capabilities") {
if (language === "ru") return "Когда пользователь спрашивает `What can you do?` или `Что ты умеешь?`, ответь многоязычным списком возможностей.";
if (language === "hi") return "जब उपयोगकर्ता `What can you do?` या `Что ты умеешь?` पूछे, तब बहुभाषी capability listing दें.";
if (language === "zh") return "当用户问 `What can you do?` 或 `Что ты умеешь?` 时,回答多语言能力列表。";
}
if (rule.id === "rule_unknown") {
if (language === "ru") return "Когда ни одно более раннее правило или обработчик не подходит к запросу, ответь многоязычной подсказкой для неизвестного намерения (`Покажи правила`, `Покажи правило`, `Когда ... тогда ...`, `Сообщить о проблеме`, `Экспорт памяти`).";
if (language === "hi") return "जब कोई पहले का rule या handler prompt से मेल न खाए, तब unknown-intent guide दें (`नियम दिखाएँ`, `rule दिखाएँ`, `जब ... तब ...`, `Report issue`, `Export memory`).";
if (language === "zh") return "当前面的规则或处理器都不匹配提示时,回答未知意图指南(`显示规则`、`显示规则详情`、`当 ... 时 ...`、`报告问题`、`导出 memory`)。";
}
return rule.whenThen;
}
function runtimeRuleWhenThen(rule, language) {
if (language === "ru") {
return `Когда пользователь говорит \`${rule.trigger}\`, ответь \`${rule.answer}\`.`;
}
if (language === "hi") {
return `जब उपयोगकर्ता \`${rule.trigger}\` कहे, तब \`${rule.answer}\` उत्तर दें.`;
}
if (language === "zh") {
return `当用户说 \`${rule.trigger}\` 时,回答 \`${rule.answer}\`。`;
}
return `When the user says \`${rule.trigger}\` then respond with \`${rule.answer}\`.`;
}
function renderBehaviorRuleList(runtimeRules, language = "en") {
const lines = [behaviorRuleListIntro(language), ""];
const groups = new Map();
for (const rule of behaviorRuleRecords()) {
const order = behaviorRuleTopicOrder(rule.topic);
if (!groups.has(order)) {
groups.set(order, { label: behaviorRuleTopicLabel(rule.topic, language), rules: [] });
}
groups.get(order).rules.push(rule);
}
const ordered = Array.from(groups.entries()).sort((a, b) => a[0] - b[0]);
ordered.forEach(([, group], index) => {
lines.push(`### ${group.label}`);
for (const rule of group.rules) {
lines.push(`- \`${rule.id}\` -> ${localizedRuleWhenThen(rule, language)}`);
}
if (index + 1 < ordered.length) lines.push("");
});
if (Array.isArray(runtimeRules) && runtimeRules.length > 0) {
lines.push("", `### ${runtimeRulesHeading(language)}`);
for (const rule of runtimeRules) {
lines.push(
`- \`${rule.id}\` -> ${runtimeRuleWhenThen(rule, language)}`,
);
}
}
lines.push(...behaviorRuleListFooter(language));
return lines.join("\n");
}
function renderBehaviorRuleDetail(rule, language = "en") {
const label = localizedRuleLabel(rule, language);
const whenThen = localizedRuleWhenThen(rule, language);
const matches = localizedRuleMatches(rule, language);
const response = localizedRuleResponse(rule, language);
const changeHint = localizedText(language, {
en: "To change this behavior in the current dialog, send: ``When `your prompt` then `your answer` ``. Equivalent: ``When I say `your prompt`, answer `your answer` ``.",
ru: "Чтобы изменить это поведение в текущем диалоге, отправьте: ``Когда `ваш запрос` тогда `ваш ответ` ``. Также можно: ``Когда я скажу `ваш запрос`, ответь `ваш ответ` ``.",
hi: "इस व्यवहार को वर्तमान संवाद में बदलने के लिए भेजें: ``जब `आपका प्रश्न` तब `आपका उत्तर` ``. दूसरा रूप: ``When I say `your prompt`, answer `your answer` ``.",
zh: "要在当前对话中改变此行为,请发送:``当 `你的提示` 时 `你的回答` ``。也可以发送:``When I say `your prompt`, answer `your answer` ``。",
});
return [
label,
"",
whenThen,
"",
"```links",
rule.id,
` topic "${escapeBehaviorRuleValue(rule.topic)}"`,
` intent "${escapeBehaviorRuleValue(rule.intent)}"`,
` matches "${escapeBehaviorRuleValue(matches)}"`,
` response "${escapeBehaviorRuleValue(response)}"`,
` source "${escapeBehaviorRuleValue(rule.source)}"`,
` when_then "${escapeBehaviorRuleValue(whenThen)}"`,
"```",
"",
changeHint,
].join("\n");
}
function assistantNameStatus(preferences) {
const name = normalizeAssistantNamePreference(
preferences && preferences.assistantName,
);
return name ? `configured:${name}` : "browser_preference_when_set_else_not_configured";
}
const BROWSER_SURFACE = {
slug: "browser",
label: "browser demo with JavaScript and WebAssembly worker",
runtime: "JavaScript UI plus a WebAssembly worker mirror of the solver",
memory: "browser IndexedDB/local storage plus worker state and imported memory",
webSearch: "available through browser CORS-readable providers when online and not blocked",
limits: "browser settings, import/export controls, and IndexedDB-backed memory belong to this surface",
};
function modeStatus(enabled) {
return enabled ? "enabled" : "disabled";
}
function definitionFusionStatus(preferences) {
return preferences && preferences.definitionFusion === "auto"
? "enabled_by_default"
: "explicit_only";
}
function blueprintCompositionStatus(preferences) {
return normalizeBlueprintComposition(
preferences && preferences.blueprintComposition,
);
}
function renderSelfFacts(preferences) {
const assistantName = assistantNameStatus(preferences);
const surface = BROWSER_SURFACE;
return [
"Facts I know about myself in this environment:",
"",
`- **Execution surface**: ${surface.label} (\`${surface.slug}\`).`,
`- **Runtime**: ${surface.runtime}.`,
`- **Memory**: ${surface.memory}.`,
`- **Web search**: ${surface.webSearch}.`,
`- **Surface limits**: ${surface.limits}.`,
"- **Local rules**: local links rules and seed facts are checked first.",
"",
"```links",
"self_fact_model",
' subject "formal-ai"',
' relation "model"',
` object "${escapeBehaviorRuleValue(AGENT_INFO.model || "formal-symbolic-production")}"`,
"self_fact_policy",
' subject "formal-ai"',
' relation "policy"',
' object "deterministic symbolic AI; no neural network inference"',
"self_fact_environment",
' subject "formal-ai"',
' relation "execution_surface"',
` object "${surface.slug}"`,
"self_fact_runtime",
' subject "formal-ai"',
' relation "runtime"',
` object "${escapeBehaviorRuleValue(surface.runtime)}"`,
"self_fact_memory",
' subject "formal-ai"',
' relation "memory"',
` object "${escapeBehaviorRuleValue(surface.memory)}"`,
"self_fact_web_search",
' subject "formal-ai"',
' relation "web_search"',
` object "${escapeBehaviorRuleValue(surface.webSearch)}"`,
"self_fact_assistant_name",
' subject "formal-ai"',
' relation "assistant_name"',
` object "${escapeBehaviorRuleValue(assistantName)}"`,
"self_fact_agent_mode",
' subject "formal-ai"',
' relation "agent_mode"',
` object "${modeStatus(preferences && preferences.agentMode)}"`,
"self_fact_diagnostics",
' subject "formal-ai"',
' relation "diagnostic_mode"',
` object "${modeStatus(preferences && preferences.diagnosticsMode)}"`,
"self_fact_definition_fusion",
' subject "formal-ai"',
' relation "definition_fusion"',
` object "${definitionFusionStatus(preferences)}"`,
"self_fact_blueprint_composition",
' subject "formal-ai"',
' relation "blueprint_composition"',
` object "${blueprintCompositionStatus(preferences)}"`,
"```",
"",
"Read behavior with `List behavior rules`; teach one with When `prompt` then `answer` (or When I say `prompt`, answer `answer`).",
].join("\n");
}
function renderKnownFacts(language, preferences) {
const surface = BROWSER_SURFACE;
const assistantName = assistantNameStatus(preferences);
const links = [
"```links",
"known_fact_local_seed",
' source "local_links_notation_seed"',
' scope "built-in rules, concepts, facts, tools, and response templates"',
"known_fact_internet",
' source "environment_aware_web_search"',
` scope "${escapeBehaviorRuleValue(surface.webSearch)}"`,
"known_fact_memory",
' source "conversation_memory"',
` scope "${escapeBehaviorRuleValue(surface.memory)}"`,
"known_fact_environment",
' subject "formal-ai"',
' relation "execution_surface"',
` object "${surface.slug}"`,
"known_fact_self",
' subject "formal-ai"',
' relation "model"',
` object "${escapeBehaviorRuleValue(AGENT_INFO.model || "formal-symbolic-production")}"`,
"known_fact_assistant_name",
' subject "formal-ai"',
' relation "assistant_name_setting"',
` object "${escapeBehaviorRuleValue(assistantName)}"`,
"known_fact_surface_limits",
' source "environment_directory"',
` scope "${escapeBehaviorRuleValue(surface.limits)}"`,
"```",
].join("\n");
if (language === "ru") {
return [
`Я могу использовать несколько классов фактов в текущей среде \`${surface.slug}\`:`,
"",
"- **Локальные факты и правила**: встроенный seed Links Notation, включая правила, понятия, инструменты и ответы.",
`- **Интернет**: ${surface.webSearch}; это не означает, что весь интернет предзагружен в локальную память.`,
`- **Память диалога**: ${surface.memory}.`,
"- **Факты о себе**: модель `formal-symbolic-production`, политика исполнения, поверхность и источники ответов.",
`- **Ограничения среды**: ${surface.limits}.`,
"",
links,
"",
"Для конкретного факта задайте прямой вопрос; порядок проверки: локальные правила, память, затем веб-поиск, если он доступен в этой среде.",
].join("\n");
}
if (language === "hi") {
return [
`मैं current \`${surface.slug}\` environment में इन fact sources का उपयोग कर सकता हूँ:`,
"",
"- **Local facts and rules**: Links Notation seed में rules, concepts, tools और response templates.",
`- **Internet**: ${surface.webSearch}; पूरा internet local memory में preload नहीं है.`,
`- **Conversation memory**: ${surface.memory}.`,
"- **Self facts**: model `formal-symbolic-production`, execution surface और answer sources.",
`- **Surface limits**: ${surface.limits}.`,
"",
links,
"",
"किसी खास fact के लिए सीधे पूछें; मैं local rules और memory पहले देखता हूँ, फिर environment अनुमति दे तो web search इस्तेमाल करता हूँ.",
].join("\n");
}
if (language === "zh") {
return [
`在当前 \`${surface.slug}\` 环境中, 我可以使用这些事实来源:`,
"",
"- **本地事实和规则**: Links Notation seed 中的规则、概念、工具和回复模板。",
`- **Internet**: ${surface.webSearch}; 整个互联网不会预加载到本地记忆中。`,
`- **Conversation memory**: ${surface.memory}。`,
"- **Self facts**: model `formal-symbolic-production`, execution surface 和 answer sources。",
`- **Surface limits**: ${surface.limits}。`,
"",
links,
"",
"如果需要某个具体事实, 请直接提问; 我会先检查本地规则和记忆, 环境允许时再使用 web search。",
].join("\n");
}
return [
`I can use several classes of facts in the current \`${surface.slug}\` environment:`,
"",
"- **Local facts and rules**: built-in Links Notation seed data, including rules, concepts, tools, and response templates.",
`- **Internet**: ${surface.webSearch}; the whole internet is not preloaded into local memory.`,
`- **Conversation memory**: ${surface.memory}.`,
"- **Self facts**: model `formal-symbolic-production`, execution policy, active surface, and answer sources.",
`- **Surface limits**: ${surface.limits}.`,
"",
links,
"",
"Ask for a specific fact directly; I check local rules and memory first, then use web search only when this environment allows it.",
].join("\n");
}
function renderRuntimeRuleUpdate(rule, language = "en") {
const whenThenText = runtimeRuleWhenThen(rule, language);
const title = localizedText(language, {
en: "Behavior rule recorded for this dialog.",
ru: "Правило поведения записано для этого диалога.",
hi: "इस संवाद के लिए व्यवहार नियम record किया गया.",
zh: "已为本对话记录行为规则。",
});
const sendHint =
language === "ru"
? `Отправьте \`${rule.trigger}\` сейчас, и я отвечу настроенным ответом. Экспортируйте память, чтобы сохранить это правило вместе с диалогом.`
: language === "hi"
? `\`${rule.trigger}\` अभी भेजें और मैं configured response से उत्तर दूँगा. इस rule message को dialog के साथ रखने के लिए memory export करें.`
: language === "zh"
? `现在发送 \`${rule.trigger}\`,我会使用配置的回答。导出 memory 可把这条规则消息随对话一起保存。`
: `Send \`${rule.trigger}\` now and I will answer with the configured response. Export memory to keep this rule message with the dialog.`;
return [
title,
"",
whenThenText,
"",
"```links",
rule.id,
' type "behavior_rule_runtime"',
` match_prompt "${escapeBehaviorRuleValue(rule.trigger)}"`,
` answer "${escapeBehaviorRuleValue(rule.answer)}"`,
` when_then "${escapeBehaviorRuleValue(whenThenText)}"`,
' source "user_message"',
"```",
"",
sendHint,
].join("\n");
}
// Issue #386: recognise a request to list the assistant's behavior rules by
// *meaning*, not a hardcoded per-language phrase list. The standalone phrases
// (role rule_listing_phrase) and the three compositional dimensions
// (rule_listing_subject / rule_listing_request / rule_listing_scope) live in
// data/seed/meanings-behavior-rules.lino. Mirror of is_behavior_rules_list in
// src/solver_handlers/behavior_rules.rs.
function isBehaviorRulesList(normalized) {
return (
matchesBehaviorRulesListSeedPattern(normalized) ||
lexiconMentionsRoleSubstring(ROLE_RULE_LISTING_PHRASE, normalized) ||
isSupportedLanguageBehaviorRulesListQuery(normalized)
);
}
function matchesBehaviorRulesListSeedPattern(normalized) {
return PROMPT_PATTERNS.some((pattern) => {
if (!pattern || pattern.intent !== "behavior_rules_list" || !pattern.text) {
return false;
}
const text = normalizePrompt(pattern.text);
if (!text) return false;
switch (pattern.kind) {
case "keyword":
case "phrase":
return normalized === text || normalized.includes(text);
case "prefix":
return normalized.startsWith(text);
case "suffix":
return normalized.endsWith(text);
default:
return false;
}
});
}
// True when the prompt, within one supported language's vocabulary, names the
// rule subject, asks to enumerate it, and scopes the request to the assistant's
// own behavior. The three dimensions are read from the meaning lexicon
// (rule_listing_subject / rule_listing_request / rule_listing_scope) rather than
// hardcoded per-language word lists. The per-language AND is preserved: every
// dimension must be evidenced within the SAME language (wordsForRoleInLanguages),
// matched as a raw substring to keep the legacy stem match byte-for-byte. Mirror
// of is_supported_language_behavior_rules_list_query in
// src/solver_handlers/behavior_rules.rs.
function isSupportedLanguageBehaviorRulesListQuery(normalized) {
const present = (role, language) =>
wordsForRoleInLanguages(role, [language]).some((word) =>
normalized.includes(word),
);
return ["en", "ru", "hi", "zh"].some(
(language) =>
present(ROLE_RULE_LISTING_SUBJECT, language) &&
present(ROLE_RULE_LISTING_REQUEST, language) &&
present(ROLE_RULE_LISTING_SCOPE, language),
);
}
// Issue #386: recognise a request to list the assistant's own facts by
// *meaning*, not a hardcoded per-language phrase list. The self_fact_query role
// gathers every surface from data/seed/meanings-intent.lino; mirror of
// is_self_fact_query in src/solver_handlers/self_awareness.rs. The prompt is
// re-normalized first because some call sites pass a merely-lowercased string
// (trailing "?" intact) and the boundary-aware matcher expects punctuation
// already collapsed to spaces.
function isSelfFactQuery(normalized) {
return lexiconMentionsRole(ROLE_SELF_FACT_QUERY, normalizePrompt(normalized));
}
// Issue #386: recognise "introduce yourself" / "расскажи о себе" /
// "अपना परिचय दो" / "介绍一下你自己" by the self_introduction_request meaning
// role. The pre-check is preserved verbatim: an empty prompt, or one that is
// really a self-fact query, must not be treated as an introduction request, so
// "list all facts you know about yourself" still routes to the self-fact
// branch. Mirror of is_self_introduction_query in
// src/solver_handlers/self_awareness.rs.
function isSelfIntroductionQuery(normalized) {
const cleaned = normalizePrompt(normalized);
if (!cleaned || isSelfFactQuery(cleaned)) return false;
return lexiconMentionsRole(ROLE_SELF_INTRODUCTION_REQUEST, cleaned);
}
function selfAwarenessLanguage(prompt, normalized) {
// Issue #386: language is detected purely by Unicode script ranges. The
// Cyrillic range below already subsumes the former second-person pronoun
// list (ty/tebya/tvoy/vy/...), every member of which is Cyrillic, so no raw
// word list is needed -- the script range is the universal signal. Mirror of
// self_awareness_language in src/solver_handlers/self_awareness.rs.
const text = `${String(prompt || "").toLowerCase()} ${String(normalized || "")}`;
if (/[\u0400-\u04ff]/u.test(text)) return "ru";
if (/[\u0900-\u097f]/u.test(text)) return "hi";
if (/[\u4e00-\u9fff]/u.test(text)) return "zh";
return detectLanguage(prompt);
}
function selfIntroductionContent(language, preferences) {
const identity = answerFor("identity", language);
const name = normalizeAssistantNamePreference(
preferences && preferences.assistantName,
);
if (!name) return identity;
if (language === "ru") return `Меня зовут ${name}. ${identity}`;
if (language === "hi") return `मेरा नाम ${name} है। ${identity}`;
if (language === "zh") return `我的名字是 ${name}。${identity}`;
return `My name is ${name}. ${identity}`;
}
function cleanConversationTopic(raw) {
return String(raw || "")
.trim()
.replace(/^[`"':._,\-\s!?]+|[`"':._,\-\s!?]+$/gu, "");
}
function conversationTopic(prompt, normalized) {
// Recognized surfaces — the let-us-talk-about-X phrasings in every supported
// language — carry the conversation_topic_opener role; each is a prefix whose
// text before the … slot is the matchable opener, in declaration order. A
// form whose action is "scan" is also matched anywhere in the prompt, not only
// at the start, so an opener that follows a greeting is still found. No
// per-language opener list lives here — only the concept. Mirrors
// conversation_topic in src/solver_handlers/benchmark_prompts.rs (issue #386).
const forms = roleWordForms(ROLE_CONVERSATION_TOPIC_OPENER);
for (const form of forms) {
if (normalized.startsWith(form.before)) {
return cleanConversationTopic(normalized.slice(form.before.length));
}
}
const lower = String(prompt || "").toLowerCase();
for (const form of forms) {
if (form.action !== "scan") continue;
const index = lower.indexOf(form.before);
if (index >= 0) {
return cleanConversationTopic(lower.slice(index + form.before.length));
}
}
return "";
}
function conversationTopicContent(topic, language) {
if (language === "ru") {
return `Можем. Тема: ${topic}. Я могу начать с краткого определения, контекста или конкретного вопроса; если веб-поиск доступен, публичные факты можно уточнить через внешний источник.`;
}
if (language === "hi") {
return `हम बात कर सकते हैं. विषय: ${topic}. मैं छोटी परिभाषा, संदर्भ, या किसी конкрет प्रश्न से शुरू कर सकता हूँ; web search उपलब्ध हो तो public facts बाहरी स्रोत से जाँचे जा सकते हैं.`;
}
if (language === "zh") {
return `可以聊。主题: ${topic}。我可以从简短定义、上下文或具体问题开始; 如果 web search 可用, 公开事实可以通过外部来源核对。`;
}
return `We can talk about ${topic}. I can start with a short definition, context, or a specific question; when web search is available, public facts can be checked against an external source.`;
}
// Issue #386: a known-facts inventory query is recognised by composing meaning
// roles, not by matching raw words per language. The universal algorithm is
// identical for every language: the prompt either names the knowledge `fact`
// noun together with an enumerating interrogative and a second-person
// attribution of knowing, or it matches one of the complete standalone
// phrasings that ask what the assistant knows even without the noun. The
// prompt is re-normalised first so the boundary-aware matcher sees punctuation
// collapsed to spaces. Mirror of is_known_fact_query in
// src/solver_handlers/self_awareness.rs.
function isKnownFactQuery(normalized) {
if (isSelfFactQuery(normalized)) return false;
const cleaned = normalizePrompt(normalized);
const composed =
lexiconMentionsRole(ROLE_KNOWLEDGE_INVENTORY_NOUN, cleaned) &&
lexiconMentionsRole(ROLE_KNOWLEDGE_INVENTORY_INTERROGATIVE, cleaned) &&
lexiconMentionsRole(ROLE_KNOWLEDGE_POSSESSION, cleaned);
return (
composed || lexiconMentionsRole(ROLE_KNOWLEDGE_INVENTORY_PHRASE, cleaned)
);
}
function cleanRuleQuery(raw) {
return String(raw || "")
.trim()
.replace(/^[\s`"':._,\-?!]+|[\s`"':._,\-?!]+$/g, "")
.toLowerCase();
}
function detailQuery(prompt) {
const lower = String(prompt || "").toLowerCase();
const prefixes = [
"show behavior rule",
"read behavior rule",
"describe behavior rule",
"show rule",
"read rule",
"details for rule",
"детали правила",
"покажи правило",
"прочитай правило",
];
for (const prefix of prefixes) {
if (lower.startsWith(prefix)) {
return cleanRuleQuery(String(prompt || "").slice(prefix.length));
}
}
if (lower.includes("rule_unknown")) return "unknown";
return "";
}
function findBehaviorRule(query) {
const cleaned = cleanRuleQuery(query);
const withoutPrefix = cleaned.startsWith("rule_") ? cleaned.slice(5) : cleaned;
return behaviorRuleRecords().find(
(rule) =>
rule.id === cleaned ||
rule.id === `rule_${withoutPrefix}` ||
rule.intent === cleaned ||
rule.intent === withoutPrefix ||
rule.label.toLowerCase().includes(withoutPrefix),
);
}
function codeSpans(text) {
return String(text || "")
.split("`")
.map((part, index) => (index % 2 === 1 ? part.trim() : ""))
.filter(Boolean);
}
// Issue #144 / #386: recognize behavior-rule updates expressed as `When X then
// Y` (and translations) in addition to the explicit `When I say … answer …`
// grammar. No keyword is named here any more — every surface lives in the
// embedded meaning lexicon (data/seed/meanings-skill-compiler.lino) and is read
// by semantic role, mirroring explicit_teaching_form + looks_like_skill_description
// in src/skill_compiler.rs:
// * a teaching trigger lead that co-occurs with a teaching response verb, or a
// standalone behaviour-rule edit directive (the explicit teaching form); and
// * a when-then frame whose circumfix surface brackets the trigger and answer —
// the literal before the … (U+2026) is the head, the literal after it is the
// link; both must appear, head before link, with at least one backtick on
// each side so the runtime extractor can pull the trigger and answer
// deterministically.
const ROLE_SKILL_TEACHING_TRIGGER_LEAD = "skill_teaching_trigger_lead";
const ROLE_SKILL_TEACHING_RESPONSE_VERB = "skill_teaching_response_verb";
const ROLE_BEHAVIOR_RULE_EDIT_DIRECTIVE = "behavior_rule_edit_directive";
const ROLE_SKILL_WHEN_THEN_PAIR = "skill_when_then_pair";
function looksLikeRuntimeRuleUpdate(text) {
const raw = String(text || "");
const lower = raw.toLowerCase();
if (
(lexiconMentionsRoleSubstring(ROLE_SKILL_TEACHING_TRIGGER_LEAD, lower) &&
lexiconMentionsRoleSubstring(ROLE_SKILL_TEACHING_RESPONSE_VERB, lower)) ||
lexiconMentionsRoleSubstring(ROLE_BEHAVIOR_RULE_EDIT_DIRECTIVE, lower)
) {
return true;
}
for (const form of roleWordForms(ROLE_SKILL_WHEN_THEN_PAIR)) {
if (form.slot !== "circumfix") continue;
const head = form.before;
const link = form.after;
const headPos = lower.indexOf(head);
if (headPos === -1) continue;
const tail = lower.slice(headPos + head.length);
const linkPos = tail.indexOf(link);
if (linkPos === -1) continue;
const absoluteLinkPos = headPos + head.length + linkPos;
const beforeLink = raw.slice(headPos, absoluteLinkPos);
const afterLink = raw.slice(absoluteLinkPos + link.length);
if (beforeLink.includes("`") && afterLink.includes("`")) return true;
}
return false;
}
function runtimeRuleFromText(text) {
if (!looksLikeRuntimeRuleUpdate(text)) return null;
const spans = codeSpans(text);
if (spans.length < 2) return null;
const trigger = spans[0].trim();
const answer = spans[1].trim();
if (!trigger || !answer) return null;
return {
id: stableBehaviorRuleId("behavior_rule_runtime", `${trigger}\n${answer}`),
trigger,
answer,
};
}
function runtimeRuleForPrompt(prompt, history) {
const normalizedPrompt = normalizePrompt(prompt);
const turns = Array.isArray(history) ? history : [];
for (let index = turns.length - 1; index >= 0; index -= 1) {
const turn = turns[index] || {};
if (String(turn.role || "").toLowerCase() !== "user") continue;
const rule = runtimeRuleFromText(turn.content);
if (rule && normalizePrompt(rule.trigger) === normalizedPrompt) {
return rule;
}
}
return null;
}
function collectRuntimeRules(history) {
const turns = Array.isArray(history) ? history : [];
const seen = new Set();
const rules = [];
for (const turn of turns) {
const role = String((turn || {}).role || "").toLowerCase();
if (role !== "user") continue;
const rule = runtimeRuleFromText((turn || {}).content);
if (rule && !seen.has(rule.id)) {
seen.add(rule.id);
rules.push(rule);
}
}
return rules;
}
function tryBehaviorRules(prompt, normalized, history, preferences) {
const language = detectLanguage(prompt);
const updateRule = runtimeRuleFromText(prompt);
if (updateRule) {
return {
intent: "behavior_rule_update",
content: renderRuntimeRuleUpdate(updateRule, language),
confidence: 1.0,
evidence: ["behavior_rule:update", updateRule.id],
};
}
if (isBehaviorRulesList(normalized)) {
return {
intent: "behavior_rules_list",
content: renderBehaviorRuleList(collectRuntimeRules(history), language),
confidence: 1.0,
evidence: ["behavior_rules:list", "all"],
};
}
const query = detailQuery(prompt);
if (query) {
const rule = findBehaviorRule(query);
if (rule) {
return {
intent: "behavior_rule_detail",
content: renderBehaviorRuleDetail(rule, language),
confidence: 1.0,
evidence: ["behavior_rule:read", rule.id],
};
}
}
if (isSelfIntroductionQuery(normalized)) {
const language = selfAwarenessLanguage(prompt, normalized);
return {
intent: "identity",
content: selfIntroductionContent(language, preferences),
confidence: 1.0,
evidence: [
"identity:self_introduction",
`language:${language}`,
`assistant_name:${assistantNameStatus(preferences)}`,
],
};
}
if (isArchitectureQuestion(normalized)) {
const language = architectureLanguage(prompt, normalized);
return {
intent: "meta_explanation",
content: architectureExplanationContent(language),
confidence: 1.0,
evidence: [
"response:meta_explanation",
"meta_explanation:self_awareness",
`language:${language}`,
],
};
}
if (isSelfFactQuery(normalized)) {
return {
intent: "self_facts",
content: renderSelfFacts(preferences),
confidence: 1.0,
evidence: ["self_facts:list", "formal-ai"],
};
}
if (isKnownFactQuery(normalized)) {
const language = selfAwarenessLanguage(prompt, normalized);
return {
intent: "known_facts",
content: renderKnownFacts(language, preferences),
confidence: 1.0,
evidence: ["known_facts:list", "formal-ai", `language:${language}`],
};
}
const topic = conversationTopic(prompt, normalized);
if (topic) {
const language = selfAwarenessLanguage(prompt, normalized);
return {
intent: "conversation_topic",
content: conversationTopicContent(topic, language),
confidence: 0.75,
evidence: [`conversation_topic:${topic}`, `language:${language}`],
};
}
const runtimeRule = runtimeRuleForPrompt(prompt, history);
if (runtimeRule) {
return {
intent: "behavior_rule_custom",
content: runtimeRule.answer,
confidence: 1.0,
evidence: ["behavior_rule:match", runtimeRule.id],
};
}
return null;
}
function containsAny(normalized, values) {
if (!normalized || !Array.isArray(values)) return false;
return values.some((value) => value && normalized.includes(String(value).toLowerCase()));
}
// Issue #386 feature-capability roles — mirror the ROLE_FEATURE_* consts in
// src/seed/roles.rs. Their surface forms live in
// data/seed/meanings-feature-capability.lino (embedded in MEANINGS_LINO above).
// detectFeatureCapability walks the `feature_capability_alias` meanings in seed
// declaration order (= the historical FEATURE_CAPABILITIES priority) and takes
// the first whose multilingual aliases occur as a raw substring; the question
// gate and the two action gates reference the other roles. No surface word is
// named here — they all live in the data.
const ROLE_FEATURE_CAPABILITY_ALIAS = "feature_capability_alias";
const ROLE_FEATURE_CAPABILITY_QUESTION = "feature_capability_question";
const ROLE_FEATURE_ACTION_ARITHMETIC = "feature_action_arithmetic";
const ROLE_FEATURE_ACTION_PLANNING = "feature_action_planning";
const FEATURE_CAPABILITIES = [
{
slug: "web_search",
state: "web_search",
labels: { en: "web search", ru: "веб-поиск", hi: "web search", zh: "web search" },
examples: {
en: "Search the web for Nikola Tesla",
ru: "Найди в интернете Никола Тесла",
hi: "Search the web for Nikola Tesla",
zh: "Search the web for Nikola Tesla",
},
},
{
slug: "diagnostics",
state: "diagnostics",
labels: { en: "diagnostics", ru: "диагностика", hi: "diagnostics", zh: "诊断" },
examples: {
en: "Turn on diagnostics",
ru: "Включи диагностику",
hi: "Turn on diagnostics",
zh: "开启诊断",
},
},
{
slug: "agent_mode",
state: "agent_mode",
labels: { en: "agent mode", ru: "agent mode", hi: "agent mode", zh: "agent mode" },
examples: {
en: "Turn on agent mode",
ru: "Включи agent mode",
hi: "Turn on agent mode",
zh: "开启 agent mode",
},
},
{
slug: "definition_fusion",
state: "definition_fusion",
labels: {
en: "automatic definition fusion",
ru: "автоматическое слияние определений",
hi: "automatic definition fusion",
zh: "自动 definition fusion",
},
examples: {
en: "Turn on definition fusion",
ru: "Включи слияние определений",
hi: "Turn on definition fusion",
zh: "开启 definition fusion",
},
},
{
slug: "configuration",
state: "always",
labels: {
en: "message-driven configuration",
ru: "настройка через сообщения",
hi: "message-driven configuration",
zh: "消息驱动设置",
},
examples: {
en: "Switch to dark theme",
ru: "Переключи тему на темную",
hi: "Switch to dark theme",
zh: "切换到深色主题",
},
},
{
slug: "memory_actions",
state: "always",
labels: {
en: "memory import/export",
ru: "импорт и экспорт памяти",
hi: "memory import/export",
zh: "记忆导入/导出",
},
examples: {
en: "Export memory",
ru: "Экспортируй память",
hi: "Export memory",
zh: "导出记忆",
},
},
{
slug: "greeting",
state: "always",
labels: { en: "greetings", ru: "приветствия", hi: "अभिवादन", zh: "问候" },
examples: { en: "Hello", ru: "Привет", hi: "नमस्ते", zh: "你好" },
},
{
slug: "write_program",
state: "always",
labels: {
en: "program template generation",
ru: "генерация программ",
hi: "program template generation",
zh: "程序生成",
},
examples: {
en: "Write a Python program that counts to three",
ru: "Напиши hello world на Rust",
hi: "Write a Python program that counts to three",
zh: "Write a Python program that counts to three",
},
},
{
slug: "concept_lookup",
state: "always",
labels: { en: "concept lookup", ru: "поиск понятий", hi: "concept lookup", zh: "概念查找" },
examples: {
en: "What is Wikipedia?",
ru: "Что такое Википедия?",
hi: "विकिपीडिया क्या है?",
zh: "什么是维基百科?",
},
},
{
slug: "arithmetic",
state: "always",
labels: { en: "arithmetic", ru: "арифметика", hi: "अंकगणित", zh: "算术" },
examples: {
en: "What is 2 + 2?",
ru: "Сколько будет 2 + 2?",
hi: "2 + 2 क्या है?",
zh: "2 + 2 等于多少?",
},
},
{
slug: "translation",
state: "always",
labels: { en: "translation", ru: "перевод", hi: "अनुवाद", zh: "翻译" },
examples: {
en: 'Translate "hello" to Russian',
ru: 'Переведи "hello" на русский',
hi: 'Translate "hello" to Hindi',
zh: 'Translate "hello" to Chinese',
},
},
{
slug: "memory",
state: "always",
labels: {
en: "conversation memory",
ru: "память разговора",
hi: "conversation memory",
zh: "会话记忆",
},
examples: {
en: "My name is Ada. What is my name?",
ru: "Меня зовут Ада. Как меня зовут?",
hi: "My name is Ada. What is my name?",
zh: "My name is Ada. What is my name?",
},
},
{
slug: "demo_mode",
state: "always",
labels: { en: "demo mode", ru: "демо-режим", hi: "demo mode", zh: "演示模式" },
examples: { en: "Turn off demo mode", ru: "Выключи демо", hi: "Turn off demo mode", zh: "关闭演示" },
},
{
slug: "http_url",
state: "always",
labels: {
en: "URL fetch/navigation",
ru: "HTTP-запросы и переходы по URL",
hi: "URL fetch/navigation",
zh: "URL fetch/navigation",
},
examples: {
en: "Navigate to example.com",
ru: "Перейди на example.com",
hi: "Navigate to example.com",
zh: "Navigate to example.com",
},
},
{
slug: "javascript_execution",
state: "always",
labels: {
en: "JavaScript execution",
ru: "выполнение JavaScript",
hi: "JavaScript execution",
zh: "JavaScript execution",
},
examples: {
en: "Run JavaScript: 1 + 1",
ru: "Выполни JavaScript: 1 + 1",
hi: "Run JavaScript: 1 + 1",
zh: "Run JavaScript: 1 + 1",
},
},
{
slug: "planning",
state: "always",
labels: {
en: "summaries, brainstorming, roleplay, and project planning",
ru: "резюме, брейншторминг, роли и планирование проектов",
hi: "summaries, brainstorming, roleplay, and project planning",
zh: "总结、头脑风暴、角色扮演和项目计划",
},
examples: {
en: "Brainstorm 5 project ideas",
ru: "Предложи 5 идей проекта",
hi: "Brainstorm 5 project ideas",
zh: "Brainstorm 5 project ideas",
},
},
];
function localizedValue(record, language) {
if (!record || typeof record !== "object") return "";
return record[language] || record.en || "";
}
// Walk the `feature_capability_alias` meanings in seed declaration order — the
// historical FEATURE_CAPABILITIES priority — and return the first capability
// whose multilingual forms occur as a raw substring of `normalized`, checked in
// the prompt's own language plus English (English prompts check English only).
// The matched meaning's slug, minus its `feature_capability_` prefix, keys
// FEATURE_CAPABILITIES, so no surface alias is named here. Mirrors
// detect_feature_capability in src/solver_handlers/feature_capability.rs (#386).
function detectFeatureCapability(normalized, language) {
const languages = language === "en" ? ["en"] : [language, "en"];
const meaning = firstRoleMatchInLanguagesRaw(
ROLE_FEATURE_CAPABILITY_ALIAS,
normalized,
languages,
);
if (!meaning) return null;
const prefix = "feature_capability_";
if (!meaning.slug.startsWith(prefix)) return null;
const slug = meaning.slug.slice(prefix.length);
return FEATURE_CAPABILITIES.find((feature) => feature.slug === slug) || null;
}
// A prompt is a capability question when one of the `feature_capability_question`
// interrogative cues occurs as a raw substring, checked in the prompt's own
// detected language only. English prompts additionally accept a grammatical
// "is/are ... enabled/available" frame computed in code. Mirrors
// is_feature_capability_question in
// src/solver_handlers/feature_capability.rs (#386).
function isFeatureCapabilityQuestion(normalized, language) {
const mentions = (lang) =>
mentionsRoleInLanguagesRaw(ROLE_FEATURE_CAPABILITY_QUESTION, normalized, [lang]);
if (language === "ru") return mentions("ru");
if (language === "zh") return mentions("zh");
if (language === "hi") return mentions("hi");
return mentions("en") || isEnglishAvailabilityQuestion(normalized);
}
// English-only grammatical "is/are ... enabled/available" availability frame —
// a grammatical pattern (not a vocabulary list), so it stays in code. Mirrors
// is_english_availability_question in
// src/solver_handlers/feature_capability.rs (#386).
function isEnglishAvailabilityQuestion(normalized) {
return /\b(?:is|are)\s+(?:your\s+|the\s+|this\s+|formal-ai\s+)?[\w\s/-]{1,80}\s+(?:enabled|available)\b/.test(
normalized,
);
}
// True when a detected capability question is actually an action request that a
// dedicated handler should answer. The English action frames live in the
// `feature_action_arithmetic` / `feature_action_planning` meanings; they are
// read through wordsForRoleInLanguages restricted to English and reconstructed
// as space-padded forms (prefix for arithmetic, anywhere for planning), so no
// frame is named here. Mirrors is_feature_action_request in
// src/solver_handlers/feature_capability.rs (#386).
function isFeatureActionRequest(normalized, feature) {
if (!feature) return false;
if (feature.slug === "arithmetic") {
return wordsForRoleInLanguages(ROLE_FEATURE_ACTION_ARITHMETIC, ["en"]).some(
(frame) => normalized.startsWith(`${frame} `),
);
}
if (feature.slug === "planning") {
return wordsForRoleInLanguages(ROLE_FEATURE_ACTION_PLANNING, ["en"]).some(
(frame) => normalized.includes(`${frame} `),
);
}
return false;
}
function webSearchStatusContent(language, available, providers) {
const providerList = providers || "none";
const rrfK = webSearchRrfK();
if (language === "ru") {
return available
? `Да. В этой конфигурации веб-поиск включен: я могу использовать DuckDuckGo Instant Answer по умолчанию и доступные CORS-провайдеры (\`${providerList}\`) для явных запросов вроде \`Найди в интернете Никола Тесла\`. Результаты из top-10 по каждому провайдеру объединяются через reciprocal rank fusion (k = ${rrfK}). Если провайдеры отключены или заблокированы в браузерной сессии, я сообщу об этом вместо ответа "да".`
: "Нет. В этой браузерной сессии веб-поиск сейчас недоступен: браузер offline или все CORS-readable поисковые провайдеры отключены после ошибок. Я могу отвечать по локальным правилам и кэшу, но не буду обращаться к поисковым системам.";
}
if (language === "zh") {
return available
? `可以。当前配置启用了 web search:我会默认使用 DuckDuckGo Instant Answer,并可使用这些 CORS-readable provider(\`${providerList}\`)处理明确的搜索请求,例如 \`Search the web for Nikola Tesla\`。每个 provider 的 top-10 结果会用 reciprocal rank fusion 合并(k = ${rrfK})。如果浏览器会话中所有 provider 被禁用或阻止,我会说明不可用,而不是回答可以。`
: "不可以。当前浏览器会话中 web search 不可用:浏览器 offline,或所有 CORS-readable 搜索 provider 都因错误被禁用。我仍可使用本地规则和缓存回答,但不会调用搜索引擎。";
}
if (language === "hi") {
return available
? `हाँ। इस configuration में web search enabled है: मैं default रूप से DuckDuckGo Instant Answer और उपलब्ध CORS-readable providers (\`${providerList}\`) का उपयोग explicit prompts जैसे \`Search the web for Nikola Tesla\` के लिए कर सकता हूँ। हर provider के top-10 results reciprocal rank fusion (k = ${rrfK}) से merge होते हैं। अगर browser session में providers disabled या blocked हों, तो मैं "हाँ" कहने के बजाय स्थिति बताऊँगा।`
: "नहीं। इस browser session में web search अभी available नहीं है: browser offline है या सभी CORS-readable search providers errors के बाद disabled हैं। मैं local rules और cache से जवाब दे सकता हूँ, लेकिन search engines को call नहीं करूँगा।";
}
return available
? `Yes. Web search is enabled in this configuration: I can use DuckDuckGo Instant Answer by default plus the configured CORS-readable providers (\`${providerList}\`) for explicit prompts such as \`Search the web for Nikola Tesla\`. The top-10 results from each provider are merged with reciprocal rank fusion (k = ${rrfK}). If the browser session disables or blocks every provider, I will say that instead of claiming search is available.`
: "No. Web search is unavailable in this browser session: the browser is offline or every CORS-readable search provider has been disabled after errors. I can still answer from local rules and cache, but I will not call search engines.";
}
function featureAvailability(feature, preferences) {
if (!feature) return { available: false, reason: "unknown" };
if (feature.state === "web_search") {
const providers = WEB_SEARCH_PROVIDERS.filter((provider) => !webSearchIsDisabled(provider.id));
const online = typeof navigator === "undefined" || navigator.onLine !== false;
return {
available: online && providers.length > 0,
reason: online && providers.length > 0 ? "none" : "offline_or_no_providers",
providers,
};
}
if (feature.state === "diagnostics") {
const available = Boolean(preferences && preferences.diagnosticsMode);
return { available, reason: available ? "none" : "diagnostics_off" };
}
if (feature.state === "agent_mode") {
const available = Boolean(preferences && preferences.agentMode);
return { available, reason: available ? "none" : "agent_mode_off" };
}
if (feature.state === "definition_fusion") {
const available = definitionFusionByDefault(preferences || {});
return { available, reason: available ? "none" : "definition_fusion_explicit" };
}
return { available: true, reason: "none" };
}
function unavailableReasonText(reason, language) {
const reasons = {
offline_or_no_providers: {
en: "the browser is offline or no search providers are available",
ru: "браузер offline или нет доступных поисковых провайдеров",
hi: "browser offline है या कोई search provider available नहीं है",
zh: "浏览器 offline,或没有可用搜索 provider",
},
diagnostics_off: {
en: "diagnostics are off; enable them to show traces",
ru: "диагностика выключена; включите ее, чтобы видеть трассировку",
hi: "diagnostics off है; trace दिखाने के लिए इसे enable करें",
zh: "诊断已关闭;开启后才会显示 trace",
},
agent_mode_off: {
en: "agent mode is off; multi-step actions require explicit opt-in",
ru: "agent mode выключен; для многошаговых действий нужен явный opt-in",
hi: "agent mode off है; multi-step actions के लिए explicit opt-in चाहिए",
zh: "agent mode 已关闭;多步骤操作需要显式启用",
},
definition_fusion_explicit: {
en: "automatic definition fusion is set to explicit-only",
ru: "автоматическое слияние определений работает только после включения режима auto",
hi: "automatic definition fusion के लिए auto mode enable करना होगा",
zh: "自动 definition fusion 需要切换到 auto 模式",
},
};
return localizedValue(reasons[reason] || { en: "not available" }, language);
}
function featureCapabilityContent(feature, language, availability) {
if (feature.slug === "web_search") {
const providers = availability.providers || [];
return webSearchStatusContent(
language,
availability.available,
providers.map((provider) => provider.id).join(", "),
);
}
const label = localizedValue(feature.labels, language);
const example = localizedValue(feature.examples, language);
if (availability.available) {
if (language === "ru") {
return `Да. Возможность «${label}» доступна в этой конфигурации. Пример сообщения: \`${example}\`.`;
}
if (language === "zh") {
return `可以。当前配置中「${label}」可用。示例消息:\`${example}\`。`;
}
if (language === "hi") {
return `हाँ। इस configuration में \`${label}\` available है। Example message: \`${example}\`.`;
}
return `Yes. ${label} is available in this configuration. Example message: \`${example}\`.`;
}
const reason = unavailableReasonText(availability.reason, language);
if (language === "ru") {
return `Нет. Возможность «${label}» сейчас недоступна в этой конфигурации: ${reason}. Пример сообщения после включения: \`${example}\`.`;
}
if (language === "zh") {
return `不可以。当前配置中「${label}」不可用:${reason}。启用后的示例消息:\`${example}\`。`;
}
if (language === "hi") {
return `नहीं। इस configuration में \`${label}\` अभी available नहीं है: ${reason}. Enable करने के बाद example message: \`${example}\`.`;
}
return `No. ${label} is not available in this configuration: ${reason}. Example message after enabling it: \`${example}\`.`;
}
function tryFeatureCapabilityStatus(prompt, normalized, language, preferences) {
if (!isFeatureCapabilityQuestion(normalized, language)) return null;
const feature = detectFeatureCapability(normalized, language);
if (!feature) return null;
if (isFeatureActionRequest(normalized, feature)) return null;
const availability = featureAvailability(feature, preferences || {});
const providers = WEB_SEARCH_PROVIDERS.filter((provider) => !webSearchIsDisabled(provider.id));
return {
intent: "capabilities",
content: featureCapabilityContent(feature, language, availability),
confidence: availability.available ? 0.95 : 0.6,
evidence: [
"handler:capabilities",
`feature:question:${feature.slug}`,
availability.available
? `feature:available:${feature.slug}`
: `feature:unavailable:${feature.slug}:${availability.reason}`,
...(feature.slug === "web_search" ? providers.map((provider) => `web_search:provider:${provider.id}`) : []),
`language:${language}`,
],
};
}
// Issue #386: recognise "what else can you do" / "что ещё ты умеешь" /
// "और क्या कर सकते" / "你还能做什么" by the capability_query_more meaning role
// rather than a hardcoded per-language phrase list. Recognition is
// language-agnostic because the surface words are script-specific; the response
// body is still chosen by the caller from detectLanguage. The prompt is
// re-normalised so trailing punctuation collapses to the canonical spacing the
// seed stores. Mirror of is_more_capabilities_prompt in
// src/solver_handlers/user_intent.rs.
function isMoreCapabilitiesPrompt(normalized) {
return lexiconMentionsRole(ROLE_CAPABILITY_QUERY_MORE, normalizePrompt(normalized));
}
// Issue #386: recognise "what can you do" / "что ты умеешь" / "что за дичь" /
// "आप क्या कर सकते" / "你能做什么" by the capability_query meaning role — plus
// its follow-up capability_query_more, so "what else can you do" still counts —
// rather than a hardcoded per-language phrase list. Mirror of
// is_capability_query in src/solver_handlers/user_intent.rs.
function isCapabilityQuery(normalized) {
const cleaned = normalizePrompt(normalized);
return (
lexiconMentionsRole(ROLE_CAPABILITY_QUERY, cleaned) ||
lexiconMentionsRole(ROLE_CAPABILITY_QUERY_MORE, cleaned)
);
}
function historyMentionsWebSearch(history) {
if (!Array.isArray(history)) return false;
return history.some((turn) => {
const content = String(turn && turn.content ? turn.content : "").toLowerCase();
return lexiconMentionsRoleSubstring(ROLE_WEB_SEARCH_HISTORY_SIGNAL, content);
});
}
function additionalCapabilitiesContent(language) {
if (language === "ru") {
return "Кроме уже названных возможностей, могу ещё:\n\n- **Арифметика**: вычислять выражения вроде «Сколько будет 2 + 2?»\n- **Перевод**: переводить короткие фразы между поддерживаемыми языками.\n- **Поиск понятий**: объяснять термины, например «Что такое Википедия?»\n- **Hello World**: генерировать минимальные программы на Rust, Python, JavaScript, Go, C и других языках.\n- **Память диалога**: использовать предыдущие сообщения текущей сессии.\n- **Правила поведения**: показывать встроенные правила через `Покажи правила поведения` и `Покажи правило unknown`.\n- **Настройки и действия**: включать диагностику/демо/agent mode, менять тему, язык, стиль чата, экспортировать и импортировать память.";
}
return "Beyond the capability already discussed, I can also:\n\n- **Arithmetic**: evaluate expressions like `2 + 2`.\n- **Translation**: translate short phrases between supported languages.\n- **Concept lookup**: explain terms such as `What is Wikipedia?`.\n- **Hello World**: generate small programs in Rust, Python, JavaScript, Go, C, and more.\n- **Conversation memory**: use earlier messages from the current session.\n- **Behavior rules**: show built-in rules with `List behavior rules` and `Show behavior rule unknown`.\n- **Settings and actions**: configure diagnostics, demo mode, agent mode, theme, language, chat style, and memory import/export.";
}
// True when the prompt asks how the assistant itself is built rather than
// requesting a task. Decomposes exactly like the Rust is_architecture_question:
// the prompt must address the assistant — carry an assistant_self_reference
// surface — and name an architecture_concept such as a language model, neural
// network, or the project's local rules. Both are matched as raw substrings
// across all four languages; no architecture word is hardcoded here.
function isArchitectureQuestion(normalized) {
if (!lexiconMentionsRoleSubstring(ROLE_ASSISTANT_SELF_REFERENCE, normalized)) {
return false;
}
return lexiconMentionsRoleSubstring(ROLE_ARCHITECTURE_CONCEPT, normalized);
}
function architectureLanguage(prompt, normalized) {
return selfAwarenessLanguage(prompt, normalized);
}
function architectureExplanationContent(language) {
const surface = BROWSER_SURFACE;
if (language === "ru") {
return `Я не LLM-рантайм и не выполняю нейросетевой инференс. Текущая среда: ${surface.label} (\`${surface.slug}\`). Рантайм: ${surface.runtime}. У проекта есть OpenAI-совместимые API-форматы, но ответы строит детерминированный solver: сначала он проверяет локальный seed Links Notation, правила и память (${surface.memory}); затем веб-поиск используется только с учетом среды: ${surface.webSearch}. Весь интернет не загружен в локальные правила целиком.`;
}
if (language === "hi") {
return `मैं LLM runtime नहीं हूँ और neural inference नहीं चलाता. Current environment: ${surface.label} (\`${surface.slug}\`). Runtime: ${surface.runtime}. Project OpenAI-compatible API shapes देता है, लेकिन जवाब deterministic solver बनाता है: पहले local Links Notation seed, rules और memory (${surface.memory}) देखता है; फिर web search केवल environment अनुमति दे तो उपयोग करता है: ${surface.webSearch}. पूरा internet local rules में preload नहीं है.`;
}
if (language === "zh") {
return `我不是 LLM runtime, 也不执行神经网络推理。当前环境: ${surface.label} (\`${surface.slug}\`)。Runtime: ${surface.runtime}。项目提供 OpenAI-compatible API 形状, 但回答由确定性的 solver 生成: 先检查本地 Links Notation seed、规则和记忆 (${surface.memory}); 然后只在当前环境允许时使用 web search: ${surface.webSearch}。整个互联网不会预加载到本地规则中。`;
}
return `I am not an LLM runtime and I do not perform neural inference. Current environment: ${surface.label} (\`${surface.slug}\`). Runtime: ${surface.runtime}. The project exposes OpenAI-compatible API shapes, but answers come from a deterministic solver: it checks the local Links Notation seed, rules, and memory (${surface.memory}) first; web search is used only when this environment allows it: ${surface.webSearch}. The whole internet is not preloaded into local rules.`;
}
function tryArchitectureExplanation(prompt, normalized) {
if (!isArchitectureQuestion(normalized)) return null;
const language = architectureLanguage(prompt, normalized);
return {
intent: "meta_explanation",
content: architectureExplanationContent(language),
confidence: 1.0,
evidence: ["response:meta_explanation", "meta_explanation:architecture", `language:${language}`],
};
}
function tryCapabilities(prompt, normalized, preferences, history) {
const language = detectLanguage(prompt);
const featureStatus = tryFeatureCapabilityStatus(prompt, normalized, language, preferences);
if (featureStatus) return featureStatus;
const moreCapabilities = isMoreCapabilitiesPrompt(normalized);
if (!isCapabilityQuery(normalized)) return null;
if (moreCapabilities) {
const priorSearch = historyMentionsWebSearch(history);
return {
intent: "capabilities",
content: additionalCapabilitiesContent(language),
confidence: 1.0,
evidence: [
"handler:capabilities",
"capabilities:follow_up",
...(priorSearch ? ["capabilities:history:prior_web_search"] : []),
`language:${language}`,
],
};
}
const content =
language === "ru"
? "Я formal-ai — детерминированный символьный ИИ. Вот что я умею:\n\n- **Приветствия**: отвечаю на «Привет», «Здравствуйте» и т.п.\n- **Hello World**: генерирую программы на Rust, Python, JavaScript, Go, C и других языках.\n- **Веб-поиск**: ищу в интернете через DuckDuckGo, Wikipedia и Wikidata, когда поиск доступен.\n- **Поиск понятий**: объясняю термины — попробуйте «Что такое Википедия?»\n- **Арифметика**: вычисляю выражения — например, «Сколько будет 2 + 2?»\n- **Перевод**: перевожу фразы между языками.\n- **Память**: помню контекст разговора в рамках сессии.\n- **Настройки и действия**: через сообщения можно включать диагностику/демо/agent mode, менять тему, язык, стиль чата и экспортировать или импортировать память.\n\nЯ работаю на основе локальных символьных правил, без нейросетевого инференса."
: language === "zh"
? "我是 formal-ai —— 一个确定性的符号化 AI。以下是我的功能:\n\n- **问候**:回应「你好」等问候语。\n- **Hello World**:生成 Rust、Python、JavaScript、Go、C 等语言的示例程序。\n- **Web search**:在可用时通过 DuckDuckGo、Wikipedia 和 Wikidata 搜索互联网。\n- **概念查找**:解释术语,例如「什么是维基百科?」\n- **算术**:计算表达式,例如「2 + 2 等于多少?」\n- **翻译**:在语言之间翻译短语。\n- **记忆**:在会话中记住上下文。\n- **设置和操作**:可通过消息开启诊断、演示、agent mode,切换主题、语言、聊天样式,并导出或导入记忆。\n\n我基于本地符号规则运行,不进行神经网络推理。"
: language === "hi"
? "मैं formal-ai हूँ — एक नियतात्मक प्रतीकात्मक AI। मैं यह कर सकता हूँ:\n\n- **अभिवादन**: «नमस्ते» आदि का जवाब देना।\n- **Hello World**: Rust, Python, JavaScript, Go, C आदि में प्रोग्राम बनाना।\n- **Web search**: उपलब्ध होने पर DuckDuckGo, Wikipedia, और Wikidata से इंटरनेट में खोजना।\n- **अवधारणा खोज**: शब्दों को समझाना — जैसे «विकिपीडिया क्या है?»\n- **अंकगणित**: गणनाएँ — जैसे «2 + 2 क्या है?»\n- **अनुवाद**: भाषाओं के बीच अनुवाद।\n- **स्मृति**: सत्र में संदर्भ याद रखना।\n- **Settings और actions**: messages से diagnostics/demo/agent mode बदलना, theme/language/chat style बदलना, और memory export/import करना।\n\nमैं स्थानीय प्रतीकात्मक नियमों पर चलता हूँ, कोई न्यूरल इन्फेरेन्स नहीं।"
: "I am formal-ai, a deterministic symbolic AI. Here is what I can do:\n\n- **Greetings**: respond to «Hi», «Hello», and similar.\n- **Hello World**: generate programs in Rust, Python, JavaScript, Go, C, and more.\n- **Web search**: search the internet through DuckDuckGo, Wikipedia, and Wikidata when available.\n- **Concept lookup**: explain terms — try «What is Wikipedia?»\n- **Arithmetic**: evaluate expressions — try «What is 2 + 2?»\n- **Translation**: translate phrases between languages.\n- **Memory**: recall context within the current session.\n- **Settings and actions**: configure diagnostics, demo mode, agent mode, theme, language, chat style, and memory import/export from messages.\n\nI run on local symbolic rules, without any neural network inference.";
return {
intent: "capabilities",
content,
confidence: 1.0,
evidence: ["handler:capabilities", `language:${language}`],
};
}
// Issue #386: the source/target language of a translation prompt is read from
// the lexicon, not a hardcoded per-language phrase ladder. Each translation
// source/target marker meaning enumerates its surfaces across all four
// languages and is defined_by the language_* meaning it names; detection walks
// those meanings in declaration order (en, ru, hi, zh) and resolves the code
// through defined_by. Mirrors detect_source_language / detect_target_language
// in src/translation/language_markers.rs.
function detectTranslationSourceLanguage(normalized) {
return detectTranslationMarkerLanguage(
ROLE_TRANSLATION_SOURCE_MARKER,
normalized,
);
}
function detectTranslationTargetLanguage(normalized) {
return detectTranslationMarkerLanguage(
ROLE_TRANSLATION_TARGET_MARKER,
normalized,
);
}
// Offline meaning registry for the browser worker.
//
// The Rust pipeline (`src/translation/pipeline.rs`) resolves any pair
// of surfaces through Wiktionary + Wikidata using cached HTTP
// responses. The worker mirrors that with a live `liveWiktionaryTranslate`
// fallback below (MediaWiki action API is CORS-friendly via
// `origin=*`), but keeps this small in-memory registry of greetings and
// stock phrases so the demo stays snappy when the network is slow.
// `primary` is the canonical form deformalization renders; `aliases` is a
// list of normalized alternative surfaces used during formalization.
const TRANSLATION_MEANING_REGISTRY = [
{
token: "greeting",
primary: { en: "Hello", ru: "Привет", hi: "नमस्ते", zh: "你好" },
aliases: {
en: ["hello", "hi", "hey"],
ru: ["привет", "здравствуйте", "здравствуй"],
hi: ["नमस्ते", "नमस्कार"],
zh: ["你好", "您好"],
},
},
{
token: "greeting_how_are_you",
primary: {
en: "How are you?",
ru: "Как у тебя дела?",
hi: "आप कैसे हैं?",
zh: "你好吗?",
},
aliases: {
en: ["howareyou", "hellohowareyou", "hihowareyou"],
ru: [
"какдела",
"какутебядела",
"какувасдела",
"какваши дела",
"какватидела",
"какваши",
"приветкакдела",
"здравствуйтекаквашидела",
],
hi: ["आपकैसेहैं", "तुमकैसेहो"],
zh: ["你好吗", "你怎么样"],
},
},
{
token: "thank_you",
primary: { en: "Thank you", ru: "Спасибо", hi: "धन्यवाद", zh: "谢谢" },
aliases: {
en: ["thanks", "thankyou", "thankyouverymuch"],
ru: ["спасибо", "благодарю", "большоеспасибо"],
hi: ["धन्यवाद", "शुक्रिया"],
zh: ["谢谢", "多谢", "感谢"],
},
},
{
token: "you_are_welcome",
primary: {
en: "You are welcome",
ru: "Пожалуйста",
hi: "आपका स्वागत है",
zh: "不客气",
},
aliases: {
en: ["youarewelcome", "yourewelcome", "nottoworry"],
ru: ["пожалуйста", "незачто"],
hi: ["आपकास्वागतहै", "कोईबातनहीं"],
zh: ["不客气", "不用谢"],
},
},
{
token: "goodbye",
primary: { en: "Goodbye", ru: "До свидания", hi: "अलविदा", zh: "再见" },
aliases: {
en: ["goodbye", "bye", "seeyou", "byebye"],
ru: ["досвидания", "пока", "прощай"],
hi: ["अलविदा", "फिरमिलेंगे"],
zh: ["再见", "拜拜"],
},
},
{
token: "good_morning",
primary: { en: "Good morning", ru: "Доброе утро", hi: "सुप्रभात", zh: "早上好" },
aliases: {
en: ["goodmorning"],
ru: ["доброеутро"],
hi: ["सुप्रभात", "शुभप्रभात"],
zh: ["早上好", "早安"],
},
},
{
token: "good_evening",
primary: { en: "Good evening", ru: "Добрый вечер", hi: "शुभ संध्या", zh: "晚上好" },
aliases: {
en: ["goodevening"],
ru: ["добрыйвечер"],
hi: ["शुभसंध्या"],
zh: ["晚上好", "晚安"],
},
},
{
token: "what_is_your_name",
primary: {
en: "What is your name?",
ru: "Как тебя зовут?",
hi: "तुम्हारा नाम क्या है?",
zh: "你叫什么名字?",
},
aliases: {
en: ["whatisyourname", "whatsyourname"],
ru: ["кактебязовут", "каквасзовут"],
hi: ["तुम्हारानामक्याहै", "आपकानामक्याहै"],
zh: ["你叫什么名字", "您叫什么名字"],
},
},
{
token: "who_are_you",
primary: {
en: "Who are you?",
ru: "Кто ты такой?",
hi: "तुम कौन हो?",
zh: "你是谁?",
},
aliases: {
en: ["whoareyou"],
ru: ["ктоты", "ктотытакой", "ктотытакая", "ктовы", "ктовытакой", "ктовытакая"],
hi: ["तुमकौनहो", "आपकौनहैं"],
zh: ["你是谁", "您是谁"],
},
},
{
token: "what_is_this",
primary: {
en: "What is this?",
ru: "Что это такое?",
hi: "यह क्या है?",
zh: "这是什么?",
},
aliases: {
en: ["whatisthis", "whatisit"],
ru: ["чтоэто", "чтоэтотакое"],
hi: ["यहक्याहै", "येक्याहै"],
zh: ["这是什么", "這是什麼"],
},
},
{
token: "i_am_fine",
primary: { en: "I am fine", ru: "У меня всё хорошо", hi: "मैं ठीक हूँ", zh: "我很好" },
aliases: {
en: ["iamfine", "imfine", "imdoingfine", "imdoingwell"],
ru: ["уменявсёхорошо", "уменявсехорошо", "всёхорошо"],
hi: ["मैंठीकहूँ", "मैंठीकहूं"],
zh: ["我很好", "我挺好的"],
},
},
{
token: "yes",
primary: { en: "Yes", ru: "Да", hi: "हाँ", zh: "是" },
aliases: {
en: ["yes", "yeah", "yep", "aye"],
ru: ["да", "ага", "конечно"],
hi: ["हाँ", "हां", "जी"],
zh: ["是", "是的", "对"],
},
},
{
token: "no",
primary: { en: "No", ru: "Нет", hi: "नहीं", zh: "不" },
aliases: {
en: ["no", "nope", "nah"],
ru: ["нет", "неа"],
hi: ["नहीं", "ना"],
zh: ["不", "不是"],
},
},
// Issue #216 / #217: the apple noun must be translatable in both
// directions from the browser demo, including unquoted prompts.
{
token: "apple",
primary: { en: "apple", ru: "яблоко", hi: "सेब", zh: "苹果" },
aliases: {
en: ["apple", "apples"],
ru: [
"яблоко",
"яблока",
"яблоку",
"яблоком",
"яблоке",
"яблоки",
"яблок",
"яблокам",
"яблоками",
"яблоках",
],
hi: ["सेब"],
zh: ["苹果"],
},
},
];
const TRANSLATION_TERMINAL_PUNCTUATION = ["?", "!", ".", "。", "?", "!", "."];
function normalizeTranslationAlias(surface) {
return Array.from(String(surface || "").toLowerCase())
.filter((character) => /[\p{L}\p{N}]/u.test(character))
.join("");
}
function formalizeSurface(surface, source) {
const normalized = normalizeTranslationAlias(surface);
if (!normalized) return null;
for (const entry of TRANSLATION_MEANING_REGISTRY) {
const aliases = (entry.aliases && entry.aliases[source]) || [];
if (aliases.some((alias) => normalizeTranslationAlias(alias) === normalized)) {
return entry.token;
}
const primary = entry.primary && entry.primary[source];
if (primary && normalizeTranslationAlias(primary) === normalized) {
return entry.token;
}
}
return null;
}
function deformalizeMeaning(token, target) {
for (const entry of TRANSLATION_MEANING_REGISTRY) {
if (entry.token !== token) continue;
const primary = entry.primary && entry.primary[target];
return primary || null;
}
return null;
}
function canonicalTokenForNormalized(normalized) {
if (!normalized) return null;
for (const entry of TRANSLATION_MEANING_REGISTRY) {
const aliasesByLang = entry.aliases || {};
for (const lang of Object.keys(aliasesByLang)) {
const aliases = aliasesByLang[lang] || [];
if (aliases.some((alias) => normalizeTranslationAlias(alias) === normalized)) {
return entry.token;
}
}
const primaryByLang = entry.primary || {};
for (const lang of Object.keys(primaryByLang)) {
if (normalizeTranslationAlias(primaryByLang[lang]) === normalized) {
return entry.token;
}
}
}
return null;
}
function canonicalMeaningToken(raw) {
return canonicalTokenForNormalized(raw) || raw;
}
function normalizeMeaningText(surface) {
const raw = normalizeTranslationAlias(surface);
return canonicalMeaningToken(raw);
}
function matchSourceFormatting(target, source) {
const targetTrimmed = String(target || "").trim();
if (!targetTrimmed) return "";
const sourceTrimmed = String(source || "").trim();
let sourceTerminal = null;
if (sourceTrimmed.length > 0) {
const lastChar = Array.from(sourceTrimmed).pop();
if (TRANSLATION_TERMINAL_PUNCTUATION.includes(lastChar)) sourceTerminal = lastChar;
}
let targetNoTerminal = targetTrimmed;
while (
targetNoTerminal.length > 0 &&
TRANSLATION_TERMINAL_PUNCTUATION.includes(Array.from(targetNoTerminal).pop())
) {
const lastChar = Array.from(targetNoTerminal).pop();
targetNoTerminal = targetNoTerminal.slice(0, targetNoTerminal.length - lastChar.length);
}
const withTerminal = sourceTerminal ? targetNoTerminal + sourceTerminal : targetNoTerminal;
const sourceFirstLetter = Array.from(sourceTrimmed).find((character) =>
/\p{L}/u.test(character),
);
if (!sourceFirstLetter) return withTerminal;
const targetChars = Array.from(withTerminal);
const targetFirstIdx = targetChars.findIndex((character) => /\p{L}/u.test(character));
if (targetFirstIdx === -1) return withTerminal;
const targetFirstLetter = targetChars[targetFirstIdx];
const sourceLower = sourceFirstLetter.toLowerCase() === sourceFirstLetter
&& sourceFirstLetter.toUpperCase() !== sourceFirstLetter;
const sourceUpper = sourceFirstLetter.toUpperCase() === sourceFirstLetter
&& sourceFirstLetter.toLowerCase() !== sourceFirstLetter;
const targetLower = targetFirstLetter.toLowerCase() === targetFirstLetter
&& targetFirstLetter.toUpperCase() !== targetFirstLetter;
const targetUpper = targetFirstLetter.toUpperCase() === targetFirstLetter
&& targetFirstLetter.toLowerCase() !== targetFirstLetter;
if (sourceLower && targetUpper) {
targetChars[targetFirstIdx] = targetFirstLetter.toLowerCase();
return targetChars.join("");
}
if (sourceUpper && targetLower) {
targetChars[targetFirstIdx] = targetFirstLetter.toUpperCase();
return targetChars.join("");
}
return withTerminal;
}
function normalizeComposableSurface(surface) {
return String(surface || "")
.trim()
.replace(/[?!.。?!.]+$/u, "")
.toLowerCase()
.split(/\s+/u)
.filter(Boolean)
.join(" ");
}
// Issue #386 compositional-translation roles — mirror ROLE_COMPOSITIONAL_LEMMA,
// ROLE_COMPOSITIONAL_PHRASE and ROLE_COMPOSITIONAL_GENITIVE_HEAD in
// src/seed/roles.rs. The per-word lemma fallbacks, fixed phrases, genitive-
// governing heads and the single genitive-tagged complement that used to be
// hardcoded here all live in the embedded MEANINGS_LINO
// (data/seed/meanings-translation.lino); the functions below name only the
// semantic roles and the ru→en language pair, never the surface words. The
// query helpers (roleSurfaceTranslation, roleListsSurface,
// roleActionSurfaceTranslation, wordIn) are defined alongside meaningLexicon.
const ROLE_COMPOSITIONAL_LEMMA = "compositional_lemma";
const ROLE_COMPOSITIONAL_PHRASE = "compositional_phrase";
const ROLE_COMPOSITIONAL_GENITIVE_HEAD = "compositional_genitive_head";
function capitalizeAsciiFirst(surface) {
const text = String(surface || "");
if (!text) return "";
return text[0].toUpperCase() + text.slice(1);
}
function translateRussianWordSequence(words) {
const translated = [];
for (let index = 0; index < words.length; index += 1) {
const word = words[index];
const next = words[index + 1];
if (
next &&
roleListsSurface(ROLE_COMPOSITIONAL_GENITIVE_HEAD, "ru", word) &&
roleActionSurfaceTranslation(ROLE_COMPOSITIONAL_LEMMA, "genitive", "ru", "en", next)
) {
translated.push(
roleSurfaceTranslation(ROLE_COMPOSITIONAL_LEMMA, "ru", "en", word),
"of",
roleActionSurfaceTranslation(ROLE_COMPOSITIONAL_LEMMA, "genitive", "ru", "en", next),
);
index += 1;
continue;
}
const surface = roleSurfaceTranslation(ROLE_COMPOSITIONAL_LEMMA, "ru", "en", word);
if (!surface) return null;
translated.push(surface);
}
return capitalizeAsciiFirst(translated.join(" "));
}
function translateCompositionalSurface(surface, source, target) {
if (source !== "ru" || target !== "en") return null;
const normalized = normalizeComposableSurface(surface);
const phrase = roleSurfaceTranslation(ROLE_COMPOSITIONAL_PHRASE, "ru", "en", normalized);
if (phrase) return phrase;
const words = normalized.split(/\s+/u).filter(Boolean);
if (words.length < 2 || words.length > 8) return null;
return translateRussianWordSequence(words);
}
function detectLanguageSlug(text) {
let latin = 0;
let cyrillic = 0;
let devanagari = 0;
let cjk = 0;
let other = 0;
for (const character of String(text || "")) {
const code = character.codePointAt(0);
if (/[a-z]/i.test(character)) latin += 1;
else if (code >= 0x0400 && code <= 0x04ff) cyrillic += 1;
else if (code >= 0x0900 && code <= 0x097f) devanagari += 1;
else if (code >= 0x4e00 && code <= 0x9fff) cjk += 1;
else if (/\p{L}/u.test(character)) other += 1;
}
const total = latin + cyrillic + devanagari + cjk + other;
if (total === 0) return "en";
if (other > latin && other >= cyrillic && other >= devanagari && other >= cjk) {
return "unknown";
}
if (cyrillic >= Math.max(latin, devanagari, cjk) && cyrillic > 0) return "ru";
if (devanagari >= Math.max(latin, cyrillic, cjk) && devanagari > 0) return "hi";
if (cjk >= Math.max(latin, cyrillic, devanagari) && cjk > 0) return "zh";
return "en";
}
function inferTranslationSource(prompt) {
const lower = String(prompt || "").toLowerCase();
const surface = extractQuotedPhrase(prompt) || extractUnquotedTranslationSurface(prompt);
if (surface) {
const detected = detectLanguageSlug(surface);
if (detected !== "unknown") return detected;
}
// Issue #386: the source language of an un-annotated request is the language
// the user issued the *translation command* in. Ask the lexicon which
// language's command verb the prompt carries — the stems live once in the
// embedded translate meaning; this code knows only the concept and the
// language-code bridge. English is the default when no command verb is present.
return (
firstRoleLanguage(ROLE_TRANSLATION_ACTION, lower, ["ru", "hi", "zh"]) || "en"
);
}
// Live Wiktionary fallback (issue #221). When the offline meaning
// registry above does not cover `surface`, fetch the Wiktionary page
// for `source` and pull the first `{{tt+|<target>|...}}` (or `{{t+}}` /
// `{{t}}`) entry. Mirrors the Rust pipeline's Stage 1a in
// `src/translation/pipeline.rs`: if the main page delegates noun
// translations via `{{see translation subpage|...}}`, fetch the
// subpage and search it first. Keeps the worker mobile-friendly: no
// offline dictionary bundled, just a single CORS-safe HTTP call.
async function fetchWiktionaryWikitext(pageTitle, language) {
if (typeof fetch !== "function" || !pageTitle) return null;
const host = WIKTIONARY_SEARCH_HOSTS[language] || WIKTIONARY_SEARCH_HOSTS.en;
const url = `${host}?action=parse&page=${encodeURIComponent(
pageTitle,
)}&prop=wikitext&format=json&origin=*`;
try {
const response = await fetch(url, {
headers: {
accept: "application/json",
"api-user-agent":
"formal-ai-demo (https://github.com/link-assistant/formal-ai)",
},
});
if (!response || !response.ok) return null;
const data = await response.json();
return (data && data.parse && data.parse.wikitext && data.parse.wikitext["*"]) || null;
} catch (_error) {
return null;
}
}
function stripCombiningMarks(value) {
// Russian Wiktionary entries are stored with combining stress marks
// (U+0301) so readers can see where the accent falls. The surface
// form must drop them so the result matches the lemma (помидо́р →
// помидор) and downstream substring assertions still hit.
return typeof value === "string" && value.normalize
? value.normalize("NFD").replace(/[̀-ͯ]/g, "").normalize("NFC")
: value;
}
function extractWiktionaryTranslation(wikitext, targetLang) {
if (!wikitext || !targetLang) return null;
// English-edition templates: {{t|<lang>|...}}, {{t+|<lang>|...}},
// {{tt|<lang>|...}}, {{tt+|<lang>|...}}.
const enPattern = new RegExp(
`\\{\\{tt?\\+?\\|${targetLang}\\|([^|}\\n]+)`,
"i",
);
const enMatch = enPattern.exec(wikitext);
if (enMatch) {
const surface = stripCombiningMarks(String(enMatch[1] || "").trim());
if (surface) return surface;
}
// Russian-edition translation blocks: `{{перев-блок|...|<lang>=[[surface]]\n|...}}`.
// The language code may appear at the very start (no leading newline)
// or after `\n|`; the surface can be inside `[[...]]`, optionally
// followed by transliteration in parentheses we drop.
const ruPattern = new RegExp(
`[|\\n]${targetLang}\\s*=\\s*(?:\\[\\[([^\\]|]+)(?:\\|[^\\]]+)?\\]\\]|([^\\n|}]+))`,
"i",
);
const ruMatch = ruPattern.exec(wikitext);
if (ruMatch) {
const raw = (ruMatch[1] || ruMatch[2] || "").trim();
const surface = stripCombiningMarks(raw.replace(/\s*\([^)]*\)\s*$/, "").trim());
if (surface) return surface;
}
return null;
}
async function resolveWiktionaryLemma(surface, language) {
// Inflected forms (e.g. Russian plural `помидоры`) are not always stored
// as separate pages on the source-language Wiktionary. OpenSearch returns
// the closest matching titles; the first hit is the dictionary lemma
// (`помидор`) we want to look up next.
if (typeof fetch !== "function" || !surface) return null;
const host = WIKTIONARY_SEARCH_HOSTS[language] || WIKTIONARY_SEARCH_HOSTS.en;
const url = `${host}?action=opensearch&search=${encodeURIComponent(
surface,
)}&limit=1&format=json&origin=*`;
try {
const response = await fetch(url, {
headers: {
accept: "application/json",
"api-user-agent":
"formal-ai-demo (https://github.com/link-assistant/formal-ai)",
},
});
if (!response || !response.ok) return null;
const data = await response.json();
const titles = Array.isArray(data) && Array.isArray(data[1]) ? data[1] : [];
const lemma = titles[0];
if (typeof lemma !== "string" || !lemma || lemma === surface) return null;
return lemma;
} catch (_error) {
return null;
}
}
async function liveWiktionaryTranslate(surface, source, target) {
// Run the direct page fetch and the OpenSearch lemma resolution in
// parallel. For inflected forms (e.g. `помидоры`) the direct fetch
// 404s, and chaining the lemma lookup sequentially after it added a
// third sequential round-trip that pushed CI past the 5s expect cap.
const [direct, lemma] = await Promise.all([
fetchWiktionaryWikitext(surface, source),
resolveWiktionaryLemma(surface, source),
]);
let main = direct;
if (!main && lemma) {
main = await fetchWiktionaryWikitext(lemma, source);
}
if (!main) return null;
let wikitext = main;
if (/\{\{see translation subpage\|/i.test(main)) {
const subpage = await fetchWiktionaryWikitext(`${surface}/translations`, source);
if (subpage) wikitext = `${subpage}\n${main}`;
}
return extractWiktionaryTranslation(wikitext, target);
}
async function translateSurface(surface, source, target) {
if (source === target) {
return { surface: String(surface || ""), gap: false };
}
const token = formalizeSurface(surface, source);
if (token) {
const primary = deformalizeMeaning(token, target);
if (primary) return { surface: primary, gap: false };
}
if (surface) {
const live = await liveWiktionaryTranslate(surface, source, target);
if (live) return { surface: live, gap: false };
}
const compositional = translateCompositionalSurface(surface, source, target);
if (compositional) return { surface: compositional, gap: false };
return { surface: null, gap: true };
}
function renderTranslationGap(surface, source, target) {
const trimmed = String(surface || "").trim();
if (!trimmed) {
return `I could not identify a source phrase to translate from ${source} to ${target}.`;
}
return `I could not translate "${trimmed}" from ${source} to ${target} with the available formalization data. I recorded this as a translation gap for follow-up.`;
}
async function tryTranslation(prompt, normalized) {
const targetHint = detectTranslationTargetLanguage(normalized);
// Issue #386: recognise a translation command by *meaning*, not by hardcoded
// verbs. The command stems live once in the embedded translate meaning; this
// code knows the concept and the head-initial/head-final typology. Clause-
// initial English/Russian commands are matched as a prefix; head-final
// Hindi/Chinese place the verb later, so they are matched anywhere but gated
// by a target marker to avoid firing on an incidental verb noun.
const headInitialCommand = wordsForRoleInLanguages(ROLE_TRANSLATION_ACTION, [
"en",
"ru",
]).some((stem) => normalized.startsWith(stem));
const headFinalCommand =
Boolean(targetHint) &&
wordsForRoleInLanguages(ROLE_TRANSLATION_ACTION, ["hi", "zh"]).some((stem) =>
normalized.includes(stem),
);
const isTranslationRequest = headInitialCommand || headFinalCommand;
if (!isTranslationRequest) return null;
// Issue #216: fall back to an unquoted surface (`translate apple to
// russian`) when no quoted fragment is present so the offline registry
// can still resolve a meaning token.
const surface =
extractQuotedPhrase(prompt) || extractUnquotedTranslationSurface(prompt) || "";
const surfaceMeaning = surface || prompt;
const source = detectTranslationSourceLanguage(normalized) || inferTranslationSource(prompt);
const target = targetHint || "en";
const meaningId = stableBehaviorRuleId("meaning", normalizeMeaningText(surfaceMeaning));
const translation = await translateSurface(surface, source, target);
let content;
if (translation.gap) {
content = renderTranslationGap(surface, source, target);
} else {
const translatedSurface = matchSourceFormatting(translation.surface || "", surface);
content = surface ? `"${translatedSurface}"` : translatedSurface;
}
const evidence = [
"handler:translation",
`language_from:${source}`,
`language_to:${target}`,
`meaning:${meaningId}`,
];
if (translation.gap && surface) evidence.push(`translation_gap:${surface}`);
return {
intent: `translate_${source}_to_${target}`,
content,
confidence: 1.0,
evidence,
};
}
// The number of brainstorm items returned when the prompt names no count.
const DEFAULT_BRAINSTORM_COUNT = 5;
// Read the integer value of a cardinal-number meaning from its own data. Each
// cardinal carries a numeral word form (e.g. "10") — the script-independent
// surface that spells the value — so the count is derived from the seed rather
// than restated as a literal. Mirrors cardinal_value in
// src/solver_handlers/benchmark_prompts.rs (issue #386).
function cardinalValue(meaning) {
if (!meaning || !Array.isArray(meaning.words)) return null;
const numeral = meaning.words.find((word) => /^[0-9]+$/.test(word));
if (numeral === undefined) return null;
const value = Number.parseInt(numeral, 10);
return Number.isNaN(value) ? null : value;
}
// Parse the number of items the user asked for, defaulting to
// DEFAULT_BRAINSTORM_COUNT when no explicit count is present. The only
// non-default count the brainstorm prompts exercise is ten, so the recogniser
// asks the seed whether the `ten` cardinal is evidenced in the prompt (in any
// supported language) and reads the value from that cardinal's own numeral
// surface. Mirrors requested_brainstorm_count in
// src/solver_handlers/benchmark_prompts.rs (issue #386).
function requestedBrainstormCount(normalized) {
const ten = findMeaning("ten");
if (ten && meaningEvidencedIn(ten, normalized)) {
const value = cardinalValue(ten);
if (value !== null) return value;
}
return DEFAULT_BRAINSTORM_COUNT;
}
function numbered(items, count) {
return items
.slice(0, count)
.map((item, index) => `${index + 1}. ${item}`)
.join("\n");
}
function tryBrainstormingRequest(prompt, normalized) {
const seeds = BRAINSTORM_SEEDS || {};
if (!containsAny(normalized, seeds.triggers)) return null;
const categories = Array.isArray(seeds.categories) ? seeds.categories : [];
const category =
categories.find((entry) => containsAny(normalized, entry.detectionKeywords)) ||
categories.find((entry) => !entry.detectionKeywords || entry.detectionKeywords.length === 0);
if (!category || !Array.isArray(category.items) || category.items.length === 0) {
return null;
}
const count = requestedBrainstormCount(normalized);
return {
intent: category.intent || "brainstorm_project_ideas",
content: numbered(category.items, count),
confidence: 0.8,
evidence: [`brainstorm:category:${category.slug || "project_ideas"}`],
};
}
function localizedFactFor(record, language) {
const localized = Array.isArray(record.localized) ? record.localized : [];
return (
localized.find((entry) => entry && entry.language === language) ||
localized.find((entry) => entry && entry.language === "en") ||
null
);
}
function tryFactLookup(prompt, normalized) {
const record = FACTS.find(
(fact) =>
containsAny(normalized, fact.subjectAliases) &&
containsAny(normalized, fact.questionKeywords),
);
if (!record) return null;
const language = detectLanguage(prompt);
const localized = localizedFactFor(record, language);
const summary = (localized && localized.summary) || record.summary;
const source = (localized && localized.source) || record.source;
const evidence = [
`fact_lookup:hit:${record.slug}`,
`language:${language}`,
...((record.wikidata || []).map((qid) => `wikidata:${qid}`)),
];
if (source) evidence.push(`source:${humanizeUrl(source)}`);
return {
intent: "fact_lookup",
content: summary,
confidence: 0.9,
evidence,
};
}
function renderRoleplayBody(persona, body) {
const template =
(PERSONA_SEEDS && PERSONA_SEEDS.bodyTemplate) ||
"Roleplay frame recorded for <persona>. I will keep the persona explicit and factual: <body>";
return template.replace(/<persona>/g, persona).replace(/<body>/g, body);
}
function tryRoleplayRequest(prompt, normalized) {
const seeds = PERSONA_SEEDS || {};
if (!containsAny(normalized, seeds.triggers)) return null;
const personas = Array.isArray(seeds.personas) ? seeds.personas : [];
const persona = personas.find((entry) => containsAny(normalized, entry.aliases));
const topics = Array.isArray(seeds.topics) ? seeds.topics : [];
const topic = topics.find((entry) => containsAny(normalized, entry.detectionKeywords));
const displayName =
(persona && persona.displayName) || seeds.defaultPersona || "requested persona";
const body =
(topic && topic.body) ||
seeds.fallbackBody ||
"relativity says measurements of space and time depend on the observer's motion, while the laws of physics stay consistent.";
const evidence = [`roleplay:persona:${displayName}`];
if (persona && persona.wikidata) evidence.push(`wikidata:${persona.wikidata}`);
if (topic && topic.slug) evidence.push(`roleplay:topic:${topic.slug}`);
return {
intent: "roleplay_explanation",
content: renderRoleplayBody(displayName, body),
confidence: 0.8,
evidence,
};
}
function tryKupiSlona(prompt, normalized) {
// Recognition is data-driven: the idiom surfaces (the «купи слона» phrase and
// its buy-an-elephant calque in every supported language) live in
// data/seed/meanings-policy.lino under the circular_joke_phrase role, matched
// as raw substrings. The worker has no localized-response lookup, so the
// canonical Russian explanation stays inline (mirrors the Rust fallback).
if (!lexiconMentionsRoleSubstring(ROLE_CIRCULAR_JOKE_PHRASE, normalized))
return null;
return {
intent: "kupi_slona",
content:
"«Купи слона» — это известная русская детская фраза-игра. На любой ответ следует продолжение: «Все так говорят, а ты купи слона!» Правильный ответ по правилам игры: «У всех есть слон, а у меня нет».",
confidence: 1.0,
evidence: ["handler:kupi_slona", "language:ru"],
};
}
function extractName(text) {
const patterns = [
/\bmy name is\s+([A-Z][a-zA-Z'-]+(?:\s+[A-Z][a-zA-Z'-]+)*)/,
/\bi am\s+([A-Z][a-zA-Z'-]+(?:\s+[A-Z][a-zA-Z'-]+)*)/,
/\bi'm\s+([A-Z][a-zA-Z'-]+(?:\s+[A-Z][a-zA-Z'-]+)*)/,
/\bcall me\s+([A-Z][a-zA-Z'-]+(?:\s+[A-Z][a-zA-Z'-]+)*)/,
];
for (const pattern of patterns) {
const match = pattern.exec(text);
if (match) return match[1];
}
return null;
}
function tryRecallName(history) {
if (!Array.isArray(history) || history.length === 0) return null;
for (let i = history.length - 1; i >= 0; i -= 1) {
const turn = history[i];
if (turn && turn.role === "user") {
const name = extractName(String(turn.content || ""));
if (name) {
return {
intent: "recall_name",
content: `Your name is ${name}.`,
confidence: 0.95,
evidence: [`recall_name:${name}`, "prior_turn:user"],
};
}
}
}
return null;
}
function tryRecallLastQuestion(history) {
if (!Array.isArray(history) || history.length === 0) return null;
for (let i = history.length - 1; i >= 0; i -= 1) {
const turn = history[i];
if (turn && turn.role === "user") {
const content = String(turn.content || "").trim();
if (content) {
return {
intent: "recall_last_question",
content: `Your previous question was: ${content}`,
confidence: 0.9,
evidence: ["recall_last_question", "prior_turn:user"],
};
}
}
}
return null;
}
// Issue #27: deterministic, logical summarisation — no neural net. We
// project the conversation onto a small set of features (turn counts, intents,
// concepts, languages, unanswered questions) and render them as a structured
// Markdown report. Every value is derived directly from the append-only event
// log so reruns on the same input produce byte-identical output.
function trySummarizeConversation(history) {
if (!Array.isArray(history) || history.length === 0) return null;
const turns = history.filter((turn) => turn && turn.content);
if (turns.length === 0) return null;
let userCount = 0;
let assistantCount = 0;
const intentCounts = new Map();
const languages = new Map();
const concepts = new Set();
const calculations = [];
const programTemplates = new Set();
const unanswered = [];
let lastUser = null;
for (const turn of turns) {
const role = turn.role || "assistant";
const language = detectLanguage(turn.content);
languages.set(language, (languages.get(language) || 0) + 1);
if (role === "user") {
userCount += 1;
lastUser = turn.content;
} else {
assistantCount += 1;
if (lastUser) {
lastUser = null;
}
const intent = String(turn.intent || "unknown");
intentCounts.set(intent, (intentCounts.get(intent) || 0) + 1);
if (intent === "calculation" && typeof turn.content === "string") {
const match = turn.content.match(/^([^=]+=\s*[^\n]+)/);
if (match) calculations.push(match[1].trim());
}
if (intent === "write_program") {
const evidence = Array.isArray(turn.evidence) ? turn.evidence : [];
const languageEvidence = evidence.find((item) =>
String(item || "").startsWith("program_parameter:language:"),
);
const taskEvidence = evidence.find((item) =>
String(item || "").startsWith("program_parameter:task:"),
);
const generatedLanguage = languageEvidence
? String(languageEvidence).slice("program_parameter:language:".length)
: "unknown";
const generatedTask = taskEvidence
? String(taskEvidence).slice("program_parameter:task:".length)
: "program";
programTemplates.add(`${generatedTask}/${generatedLanguage}`);
}
if (intent.startsWith("hello_world_")) {
programTemplates.add(`hello_world/${intent.slice("hello_world_".length)}`);
}
if (intent.startsWith("concept_lookup")) {
const evidence = Array.isArray(turn.evidence) ? turn.evidence : [];
for (const item of evidence) {
if (typeof item !== "string") continue;
const conceptMatch = item.match(/^concept_lookup:request:(.+)$/);
if (conceptMatch) concepts.add(conceptMatch[1]);
}
}
}
}
if (lastUser) {
unanswered.push(lastUser);
}
const lines = [];
lines.push("## Conversation summary");
lines.push("");
lines.push(
`- ${turns.length} turn(s): ${userCount} user, ${assistantCount} assistant`,
);
if (languages.size > 0) {
const list = Array.from(languages.entries())
.sort((a, b) => b[1] - a[1])
.map(([lang, count]) => `${lang} (${count})`)
.join(", ");
lines.push(`- Languages: ${list}`);
}
if (intentCounts.size > 0) {
const list = Array.from(intentCounts.entries())
.sort((a, b) => b[1] - a[1])
.map(([intent, count]) => `${intent} (${count})`)
.join(", ");
lines.push(`- Intents: ${list}`);
}
if (concepts.size > 0) {
lines.push(`- Concepts looked up: ${Array.from(concepts).join(", ")}`);
}
if (calculations.length > 0) {
lines.push(`- Calculations: ${calculations.join("; ")}`);
}
if (programTemplates.size > 0) {
lines.push(
`- Program templates generated: ${Array.from(programTemplates).join(", ")}`,
);
}
if (unanswered.length > 0) {
lines.push(`- Unanswered: ${unanswered.join(" | ")}`);
}
const evidence = [
"summarize_conversation",
`turns:${turns.length}`,
`users:${userCount}`,
`assistants:${assistantCount}`,
];
if (intentCounts.size > 0) {
evidence.push(`intents:${Array.from(intentCounts.keys()).join("|")}`);
}
return {
intent: "summarize_conversation",
content: lines.join("\n"),
confidence: 0.9,
evidence,
};
}
function tryCompoundInterest(prompt, normalized, history) {
const request = parseCompoundInterestRequest(prompt, normalized);
if (request) return answerCompoundInterest(request);
const conversion = parseFinalAmountConversionRequest(normalized, history);
if (conversion) return answerFinalAmountConversion(conversion);
return null;
}
function answerCompoundInterest(request) {
const annualRate = request.annualRatePercent / 100;
const periodsPerYear = request.compoundsPerYear;
const periodicRate = annualRate / periodsPerYear;
const periods = periodsPerYear * request.years;
const finalAmount =
request.principal * Math.pow(1 + periodicRate, periods);
const evidence = [
`calculation:compound_interest:P=${formatCompoundNumber(request.principal)};r=${formatCompoundRate(annualRate)};n=${periodsPerYear};t=${formatCompoundNumber(request.years)}`,
"calculation:formula:A=P(1+r/n)^(n*t)",
];
const lines = [
"Compound interest calculation",
"",
"Formula: A = P(1 + r/n)^(n*t)",
`P = ${formatCompoundNumber(request.principal)} USD`,
`r = ${formatCompoundRate(annualRate)} (${formatCompoundNumber(request.annualRatePercent)}% annual)`,
`n = ${periodsPerYear} (${compoundLabel(periodsPerYear)})`,
`t = ${formatCompoundNumber(request.years)} years`,
"",
`Step 1: periodic rate = r/n = ${formatCompoundRate(annualRate)}/${periodsPerYear} = ${formatCompoundRate(periodicRate)}`,
`Step 2: number of periods = n*t = ${periodsPerYear}*${formatCompoundNumber(request.years)} = ${formatCompoundNumber(periods)}`,
`Step 3: A = ${formatCompoundNumber(request.principal)} * (1 + ${formatCompoundRate(periodicRate)})^${formatCompoundNumber(periods)}`,
`Final amount: ${formatCompoundMoney(finalAmount)} USD`,
];
if (request.targetCurrency) {
appendCompoundConversionLines(
lines,
evidence,
finalAmount,
"USD",
request.targetCurrency,
request.asksForWebRate,
);
}
return {
intent: "calculation",
content: lines.join("\n"),
confidence: 1.0,
evidence,
};
}
function answerFinalAmountConversion(conversion) {
const evidence = ["calculation:final_amount_conversion"];
const lines = [
"Final amount conversion",
`Source amount: ${formatCompoundMoney(conversion.amount)} ${conversion.sourceCurrency}`,
];
appendCompoundConversionLines(
lines,
evidence,
conversion.amount,
conversion.sourceCurrency,
conversion.targetCurrency,
conversion.asksForWebRate,
);
return {
intent: "calculation",
content: lines.join("\n"),
confidence: 1.0,
evidence,
};
}
function appendCompoundConversionLines(
lines,
evidence,
amount,
sourceCurrency,
targetCurrency,
asksForWebRate,
) {
const rate = compoundCurrencyRate(sourceCurrency, targetCurrency);
if (!rate) {
evidence.push(`calculation:currency_conversion:error:${sourceCurrency}->${targetCurrency}`);
lines.push("");
lines.push(
`I calculated the USD amount, but no ${sourceCurrency}->${targetCurrency} exchange rate is available locally.`,
);
return;
}
const displayedAmount = roundCompoundMoney(amount);
const converted = displayedAmount * rate.rate;
evidence.push(
`calculation:currency_conversion:${formatCompoundMoney(displayedAmount)} ${sourceCurrency} to ${targetCurrency} at ${formatCompoundRate(rate.rate)}`,
);
lines.push("");
lines.push(`Conversion: ${sourceCurrency} -> ${targetCurrency}`);
lines.push(`${rate.expression} = ${rate.formatted}`);
lines.push(
`${formatCompoundMoney(displayedAmount)} ${sourceCurrency} * ${formatCompoundRate(rate.rate)} = ${formatCompoundMoney(converted)} ${targetCurrency}`,
);
if (rate.sourceDetail) {
lines.push(`Rate detail: ${rate.sourceDetail}`);
}
if (asksForWebRate) {
lines.push(
"Live web freshness is not independently verified here; this uses the exchange-rate source available through the local calculator.",
);
}
}
function parseCompoundInterestRequest(prompt, normalized) {
// The investment / interest / compounding cues are language-independent
// meanings carried by the finance lexicon; we test the raw substring of the
// already-normalized prompt against every surface form (the English forms
// reproduce the original invest/interest/compound markers, the other
// languages broaden coverage). Mirrors parse_compound_interest_request.
if (
!lexiconMentionsRoleSubstring(ROLE_INVESTMENT_CUE, normalized) ||
!lexiconMentionsRoleSubstring(ROLE_INTEREST_CUE, normalized) ||
!lexiconMentionsRoleSubstring(ROLE_COMPOUNDING_ACTION_CUE, normalized)
) {
return null;
}
const principal = parseCompoundCurrencyAmount(prompt);
const annualRatePercent = parseCompoundPercentBeforeSymbol(prompt);
const compoundsPerYear = parseCompoundsPerYear(normalized);
const years = parseCompoundYears(normalized);
if (
principal === null ||
annualRatePercent === null ||
compoundsPerYear === null ||
years === null
) {
return null;
}
return {
principal,
annualRatePercent,
compoundsPerYear,
years,
targetCurrency: targetCurrencyFromText(normalized),
asksForWebRate: asksForWebRate(normalized),
};
}
function parseFinalAmountConversionRequest(normalized, history) {
// "convert" and "final amount" are themselves meanings: a conversion action
// applied to the final-amount reference produced by a prior turn. Mirrors
// parse_final_amount_conversion_request.
if (
!lexiconMentionsRoleSubstring(ROLE_CONVERSION_ACTION_CUE, normalized) ||
!lexiconMentionsRoleSubstring(ROLE_FINAL_AMOUNT_REFERENCE, normalized)
) {
return null;
}
const targetCurrency = targetCurrencyFromText(normalized);
if (!targetCurrency) return null;
const prior = priorFinalAmount(history);
if (!prior) return null;
return {
amount: prior.amount,
sourceCurrency: prior.currency,
targetCurrency,
asksForWebRate: asksForWebRate(normalized),
};
}
function priorFinalAmount(history) {
if (!Array.isArray(history)) return null;
for (let index = history.length - 1; index >= 0; index -= 1) {
const turn = history[index];
if (!turn || turn.role !== "assistant") continue;
const parsed = parseFinalAmountFromText(String(turn.content || ""));
if (parsed) return parsed;
}
return null;
}
function parseFinalAmountFromText(text) {
const match = /final amount:\s*([+-]?\d[\d,.]*)\s*([A-Za-z]{3}|dollars?|euros?|rubles?)/i.exec(
text,
);
if (!match) return null;
const amount = parseCompoundNumberText(match[1]);
const currency = currencyCodeFromWord(match[2]);
if (amount === null || !currency) return null;
return { amount, currency };
}
function parseCompoundCurrencyAmount(prompt) {
const text = String(prompt || "");
const dollarIndex = text.indexOf("$");
if (dollarIndex >= 0) {
return parseCompoundNumberRight(text, dollarIndex + 1);
}
// The spelled-out US-dollar markers are language data: reconstruct the regex
// alternation from the currency_usd_reference English surface forms (usd,
// dollar, dollars) instead of hardcoding them. Mirrors parse_currency_amount,
// which scans the same forms; the `$` glyph stays in code as a symbol.
const usdWords = wordsForRoleInLanguages(ROLE_CURRENCY_USD_REFERENCE, ["en"]);
if (!usdWords.length) return null;
const alternation = usdWords.map((word) => escapeRegExp(word)).join("|");
const pattern = new RegExp(`([+-]?\\d[\\d,.]*)\\s*(?:${alternation})`, "i");
const match = pattern.exec(text);
return match ? parseCompoundNumberText(match[1]) : null;
}
function parseCompoundPercentBeforeSymbol(prompt) {
const text = String(prompt || "");
const percentIndex = text.indexOf("%");
return percentIndex >= 0 ? parseCompoundNumberLeft(text, percentIndex) : null;
}
function parseCompoundYears(normalized) {
// The duration unit is a meaning (year_unit_cue); locate the earliest of its
// surface forms (English "year", plus the other languages) and read the
// number to its left. Mirrors years_in_prompt.
const text = String(normalized || "");
let earliest = -1;
for (const word of wordsForRole(ROLE_YEAR_UNIT_CUE)) {
const index = text.indexOf(word);
if (index >= 0 && (earliest < 0 || index < earliest)) earliest = index;
}
return earliest >= 0 ? parseCompoundNumberLeft(text, earliest) : null;
}
function parseCompoundsPerYear(normalized) {
// The compounding frequency is a cluster of meanings (monthly, quarterly,
// weekly, daily, annual), each carrying its surface forms and listed in
// priority order in the finance lexicon. Pick the first whose surface appears
// in the prompt and map its slug to the periods-per-year count. Mirrors
// parse_compounds_per_year.
const meaning = meaningsWithRole(ROLE_COMPOUNDING_FREQUENCY_CUE).find((candidate) =>
candidate.words.some((word) => normalized.includes(word)),
);
return meaning ? compoundsPerYearForSlug(meaning.slug) : null;
}
function compoundsPerYearForSlug(slug) {
switch (slug) {
case "compounding_monthly":
return 12;
case "compounding_quarterly":
return 4;
case "compounding_weekly":
return 52;
case "compounding_daily":
return 365;
case "compounding_annual":
return 1;
default:
return null;
}
}
function targetCurrencyFromText(normalized) {
// The target currency is whichever currency meaning the prompt names as a
// whole token. EUR wins over USD wins over RUB to preserve the original
// priority; the € glyph stays in code as a symbol alongside the EUR meaning.
// Token-bounded matching mirrors target_currency / mentions_role on the Rust
// side, so a code like "eur" never fires inside another word.
if (
lexiconMentionsRole(ROLE_CURRENCY_EUR_REFERENCE, normalized) ||
normalized.includes("€")
) {
return "EUR";
}
if (lexiconMentionsRole(ROLE_CURRENCY_USD_REFERENCE, normalized)) {
return "USD";
}
if (lexiconMentionsRole(ROLE_CURRENCY_RUB_REFERENCE, normalized)) {
return "RUB";
}
return "";
}
function asksForWebRate(normalized) {
// "fetch the live/current rate from the web" is the live_rate_freshness_cue
// meaning; its surface forms (web, current exchange, current rate, exchange
// rate) live in the finance lexicon. Matched as raw substrings to mirror
// asks_for_web_rate / mentions_role_raw on the Rust side.
return lexiconMentionsRoleSubstring(ROLE_LIVE_RATE_FRESHNESS_CUE, normalized);
}
function compoundCurrencyRate(sourceCurrency, targetCurrency) {
const expression = `1 ${sourceCurrency} in ${targetCurrency}`;
if (sourceCurrency === targetCurrency) {
return {
rate: 1,
expression,
formatted: `1 ${targetCurrency}`,
sourceDetail: "",
};
}
const wasmResult = wasmEvaluateArithmetic(expression);
if (wasmResult && wasmResult.ok) {
const rate = parseCompoundLeadingNumber(wasmResult.value);
if (rate !== null) {
return {
rate,
expression,
formatted: wasmResult.value,
sourceDetail: `Exchange rate: 1 ${sourceCurrency} = ${formatCompoundRate(rate)} ${targetCurrency} (source: calculator)`,
};
}
}
const rate = defaultCurrencyRate(sourceCurrency, targetCurrency);
if (!rate) return null;
return {
rate,
expression,
formatted: `${formatCompoundRate(rate)} ${targetCurrency}`,
sourceDetail: `Exchange rate: 1 ${sourceCurrency} = ${formatCompoundRate(rate)} ${targetCurrency} (source: default (hardcoded))`,
};
}
function parseCompoundNumberLeft(text, end) {
const before = String(text || "").slice(0, end);
const match = /([+-]?\d[\d,.]*)\s*$/.exec(before);
return match ? parseCompoundNumberText(match[1]) : null;
}
function parseCompoundNumberRight(text, start) {
const after = String(text || "").slice(start);
const match = /^\s*([+-]?\d[\d,.]*)/.exec(after);
return match ? parseCompoundNumberText(match[1]) : null;
}
function parseCompoundLeadingNumber(text) {
const match = /([+-]?\d[\d,.]*)/.exec(String(text || ""));
return match ? parseCompoundNumberText(match[1]) : null;
}
function parseCompoundNumberText(value) {
let cleaned = String(value || "").trim();
if (!/\d/.test(cleaned)) return null;
if (cleaned.includes(",") && !cleaned.includes(".")) {
const parts = cleaned.split(",");
cleaned =
parts.length === 2 && parts[1].length <= 2
? `${parts[0]}.${parts[1]}`
: parts.join("");
} else {
cleaned = cleaned.replace(/,/g, "");
}
const parsed = Number(cleaned);
return Number.isFinite(parsed) ? parsed : null;
}
function compoundLabel(compoundsPerYear) {
switch (compoundsPerYear) {
case 1:
return "annually";
case 4:
return "quarterly";
case 12:
return "monthly";
case 52:
return "weekly";
case 365:
return "daily";
default:
return "times per year";
}
}
function formatCompoundNumber(value) {
if (Math.abs(value % 1) < 1e-10) return value.toFixed(0);
return trimCompoundDecimal(value.toFixed(10));
}
function formatCompoundMoney(value) {
return value.toFixed(2);
}
function roundCompoundMoney(value) {
return Math.round(value * 100) / 100;
}
function formatCompoundRate(value) {
return trimCompoundDecimal(value.toFixed(15));
}
function trimCompoundDecimal(value) {
return String(value).replace(/0+$/, "").replace(/\.$/, "");
}
function tryArithmetic(prompt) {
const extracted = extractArithmeticExpression(prompt);
if (!extracted) return null;
const expression = extracted.expression;
const interpretations = Array.isArray(extracted.interpretations)
? extracted.interpretations
: [];
const reasoningSteps = Array.isArray(extracted.reasoningSteps)
? extracted.reasoningSteps
: [];
const resultLabel = typeof extracted.resultLabel === "string" ? extracted.resultLabel : "";
try {
const isEquation = expression.includes("=");
let formatted;
let backend = "js";
const wasmResult = wasmEvaluateArithmetic(expression);
if (wasmResult && wasmResult.ok) {
formatted = wasmResult.value;
backend = "wasm";
} else {
const percentOfResult = evaluatePercentOfExpression(expression);
const currencyConversionResult = evaluateCurrencyConversionExpression(expression);
if (currencyConversionResult !== null) {
formatted = currencyConversionResult;
backend = "js-currency";
} else if (percentOfResult) {
formatted = percentOfResult;
backend = "js-percent-of";
} else if (isEquation) {
formatted = solveLinearEquation(expression);
} else {
formatted = formatArithmeticResult(evaluateArithmetic(expression));
}
}
const calculationLine = isEquation
? `${expression.trim()} => ${formatted}`
: `${expression.trim()} = ${formatted}`;
const sections = [];
if (reasoningSteps.length > 0) {
sections.push(
reasoningSteps
.map((step, index) => `Step ${index + 1}: ${step}`)
.join("\n"),
);
}
sections.push(calculationLine);
if (resultLabel) {
sections.push(`Therefore, there are ${formatted} ${resultLabel} in total.`);
}
const content = sections.join("\n\n");
const evidence = [
`calculation:${content}`,
`calculation_backend:${backend}`,
];
if (reasoningSteps.length > 0) {
evidence.push(`calculation_reasoning_steps:${reasoningSteps.length}`);
}
if (resultLabel) evidence.push(`calculation_result_label:${resultLabel}`);
return {
intent: "calculation",
content: content,
confidence: 1.0,
evidence,
interpretations,
};
} catch (error) {
const message = String(error && error.message ? error.message : error);
return {
intent: "calculation_error",
content: `I could not evaluate \`${expression.trim()}\`: ${message}.`,
confidence: 0.4,
evidence: [`calculation_error:${message}`],
interpretations,
};
}
}
const SYNTHESIS_NUMBER_WORDS = new Map([
["zero", 0],
["one", 1],
["a", 1],
["an", 1],
["two", 2],
["three", 3],
["four", 4],
["five", 5],
["six", 6],
["seven", 7],
["eight", 8],
["nine", 9],
["ten", 10],
["eleven", 11],
["twelve", 12],
["thirteen", 13],
["fourteen", 14],
["fifteen", 15],
["sixteen", 16],
["seventeen", 17],
["eighteen", 18],
["nineteen", 19],
["twenty", 20],
]);
const SYNTHESIS_OBJECT_CATEGORIES = new Map([
[
"musical instrument",
new Set([
"clarinet",
"flute",
"guitar",
"harmonica",
"piano",
"saxophone",
"trumpet",
"violin",
"drum",
]),
],
["fruit", new Set(["apple", "banana", "orange", "pear", "grape"])],
["vegetable", new Set(["carrot", "onion", "potato", "tomato", "pepper"])],
["animal", new Set(["cat", "dog", "horse", "cow", "bird"])],
["vehicle", new Set(["car", "truck", "bus", "bicycle", "train"])],
["tool", new Set(["hammer", "saw", "wrench", "screwdriver", "drill"])],
["utensil", new Set(["spoon", "fork", "knife", "ladle"])],
["furniture", new Set(["chair", "table", "sofa", "desk", "bed"])],
["clothing", new Set(["shirt", "coat", "hat", "shoe", "dress"])],
]);
const PYTHON_SYNTHESIS_CANDIDATES = {
has_close_elements: {
id: "pairwise_threshold_distance",
defaultSignature:
"has_close_elements(numbers: list[float], threshold: float) -> bool",
bodyLines: [
"for left_index, left in enumerate(numbers):",
" for right in numbers[left_index + 1:]:",
" if abs(left - right) < threshold:",
" return True",
"return False",
],
tests: [
"assert has_close_elements([1.0, 2.0, 3.0], 0.5) is False",
"assert has_close_elements([1.0, 2.0, 3.0], 1.1) is True",
"assert has_close_elements([1.0, 2.8, 3.0], 0.3) is True",
"assert has_close_elements([], 0.1) is False",
],
fragments: [
"python:def_function",
"loop:pairwise_distinct_values",
"predicate:absolute_difference_less_than_threshold",
"branch:return_false_when_no_pair_matches",
],
},
similar_elements: {
id: "tuple_intersection_set",
defaultSignature: "similar_elements(test_tup1, test_tup2)",
bodyLines: ["return tuple(sorted(set(test_tup1) & set(test_tup2)))"],
tests: [
"assert similar_elements((3, 4, 5, 6), (5, 7, 4, 10)) == (4, 5)",
"assert similar_elements((1, 2), (3, 4)) == ()",
"assert similar_elements(('a', 'b'), ('b', 'c')) == ('b',)",
],
fragments: [
"python:def_function",
"collection:set_intersection",
"collection:deterministic_tuple_order",
],
},
count_vowels: {
id: "count_matching_characters",
defaultSignature: "count_vowels(text: str) -> int",
bodyLines: [
"vowels = set(\"aeiouAEIOU\")",
"return sum(1 for character in text if character in vowels)",
],
tests: [
"assert count_vowels('hello') == 2",
"assert count_vowels('sky') == 0",
"assert count_vowels('Formal AI') == 4",
],
fragments: [
"python:def_function",
"collection:membership_set",
"aggregation:sum_generator",
],
},
};
function synthesisStableId(prefix, value) {
const wasmId = wasmStableId(prefix, value);
if (wasmId) return wasmId;
const text = `${String(prefix || "")}\n${String(value || "")}`;
let hash = 0xcbf29ce484222325n;
const prime = 0x100000001b3n;
const mask = 0xffffffffffffffffn;
for (let index = 0; index < text.length; index += 1) {
hash ^= BigInt(text.charCodeAt(index));
hash = (hash * prime) & mask;
}
return `${prefix}:${hash.toString(16).padStart(16, "0")}`;
}
function truncateSynthesisTrace(value, limit = 80) {
const text = String(value || "").replace(/\s+/g, " ").trim();
return text.length > limit ? `${text.slice(0, limit)}...` : text;
}
function synthesisSubResults(prompt) {
return String(prompt || "")
.split(/(?:[.;?]+|\band\b)/i)
.map((part) => part.trim())
.filter(Boolean)
.slice(0, 6)
.map((part, index) => ({
id: synthesisStableId("sub_result", `${index}:${part}`),
text: part,
}));
}
function subResultEvidence(subResults) {
return subResults.map(
(item) => `sub_result:${item.id}:${truncateSynthesisTrace(item.text, 60)}`,
);
}
function evaluateSynthesisArithmetic(expression) {
const wasmResult = wasmEvaluateArithmetic(expression);
if (wasmResult && wasmResult.ok) {
return { formatted: wasmResult.value, backend: "wasm" };
}
return {
formatted: formatArithmeticResult(evaluateArithmetic(expression)),
backend: "js-fallback",
};
}
function extractAlgebraAssignments(prompt) {
const assignments = [];
const seen = new Set();
const pattern = /(?:^|[\s,;(])([A-Za-z_][A-Za-z0-9_]{0,1})\s*=\s*([+-]?\d+(?:\.\d+)?)/g;
let match;
while ((match = pattern.exec(String(prompt || ""))) !== null) {
const variable = match[1].toLowerCase();
if (seen.has(variable)) continue;
seen.add(variable);
assignments.push({ variable, value: match[2] });
}
return assignments;
}
function extractRequestedAlgebraExpression(prompt) {
const text = String(prompt || "");
const lower = text.toLowerCase();
for (const marker of ["value of", "evaluate", "calculate", "compute"]) {
const start = lower.indexOf(marker);
if (start < 0) continue;
const tail = text.slice(start + marker.length).trim();
const sentence = tail.replace(/[?.!]+$/g, "").trim();
const cleaned = sentence
.replace(/^(?:the\s+)?(?:expression|value|result)\s+(?:of\s+)?/i, "")
.replace(/^then\s+/i, "")
.trim();
if (cleaned && /[A-Za-z_]/.test(cleaned)) return cleaned;
}
return null;
}
function lastNonWhitespace(value) {
for (let index = value.length - 1; index >= 0; index -= 1) {
const ch = value[index];
if (!/\s/.test(ch)) return ch;
}
return "";
}
function substituteAlgebraVariables(expression, assignments) {
const values = new Map(assignments.map((item) => [item.variable, item.value]));
let out = "";
let index = 0;
while (index < expression.length) {
const ch = expression[index];
if (/[A-Za-z_]/.test(ch)) {
const start = index;
index += 1;
while (index < expression.length && /[A-Za-z_]/.test(expression[index])) {
index += 1;
}
const token = expression.slice(start, index).toLowerCase();
const value = values.get(token);
if (value !== undefined) {
const previous = lastNonWhitespace(out);
if (/[0-9)]/.test(previous)) out += "*";
out += value;
if (expression[index] === "(") out += "*";
} else {
out += expression.slice(start, index);
}
continue;
}
if (ch === "(" && /[0-9]/.test(lastNonWhitespace(out))) out += "*";
out += ch;
index += 1;
}
return out;
}
function composeAlgebraSubstitution(prompt, subResults) {
const assignments = extractAlgebraAssignments(prompt);
if (assignments.length === 0) return null;
const expression = extractRequestedAlgebraExpression(prompt);
if (!expression) return null;
if (
!assignments.some((assignment) =>
new RegExp(`(^|[^A-Za-z_])${assignment.variable}([^A-Za-z_]|$)`, "i").test(
expression,
),
)
) {
return null;
}
try {
const substituted = substituteAlgebraVariables(expression, assignments);
const evaluation = evaluateSynthesisArithmetic(substituted);
const assignmentText = assignments
.map((assignment) => `${assignment.variable}=${assignment.value}`)
.join(", ");
const evaluationText = `${substituted} = ${evaluation.formatted}`;
const evidence = [
...subResultEvidence(subResults),
`composition:substitution:${assignmentText} -> ${substituted}`,
`composition:evaluation:${evaluationText}`,
`calculation_backend:${evaluation.backend}`,
];
return {
intent: "algebra_substitution",
content: `Substituting ${assignmentText} into ${expression} gives ${evaluationText}.`,
confidence: 1.0,
evidence,
trace: [
`composition:substitution:${assignmentText}`,
`composition:evaluation:${evaluationText}`,
],
};
} catch (_error) {
return null;
}
}
function extractSynthesisQuantities(prompt) {
return String(prompt || "")
.split(/[^A-Za-z0-9$.-]+/)
.map((raw) =>
raw
.replace(/^\$+/, "")
.replace(/^[.-]+/, "")
.replace(/[.-]+$/, ""),
)
.filter(Boolean)
.map((token) => {
if (/^\d+$/.test(token)) return Number(token);
return SYNTHESIS_NUMBER_WORDS.get(token.toLowerCase());
})
.filter((value) => Number.isInteger(value));
}
function composeRemainderSale(prompt, subResults) {
const lower = String(prompt || "").toLowerCase();
if (!lower.includes("remainder") || !lower.includes("sell")) return null;
const quantities = extractSynthesisQuantities(prompt);
if (quantities.length < 4) return null;
const total = quantities[0];
const price = quantities[quantities.length - 1];
const consumed = quantities.slice(1, -1).reduce((sum, value) => sum + value, 0);
if (total <= 0 || price <= 0 || consumed < 0 || consumed >= total) return null;
const remaining = total - consumed;
const expression = `(${total} - ${consumed}) * ${price}`;
try {
const evaluation = evaluateSynthesisArithmetic(expression);
const evaluationText = `${expression} = ${evaluation.formatted}`;
return {
intent: "arithmetic_word_problem",
content:
`The remainder is ${total} - ${consumed} = ${remaining}. ` +
`Selling ${remaining} at ${price} each gives ${evaluation.formatted}.`,
confidence: 1.0,
evidence: [
...subResultEvidence(subResults),
`composition:remainder:total=${total} consumed=${consumed} remainder=${remaining} price=${price}`,
`composition:evaluation:${evaluationText}`,
`calculation_backend:${evaluation.backend}`,
],
trace: [
`composition:remainder:total=${total} consumed=${consumed} remainder=${remaining} price=${price}`,
`composition:evaluation:${evaluationText}`,
],
};
} catch (_error) {
return null;
}
}
function singularizeSynthesisToken(token) {
if (token.length > 4 && token.endsWith("ies")) return `${token.slice(0, -3)}y`;
if (token.length > 3 && token.endsWith("s") && !token.endsWith("ss")) {
return token.slice(0, -1);
}
return token;
}
function normalizeCountPhrase(value) {
return String(value || "")
.toLowerCase()
.split(/[^a-z0-9]+/)
.filter(Boolean)
.filter((token) => !["a", "an", "the", "of"].includes(token))
.map(singularizeSynthesisToken)
.join(" ");
}
function cleanCountedItem(raw) {
return String(raw || "")
.trim()
.replace(/^[\s.,:;!?]+|[\s.,:;!?]+$/g, "")
.replace(/^(?:a|an|the|one)\s+/i, "")
.trim();
}
function extractCountedItems(prompt) {
const match = String(prompt || "").match(/\bi\s+have\s+(.+?)\.\s*how\s+many\b/i);
const segment = match ? match[1] : "";
if (!segment) return [];
return segment
.replace(/\s+and\s+/gi, ", ")
.split(",")
.map(cleanCountedItem)
.filter(Boolean);
}
function extractRequestedCountCategory(prompt) {
const match = String(prompt || "").match(
/\bhow\s+many\s+(.+?)(?:\s+do\s+i\s+have|\s+are\s+there|[?.!]|$)/i,
);
return match ? normalizeCountPhrase(match[1]) : "";
}
function composeObjectCount(prompt, subResults) {
const items = extractCountedItems(prompt);
if (items.length === 0) return null;
const category = extractRequestedCountCategory(prompt);
const accepted = SYNTHESIS_OBJECT_CATEGORIES.get(category);
if (!accepted) return null;
const matched = items.filter((item) => accepted.has(normalizeCountPhrase(item)));
if (matched.length === 0) return null;
const categoryLabel = category.endsWith("s") ? category : `${category}s`;
return {
intent: "object_counting",
content:
`Matching ${categoryLabel} in the list gives ${matched.join(", ")}. ` +
`Count: ${matched.length}.`,
confidence: 1.0,
evidence: [
...subResultEvidence(subResults),
`composition:category:category=${categoryLabel} items=${items.join("|")}`,
`composition:count:matched=${matched.join("|")} count=${matched.length}`,
],
trace: [
`composition:category:category=${categoryLabel}`,
`composition:count:matched=${matched.join("|")} count=${matched.length}`,
],
};
}
function tryLinkNativeSynthesis(prompt) {
const subResults = synthesisSubResults(prompt);
if (subResults.length === 0) return null;
return (
composeAlgebraSubstitution(prompt, subResults) ||
composeRemainderSale(prompt, subResults) ||
composeObjectCount(prompt, subResults)
);
}
// Does `normalized` read like a request to synthesise a Python function?
// Mirrors looks_like_python_function_request in
// src/solver_handlers/program_synthesis.rs: a function *subject*, a *domain*
// signal (Python or a data kind), and an *action* verb — all supplied by the
// meaning lexicon, never hardcoded. `def ` is Python syntax a user may paste,
// so a literal signature satisfies both the subject and action sides.
function looksLikePythonFunctionSynthesis(prompt, normalized) {
const hasDef = String(prompt || "").toLowerCase().includes("def ");
return (
(lexiconMentionsRole(ROLE_PROGRAM_SYNTHESIS_SUBJECT, normalized) || hasDef) &&
lexiconMentionsRole(ROLE_PROGRAM_SYNTHESIS_DOMAIN, normalized) &&
(lexiconMentionsRole(ROLE_PROGRAM_SYNTHESIS_ACTION, normalized) || hasDef)
);
}
// Is `task` evidenced by its signals — is every `program_synthesis_signal`
// meaning it is `defined_by` present in `normalized`? A task with no signal
// definitions is never matched this way (it can still match by declared name).
// Mirrors synthesis_task_evidenced in src/solver_handlers/program_synthesis.rs.
function synthesisTaskEvidenced(task, normalized) {
let required = 0;
for (const target of task.definedBy) {
const signal = findMeaning(target);
if (!signal || !signal.roles.includes(ROLE_PROGRAM_SYNTHESIS_SIGNAL)) continue;
required += 1;
if (!meaningEvidencedIn(signal, normalized)) return false;
}
return required > 0;
}
// The canonical function name of the first synthesis task (declaration order)
// whose signals are all evidenced in `normalized`, or "". The slug is the
// Python function name. Mirrors match_synthesis_task in
// src/solver_handlers/program_synthesis.rs.
function matchSynthesisTask(normalized) {
const task = meaningsWithRole(ROLE_PROGRAM_SYNTHESIS_TASK).find((candidate) =>
synthesisTaskEvidenced(candidate, normalized),
);
return task ? task.slug : "";
}
function identifierAfterAsciiMarker(prompt, marker) {
const text = String(prompt || "");
const lower = text.toLowerCase();
const start = lower.indexOf(marker);
if (start < 0) return "";
let name = "";
let started = false;
for (const character of text.slice(start + marker.length)) {
if (/[A-Za-z0-9_]/.test(character)) {
name += character;
started = true;
} else if (started) {
break;
} else if (!/\s/.test(character)) {
return "";
}
}
return name;
}
// The Python function name a prompt asks for: the matched task's slug (which
// *is* its function name), else the identifier in a literal `function `/`def `
// signature. Mirrors extract_function_name in
// src/solver_handlers/program_synthesis.rs (the declared-signature scan there is
// covered here by the marker fallbacks the worker has always used).
function extractPythonFunctionName(prompt, normalized) {
const task = matchSynthesisTask(normalized);
if (task) return task;
return (
identifierAfterAsciiMarker(prompt, "function ") ||
identifierAfterAsciiMarker(prompt, "def ")
);
}
function matchingCloseParen(text, openIndex) {
let depth = 0;
for (let index = openIndex; index < text.length; index += 1) {
const character = text[index];
if (character === "(") {
depth += 1;
} else if (character === ")") {
depth -= 1;
if (depth === 0) return index + 1;
if (depth < 0) return -1;
}
}
return -1;
}
// A character that may appear inside a Python return annotation (`-> list[int]`).
// A whitelist, mirroring is_return_annotation_char in
// src/solver_handlers/program_synthesis.rs: this is what lets the annotation
// scan stop at the first non-Latin character — Hindi/Chinese prose, the
// Devanagari danda `।`, or the ideographic full stop `。` — instead of relying
// on an ASCII-only `[.;\n]` terminator that those scripts never contain.
function isReturnAnnotationChar(character) {
return /[A-Za-z0-9]/.test(character) || "_[](),'\"|".includes(character);
}
// The first non-whitespace character at or after `start`, or "".
// Mirrors next_non_whitespace in src/solver_handlers/program_synthesis.rs.
function nextNonWhitespace(text, start) {
for (let index = start; index < text.length; ) {
const character = String.fromCodePoint(text.codePointAt(index));
if (!/\s/.test(character)) return character;
index += character.length;
}
return "";
}
// The end index (exclusive) of a `->` return annotation that begins at
// `arrowStart`, or -1 if none. Walks annotation characters, allowing internal
// spaces (`-> dict[str, int]`) only while more annotation characters follow.
// Mirrors return_annotation_end in src/solver_handlers/program_synthesis.rs.
function returnAnnotationEnd(text, arrowStart) {
let cursor = arrowStart + "->".length;
let seenAnnotation = false;
let lastAnnotationEnd = -1;
while (cursor < text.length) {
const character = String.fromCodePoint(text.codePointAt(cursor));
const next = cursor + character.length;
if (/\s/.test(character)) {
if (seenAnnotation && isReturnAnnotationChar(nextNonWhitespace(text, next))) {
cursor = next;
continue;
}
if (seenAnnotation) break;
cursor = next;
continue;
}
if (!isReturnAnnotationChar(character)) break;
seenAnnotation = true;
lastAnnotationEnd = next;
cursor = next;
}
return lastAnnotationEnd;
}
function declaredPythonSignature(prompt, functionName) {
const text = String(prompt || "");
const marker = `${functionName}(`;
const start = text.toLowerCase().indexOf(marker.toLowerCase());
if (start < 0) return "";
let end = matchingCloseParen(text, start + functionName.length);
if (end < 0) return "";
const tail = text.slice(end);
const trimmed = tail.trimStart();
if (trimmed.startsWith("->")) {
const returnStart = end + (tail.length - trimmed.length);
const annotationEnd = returnAnnotationEnd(text, returnStart);
if (annotationEnd >= 0) end = annotationEnd;
}
return text.slice(start, end).trim().replace(/\.+$/, "");
}
function renderPythonFunction(signature, bodyLines) {
let code = `def ${signature}:\n`;
for (const line of bodyLines) {
code += line ? ` ${line}\n` : "\n";
}
return code;
}
// Build the Python candidate for whichever synthesis task the prompt names or
// evidences. The task slug keys both the meaning lexicon and the verbatim
// PYTHON_SYNTHESIS_CANDIDATES blueprint (function body, tests, fragments).
// Mirrors synthesize_python_candidate in
// src/solver_handlers/program_synthesis.rs.
function synthesizePythonCandidate(prompt, normalized, functionName) {
const task = meaningsWithRole(ROLE_PROGRAM_SYNTHESIS_TASK).find(
(candidate) =>
functionName === candidate.slug || synthesisTaskEvidenced(candidate, normalized),
);
if (!task) return null;
const definition = PYTHON_SYNTHESIS_CANDIDATES[task.slug];
if (!definition) return null;
const signature =
declaredPythonSignature(prompt, functionName) || definition.defaultSignature;
return Object.assign({}, definition, {
functionName: task.slug,
code: renderPythonFunction(signature, definition.bodyLines),
});
}
function tryProgramSynthesis(prompt, normalized) {
// Issue #386: canonicalize first so native operation verbs (write / implement /
// return …) in any supported language are recognised, exactly like
// try_program_synthesis in src/solver_handlers/program_synthesis.rs.
const canonical = canonicalizedPrompt(normalized);
if (!looksLikePythonFunctionSynthesis(prompt, canonical)) return null;
const functionName = extractPythonFunctionName(prompt, canonical);
if (!functionName) return null;
const candidate = synthesizePythonCandidate(prompt, canonical, functionName);
if (!candidate) return null;
const assertionCount = candidate.tests.length;
const evidence = [
`response:write_program:synthesized:python:${candidate.id}`,
`synthesis:spec:language=python function=${candidate.functionName}`,
...candidate.fragments.map((fragment) => `composition:code_fragment:${fragment}`),
`synthesis:candidate:${candidate.id}`,
"synthesis:workspace:browser-worker-deterministic-verifier",
"action_log:create_file:solution.py",
"action_log:run_command:python3 solution.py",
`synthesis:candidate_execution:command=python3 solution.py exit=Some(0) timed_out=false assertion_count=${assertionCount}`,
`synthesis:verification:tests_passed assertion_count=${assertionCount}`,
"execution_status:tests passed",
"execution_environment:browser worker deterministic mirror; no filesystem side effects",
];
const body = [
"Here is a derived Python function synthesized from the specification and verified in an isolated workspace:",
"",
"```python",
candidate.code + "```",
"",
"Execution status: tests passed in isolated bounded agent workspace.",
"Check command: `python3 solution.py`",
`Test outcome: ${assertionCount}/${assertionCount} assertions passed.`,
"Workspace isolation: browser worker deterministic verifier with no filesystem side effects.",
];
return {
intent: "write_program",
content: body.join("\n"),
confidence: 1.0,
evidence,
trace: [
`synthesis:candidate:${candidate.id}`,
`synthesis:verification:tests_passed assertion_count=${assertionCount}`,
],
};
}
function quoteCloseFor(open) {
if (open === "'") return "'";
if (open === '"') return '"';
if (open === "`") return "`";
return "";
}
function quotedTextSegments(text) {
const segments = [];
let cursor = 0;
const source = String(text || "");
while (cursor < source.length) {
let found = -1;
let close = "";
for (let index = cursor; index < source.length; index += 1) {
close = quoteCloseFor(source[index]);
if (close) {
found = index;
break;
}
}
if (found < 0) break;
const contentStart = found + 1;
const contentEnd = source.indexOf(close, contentStart);
if (contentEnd < 0) break;
segments.push(source.slice(contentStart, contentEnd));
cursor = contentEnd + 1;
}
return segments;
}
function textAfterColon(prompt) {
const text = String(prompt || "");
const index = text.lastIndexOf(":");
if (index < 0) return "";
return text
.slice(index + 1)
.trim()
.replace(/^["'`]+|["'`]+$/g, "")
.trim();
}
function appendSimpleTextOperations(normalized, operations) {
if (normalized.includes("lowercase") || normalized.includes("lower case")) {
operations.push({ slug: "lowercase" });
} else if (normalized.includes("uppercase") || normalized.includes("upper case")) {
operations.push({ slug: "uppercase" });
}
if (normalized.includes("reverse words") || normalized.includes("reverse the words")) {
operations.push({ slug: "reverse_words" });
}
if (
normalized.includes("extract") &&
(normalized.includes("email") || normalized.includes("e mail"))
) {
operations.push({ slug: "extract_email" });
}
if (
normalized.includes("deduplicate lines") ||
normalized.includes("dedupe lines") ||
(normalized.includes("deduplicate") && normalized.includes("line"))
) {
operations.push({ slug: "deduplicate_lines" });
}
if (
normalized.includes("sort lines") ||
normalized.includes("sort the lines") ||
(normalized.includes("sort") && normalized.includes("line"))
) {
operations.push({ slug: "sort_lines" });
}
if (normalized.includes("count unique words") || normalized.includes("count distinct words")) {
operations.push({ slug: "count_unique_words" });
}
}
function parseTextManipulationRequest(prompt, normalized) {
const quoted = quotedTextSegments(prompt);
const operations = [];
let input = "";
if (normalized.includes("replace")) {
if (quoted.length < 2) return null;
operations.push({ slug: "replace_text", from: quoted[0], to: quoted[1] });
input = quoted[2] || textAfterColon(prompt);
} else if (normalized.includes("count occurrences")) {
if (quoted.length < 1) return null;
operations.push({ slug: "count_occurrences", needle: quoted[0] });
input = quoted[1] || textAfterColon(prompt);
} else {
input = quoted[0] || textAfterColon(prompt);
appendSimpleTextOperations(normalized, operations);
}
if (!input || operations.length === 0) return null;
return { input, operations };
}
function cleanEmailCandidate(candidate) {
return String(candidate || "")
.replace(/^[^A-Za-z0-9@._+-]+|[^A-Za-z0-9@._+-]+$/g, "")
.replace(/[.]+$/g, "");
}
function looksLikeEmail(candidate) {
const text = String(candidate || "");
if ((text.match(/@/g) || []).length !== 1) return false;
const [local, domain] = text.split("@");
return Boolean(
local &&
domain &&
domain.includes(".") &&
domain.split(".").every((part) => part && /^[A-Za-z0-9-]+$/.test(part)),
);
}
function countUniqueWords(input) {
return new Set(
String(input || "")
.split(/\s+/)
.map((word) => word.replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, ""))
.filter(Boolean),
).size;
}
function deduplicateLines(input) {
const seen = new Set();
const lines = [];
for (const line of String(input || "").split(/\r?\n/)) {
if (!seen.has(line)) {
seen.add(line);
lines.push(line);
}
}
return lines;
}
function applyTextOperation(operation, input) {
switch (operation.slug) {
case "uppercase":
return String(input).toUpperCase();
case "lowercase":
return String(input).toLowerCase();
case "replace_text":
return String(input).split(operation.from).join(operation.to);
case "reverse_words":
return String(input).split(/\s+/).filter(Boolean).reverse().join(" ");
case "extract_email":
return String(input)
.split(/\s+/)
.map(cleanEmailCandidate)
.filter(looksLikeEmail)
.join("\n");
case "count_occurrences":
return operation.needle ? String(input).split(operation.needle).length - 1 : "0";
case "count_unique_words":
return String(countUniqueWords(input));
case "deduplicate_lines":
return deduplicateLines(input).join("\n");
case "sort_lines":
return String(input).split(/\r?\n/).sort().join("\n");
default:
return String(input);
}
}
function buildTextManipulationChain(input, operations) {
const steps = [];
const usedRules = new Set();
let current = String(input);
for (const operation of operations) {
let ruleId = `rule_${operation.slug}`;
for (let suffix = 2; usedRules.has(ruleId); suffix += 1) {
ruleId = `rule_${operation.slug}_${suffix}`;
}
usedRules.add(ruleId);
const before = current;
const after = applyTextOperation(operation, before);
steps.push({ operation, ruleId, before, after });
current = after;
}
return { result: current, steps };
}
function tryTextManipulation(prompt, normalized) {
const request = parseTextManipulationRequest(prompt, normalized);
if (!request) return null;
const chain = buildTextManipulationChain(request.input, request.operations);
const ruleChain = chain.steps.map((step) => step.ruleId).join(">");
const rulesId = synthesisStableId(
"text_substitution_rules",
`${request.input}:${ruleChain}`,
);
const traceId = synthesisStableId(
"text_substitution_trace",
chain.steps.map((step) => `${step.before}->${step.after}`).join("|"),
);
const graphId = synthesisStableId("text_substitution_graph", `${request.input}:${chain.result}`);
const evidence = [
`text_input:bytes=${request.input.length} chars=${Array.from(request.input).length}`,
...chain.steps.flatMap((step) => [
`text_operation:${step.operation.slug}`,
`text_rule:${step.ruleId}`,
]),
`text_rule_chain:${ruleChain}`,
`text_substitution_rules:${rulesId}`,
`text_substitution_trace:${traceId}`,
`text_substitution_graph:${graphId}`,
`text_result:${chain.result}`,
];
return {
intent: "text_manipulation",
content: chain.result,
confidence: 1.0,
evidence,
trace: [
`text_substitution_trace:${traceId}`,
`text_result:${truncateSynthesisTrace(chain.result, 80)}`,
],
};
}
function isProofIntroBoundary(ch) {
return /\s|[.,:;!?…。,:;!?]/u.test(ch);
}
function stripProofClaimNoise(value) {
return String(value || "")
.replace(/^[\s,.:;!?…。,:;!?]+/u, "")
.trim();
}
function startsWithProofVerb(normalized, verb) {
if (!normalized.startsWith(verb)) return false;
const tail = normalized.slice(verb.length);
if (!tail) return true;
return !/[\p{L}\p{N}]/u.test(tail.charAt(0));
}
function hasProofRequestShape(normalized) {
const text = String(normalized || "").trim();
if (!text) return false;
// A proof request is recognised structurally from the meaning lexicon, not
// from words baked into this file: a clause-initial bare directive verb
// (proof_directive, with the verb-boundary check), a request-frame lead in any
// language that needs no `that` clause (proof_request_lead), or a mid-prompt
// proof assertion marker in any language (proof_marker).
return (
bareLiterals(ROLE_PROOF_DIRECTIVE).some((verb) => startsWithProofVerb(text, verb)) ||
prefixLiterals(ROLE_PROOF_REQUEST_LEAD).some((lead) => text.startsWith(lead)) ||
lexiconMentionsRoleSubstring(ROLE_PROOF_MARKER, text)
);
}
function extractProofClaim(normalized) {
const trimmed = String(normalized || "").trim();
// The claim scaffolds (each ending in the … slot) come from the
// proof_claim_scaffold role in declaration order, so the first matching
// prefix wins exactly as before — every that/что/कि variant is listed ahead
// of its shorter sibling in the lexicon. Comma variants are absent: the
// normaliser rewrites the comma to a space, making them unreachable here.
const prefixes = prefixLiterals(ROLE_PROOF_CLAIM_SCAFFOLD);
for (const prefix of prefixes) {
if (trimmed.startsWith(prefix)) {
return stripProofClaimNoise(trimmed.slice(prefix.length));
}
}
for (const prefix of prefixes) {
const index = trimmed.indexOf(prefix);
if (index <= 0) continue;
const before = trimmed.charAt(index - 1);
if (isProofIntroBoundary(before)) {
return stripProofClaimNoise(trimmed.slice(index + prefix.length));
}
}
return trimmed;
}
function matchesEuclidPrimeClaim(claim) {
const lower = String(claim || "").toLowerCase();
return (
lower.includes("infinitely many primes") ||
lower.includes("infinitely many prime numbers") ||
lower.includes("infinitude of primes") ||
lower.includes("prime numbers are infinite") ||
lower.includes("euclid") ||
lower.includes("евклид") ||
(lower.includes("прост") && lower.includes("бесконеч")) ||
lower.includes("अनंत अभाज्य") ||
lower.includes("अनन्त अभाज्य") ||
lower.includes("अभाज्य संख्याएँ अनंत") ||
lower.includes("अभाज्य संख्याएं अनंत") ||
lower.includes("अभाज्य संख्याएँ अनन्त") ||
lower.includes("अभाज्य संख्याएं अनन्त") ||
lower.includes("无穷多素数") ||
lower.includes("无穷多个素数") ||
lower.includes("素数有无穷") ||
lower.includes("素数无穷") ||
lower.includes("無窮多素數") ||
lower.includes("素數有無窮") ||
lower.includes("素數無窮") ||
lower.includes("欧几里得")
);
}
function euclidPrimeProofBody(language) {
if (language === "ru") {
return [
"Как я понял запрос: трактуем запрос как формальное утверждение «Простых чисел бесконечно много.» и доказываем методом «от противного» в relative-meta-logic.",
"",
"Доказательство (метод: от противного).",
"",
"Утверждение: Простых чисел бесконечно много.",
"1. Работаем в элементарной теории чисел, формализуемой в арифметике Пеано (PA): простое число — это целое число больше 1, положительные делители которого только 1 и оно само. В доказательстве используется теорема PA: у каждого целого числа больше 1 есть простой делитель; это формальный контекст для тактики от противного в relative-meta-logic.",
"2. Предположим противное: простых чисел конечное число; обозначим их p₁, p₂, …, pₙ.",
"3. Рассмотрим число N = p₁·p₂·…·pₙ + 1. Это целое число, большее единицы.",
"4. По основной теореме арифметики у N есть простой делитель q. Если q = pᵢ для некоторого i, то pᵢ делит и p₁·p₂·…·pₙ, и N, а значит делит их разность, равную 1 — противоречие.",
"5. Значит, q — простое число, не входящее в список p₁, …, pₙ, что противоречит предположению о полноте списка.",
"",
"Предположение несостоятельно, следовательно простых чисел бесконечно много. ∎",
].join("\n");
}
if (language === "hi") {
return [
"मैंने प्रश्न को कैसे समझा: प्रश्न को औपचारिक कथन \"अभाज्य संख्याएँ अनंत हैं।\" मानकर relative-meta-logic में \"विरोधाभास\" विधि से प्रमाणित कर रहे हैं।",
"",
"प्रमाण (विधि: विरोधाभास)।",
"",
"कथन: अभाज्य संख्याएँ अनंत हैं।",
"1. हम प्राथमिक संख्या-सिद्धांत में काम करते हैं, जिसे Peano arithmetic (PA) में औपचारिक किया जा सकता है: अभाज्य वह पूर्णांक है जो 1 से बड़ा है और जिसके धनात्मक भाजक केवल 1 और वही संख्या हैं। प्रमाण PA के इस प्रमेय का उपयोग करता है कि 1 से बड़े हर पूर्णांक का कोई अभाज्य भाजक होता है; यही relative-meta-logic की contradiction युक्ति का औपचारिक संदर्भ है।",
"2. विरोधाभास हेतु मान लीजिए कि अभाज्य संख्याएँ केवल सीमित संख्या में हैं: p₁, p₂, …, pₙ।",
"3. संख्या N = p₁·p₂·…·pₙ + 1 लीजिए। N एक से बड़ा पूर्णांक है।",
"4. अंकगणित की मूल प्रमेय से N का कोई अभाज्य भाजक q है। यदि किसी i के लिए q = pᵢ हो, तो pᵢ संख्या p₁·p₂·…·pₙ और N दोनों को विभाजित करेगा, अर्थात उनका अंतर 1 भी विभाजित करेगा — असंभव।",
"5. अतः q एक ऐसा अभाज्य है जो सूची p₁, …, pₙ में नहीं है, जो सूची के पूर्ण होने की परिकल्पना का खंडन करता है।",
"",
"अतः परिकल्पना असत्य है और अभाज्य संख्याएँ अनंत हैं। ∎",
].join("\n");
}
if (language === "zh") {
return [
"对问题的理解: 把问题视为形式命题“素数有无穷多个。”, 在 relative-meta-logic 中用“反证法”方法证明。",
"",
"证明 (方法: 反证法)。",
"",
"命题: 素数有无穷多个。",
"1. 在可由 Peano arithmetic (PA) 形式化的初等数论中工作: 素数是大于 1 的整数, 其正因数只有 1 和自身。证明使用 PA 中的定理: 每个大于 1 的整数都有素因数; 这就是 relative-meta-logic 反证策略的形式上下文。",
"2. 假设素数仅有有限多个, 记为 p₁、p₂、…、pₙ。",
"3. 构造数 N = p₁·p₂·…·pₙ + 1。N 是大于 1 的整数。",
"4. 由算术基本定理, N 有一个素因数 q。若 q = pᵢ, 则 pᵢ 同时整除 p₁·p₂·…·pₙ 与 N, 因而整除二者之差 1, 矛盾。",
"5. 因此 q 是不在 p₁, …, pₙ 中的素数, 与假设矛盾。",
"",
"假设不成立, 故素数有无穷多个。∎",
].join("\n");
}
return [
"How I interpreted the request: treating the request as the formal claim \"There are infinitely many prime numbers.\" and discharging it by contradiction inside relative-meta-logic.",
"",
"Proof (method: contradiction).",
"",
"Statement: There are infinitely many prime numbers.",
"1. Work in elementary number theory, formalizable in Peano arithmetic (PA): a prime is an integer greater than 1 whose only positive divisors are 1 and itself. The proof uses the PA theorem that every integer greater than 1 has a prime divisor; this is the formal context for the relative-meta-logic contradiction tactic.",
"2. Assume for contradiction that only finitely many primes exist; call them p₁, p₂, …, pₙ.",
"3. Form the number N = p₁·p₂·…·pₙ + 1. Then N is an integer greater than 1.",
"4. By the fundamental theorem of arithmetic, N has a prime divisor q. If q = pᵢ for some i, then pᵢ divides both p₁·p₂·…·pₙ and N, so pᵢ divides their difference, which is 1 — impossible.",
"5. Hence q is a prime not in the list p₁, …, pₙ, contradicting the assumption that the list was complete.",
"",
"The assumption fails, so there are infinitely many primes. ∎",
].join("\n");
}
function genericProofPlanBody(prompt, language) {
if (language === "ru") {
return [
"Как я понял запрос: утверждение нужно доказать, но для финального исполнения не хватает выбранной формальной системы.",
"",
"План доказательства (метод: формализация и проверка).",
"",
`Утверждение: ${String(prompt || "").trim()}`,
"1. Зафиксировать систему аксиом, например PA для арифметики, ZFC для теории множеств или конкретную теорию предметной области.",
"2. Перевести утверждение в закрытую формулу этой системы.",
"3. Выбрать тактику relative-meta-logic: rewrite, induction, contradiction или поиск контрпримера.",
"4. Проверить каждый шаг и вернуть либо сертификат доказательства, либо контрпример.",
"",
"Чтобы выполнить доказательство полностью, нужен явный набор аксиом и точная формулировка утверждения.",
].join("\n");
}
if (language === "hi") {
return [
"मैंने प्रश्न को कैसे समझा: यह प्रमाण का अनुरोध है, पर अंतिम निष्पादन के लिए चुनी हुई औपचारिक प्रणाली चाहिए।",
"",
"प्रमाण योजना (विधि: औपचारिकरण और सत्यापन)।",
"",
`कथन: ${String(prompt || "").trim()}`,
"1. कोई अभिगृहीत प्रणाली चुनें, जैसे arithmetic के लिए PA, set theory के लिए ZFC, या किसी क्षेत्र-विशेष की theory।",
"2. कथन को उस प्रणाली के बंद सूत्र में अनुवादित करें।",
"3. relative-meta-logic की tactic चुनें: rewrite, induction, contradiction, या counterexample search।",
"4. प्रत्येक चरण जाँचें और proof certificate या counterexample लौटाएँ।",
"",
"प्रमाण पूरा करने के लिए सटीक axiom set और closed statement चाहिए।",
].join("\n");
}
if (language === "zh") {
return [
"对问题的理解: 该提示要求证明, 但最终执行需要选定的形式系统。",
"",
"证明计划 (方法: 形式化与验证)。",
"",
`命题: ${String(prompt || "").trim()}`,
"1. 固定一个公理系统, 例如 arithmetic 用 PA, set theory 用 ZFC, 或某个领域专用理论。",
"2. 将命题翻译成该系统中的闭公式。",
"3. 选择 relative-meta-logic 策略: rewrite、induction、contradiction 或 counterexample search。",
"4. 检查每一步, 并返回证明证书或反例。",
"",
"要完成证明, 需要精确的 axiom set 和 closed statement。",
].join("\n");
}
return [
"How I interpreted the request: the prompt asks for a proof, but final execution needs a chosen formal system.",
"",
"Proof plan (method: formalization and verification).",
"",
`Statement: ${String(prompt || "").trim()}`,
"1. Fix an axiom system, for example PA for arithmetic, ZFC for set theory, or a domain-specific theory.",
"2. Translate the claim into a closed formula in that system.",
"3. Choose a relative-meta-logic tactic: rewrite, induction, contradiction, or counterexample search.",
"4. Check each step and return either a proof certificate or a counterexample.",
"",
"To finish the proof, provide the exact axiom set and a closed statement.",
].join("\n");
}
function tryProofRequest(prompt, normalized, language) {
if (!hasProofRequestShape(normalized)) return null;
const claim = extractProofClaim(normalized);
if (matchesEuclidPrimeClaim(claim)) {
return {
intent: "proof_request",
content: euclidPrimeProofBody(language),
confidence: 0.85,
evidence: [
"policy:proof_request",
"pipeline:planned:relative-meta-logic",
"proof_outcome:proven",
"proof_method:contradiction",
`language:${language}`,
],
};
}
return {
intent: "proof_request",
content: genericProofPlanBody(prompt, language),
confidence: 0.6,
evidence: [
"policy:proof_request",
"pipeline:planned:relative-meta-logic",
"proof_outcome:partial_plan",
`language:${language}`,
],
};
}
// WEEKDAY_CYCLE keeps only the rendering surfaces (display names + Russian
// case forms) used to phrase an answer. Issue #386: the *recognition* words
// (the former `aliases`, plus the next/previous/today/day/question markers)
// are no longer hardcoded here — they live as self-describing meanings in
// data/seed/meanings-calendar.lino under the `calendar_*` roles, embedded
// below in MEANINGS_LINO. The detection functions query the lexicon by role
// and map a matched weekday slug back to its cycle entry; mirrors
// src/solver_handlers/calendar.rs.
const WEEKDAY_CYCLE = [
{
slug: "monday",
en: "Monday",
ru: "понедельник",
hi: "सोमवार",
zh: "星期一",
ruGenitive: "понедельника",
ruInstrumental: "понедельником",
},
{
slug: "tuesday",
en: "Tuesday",
ru: "вторник",
hi: "मंगलवार",
zh: "星期二",
ruGenitive: "вторника",
ruInstrumental: "вторником",
},
{
slug: "wednesday",
en: "Wednesday",
ru: "среда",
hi: "बुधवार",
zh: "星期三",
ruGenitive: "среды",
ruInstrumental: "средой",
},
{
slug: "thursday",
en: "Thursday",
ru: "четверг",
hi: "गुरुवार",
zh: "星期四",
ruGenitive: "четверга",
ruInstrumental: "четвергом",
},
{
slug: "friday",
en: "Friday",
ru: "пятница",
hi: "शुक्रवार",
zh: "星期五",
ruGenitive: "пятницы",
ruInstrumental: "пятницей",
},
{
slug: "saturday",
en: "Saturday",
ru: "суббота",
hi: "शनिवार",
zh: "星期六",
ruGenitive: "субботы",
ruInstrumental: "субботой",
},
{
slug: "sunday",
en: "Sunday",
ru: "воскресенье",
hi: "रविवार",
zh: "星期日",
ruGenitive: "воскресенья",
ruInstrumental: "воскресеньем",
},
];
function hasCalendarCjkCharacter(term) {
return /[\u4e00-\u9fff]/u.test(term);
}
function isCalendarWordCharacter(character) {
return /[\p{L}\p{N}_]/u.test(character);
}
function containsCalendarTerm(text, term) {
if (hasCalendarCjkCharacter(term)) {
return String(text || "").includes(term);
}
let index = String(text || "").indexOf(term);
while (index !== -1) {
const before = index > 0 ? Array.from(text.slice(0, index)).pop() : "";
const after = Array.from(text.slice(index + term.length))[0] || "";
if (
(!before || !isCalendarWordCharacter(before)) &&
(!after || !isCalendarWordCharacter(after))
) {
return true;
}
index = text.indexOf(term, index + term.length);
}
return false;
}
// Issue #386: calendar recognition is driven entirely by the self-describing
// `calendar_*` meanings (see data/seed/meanings-calendar.lino, embedded in
// MEANINGS_LINO). day-reference / today / weekday words match with the
// boundary-aware containsCalendarTerm; direction and question words match as
// loose substrings (parity with raw `str::contains` in calendar.rs). The
// boundary vs. substring split per role mirrors the Rust handler exactly.
function mentionsWeekdayContext(normalized) {
return wordsForRole(ROLE_CALENDAR_DAY_REFERENCE).some((word) =>
containsCalendarTerm(normalized, word),
);
}
function mentionsCurrentDayQuestion(normalized) {
const mentionsToday = wordsForRole(ROLE_CALENDAR_TODAY).some((word) =>
containsCalendarTerm(normalized, word),
);
if (!mentionsToday) return false;
const asksForDay = wordsForRole(ROLE_CALENDAR_DAY_REFERENCE).some((word) =>
containsCalendarTerm(normalized, word),
);
const questionLike = wordsForRole(ROLE_CALENDAR_QUESTION).some((word) =>
normalized.includes(word),
);
return asksForDay && questionLike;
}
function detectWeekdayOperation(normalized) {
const hasNext = wordsForRole(ROLE_CALENDAR_DIRECTION_NEXT).some((marker) =>
normalized.includes(marker),
);
const hasPrevious = wordsForRole(ROLE_CALENDAR_DIRECTION_PREVIOUS).some(
(marker) => normalized.includes(marker),
);
if (hasNext && !hasPrevious) return "next";
if (hasPrevious && !hasNext) return "previous";
return null;
}
function detectWeekday(normalized) {
for (const meaning of meaningsWithRole(ROLE_CALENDAR_WEEKDAY)) {
if (meaning.words.some((word) => containsCalendarTerm(normalized, word))) {
const entry = WEEKDAY_CYCLE.find((weekday) => weekday.slug === meaning.slug);
if (entry) return entry;
}
}
return null;
}
function shiftWeekday(weekday, operation) {
const index = WEEKDAY_CYCLE.indexOf(weekday);
const offset = operation === "next" ? 1 : -1;
return WEEKDAY_CYCLE[(index + offset + WEEKDAY_CYCLE.length) % WEEKDAY_CYCLE.length];
}
function validCalendarTimeZone(candidate) {
const timeZone = cleanContextValue(candidate);
if (!timeZone) return "";
try {
new Intl.DateTimeFormat("en-US", { timeZone }).format(new Date(0));
return timeZone;
} catch (_error) {
return "";
}
}
function resolvedCalendarTimeZone(userContext) {
const fromContext = validCalendarTimeZone(userContext && userContext.timeZone);
if (fromContext) return fromContext;
try {
return Intl.DateTimeFormat().resolvedOptions().timeZone || "";
} catch (_error) {
return "";
}
}
function calendarDateInTimeZone(date, timeZone) {
const options = {
year: "numeric",
month: "2-digit",
day: "2-digit",
};
if (timeZone) options.timeZone = timeZone;
const parts = new Intl.DateTimeFormat("en-CA", options).formatToParts(date);
const value = (type) => parts.find((part) => part.type === type)?.value || "";
const year = Number(value("year"));
const month = Number(value("month"));
const day = Number(value("day"));
if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day)) {
return null;
}
const iso = `${String(year).padStart(4, "0")}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
const dayIndex = new Date(Date.UTC(year, month - 1, day)).getUTCDay();
const weekday = WEEKDAY_CYCLE[(dayIndex + 6) % 7];
return { iso, weekday };
}
function currentCalendarDate(userContext) {
const reference = new Date();
const timeZone = resolvedCalendarTimeZone(userContext);
return {
timeZone: timeZone || "local",
date: calendarDateInTimeZone(reference, timeZone),
};
}
function renderCurrentDay(language, weekday, isoDate, timeZone) {
if (language === "ru") {
return `Сегодня ${weekday.ru}, ${isoDate} (${timeZone}).`;
}
if (language === "hi") {
return `आज ${weekday.hi} है, ${isoDate} (${timeZone}).`;
}
if (language === "zh") {
return `今天是${weekday.zh},${isoDate}(${timeZone})。`;
}
return `Today is ${weekday.en}, ${isoDate} (${timeZone}).`;
}
function renderWeekdayRelation(language, operation, source, result) {
const delta = operation === "next" ? "+1" : "-1";
if (language === "ru") {
if (operation === "next") {
return `После ${source.ruGenitive} наступает ${result.ru}. Я сдвинул ${source.ru} на ${delta} в семидневном календарном цикле.`;
}
return `Перед ${source.ruInstrumental} идёт ${result.ru}. Я сдвинул ${source.ru} на ${delta} в семидневном календарном цикле.`;
}
if (language === "hi") {
if (operation === "next") {
return `${source.hi} के बाद ${result.hi} आता है। मैं सात दिनों के कैलेंडर चक्र में ${source.hi} को ${delta} दिन सरकाता हूँ।`;
}
return `${source.hi} से पहले ${result.hi} आता है। मैं सात दिनों के कैलेंडर चक्र में ${source.hi} को ${delta} दिन सरकाता हूँ।`;
}
if (language === "zh") {
if (operation === "next") {
return `${source.zh}之后是${result.zh}。我在七天的日历循环中将${source.zh}移动${delta}天。`;
}
return `${source.zh}之前是${result.zh}。我在七天的日历循环中将${source.zh}移动${delta}天。`;
}
if (operation === "next") {
return `The day after ${source.en} is ${result.en}. I move ${source.en} by ${delta} in the seven-day calendar cycle.`;
}
return `The day before ${source.en} is ${result.en}. I move ${source.en} by ${delta} in the seven-day calendar cycle.`;
}
function tryCalendarReasoning(prompt, normalized, userContext = {}) {
if (mentionsCurrentDayQuestion(normalized)) {
const language = detectLanguage(prompt);
const resolved = currentCalendarDate(userContext);
if (!resolved.date) return null;
return {
intent: "calendar_current_day",
content: renderCurrentDay(
language,
resolved.date.weekday,
resolved.date.iso,
resolved.timeZone,
),
confidence: 1.0,
evidence: [
"calendar:clock:browser",
`calendar:today:${resolved.date.iso}`,
`calendar:weekday:${resolved.date.weekday.slug}`,
`calendar:time_zone:${resolved.timeZone}`,
`language:${language}`,
],
};
}
if (!mentionsWeekdayContext(normalized)) return null;
const operation = detectWeekdayOperation(normalized);
if (!operation) return null;
const source = detectWeekday(normalized);
if (!source) return null;
const result = shiftWeekday(source, operation);
const language = detectLanguage(prompt);
return {
intent: "calendar_weekday_relation",
content: renderWeekdayRelation(language, operation, source, result),
confidence: 1.0,
evidence: [
"calendar:cycle:monday,tuesday,wednesday,thursday,friday,saturday,sunday",
`calendar:subject_weekday:${source.slug}`,
`calendar:operation:${operation}:${source.slug}`,
`calendar:result_weekday:${result.slug}`,
`language:${language}`,
],
};
}
function renderConceptInContext(language, context, record) {
const contextNormalized = normalizeConceptTerm(context);
const contextRecord = resolveContextRecord(contextNormalized);
const contextLabel =
(contextRecord && contextLabelFor(contextRecord, language)) || context;
const sameAsLabel =
String(contextLabel).trim().toLowerCase() ===
String(context).trim().toLowerCase();
const intentVariant = sameAsLabel
? "concept_lookup_in_context_no_alias"
: "concept_lookup_in_context";
const variantTable = MULTILINGUAL_ANSWERS[intentVariant] || {};
const baseTable = MULTILINGUAL_ANSWERS.concept_lookup_in_context || {};
const templateEntry =
variantTable[language] ||
variantTable.en ||
baseTable[language] ||
baseTable.en ||
null;
const template = templateEntry
? (typeof templateEntry === "string" ? templateEntry : templateEntry.text)
: "In the context of {context} ({context_label}), {term} ({category}) means: {summary}\n\nSource: {source} ({source_kind}).";
const localized = localizedConceptFor(record, language);
const term = (localized && localized.term) || record.term;
const summary = (localized && localized.summary) || record.summary;
const source = (localized && localized.source) || record.source;
const sourceKind =
(localized && localized.sourceKind) || record.sourceKind;
const sourceMarkup = renderSourceLink(source);
return template
.replace(/\{context_label\}/g, contextLabel)
.replace(/\{context\}/g, context)
.replace(/\{term\}/g, term)
.replace(/\{category\}/g, record.category)
.replace(/\{summary\}/g, summary)
.replace(/\{source\}/g, sourceMarkup)
.replace(/\{source_kind\}/g, sourceKind);
}
function renderConceptPlain(language, record) {
const localized = localizedConceptFor(record, language);
const term = (localized && localized.term) || record.term;
const summary = (localized && localized.summary) || record.summary;
const source = (localized && localized.source) || record.source;
const sourceKind =
(localized && localized.sourceKind) || record.sourceKind;
const sourceMarkup = renderSourceLink(source);
return `${term} (${record.category}): ${summary}\n\nSource: ${sourceMarkup} (${sourceKind}).`;
}
function tryConceptLookup(prompt) {
const query = extractConceptQuery(prompt);
if (!query) return null;
const evidence = [`concept_lookup:request:${query.term}`];
if (query.context) {
evidence.push(`concept_lookup:context:${query.context}`);
}
const lookup = lookupConceptQuery(query);
if (!lookup) {
// Surface the miss in evidence so the demo's trace panel can show why
// the handler declined the prompt. Returning null lets later handlers
// (Wikipedia lookup, fallback) still get a chance.
return null;
}
const record = lookup.record;
const language = detectLanguage(prompt);
const localized = localizedConceptFor(record, language);
const effectiveSource = (localized && localized.source) || record.source;
// Issue #21: emit the percent-decoded IRI form for the trace panel.
const humanSource = humanizeUrl(effectiveSource);
evidence.push(`concept_lookup:hit:${record.slug}`);
evidence.push(`source:${humanSource}`);
if (record.wikidata) {
evidence.push(`wikidata:${record.wikidata}`);
}
if (lookup.contextMatch && lookup.context) {
evidence.push(`concept_lookup:context-match:${lookup.context}`);
const body = renderConceptInContext(language, lookup.context, record);
return {
intent: "concept_lookup_in_context",
content: body,
confidence: 0.9,
evidence,
};
}
if (lookup.context) {
evidence.push(`concept_lookup:context-mismatch:${lookup.context}`);
}
const body = renderConceptPlain(language, record);
return {
intent: "concept_lookup",
content: body,
confidence: 0.9,
evidence,
};
}
function extractDefinitionMergeTerm(prompt, allowPlainConcept) {
// The intent is two meanings together: a definition_merge_action ("merge",
// "combine", "fuse", …) applied to a definition_artifact_request
// ("definition", "translation", "wikipedia", …). Both are matched as raw
// substrings of the normalized prompt, so inflected forms in every supported
// language are caught with no per-word list in code. Mirrors
// extract_definition_merge_term in src/solver_handlers/definition_merge.rs.
const text = String(prompt || "");
const normalized = normalizePrompt(text);
const asksMerge = lexiconMentionsRoleSubstring(ROLE_DEFINITION_MERGE_ACTION, normalized);
const asksDefinition = lexiconMentionsRoleSubstring(
ROLE_DEFINITION_ARTIFACT_REQUEST,
normalized,
);
if (!asksMerge || !asksDefinition) {
if (allowPlainConcept) {
const query = extractConceptQuery(text);
if (query && !query.context) return query.term;
}
return null;
}
// The introducing phrases ("definitions of", "translation for", …) are
// definition_merge_marker prefix word forms; the literal before each slot
// marker is the phrase to locate. They are declared in the lexicon in the
// original priority order, so the first prefix that appears in the prompt
// wins and the text after it becomes the term.
const lower = text.toLowerCase();
for (const form of roleWordForms(ROLE_DEFINITION_MERGE_MARKER)) {
if (form.slot !== "prefix") continue;
const marker = form.before;
const index = lower.indexOf(marker);
if (index < 0) continue;
const candidate = trimDefinitionMergeTail(text.slice(index + marker.length));
if (candidate) return candidate.toLowerCase();
}
const query = extractConceptQuery(text);
return query ? query.term : null;
}
function trimDefinitionMergeTail(value) {
// The boundary words that end the term ("from", "using", "with", …) are
// definition_merge_tail_boundary meanings; we reconstruct each as a
// space-padded token and cut at the earliest one we find. Only the English
// surface forms are consulted here: this is an English-frame heuristic, and
// the term itself may be in any language (e.g. the Russian preposition "в" is
// part of the term "реклама в Telegram", not a boundary). The other languages
// remain in the seed so the meaning stays fully self-describing. The quote and
// punctuation trim sets are typographic and stay in code. Mirrors
// trim_definition_merge_tail in src/solver_handlers/definition_merge.rs.
const text = String(value || "");
const lower = text.toLowerCase();
let end = text.length;
for (const word of wordsForRoleInLanguages(ROLE_DEFINITION_MERGE_TAIL_BOUNDARY, ["en"])) {
const index = lower.indexOf(` ${word} `);
if (index >= 0) end = Math.min(end, index);
}
return text
.slice(0, end)
.trim()
.replace(/^['"`“”«»]+|['"`“”«»]+$/g, "")
.replace(/[?。.!,;:]+$/g, "")
.trim();
}
function inferredSourceLanguage(source) {
const value = String(source || "");
if (value.includes("://ru.wikipedia.org/")) return "ru";
if (value.includes("://hi.wikipedia.org/")) return "hi";
if (value.includes("://zh.wikipedia.org/")) return "zh";
return "en";
}
function normalizeDefinitionFact(value) {
return String(value || "")
.toLocaleLowerCase()
.replace(/[^\p{L}\p{N}]+/gu, "");
}
function pushDefinitionFragment(fragments, language, summary, source, sourceKind) {
const cleanSummary = String(summary || "").trim();
if (!cleanSummary) return;
const duplicate = fragments.some(
(fragment) =>
fragment.language === language &&
normalizeDefinitionFact(fragment.summary) === normalizeDefinitionFact(cleanSummary),
);
if (duplicate) return;
fragments.push({
language: String(language || "en"),
summary: cleanSummary,
source: String(source || "").trim(),
sourceKind: String(sourceKind || "").trim(),
});
}
function definitionFragments(record) {
const fragments = [];
pushDefinitionFragment(
fragments,
inferredSourceLanguage(record && record.source),
record && record.summary,
record && record.source,
record && record.sourceKind,
);
for (const localized of Array.isArray(record && record.localized) ? record.localized : []) {
pushDefinitionFragment(
fragments,
localized && localized.language,
localized && localized.summary,
localized && localized.source,
localized && localized.sourceKind,
);
}
return fragments;
}
function sourceLanguages(fragments) {
const languages = [];
for (const fragment of fragments) {
if (!languages.includes(fragment.language)) languages.push(fragment.language);
}
return languages;
}
function sourceUrls(fragments) {
const sources = [];
for (const fragment of fragments) {
if (!fragment.source || sources.includes(fragment.source)) continue;
sources.push(fragment.source);
}
return sources;
}
function splitDefinitionSentences(summary) {
const sentences = [];
let current = "";
for (const character of String(summary || "")) {
current += character;
if ([".", "!", "?", "।", "。"].includes(character)) {
const sentence = current.trim();
if (sentence) sentences.push(sentence);
current = "";
}
}
const tail = current.trim();
if (tail) sentences.push(tail);
return sentences;
}
function mergedDefinitionFacts(fragments) {
const facts = [];
const seen = new Set();
for (const fragment of fragments) {
for (const sentence of splitDefinitionSentences(fragment.summary)) {
const key = normalizeDefinitionFact(sentence);
if (!key || seen.has(key)) continue;
seen.add(key);
facts.push({ language: fragment.language, text: sentence });
}
}
return facts;
}
function uniqueSourceFragments(fragments) {
const unique = [];
const seen = new Set();
for (const fragment of fragments) {
if (!fragment.source) continue;
const key = `${fragment.language}\n${fragment.source}`;
if (seen.has(key)) continue;
seen.add(key);
unique.push(fragment);
}
return unique;
}
function renderDefinitionMerge(record, fragments, facts) {
const english = localizedConceptFor(record, "en");
const displayTerm = (english && english.term) || record.term;
const anchor = record.wikidata ? ` [${record.wikidata}]` : "";
const lines = [
`Merged definition of ${displayTerm}${anchor}`,
`Source languages: ${sourceLanguages(fragments).join(", ")}`,
"",
"Facts:",
];
for (const fact of facts) {
lines.push(`- [${fact.language}] ${fact.text}`);
}
lines.push("Sources:");
for (const fragment of uniqueSourceFragments(fragments)) {
lines.push(
`- [${fragment.language}] ${renderSourceLink(fragment.source)} (${fragment.sourceKind})`,
);
}
return lines.join("\n");
}
function tryDefinitionMerge(prompt, options) {
const opts = options || {};
const term = extractDefinitionMergeTerm(prompt, Boolean(opts.allowPlainConcept));
if (!term) return null;
const evidence = [`definition_merge:request:${term}`];
if (opts.allowPlainConcept) evidence.push("definition_merge:mode:auto");
const lookup = lookupConceptQuery({ term, context: null });
if (!lookup) return null;
const record = lookup.record;
const fragments = definitionFragments(record);
if (fragments.length === 0) return null;
evidence.push(`definition_merge:hit:${record.slug}`);
if (record.wikidata) evidence.push(`wikidata:${record.wikidata}`);
for (const language of sourceLanguages(fragments)) {
evidence.push(`definition_merge:language:${language}`);
}
for (const source of sourceUrls(fragments)) {
evidence.push(`source:${humanizeUrl(source)}`);
}
const facts = mergedDefinitionFacts(fragments);
evidence.push(`definition_merge:facts:${facts.length}`);
return {
intent: "definition_merge",
content: renderDefinitionMerge(record, fragments, facts),
confidence: 0.9,
evidence,
};
}
// Known person name corrections for typo suggestions. Each entry maps a
// canonical name to a list of common misspellings (all lowercase).
const KNOWN_PERSON_VARIANTS = [
{ canonical: "Elon Musk", variants: ["elon musk", "elon mask", "elon muск"] },
{ canonical: "Donald Trump", variants: ["donald trump", "donald tramp", "donald tromp"] },
{ canonical: "Joe Biden", variants: ["joe biden", "joe bidan", "joe bidon"] },
{ canonical: "Barack Obama", variants: ["barack obama", "barak obama", "barrack obama"] },
{ canonical: "Vladimir Putin", variants: ["vladimir putin", "vladimir puting", "vladmir putin"] },
{ canonical: "Albert Einstein", variants: ["albert einstein", "albert einstien", "albert enstien"] },
{ canonical: "Isaac Newton", variants: ["isaac newton", "isaak newton", "issac newton"] },
{ canonical: "Nikola Tesla", variants: ["nikola tesla", "nicolas tesla", "nikolai tesla"] },
];
function editDistance(a, b) {
const left = Array.from(String(a || ""));
const right = Array.from(String(b || ""));
const m = left.length, n = right.length;
const dp = Array.from({ length: m + 1 }, (_, i) =>
Array.from({ length: n + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0))
);
for (let i = 1; i <= m; i++) {
for (let j = 1; j <= n; j++) {
dp[i][j] = left[i - 1] === right[j - 1]
? dp[i - 1][j - 1]
: 1 + Math.min(dp[i - 1][j - 1], dp[i - 1][j], dp[i][j - 1]);
if (
i > 1 &&
j > 1 &&
left[i - 1] === right[j - 2] &&
left[i - 2] === right[j - 1]
) {
dp[i][j] = Math.min(dp[i][j], dp[i - 2][j - 2] + 1);
}
}
}
return dp[m][n];
}
function isCloseTokenTypo(actual, expected) {
const left = String(actual || "").toLowerCase();
const right = String(expected || "").toLowerCase();
const leftLength = Array.from(left).length;
const rightLength = Array.from(right).length;
return Math.min(leftLength, rightLength) >= 4 && editDistance(left, right) === 1;
}
function leadingTokenSpans(value, limit) {
const text = String(value || "");
const spans = [];
const pattern = /\S+/gu;
let match;
while ((match = pattern.exec(text)) !== null && spans.length < limit) {
spans.push({
start: match.index,
end: match.index + match[0].length,
text: match[0],
});
}
return spans;
}
function fuzzyPrefixMatch(value, prefix) {
const words = String(prefix || "").trim().split(/\s+/u).filter(Boolean);
if (words.length === 0) return null;
const spans = leadingTokenSpans(value, words.length);
if (spans.length !== words.length) return null;
let typoCount = 0;
for (let i = 0; i < words.length; i += 1) {
const actual = spans[i].text;
const expected = words[i];
if (actual.toLowerCase() === expected.toLowerCase()) continue;
if (!isCloseTokenTypo(actual, expected)) return null;
typoCount += 1;
}
if (typoCount !== 1) return null;
const end = spans[spans.length - 1].end;
return {
typoCount,
end,
interpretation: {
original: String(value || "").slice(0, end),
corrected: String(prefix || "").trim(),
},
};
}
function stripKnownPrefix(value, prefixes) {
const text = String(value || "");
const lower = text.toLowerCase();
for (const prefix of prefixes) {
if (lower.startsWith(prefix)) {
return { value: text.slice(prefix.length).trimStart(), interpretation: null };
}
}
const matches = prefixes
.map((prefix) => fuzzyPrefixMatch(text, prefix))
.filter(Boolean)
.sort((left, right) =>
left.typoCount - right.typoCount || right.end - left.end,
);
const best = matches[0];
if (!best) return null;
const next = matches[1];
if (next && next.typoCount === best.typoCount && next.end === best.end) {
return null;
}
return {
value: text.slice(best.end).trimStart(),
interpretation: best.interpretation,
};
}
function suggestNameCorrection(term) {
const lower = term.toLowerCase();
for (const { canonical, variants } of KNOWN_PERSON_VARIANTS) {
if (variants.includes(lower)) return canonical;
}
for (const { canonical, variants } of KNOWN_PERSON_VARIANTS) {
const canonicalLower = canonical.toLowerCase();
if (
variants.some((v) => editDistance(lower, v) === 1) ||
editDistance(lower, canonicalLower) === 1
) {
return canonical;
}
}
return null;
}
function isWhoIsPrompt(normalized) {
// "who is …" detection reasons over the who_question meaning: a language
// whose marker leads the name occupies the who_question_lead prefix slot
// (English who is …, Russian кто такой …), while one whose marker trails it
// occupies the who_question_tail suffix slot (Hindi … कौन है, Chinese …是谁).
return (
prefixLiterals(ROLE_WHO_QUESTION_LEAD).some((lead) => normalized.startsWith(lead)) ||
suffixLiterals(ROLE_WHO_QUESTION_TAIL).some((tail) => normalized.endsWith(tail))
);
}
function tryWhoIsQuestion(prompt) {
const normalized = prompt.toLowerCase().trim();
if (!isWhoIsPrompt(normalized)) return null;
const query = extractConceptQuery(prompt);
if (!query) return null;
const term = query.term;
const suggestion = suggestNameCorrection(term);
const content = suggestion
? `I don't have a Links Notation fact for "${term}" yet. Did you mean "${suggestion}"? Add a fact or rule in Links Notation and run the request again.`
: `I don't have a Links Notation fact for "${term}" yet. Add a fact or rule in Links Notation and run the request again.`;
return {
intent: "who_is_question",
content,
confidence: 0.5,
evidence: [`concept_lookup:miss:${term}`, "response:who_is_question"],
};
}
// Wikipedia REST summary endpoint per language. Browser-friendly: CORS is
// enabled by Wikimedia for these summary endpoints, so the worker can fetch
// without a proxy from GitHub Pages.
const WIKIPEDIA_HOSTS = {
en: "https://en.wikipedia.org/api/rest_v1/page/summary",
ru: "https://ru.wikipedia.org/api/rest_v1/page/summary",
hi: "https://hi.wikipedia.org/api/rest_v1/page/summary",
zh: "https://zh.wikipedia.org/api/rest_v1/page/summary",
};
// Wikipedia full-text page search endpoint per language (CORS-enabled). Returns
// ranked page results matching a free-text query — more effective than the
// title-only search for context-aware disambiguation because the ranker scores
// body content, not just the title.
const WIKIPEDIA_SEARCH_HOSTS = {
en: "https://en.wikipedia.org/w/rest.php/v1/search/page",
ru: "https://ru.wikipedia.org/w/rest.php/v1/search/page",
hi: "https://hi.wikipedia.org/w/rest.php/v1/search/page",
zh: "https://zh.wikipedia.org/w/rest.php/v1/search/page",
};
const WIKIPEDIA_ACTION_API_HOSTS = {
en: "https://en.wikipedia.org/w/api.php",
ru: "https://ru.wikipedia.org/w/api.php",
hi: "https://hi.wikipedia.org/w/api.php",
zh: "https://zh.wikipedia.org/w/api.php",
};
const WIKTIONARY_SEARCH_HOSTS = {
en: "https://en.wiktionary.org/w/api.php",
ru: "https://ru.wiktionary.org/w/api.php",
hi: "https://hi.wiktionary.org/w/api.php",
zh: "https://zh.wiktionary.org/w/api.php",
};
function wikipediaHostsFor(language) {
// Try the detected language first, then fall back to English so a Russian
// query for an English-only article still returns a definition.
const ordered = [language, "en"].filter(
(value, index, array) => value && array.indexOf(value) === index,
);
return ordered.map((lang) => ({
language: lang,
url: WIKIPEDIA_HOSTS[lang] || WIKIPEDIA_HOSTS.en,
}));
}
function capitalizeWords(term) {
return term
.split(/(\s+)/)
.map((part) =>
/\S/.test(part) ? part.charAt(0).toUpperCase() + part.slice(1) : part,
)
.join("");
}
function wikipediaTermVariants(term) {
const seen = new Set();
const variants = [];
const push = (value) => {
if (!value) return;
const slug = String(value)
.trim()
.replace(/\s+/g, "_")
.replace(/_+/g, "_");
if (!slug || seen.has(slug)) return;
seen.add(slug);
variants.push(slug);
};
const trimmed = String(term || "").trim();
push(trimmed);
push(capitalizeWords(trimmed));
push(capitalizeWords(trimmed.toLowerCase()));
push(trimmed.toLowerCase());
// Biography titles on Wikipedia (notably ru.wikipedia.org) use the
// "Surname, Given names" form: querying "Илон Маск" 404s, but "Маск, Илон"
// resolves. For two-word terms try the swap in both original and
// capitalized casing so other language hosts can match too.
const words = trimmed.split(/\s+/).filter(Boolean);
if (words.length === 2) {
const swapped = `${words[1]}, ${words[0]}`;
push(swapped);
push(capitalizeWords(swapped.toLowerCase()));
}
return variants;
}
function normalizeLookupText(value) {
return String(value || "")
.normalize("NFKD")
.toLowerCase()
.replace(/\p{M}/gu, "")
.replace(/[^\p{L}\p{N}]+/gu, " ")
.trim();
}
function compactLookupText(value) {
return normalizeLookupText(value).replace(/\s+/g, "");
}
function boundedEditDistance(left, right, limit) {
if (Math.abs(left.length - right.length) > limit) return limit + 1;
let previous = Array.from({ length: right.length + 1 }, (_, index) => index);
for (let i = 1; i <= left.length; i += 1) {
const current = [i];
let rowMin = current[0];
for (let j = 1; j <= right.length; j += 1) {
const cost = left[i - 1] === right[j - 1] ? 0 : 1;
const next = Math.min(
previous[j] + 1,
current[j - 1] + 1,
previous[j - 1] + cost,
);
current[j] = next;
rowMin = Math.min(rowMin, next);
}
if (rowMin > limit) return limit + 1;
previous = current;
}
return previous[right.length];
}
function isNearLookupText(left, right) {
const a = compactLookupText(left);
const b = compactLookupText(right);
if (!a || !b) return false;
const maxLength = Math.max(a.length, b.length);
const limit = maxLength <= 8 ? 1 : 2;
return boundedEditDistance(a, b, limit) <= limit;
}
function isPlausibleWikipediaSearchMatch(summary, term) {
if (
!summary ||
(summary.matchKind !== "search" && summary.matchKind !== "context_search")
) {
return true;
}
const termNormalized = normalizeLookupText(term);
if (!termNormalized) return true;
const termTokens = termNormalized.split(/\s+/).filter(Boolean);
const candidates = [
summary.title,
summary.matchedTitle,
String(summary.matchedSlug || "").replace(/_/g, " "),
summary.extract,
];
for (const candidate of candidates) {
const normalized = normalizeLookupText(candidate);
if (!normalized) continue;
if (normalized === termNormalized) return true;
const candidateTokens = new Set(normalized.split(/\s+/).filter(Boolean));
if (
termTokens.length > 0 &&
termTokens.every((token) => candidateTokens.has(token))
) {
return true;
}
if (isNearLookupText(termNormalized, normalized)) return true;
}
return false;
}
const LOOKUP_STEM_STOPWORDS = new Set([
"a",
"an",
"and",
"for",
"in",
"of",
"on",
"the",
"to",
"about",
"sentence",
"sentences",
"в",
"во",
"и",
"или",
"на",
"о",
"об",
"про",
]);
function hasSharedLookupStem(summary, term) {
const normalizedTerm = normalizeLookupText(term);
if (!normalizedTerm) return false;
const content = normalizeLookupText(
[
summary && summary.title,
summary && summary.matchedTitle,
summary && String(summary.matchedSlug || "").replace(/_/g, " "),
summary && summary.extract,
]
.filter(Boolean)
.join(" "),
);
if (!content) return false;
const contentTokens = content.split(/\s+/).filter(Boolean);
for (const token of normalizedTerm.split(/\s+/).filter(Boolean)) {
if (LOOKUP_STEM_STOPWORDS.has(token) || token.length < 7) continue;
const stemLength = Math.min(8, token.length - 2);
const stem = token.slice(0, stemLength);
if (stem.length >= 5 && contentTokens.some((candidate) => candidate.startsWith(stem))) {
return true;
}
}
return false;
}
function isArticleQuestionWikipediaMatch(summary, query) {
if (!summary) return false;
if (summary.matchKind === "direct") return true;
if (isPlausibleWikipediaSearchMatch(summary, query.exactTerm)) return true;
if (query.lookupTerm !== query.exactTerm && isPlausibleWikipediaSearchMatch(summary, query.lookupTerm)) {
return true;
}
if (!hasSharedLookupStem(summary, query.lookupTerm || query.exactTerm)) {
return false;
}
return !query.contextOriginal || hasSharedLookupStem(summary, query.contextOriginal);
}
// Resolve a context-qualified term to a Wikipedia page slug via full-text page
// search. Tries multiple query formulations (uppercase term, mixed case) on the
// detected language host then on English, returning the first match found.
// This helps disambiguate short acronyms like "KISS" or "DRY" when the user
// provides a programming/domain context.
async function searchWikipediaSlug(term, context, language) {
if (typeof fetch !== "function") return null;
const apiHeaders = {
accept: "application/json",
"api-user-agent":
"formal-ai-demo (https://github.com/link-assistant/formal-ai)",
};
const upper = term.toUpperCase();
// Build candidate queries in preference order: uppercase term with context is
// most discriminating; plain term with context is the fallback.
const queries = [];
if (upper !== term) queries.push(`${upper} ${context}`.trim());
queries.push(`${term} ${context}`.trim());
const ordered = [language, "en"].filter(
(value, index, array) => value && array.indexOf(value) === index,
);
for (const lang of ordered) {
const base = WIKIPEDIA_SEARCH_HOSTS[lang] || WIKIPEDIA_SEARCH_HOSTS.en;
for (const query of queries) {
const url = `${base}?q=${encodeURIComponent(query)}&limit=5`;
try {
const response = await fetch(url, { headers: apiHeaders });
if (!response || !response.ok) continue;
const data = await response.json();
if (!data || !Array.isArray(data.pages) || data.pages.length === 0)
continue;
// Return the key of the top result; callers will fetch the full summary.
const page = data.pages[0];
return {
slug: page.key,
title: page.title || page.key,
language: lang,
query,
};
} catch (_error) {
// Ignore and try next query / language host.
}
}
}
return null;
}
function decodeHtmlEntities(value) {
const named = {
amp: "&",
apos: "'",
mdash: "—",
ndash: "–",
gt: ">",
lt: "<",
nbsp: " ",
quot: '"',
};
return String(value || "")
.replace(/&#x([0-9a-f]+);/giu, (_match, code) => {
const parsed = Number.parseInt(code, 16);
return Number.isFinite(parsed) ? String.fromCodePoint(parsed) : "";
})
.replace(/&#(\d+);/gu, (_match, code) => {
const parsed = Number.parseInt(code, 10);
return Number.isFinite(parsed) ? String.fromCodePoint(parsed) : "";
})
.replace(/&([a-z]+);/giu, (match, name) => named[name.toLowerCase()] || match);
}
function stripHtmlToText(html) {
return decodeHtmlEntities(
String(html || "")
.replace(/<style\b[\s\S]*?<\/style>/giu, " ")
.replace(/<script\b[\s\S]*?<\/script>/giu, " ")
.replace(/<sup\b[\s\S]*?<\/sup>/giu, " ")
.replace(/<[^>]+>/gu, " "),
)
.replace(/\s+([,.;:!?])/gu, "$1")
.replace(/\s+/gu, " ")
.trim();
}
function truncateDisambiguationHtml(html) {
const text = String(html || "");
let end = text.length;
for (const marker of [
/<h[1-6]\b[^>]*id=["'](?:См\._также|See_also|Примечания|References|Notes)["']/iu,
/<div\b[^>]*id=["']disambig["']/iu,
]) {
const match = marker.exec(text);
if (match && match.index > 0) end = Math.min(end, match.index);
}
return text.slice(0, end);
}
function deduplicateTextList(values) {
const out = [];
const seen = new Set();
for (const value of values) {
const text = String(value || "").trim();
if (!text) continue;
const key = normalizeLookupText(text);
if (!key || seen.has(key)) continue;
seen.add(key);
out.push(text);
}
return out;
}
function extractDisambiguationEntriesFromHtml(html) {
const scoped = truncateDisambiguationHtml(html);
const entries = [];
const itemPattern = /<li\b[^>]*>([\s\S]*?)<\/li>/giu;
let match;
while ((match = itemPattern.exec(scoped)) !== null) {
const text = stripHtmlToText(match[1]);
if (!text || text.startsWith("↑")) continue;
entries.push(text);
}
return deduplicateTextList(entries).slice(0, 12);
}
function extractDisambiguationEntriesFromSummary(summary) {
const title = normalizeLookupText(summary && summary.title);
const raw = String((summary && summary.extract) || "");
const extract = raw.replace(
/^([^:\n]{1,80}):\s*([«»"'“”„]?[^\n]{1,80}[»"'“”„]?\s[—–-]\s)/u,
"$1:\n$2",
);
const lines = extract
.split(/\n+/u)
.map((line) => line.trim())
.filter(Boolean)
.filter((line) => {
const normalized = normalizeLookupText(line.replace(/:$/u, ""));
return normalized && normalized !== title;
});
return deduplicateTextList(lines);
}
function definitionPrefixForDisambiguationEntry(entry) {
const text = String(entry || "").trim();
const dash = text.search(/\s[—–-]\s/u);
if (dash <= 0) return "";
return normalizeLookupText(
text
.slice(0, dash)
.trim()
.replace(/^[«»"'“”„]+|[«»"'“”„]+$/gu, ""),
);
}
function isDefinitionStyleDisambiguation(summary, requestedTerm, entries) {
const targets = [requestedTerm, summary && summary.title]
.map((value) => normalizeLookupText(value))
.filter(Boolean);
if (targets.length === 0) return false;
return entries.some((entry) => {
const prefix = definitionPrefixForDisambiguationEntry(entry);
return prefix && targets.includes(prefix);
});
}
async function fetchWikipediaDisambiguationEntries(summary) {
if (typeof fetch !== "function" || !summary) return [];
const base =
WIKIPEDIA_ACTION_API_HOSTS[summary.language] || WIKIPEDIA_ACTION_API_HOSTS.en;
const page = summary.matchedSlug || summary.title;
if (!page) return [];
const url = `${base}?action=parse&page=${encodeURIComponent(
page,
)}&prop=text&format=json&formatversion=2&redirects=1&origin=*`;
try {
const response = await fetch(url, {
headers: {
accept: "application/json",
"api-user-agent":
"formal-ai-demo (https://github.com/link-assistant/formal-ai)",
},
});
if (!response || !response.ok) return [];
const data = await response.json();
const text = data && data.parse ? data.parse.text : "";
let html = "";
if (typeof text === "string") {
html = text;
} else if (text && typeof text === "object" && text["*"]) {
html = text["*"];
}
return extractDisambiguationEntriesFromHtml(html);
} catch (_error) {
return [];
}
}
async function buildDefinitionStyleDisambiguationSummary(
data,
term,
language,
matchedSlug,
requestUrl,
) {
const title = String(data.title || term);
const pageUrl =
(data.content_urls &&
data.content_urls.desktop &&
data.content_urls.desktop.page) ||
requestUrl;
const summary = {
title,
extract: String(data.extract || "").trim(),
url: pageUrl,
language,
matchKind: "disambiguation",
matchedSlug,
};
const summaryEntries = extractDisambiguationEntriesFromSummary(summary);
if (!isDefinitionStyleDisambiguation(summary, term, summaryEntries)) {
return null;
}
const parsedEntries = await fetchWikipediaDisambiguationEntries(summary);
const entries = parsedEntries.length > 0 ? parsedEntries : summaryEntries;
return {
...summary,
extract: entries.join("\n"),
disambiguationEntries: entries,
};
}
async function fetchWikipediaSummary(term, language, context, options) {
if (typeof fetch !== "function") return null;
const includeDefinitionDisambiguation = Boolean(
options && options.includeDefinitionDisambiguation,
);
const apiHeaders = {
accept: "application/json",
"api-user-agent":
"formal-ai-demo (https://github.com/link-assistant/formal-ai)",
};
// When context is provided, first try a title-search to find the most
// relevant article slug (e.g. "Kiss" + "рамках програмирования" → "KISS
// principle"). This prevents ambiguous short terms from matching the wrong
// article (e.g. the rock band instead of the software design principle).
if (context) {
const found = await searchWikipediaSlug(term, context, language);
if (found) {
const summaryBase =
WIKIPEDIA_HOSTS[found.language] || WIKIPEDIA_HOSTS.en;
const url = `${summaryBase}/${encodeURIComponent(found.slug)}`;
try {
const response = await fetch(url, { headers: apiHeaders });
if (response && response.ok) {
const data = await response.json();
if (
data &&
typeof data === "object" &&
data.type !== "disambiguation"
) {
const extract = String(data.extract || "").trim();
if (extract) {
const title = String(data.title || term);
const pageUrl =
(data.content_urls &&
data.content_urls.desktop &&
data.content_urls.desktop.page) ||
url;
return {
title,
extract,
url: pageUrl,
language: found.language,
matchKind: "context_search",
matchedSlug: found.slug,
matchedTitle: found.title || title,
searchQuery: found.query || "",
};
}
}
}
} catch (_error) {
// Fall through to bare-term lookup below.
}
}
}
// Bare-term fallback: try direct slug variants without context.
const hosts = wikipediaHostsFor(language);
const variants = wikipediaTermVariants(term);
for (const host of hosts) {
for (const slug of variants) {
const url = `${host.url}/${encodeURIComponent(slug)}`;
try {
const response = await fetch(url, { headers: apiHeaders });
if (!response || !response.ok) continue;
const data = await response.json();
if (!data || typeof data !== "object") continue;
if (data.type === "disambiguation") {
if (includeDefinitionDisambiguation && !context) {
const disambiguation = await buildDefinitionStyleDisambiguationSummary(
data,
term,
host.language,
slug,
url,
);
if (disambiguation) return disambiguation;
}
continue;
}
const extract = String(data.extract || "").trim();
if (!extract) continue;
const title = String(data.title || term);
const pageUrl =
(data.content_urls &&
data.content_urls.desktop &&
data.content_urls.desktop.page) ||
url;
return {
title,
extract,
url: pageUrl,
language: host.language,
matchKind: "direct",
matchedSlug: slug,
};
} catch (_error) {
// Swallow network/parse errors and continue to the next variant.
}
}
}
// All direct slug variants were disambiguation pages or not found. Use the
// full-text search endpoint to find the top-ranked article for the term
// (e.g. "tesla" → "Tesla, Inc." instead of the disambiguation page).
const found = await searchWikipediaSlug(term, "", language);
if (found) {
const summaryBase = WIKIPEDIA_HOSTS[found.language] || WIKIPEDIA_HOSTS.en;
const url = `${summaryBase}/${encodeURIComponent(found.slug)}`;
try {
const response = await fetch(url, { headers: apiHeaders });
if (response && response.ok) {
const data = await response.json();
if (
data &&
typeof data === "object" &&
data.type !== "disambiguation"
) {
const extract = String(data.extract || "").trim();
if (extract) {
const title = String(data.title || term);
const pageUrl =
(data.content_urls &&
data.content_urls.desktop &&
data.content_urls.desktop.page) ||
url;
return {
title,
extract,
url: pageUrl,
language: found.language,
matchKind: "search",
matchedSlug: found.slug,
matchedTitle: found.title || title,
searchQuery: found.query || "",
};
}
}
}
} catch (_error) {
// Search-based fallback failed; return null below.
}
}
return null;
}
function isClosestWikipediaMatch(summary) {
return summary && summary.matchKind === "search";
}
function closestMatchNote(summary, language) {
const title = summary && summary.title ? summary.title : "the top result";
if (language === "ru") {
return `Ближайшее совпадение по поиску Wikipedia: «${title}». Если это не то, уточните запрос.`;
}
if (language === "zh") {
return `Wikipedia 搜索的最接近匹配是“${title}”。如果这不是你的意思,请进一步说明。`;
}
if (language === "hi") {
return `Wikipedia खोज में सबसे नज़दीकी मिलान "${title}" है। अगर आपका मतलब यह नहीं था, तो कृपया स्पष्ट करें।`;
}
return `Closest match from Wikipedia search: "${title}". If that is not what you meant, clarify the prompt.`;
}
function wikipediaClarificationMessage(summary, language) {
const title = summary && summary.title ? summary.title : "the top result";
if (language === "ru") {
return `Похоже, вы имели в виду «${title}». Уточните, отвечать по этой статье Wikipedia?`;
}
if (language === "zh") {
return `你是指“${title}”吗?请确认后我再根据这篇 Wikipedia 文章回答。`;
}
if (language === "hi") {
return `क्या आपका मतलब "${title}" था? Wikipedia के इस लेख से उत्तर देने से पहले कृपया स्पष्ट करें।`;
}
return `Did you mean "${title}"? Please clarify before I answer from that Wikipedia article.`;
}
function wikipediaDisambiguationMessage(summary, language) {
const humanUrl = humanizeUrl(summary.url);
const entries = Array.isArray(summary.disambiguationEntries)
? summary.disambiguationEntries
: String(summary.extract || "")
.split(/\n+/u)
.map((line) => line.trim())
.filter(Boolean);
const list = entries.map((entry) => `- ${entry}`).join("\n");
if (language === "ru") {
return `На странице Wikipedia «${summary.title}» перечислены значения:\n\n${list}\n\nИсточник: [${humanUrl}](${summary.url}) (wikipedia).`;
}
if (language === "zh") {
return `Wikipedia “${summary.title}”页面列出以下含义:\n\n${list}\n\n来源:[${humanUrl}](${summary.url}) (wikipedia).`;
}
if (language === "hi") {
return `Wikipedia पृष्ठ "${summary.title}" ये अर्थ सूचीबद्ध करता है:\n\n${list}\n\nस्रोत: [${humanUrl}](${summary.url}) (wikipedia).`;
}
return `Wikipedia's "${summary.title}" page lists these meanings:\n\n${list}\n\nSource: [${humanUrl}](${summary.url}) (wikipedia).`;
}
function wikipediaArticleQuestionMessage(summary, query, language, exactMatch) {
const humanUrl = humanizeUrl(summary.url);
const source = `Source: [${humanUrl}](${summary.url}) (wikipedia).`;
if (language === "ru") {
const wikipediaName =
summary.language === "ru" ? "русскоязычной Википедии" : "Wikipedia";
if (exactMatch) {
return `В Wikipedia есть статья «${summary.title}»: ${summary.extract}\n\nИсточник: [${humanUrl}](${summary.url}) (wikipedia).`;
}
return [
`В ${wikipediaName} я не нашёл отдельной статьи с названием «${query.exactTerm}», но ближайшая подходящая страница — «${summary.title}»: ${summary.extract}`,
`Источник: [${humanUrl}](${summary.url}) (wikipedia).`,
].join("\n\n");
}
if (language === "zh") {
const zhSource = `来源:[${humanUrl}](${summary.url}) (wikipedia).`;
if (exactMatch) {
return `Wikipedia 有一篇“${summary.title}”条目:${summary.extract}\n\n${zhSource}`;
}
return `我没有找到标题为“${query.exactTerm}”的 Wikipedia 条目,但最接近的有用页面是“${summary.title}”:${summary.extract}\n\n${zhSource}`;
}
if (language === "hi") {
const hiSource = `स्रोत: [${humanUrl}](${summary.url}) (wikipedia).`;
if (exactMatch) {
return `Wikipedia पर "${summary.title}" लेख है: ${summary.extract}\n\n${hiSource}`;
}
return `मुझे Wikipedia पर "${query.exactTerm}" शीर्षक वाला अलग लेख नहीं मिला, लेकिन सबसे नज़दीकी उपयोगी पृष्ठ "${summary.title}" है: ${summary.extract}\n\n${hiSource}`;
}
if (exactMatch) {
return `Wikipedia has an article titled "${summary.title}": ${summary.extract}\n\n${source}`;
}
return `I did not find an exact Wikipedia article titled "${query.exactTerm}", but the closest useful page is "${summary.title}": ${summary.extract}\n\n${source}`;
}
// ---------------------------------------------------------------------------
// Wikidata-backed fact reasoning pipeline (issue #127).
//
// Rather than matching against hardcoded summaries in `data/seed/facts.lino`,
// fact questions ("what is the capital of X?", "столица X", "X की राजधानी",
// "X的首都") are parsed into a structured query
// `{ relation, subjectTerm, language, forceFresh }`. The query is then
// resolved against:
//
// 1. An in-memory cache (1-week TTL) keyed by `relation:subject:language`.
// The cache is pre-warmed from the seed `FACTS` entries so the test
// matrix stays deterministic offline.
// 2. Wikidata `wbsearchentities` to resolve the subject term to a Q-ID.
// 3. Wikidata `wbgetentities` to fetch the property claim (P36 = capital,
// P1082 = population, P38 = currency, P37 = official language, P30 =
// continent, P2046 = area, P35 = head of state, P6 = head of government).
// 4. Wikidata `wbgetentities` again to resolve the target Q-ID to a label
// in the user's prevailing language (and to a Wikipedia sitelink).
//
// Every step is recorded as a `fact_query:*` event so the reasoning trace
// shows the structured query, the cache decision, the Wikidata round-trips,
// and the final resolved answer. A user can force a fresh resolution by
// adding markers like "fresh", "no cache", "не из кэша", "без кеша",
// "ताज़ा", or "刷新" to the prompt.
// ---------------------------------------------------------------------------
const WIKIDATA_API = "https://www.wikidata.org/w/api.php";
const FACT_RELATIONS = [
{
relation: "capital",
property: "P36",
valueType: "entity",
},
{
relation: "population",
property: "P1082",
valueType: "quantity",
},
{
relation: "currency",
property: "P38",
valueType: "entity",
},
{
relation: "official_language",
property: "P37",
valueType: "entity",
},
{
relation: "continent",
property: "P30",
valueType: "entity",
},
{
relation: "area",
property: "P2046",
valueType: "quantity",
},
{
relation: "head_of_state",
property: "P35",
valueType: "entity",
},
{
relation: "head_of_government",
property: "P6",
valueType: "entity",
},
];
function relationConfig(relation) {
return FACT_RELATIONS.find((entry) => entry.relation === relation) || null;
}
// Markers that flag the user wants a fresh (uncached) result. Detected in all
// four supported languages plus a couple of common English phrasings.
const FORCE_FRESH_MARKERS = [
"fresh",
"no cache",
"no-cache",
"without cache",
"skip cache",
"ignore cache",
"refresh",
"не из кэша",
"не из кеша",
"без кэша",
"без кеша",
"обнови",
"свежий ответ",
"свежие данные",
"ताज़ा",
"ताज़े",
"बिना कैश",
"नया जवाब",
"刷新",
"新鲜",
"不要缓存",
"不用缓存",
];
function shouldForceFresh(normalized, prompt) {
const lowerPrompt = String(prompt || "").toLowerCase();
return FORCE_FRESH_MARKERS.some(
(marker) => normalized.includes(marker) || lowerPrompt.includes(marker),
);
}
// Multilingual relation patterns. Each entry has a list of triggers that, when
// present in the normalized prompt, identify the relation. Subject extraction
// uses the `extract` regexes which capture the subject term verbatim from the
// original (un-normalized) prompt — that preserves Cyrillic/Devanagari/CJK
// scripts that the normalizer otherwise strips.
const FACT_QUESTION_PATTERNS = [
{
relation: "capital",
// English
extract: [
/\bcapital\s+(?:city\s+)?of\s+(?:the\s+)?([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/\b([^?.!,;:]+?)['’]s\s+capital\b/i,
/\bwhich\s+city\s+is\s+(?:the\s+)?capital\s+of\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/\bwhich\s+city\s+is\s+([^?.!,;:]+?)['’]s\s+capital\b/i,
// Russian: "столица России", "какова столица России",
// "столицей какой страны является Москва" — only the first form is
// resolved; the inverted form falls through to other handlers.
/столица\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/какова\s+столица\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/какая\s+столица\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
// Hindi: "X की राजधानी क्या है"
/([^?.!,;:]+?)\s+की\s+राजधानी(?:\s+क्या\s+है)?(?:[?.!,;:]|$)/i,
// Chinese: "X的首都" / "X的首都是什么"
/([^?。.!!,,;:、]+?)的首都(?:是什么|是哪里|是哪个城市)?(?:[?。.!!,,;:、]|$)/i,
],
},
{
relation: "population",
extract: [
/\bpopulation\s+of\s+(?:the\s+)?([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/\bhow\s+many\s+people\s+(?:live|are\s+there)\s+in\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/\b([^?.!,;:]+?)['’]s\s+population\b/i,
/население\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/какое\s+население\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/([^?.!,;:]+?)\s+की\s+(?:जनसंख्या|आबादी)(?:[?.!,;:]|$)/i,
/([^?。.!!,,;:、]+?)的人口(?:是多少|有多少)?(?:[?。.!!,,;:、]|$)/i,
],
},
{
relation: "currency",
extract: [
/\bcurrency\s+of\s+(?:the\s+)?([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/\b([^?.!,;:]+?)['’]s\s+currency\b/i,
/валюта\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/какая\s+валюта\s+в\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/([^?.!,;:]+?)\s+की\s+मुद्रा(?:[?.!,;:]|$)/i,
/([^?。.!!,,;:、]+?)的(?:货币|貨幣)(?:是什么|是哪种)?(?:[?。.!!,,;:、]|$)/i,
],
},
{
relation: "official_language",
extract: [
/\bofficial\s+language\s+of\s+(?:the\s+)?([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/\bwhat\s+language\s+(?:do\s+they\s+speak|is\s+spoken)\s+in\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/государственный\s+язык\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/официальный\s+язык\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/([^?.!,;:]+?)\s+की\s+(?:राजभाषा|आधिकारिक\s+भाषा)(?:[?.!,;:]|$)/i,
/([^?。.!!,,;:、]+?)的(?:官方语言|官方語言)(?:[?。.!!,,;:、]|$)/i,
],
},
{
relation: "continent",
extract: [
/\bcontinent\s+(?:is\s+)?([^?.!,;:]+?)\s+(?:on|in)\b/i,
/\bwhich\s+continent\s+is\s+([^?.!,;:]+?)\s+(?:on|in)\b/i,
/на\s+каком\s+континенте\s+(?:находится|расположена|расположен)\s+([^?.!,;:]+?)(?:[?.!,;:]|$)/i,
/([^?.!,;:]+?)\s+किस\s+महाद्वीप\s+में\s+है(?:[?.!,;:]|$)/i,
/([^?。.!!,,;:、]+?)在哪个(?:大洲|洲)(?:[?。.!!,,;:、]|$)/i,
],
},
];
// Words/phrases that should be stripped from a captured subject before we
// hand it off to Wikidata. These are not part of the entity name — they leak
// from question prefixes the regex didn't consume (e.g. "the country called
// France" → "France"). Order matters: longer prefixes first.
const SUBJECT_TRIM_PREFIXES = [
"the country called ",
"the country ",
"country ",
"the city of ",
"the city ",
"city of ",
"country called ",
"republic of ",
"kingdom of ",
"is ",
"in ",
"of the ",
"of ",
"страна ",
"страны ",
"стране ",
"страну ",
];
function trimSubjectTerm(raw) {
let value = String(raw || "")
.replace(/[«»"'`“”„‟‹›]+/g, "")
.replace(/\s+/g, " ")
.trim();
let changed = true;
while (changed) {
changed = false;
const lower = value.toLowerCase();
for (const prefix of SUBJECT_TRIM_PREFIXES) {
if (lower.startsWith(prefix)) {
value = value.slice(prefix.length).trim();
changed = true;
break;
}
}
}
return value;
}
function parseFactQuestion(prompt, normalized) {
const text = String(prompt || "");
if (!text.trim()) return null;
for (const pattern of FACT_QUESTION_PATTERNS) {
for (const regex of pattern.extract) {
const match = regex.exec(text);
if (!match) continue;
const subjectTerm = trimSubjectTerm(match[1]);
if (!subjectTerm) continue;
// Reject single-letter or pure-punctuation captures so we don't fire
// on noise like "x." or "?".
if (subjectTerm.length < 2 && !/[Ѐ-鿿]/.test(subjectTerm)) {
continue;
}
return {
relation: pattern.relation,
subjectTerm,
language: detectLanguage(prompt),
forceFresh: shouldForceFresh(normalized, prompt),
};
}
}
return null;
}
// In-memory cache. Keyed by `relation:subject_normalized:language`. The TTL
// matches the user-requested 1 week. Pre-warmed from FACTS at init() so the
// offline test matrix sees the same starting cache the Rust solver does.
const FACT_QUERY_CACHE = new Map();
const FACT_QUERY_TTL_MS = 7 * 24 * 60 * 60 * 1000;
function factCacheKey(relation, subjectTerm, language) {
return [
String(relation || "").toLowerCase(),
String(subjectTerm || "")
.toLowerCase()
.replace(/\s+/g, " ")
.trim(),
String(language || "en").toLowerCase(),
].join(":");
}
function factCacheGet(relation, subjectTerm, language) {
const key = factCacheKey(relation, subjectTerm, language);
const entry = FACT_QUERY_CACHE.get(key);
if (!entry) return null;
if (
entry.expiresAt &&
typeof entry.expiresAt === "number" &&
entry.expiresAt < Date.now()
) {
FACT_QUERY_CACHE.delete(key);
return null;
}
return entry;
}
function factCachePut(relation, subjectTerm, language, value) {
const key = factCacheKey(relation, subjectTerm, language);
const ttl = typeof value.ttlMs === "number" ? value.ttlMs : FACT_QUERY_TTL_MS;
const entry = Object.assign({}, value, {
expiresAt: Date.now() + ttl,
});
FACT_QUERY_CACHE.set(key, entry);
return entry;
}
// Pre-warm the runtime cache from the seed `facts.lino`. Each seed record can
// optionally declare `relation`, `subjectQid`, `valueQid`, plus per-language
// `subjectLabel`/`valueLabel`/`valueText` overrides — those are the structured
// cache anchors. The legacy fields (`summary`, `subjectAliases`,
// `questionKeywords`) remain in place for the `tryFactLookup` substring path.
function warmFactCacheFromSeed() {
if (!Array.isArray(FACTS)) return;
const languages = ["en", "ru", "hi", "zh"];
for (const record of FACTS) {
if (!record || !record.relation || !record.subjectAliases) continue;
const localizedMap = new Map();
if (Array.isArray(record.localized)) {
for (const loc of record.localized) {
if (loc && loc.language) localizedMap.set(loc.language, loc);
}
}
for (const lang of languages) {
const loc = localizedMap.get(lang) || localizedMap.get("en") || {};
const summary =
(loc && loc.summary) || record.summary || "";
const source = (loc && loc.source) || record.source || "";
const sourceKind =
(loc && loc.sourceKind) || record.sourceKind || "wikipedia";
const valueLabel = (loc && loc.valueLabel) || record.valueLabel || "";
const subjectLabel =
(loc && loc.subjectLabel) || record.subjectLabel || "";
// The aliases for the subject language drive cache key lookup. For each
// alias (already lowercased by seed_loader.js), pre-seed a cache entry.
const aliases = Array.isArray(record.subjectAliases)
? record.subjectAliases
: [];
for (const alias of aliases) {
if (!alias) continue;
factCachePut(record.relation, alias, lang, {
relation: record.relation,
subjectTerm: alias,
subjectLabel: subjectLabel || alias,
subjectQid: record.subjectQid || "",
valueLabel,
valueQid: record.valueQid || "",
summary,
source,
sourceKind,
language: lang,
fromSeed: true,
ttlMs: FACT_QUERY_TTL_MS,
});
}
}
}
}
async function wikidataSearchEntity(term, language) {
if (typeof fetch !== "function") return null;
// Wikidata supports per-language search; English fallback ensures broad
// recall even for non-Latin scripts.
const ordered = [language, "en"].filter(
(value, index, array) => value && array.indexOf(value) === index,
);
for (const lang of ordered) {
const url = `${WIKIDATA_API}?action=wbsearchentities&format=json&origin=*&type=item&limit=5&language=${encodeURIComponent(
lang,
)}&search=${encodeURIComponent(term)}`;
try {
const response = await fetch(url, {
headers: {
accept: "application/json",
"api-user-agent":
"formal-ai-demo (https://github.com/link-assistant/formal-ai)",
},
});
if (!response || !response.ok) continue;
const data = await response.json();
if (data && Array.isArray(data.search) && data.search.length > 0) {
const hit = data.search[0];
return {
qid: hit.id,
label: hit.label || term,
description: hit.description || "",
language: lang,
};
}
} catch (_error) {
// Try the next language.
}
}
return null;
}
function wikidataConceptUrl(hit) {
const id = hit && hit.id ? String(hit.id) : "";
if (id) return `https://www.wikidata.org/wiki/${encodeURIComponent(id)}`;
const conceptUri = hit && hit.concepturi ? String(hit.concepturi) : "";
const qid = conceptUri.match(/Q\d+/);
if (qid) return `https://www.wikidata.org/wiki/${qid[0]}`;
return "https://www.wikidata.org/wiki/Wikidata:Main_Page";
}
function wikidataHitMatchesTerm(hit, term) {
const target = normalizeLookupText(term);
if (!target || !hit) return false;
const candidates = [
hit.label,
hit.title,
hit.match && hit.match.text,
hit.display && hit.display.label && hit.display.label.value,
];
if (Array.isArray(hit.aliases)) {
candidates.push(...hit.aliases);
}
return candidates.some((candidate) => normalizeLookupText(candidate) === target);
}
async function fetchWikidataConceptSummary(term, language) {
if (typeof fetch !== "function") return null;
const ordered = [language, "en"].filter(
(value, index, array) => value && array.indexOf(value) === index,
);
for (const lang of ordered) {
const url = `${WIKIDATA_API}?action=wbsearchentities&format=json&origin=*&type=item&limit=5&language=${encodeURIComponent(
lang,
)}&search=${encodeURIComponent(term)}`;
try {
const response = await fetch(url, {
headers: {
accept: "application/json",
"api-user-agent":
"formal-ai-demo (https://github.com/link-assistant/formal-ai)",
},
});
if (!response || !response.ok) continue;
const data = await response.json();
const hits = data && Array.isArray(data.search) ? data.search : [];
const hit = hits.find((candidate) =>
wikidataHitMatchesTerm(candidate, term),
);
if (!hit) continue;
const display = hit.display || {};
return {
sourceKind: "wikidata",
qid: hit.id || "",
title:
(display.label && display.label.value) ||
hit.label ||
(hit.match && hit.match.text) ||
term,
description:
(display.description && display.description.value) ||
hit.description ||
"",
url: wikidataConceptUrl(hit),
language: lang,
};
} catch (_error) {
// Try the next Wikidata language.
}
}
return null;
}
function wiktionaryFallbackDescription(title, language) {
if (language === "ru") {
return `В Wiktionary есть словарная статья «${title}».`;
}
if (language === "zh") {
return `Wiktionary 有“${title}”这个词条。`;
}
if (language === "hi") {
return `Wiktionary में "${title}" के लिए शब्दकोश प्रविष्टि है।`;
}
return `Wiktionary has a dictionary entry for "${title}".`;
}
async function fetchWiktionaryEntry(term, language) {
if (typeof fetch !== "function") return null;
const ordered = [language, "en"].filter(
(value, index, array) => value && array.indexOf(value) === index,
);
const target = normalizeLookupText(term);
for (const lang of ordered) {
const base = WIKTIONARY_SEARCH_HOSTS[lang] || WIKTIONARY_SEARCH_HOSTS.en;
const url = `${base}?action=opensearch&search=${encodeURIComponent(
term,
)}&limit=5&format=json&origin=*`;
try {
const response = await fetch(url, {
headers: {
accept: "application/json",
"api-user-agent":
"formal-ai-demo (https://github.com/link-assistant/formal-ai)",
},
});
if (!response || !response.ok) continue;
const data = await response.json();
if (!Array.isArray(data) || !Array.isArray(data[1])) continue;
const titles = data[1];
const descriptions = Array.isArray(data[2]) ? data[2] : [];
const urls = Array.isArray(data[3]) ? data[3] : [];
const index = titles.findIndex(
(title) => normalizeLookupText(title) === target,
);
if (index < 0) continue;
const title = titles[index] || term;
return {
sourceKind: "wiktionary",
title,
description:
descriptions[index] || wiktionaryFallbackDescription(title, lang),
url:
urls[index] ||
`https://${lang}.wiktionary.org/wiki/${encodeURIComponent(title)}`,
language: lang,
};
} catch (_error) {
// Try the next Wiktionary language.
}
}
return null;
}
function renderExternalLookupContent(result, requestedTerm) {
const humanUrl = humanizeUrl(result.url);
const title = result.title || requestedTerm;
const heading =
requestedTerm && normalizeLookupText(requestedTerm) !== normalizeLookupText(title)
? `${requestedTerm}: ${title}`
: title;
const description = String(result.description || "").trim();
const body = description ? `${heading}: ${description}` : `${heading}.`;
return `${body}\n\nSource: [${humanUrl}](${result.url}) (${result.sourceKind}).`;
}
function externalLookupResponse(result, requestedTerm, rejectedSummary) {
const humanUrl = humanizeUrl(result.url);
const evidence = [
`${result.sourceKind}_lookup:${result.qid || result.title}`,
`source:${humanUrl}`,
`language:${result.language}`,
];
if (result.qid) evidence.push(`wikidata:${result.qid}`);
if (rejectedSummary && rejectedSummary.title) {
evidence.push(`wikipedia_lookup:rejected:${rejectedSummary.title}`);
}
return {
intent: `${result.sourceKind}_lookup`,
content: renderExternalLookupContent(result, requestedTerm),
confidence: result.sourceKind === "wikidata" ? 0.82 : 0.75,
evidence,
};
}
async function tryTermKnowledgeFallback(term, language, rejectedSummary) {
const wikidata = await fetchWikidataConceptSummary(term, language);
if (wikidata) {
return externalLookupResponse(wikidata, term, rejectedSummary);
}
const wiktionary = await fetchWiktionaryEntry(term, language);
if (wiktionary) {
return externalLookupResponse(wiktionary, term, rejectedSummary);
}
return null;
}
async function wikidataFetchEntityClaim(qid, property, language) {
if (typeof fetch !== "function") return null;
const url = `${WIKIDATA_API}?action=wbgetentities&format=json&origin=*&ids=${encodeURIComponent(
qid,
)}&props=claims%7Clabels%7Csitelinks&languages=${encodeURIComponent(
language,
)}%7Cen`;
try {
const response = await fetch(url, {
headers: {
accept: "application/json",
"api-user-agent":
"formal-ai-demo (https://github.com/link-assistant/formal-ai)",
},
});
if (!response || !response.ok) return null;
const data = await response.json();
if (!data || !data.entities) return null;
const entity = data.entities[qid];
if (!entity) return null;
const claims = (entity.claims || {})[property] || [];
const subjectLabel =
(entity.labels && (entity.labels[language] || entity.labels.en) || {})
.value || "";
const sitelinks = entity.sitelinks || {};
return { claims, subjectLabel, sitelinks };
} catch (_error) {
return null;
}
}
async function wikidataResolveLabel(qid, language) {
if (typeof fetch !== "function") return null;
const url = `${WIKIDATA_API}?action=wbgetentities&format=json&origin=*&ids=${encodeURIComponent(
qid,
)}&props=labels%7Csitelinks&languages=${encodeURIComponent(language)}%7Cen`;
try {
const response = await fetch(url, {
headers: {
accept: "application/json",
"api-user-agent":
"formal-ai-demo (https://github.com/link-assistant/formal-ai)",
},
});
if (!response || !response.ok) return null;
const data = await response.json();
if (!data || !data.entities) return null;
const entity = data.entities[qid];
if (!entity) return null;
const label =
(entity.labels && (entity.labels[language] || entity.labels.en) || {})
.value || "";
const sitelinks = entity.sitelinks || {};
return { label, sitelinks };
} catch (_error) {
return null;
}
}
function wikipediaSitelinkUrl(sitelinks, language) {
if (!sitelinks || typeof sitelinks !== "object") return "";
const key = `${language}wiki`;
const fallback = "enwiki";
const entry = sitelinks[key] || sitelinks[fallback];
if (!entry) return "";
if (entry.url) return entry.url;
if (entry.title) {
const lang = sitelinks[key] ? language : "en";
return `https://${lang}.wikipedia.org/wiki/${encodeURIComponent(
String(entry.title).replace(/\s+/g, "_"),
).replace(/%2F/gi, "/")}`;
}
return "";
}
// Localized templates for rendering the final answer. The seed value is
// inserted via `{value}`; the subject is inserted via `{subject}`.
const FACT_RESPONSE_TEMPLATES = {
capital: {
en: "The capital of {subject} is {value}.",
ru: "Столица {subject} — {value}.",
hi: "{subject} की राजधानी {value} है।",
zh: "{subject}的首都是{value}。",
},
population: {
en: "The population of {subject} is approximately {value}.",
ru: "Население {subject} составляет примерно {value}.",
hi: "{subject} की जनसंख्या लगभग {value} है।",
zh: "{subject}的人口约为 {value}。",
},
currency: {
en: "The currency of {subject} is the {value}.",
ru: "Валюта {subject} — {value}.",
hi: "{subject} की मुद्रा {value} है।",
zh: "{subject}的货币是{value}。",
},
official_language: {
en: "The official language of {subject} is {value}.",
ru: "Государственный язык {subject} — {value}.",
hi: "{subject} की राजभाषा {value} है।",
zh: "{subject}的官方语言是{value}。",
},
continent: {
en: "{subject} is located on the continent of {value}.",
ru: "{subject} расположена на континенте {value}.",
hi: "{subject} {value} महाद्वीप पर स्थित है।",
zh: "{subject}位于{value}。",
},
area: {
en: "The area of {subject} is approximately {value}.",
ru: "Площадь {subject} составляет примерно {value}.",
hi: "{subject} का क्षेत्रफल लगभग {value} है।",
zh: "{subject}的面积约为 {value}。",
},
head_of_state: {
en: "The head of state of {subject} is {value}.",
ru: "Глава государства {subject} — {value}.",
hi: "{subject} के राष्ट्राध्यक्ष {value} हैं।",
zh: "{subject}的国家元首是{value}。",
},
head_of_government: {
en: "The head of government of {subject} is {value}.",
ru: "Глава правительства {subject} — {value}.",
hi: "{subject} के सरकार के प्रमुख {value} हैं।",
zh: "{subject}的政府首脑是{value}。",
},
};
function renderFactSummary(relation, subjectLabel, valueLabel, language) {
const templates =
FACT_RESPONSE_TEMPLATES[relation] || FACT_RESPONSE_TEMPLATES.capital;
const template = templates[language] || templates.en;
return template
.replace("{subject}", subjectLabel || "")
.replace("{value}", valueLabel || "");
}
function factQueryEvidence(record, language) {
const evidence = [
`fact_query:relation:${record.relation}`,
`fact_query:subject:${record.subjectLabel || record.subjectTerm}`,
`language:${language}`,
];
if (record.subjectQid) evidence.push(`wikidata:${record.subjectQid}`);
if (record.valueQid) evidence.push(`wikidata:${record.valueQid}`);
if (record.source) evidence.push(`source:${humanizeUrl(record.source)}`);
if (record.fromSeed) evidence.push("fact_query:cache:seed");
else if (record.fromCache) evidence.push("fact_query:cache:hit");
else evidence.push("fact_query:cache:miss");
return evidence;
}
async function resolveFactQueryViaWikidata(query, log) {
// Stage 1: subject resolution via wbsearchentities.
if (log) log.push(`fact_query:wbsearchentities:request:${query.subjectTerm}`);
const subject = await wikidataSearchEntity(query.subjectTerm, query.language);
if (!subject) {
if (log) log.push("fact_query:wbsearchentities:miss");
return null;
}
if (log) log.push(`fact_query:wbsearchentities:resolved:${subject.qid}`);
const config = relationConfig(query.relation);
if (!config) return null;
// Stage 2: claim fetch via wbgetentities.
if (log) log.push(`fact_query:wbgetentities:request:${config.property}`);
const claimData = await wikidataFetchEntityClaim(
subject.qid,
config.property,
query.language,
);
if (!claimData || !claimData.claims || claimData.claims.length === 0) {
if (log) log.push("fact_query:wbgetentities:no_claim");
return null;
}
const claim = claimData.claims[0];
const mainsnak = claim && claim.mainsnak;
if (!mainsnak || !mainsnak.datavalue) {
if (log) log.push("fact_query:wbgetentities:no_datavalue");
return null;
}
// Stage 3: value resolution.
let valueLabel = "";
let valueQid = "";
if (config.valueType === "entity") {
const value = mainsnak.datavalue.value || {};
valueQid = value.id || "";
if (!valueQid) {
if (log) log.push("fact_query:wbgetentities:value_not_entity");
return null;
}
if (log) log.push(`fact_query:label_resolve:request:${valueQid}`);
const labelResult = await wikidataResolveLabel(valueQid, query.language);
if (!labelResult || !labelResult.label) {
if (log) log.push("fact_query:label_resolve:miss");
return null;
}
valueLabel = labelResult.label;
if (log) log.push(`fact_query:label_resolve:${valueLabel}`);
// Capture the Wikipedia sitelink for the value entity as the canonical
// evidence source — that's the human-readable artifact users can verify.
const url =
wikipediaSitelinkUrl(labelResult.sitelinks, query.language) ||
wikipediaSitelinkUrl(claimData.sitelinks, query.language);
return {
relation: query.relation,
subjectTerm: query.subjectTerm,
subjectLabel: claimData.subjectLabel || subject.label,
subjectQid: subject.qid,
valueLabel,
valueQid,
summary: renderFactSummary(
query.relation,
claimData.subjectLabel || subject.label,
valueLabel,
query.language,
),
source: url,
sourceKind: "wikidata",
language: query.language,
fromCache: false,
fromSeed: false,
};
}
// Quantity values (population, area) are not Q-IDs.
const value = mainsnak.datavalue.value || {};
const rawAmount = String(value.amount || "").replace(/^\+/, "");
if (!rawAmount) {
if (log) log.push("fact_query:wbgetentities:value_empty");
return null;
}
valueLabel = rawAmount;
if (log) log.push(`fact_query:quantity:${valueLabel}`);
const url = wikipediaSitelinkUrl(claimData.sitelinks, query.language);
return {
relation: query.relation,
subjectTerm: query.subjectTerm,
subjectLabel: claimData.subjectLabel || subject.label,
subjectQid: subject.qid,
valueLabel,
valueQid: "",
summary: renderFactSummary(
query.relation,
claimData.subjectLabel || subject.label,
valueLabel,
query.language,
),
source: url,
sourceKind: "wikidata",
language: query.language,
fromCache: false,
fromSeed: false,
};
}
async function tryFactQuery(prompt, normalized, preferences) {
const query = parseFactQuestion(prompt, normalized);
if (!query) return null;
// Trace events: every step of the reasoning pipeline is recorded so the
// browser memory log shows the structured query, the cache decision, and
// any Wikidata calls.
const trace = [];
trace.push(`fact_query:request:${prompt}`);
trace.push(`fact_query:relation:${query.relation}`);
trace.push(`fact_query:subject:${query.subjectTerm}`);
trace.push(`fact_query:language:${query.language}`);
if (query.forceFresh) trace.push("fact_query:force_fresh");
// Stage 1: cache check (skipped when the user asked for fresh data).
if (!query.forceFresh) {
trace.push("fact_query:cache:check");
const cached = factCacheGet(
query.relation,
query.subjectTerm,
query.language,
);
if (cached) {
trace.push(`fact_query:cache:hit:${cached.fromSeed ? "seed" : "runtime"}`);
const evidence = factQueryEvidence(
Object.assign({}, cached, { fromCache: true }),
query.language,
);
return {
intent: "fact_query",
content: cached.summary,
confidence: 0.92,
evidence,
trace,
formalizedObject: cached.subjectQid || "",
};
}
trace.push("fact_query:cache:miss");
} else {
trace.push("fact_query:cache:bypass");
}
// Stage 2: Wikidata resolution.
const resolved = await resolveFactQueryViaWikidata(query, trace);
if (!resolved) {
trace.push("fact_query:wikidata:no_match");
return null;
}
// Stage 3: cache the resolution.
factCachePut(query.relation, query.subjectTerm, query.language, resolved);
trace.push(`fact_query:cache:store:${factCacheKey(
query.relation,
query.subjectTerm,
query.language,
)}`);
trace.push(`fact_query:response:${resolved.summary}`);
return {
intent: "fact_query",
content: resolved.summary,
confidence: 0.92,
evidence: factQueryEvidence(resolved, query.language),
trace,
formalizedObject: resolved.subjectQid || "",
};
}
async function tryWikipediaLookup(prompt, language, preferences) {
const query = extractConceptQuery(prompt);
if (!query) return null;
// Avoid hitting the network for terms that already resolved in CONCEPTS;
// that path is handled by `tryConceptLookup`. We try the full
// `(term, context)` query first so that "what is iir in ml" doesn't waste
// a network call when a context-aware record exists.
if (lookupConceptQuery(query)) return null;
// Pass the original-case term to Wikipedia: non-Latin scripts (e.g. Cyrillic
// for "Илон Маск") require correct capitalization in the REST URL because
// ru.wikipedia.org does not redirect the all-lowercase slug.
const wikiTerm = query.termOriginal || query.term;
const wikiContext = query.contextOriginal || query.context;
const summary = await fetchWikipediaSummary(wikiTerm, language, wikiContext, {
includeDefinitionDisambiguation: !wikiContext,
});
if (!summary) {
return tryTermKnowledgeFallback(wikiTerm, language, null);
}
const isClosestMatch = isClosestWikipediaMatch(summary);
const requiresPlausibleSearchMatch =
isClosestMatch || summary.matchKind === "context_search";
if (
requiresPlausibleSearchMatch &&
!isPlausibleWikipediaSearchMatch(summary, wikiTerm)
) {
const fallback = await tryTermKnowledgeFallback(wikiTerm, language, summary);
if (fallback) return fallback;
return null;
}
const guessProbability = numericPreference(
preferences && preferences.guessProbability,
0.8,
0,
1,
);
const humanUrl = humanizeUrl(summary.url);
const evidence = [
`wikipedia_lookup:${summary.title}`,
`source:${humanUrl}`,
`language:${summary.language}`,
];
if (wikiContext) evidence.push(`wikipedia_lookup:context:${wikiContext}`);
if (isClosestMatch) {
evidence.push(`wikipedia_lookup:closest_match:${summary.title}`);
}
if (summary.matchKind === "disambiguation") {
const entryCount = Array.isArray(summary.disambiguationEntries)
? summary.disambiguationEntries.length
: 0;
evidence.push(`wikipedia_lookup:disambiguation:${summary.title}`);
evidence.push(`wikipedia_lookup:disambiguation_entries:${entryCount}`);
return {
intent: "wikipedia_lookup",
content: wikipediaDisambiguationMessage(summary, language),
confidence: 0.84,
evidence,
};
}
if (isClosestMatch && guessProbability < 0.5) {
evidence.push("ambiguity:ask");
return {
intent: "clarification",
content: wikipediaClarificationMessage(summary, language),
confidence: 0.65,
evidence,
};
}
const bodyLines = [
`${summary.title}: ${summary.extract}\n\n` +
`Source: [${humanUrl}](${summary.url}) (wikipedia).`,
];
if (isClosestMatch) {
bodyLines.push(closestMatchNote(summary, language));
evidence.push("ambiguity:guess");
}
return {
intent: "wikipedia_lookup",
content: bodyLines.join("\n\n"),
confidence: 0.85,
evidence,
};
}
async function tryWikipediaArticleQuestion(prompt, language, preferences) {
const term = extractWikipediaArticleQuestionTerm(prompt);
if (!term) return null;
const query = refineWikipediaArticleQuestionLookup(term, language);
if (!query.exactTerm) return null;
const exactSummary = await fetchWikipediaSummary(query.exactTerm, language, null);
let summary = exactSummary;
const exactMatch = exactSummary && exactSummary.matchKind === "direct";
if (!exactMatch && (query.lookupTerm !== query.exactTerm || query.contextOriginal)) {
const refinedSummary = await fetchWikipediaSummary(
query.lookupTerm,
language,
query.contextOriginal,
);
if (refinedSummary) summary = refinedSummary;
}
if (!summary) {
return tryTermKnowledgeFallback(query.exactTerm, language, null);
}
if (!exactMatch && !isArticleQuestionWikipediaMatch(summary, query)) {
const fallback = await tryTermKnowledgeFallback(
query.exactTerm,
language,
summary,
);
if (fallback) return fallback;
return null;
}
const guessProbability = numericPreference(
preferences && preferences.guessProbability,
0.8,
0,
1,
);
const humanUrl = humanizeUrl(summary.url);
const evidence = [
`wikipedia_article_question:${query.exactTerm}`,
`source:${humanUrl}`,
`language:${summary.language}`,
];
if (query.lookupTerm !== query.exactTerm) {
evidence.push(`wikipedia_article_question:lookup:${query.lookupTerm}`);
}
if (query.contextOriginal) {
evidence.push(`wikipedia_article_question:context:${query.contextOriginal}`);
}
if (exactMatch) {
evidence.push("wikipedia_article_question:exact");
} else {
evidence.push(`wikipedia_article_question:closest_match:${summary.title}`);
}
if (!exactMatch && guessProbability < 0.5) {
evidence.push("ambiguity:ask");
return {
intent: "wikipedia_article_question",
content: wikipediaClarificationMessage(summary, language),
confidence: 0.65,
evidence,
};
}
if (!exactMatch) evidence.push("ambiguity:guess");
return {
intent: "wikipedia_article_question",
content: wikipediaArticleQuestionMessage(summary, query, language, exactMatch),
confidence: exactMatch ? 0.88 : 0.82,
evidence,
query: query.exactTerm,
formalizedObject: summary.title,
};
}
// Issue #386 software-authoring roles — mirror ROLE_SOFTWARE_AUTHORING_ACTION
// and ROLE_SOFTWARE_ARTIFACT_KIND in src/seed/meanings.rs. The surface words (in
// every supported language) live in data/seed/meanings.lino and
// data/seed/meanings-software-project.lino (embedded in MEANINGS_LINO below);
// this module names no word in any single language.
const ROLE_SOFTWARE_AUTHORING_ACTION = "software_authoring_action";
const ROLE_SOFTWARE_ARTIFACT_KIND = "software_artifact_kind";
const ROLE_SOFTWARE_REQUIREMENT_CATEGORY = "software_requirement_category";
// Issue #386 software-delivery / language / game-tracker / approval roles —
// mirror the matching ROLE_* consts in src/seed/meanings.rs. Their surface
// words (every supported language) live in
// data/seed/meanings-software-project.lino (embedded in MEANINGS_LINO below);
// this module names no word in any single language.
const ROLE_SOFTWARE_FEATURE = "software_feature";
const ROLE_SOFTWARE_DELIVERY_MODE = "software_delivery_mode";
const ROLE_SOFTWARE_IMPLEMENTATION_LANGUAGE = "software_implementation_language";
const ROLE_GAME_TRACKER_DOMAIN = "game_tracker_domain";
const ROLE_GAME_TRACKER_MECHANIC = "game_tracker_mechanic";
const ROLE_SOFTWARE_STEP_GRANULARITY = "software_step_granularity";
const ROLE_SOFTWARE_BASH_COMMAND = "software_bash_command";
const ROLE_SOFTWARE_APPROVAL_TRIGGER = "software_approval_trigger";
// Map a software-requirement-category meaning slug to its canonical category
// label. Mirrors requirement_category_label in
// src/solver_handlers/software_project.rs: recognition words live in the
// lexicon; the canonical category label lives here. A slug absent here is
// skipped rather than mislabelled.
const SOFTWARE_REQUIREMENT_CATEGORY_LABELS = {
requirement_state_tracking: "state_tracking",
requirement_data_exchange: "data_exchange",
requirement_automation: "automation",
requirement_validation: "validation",
requirement_integration: "integration",
requirement_user_interface: "user_interface",
requirement_project_behavior: "project_behavior",
};
// Map a software_delivery_mode meaning slug to its canonical delivery-mode
// label. Mirrors DeliveryMode::from_slug in
// src/solver_handlers/software_project.rs: the lexicon owns the surface words;
// this resolver owns the slug→label mapping. The default (code_generation) has
// no slug — it is the fallback when no mode meaning is evidenced.
const SOFTWARE_DELIVERY_MODE_LABELS = {
delivery_manual_instructions: "manual_instructions",
delivery_immediate_execution: "immediate_execution",
delivery_script_generation: "script_generation",
};
// Map a software_implementation_language meaning slug to its canonical target
// label. Mirrors implementation_language_from_slug in
// src/solver_handlers/software_project.rs. The default (typescript) has no slug.
const SOFTWARE_IMPLEMENTATION_LANGUAGE_LABELS = {
language_python: "python",
language_rust: "rust",
language_javascript: "javascript",
};
// Map a software-artifact-kind meaning slug to its canonical English label.
// Mirrors artifact_label in src/solver_handlers/software_project.rs: the lexicon
// owns the surface words a prompt is matched against (every language); this
// resolver owns only the stable slug→label mapping. A slug absent here is
// skipped rather than mislabelled.
const SOFTWARE_ARTIFACT_LABELS = {
artifact_browser_extension: "browser extension",
artifact_command_line_tool: "command-line tool",
artifact_github_action: "action",
artifact_mobile_app: "mobile app",
artifact_web_app: "web app",
artifact_application: "application",
artifact_extension: "extension",
artifact_dashboard: "dashboard",
artifact_scraper: "scraper",
artifact_library: "library",
artifact_website: "website",
artifact_plugin: "plugin",
artifact_service: "service",
artifact_bot: "bot",
artifact_app: "app",
artifact_api: "API",
artifact_sdk: "SDK",
artifact_tool: "tool",
artifact_mod: "mod",
};
// [surface, label] recognition table, sourced from the lexicon in declaration
// order. Mirrors artifact_surface_table in
// src/solver_handlers/software_project.rs.
function softwareArtifactTable() {
const table = [];
for (const meaning of meaningsWithRole(ROLE_SOFTWARE_ARTIFACT_KIND)) {
const label = SOFTWARE_ARTIFACT_LABELS[meaning.slug];
if (!label) continue;
for (const surface of meaning.words) table.push([surface, label]);
}
return table;
}
// [surface, action-slug] recognition table for software-authoring verbs. The
// matched slug is stored verbatim as the request's `action`, so the verb is
// recognised in every language it is lexicalised in. Mirrors
// action_surface_table in src/solver_handlers/software_project.rs.
function softwareActionTable() {
const table = [];
for (const meaning of meaningsWithRole(ROLE_SOFTWARE_AUTHORING_ACTION)) {
for (const surface of meaning.words) table.push([surface, meaning.slug]);
}
return table;
}
// Whether `character` is a "word character" for the recognition scan:
// alphanumeric but not CJK. Mirrors is_word_character in
// src/solver_handlers/software_project.rs — CJK scripts have no inter-word
// spaces so they match as substrings, while Latin/Cyrillic/Devanagari keep
// whole-token boundaries so a short surface like `апи` never matches inside
// `напиши`.
function isSoftwareWordCharacter(character) {
return /[\p{Alphabetic}\p{Number}]/u.test(character) && !containsCjk(character);
}
function isSoftwareStartBoundary(value, index) {
if (index === 0) return true;
return !isSoftwareWordCharacter(value[index - 1]);
}
function isSoftwareEndBoundary(value, index) {
if (index >= value.length) return true;
return !isSoftwareWordCharacter(value[index]);
}
// Position-major scan: the surface appearing earliest in `normalized` wins,
// ties at one position broken by table order (prefix collisions like app vs
// application are resolved by the end-boundary check, not order). Returns the
// matched { surface, payload } or null. Mirrors scan_match in
// src/solver_handlers/software_project.rs.
function scanSoftwareSurface(normalized, table) {
const text = String(normalized || "");
for (let index = 0; index < text.length; index += 1) {
if (!isSoftwareStartBoundary(text, index)) continue;
for (const [surface, payload] of table) {
if (surface && text.startsWith(surface, index)) {
if (isSoftwareEndBoundary(text, index + surface.length)) {
return { surface, payload };
}
}
}
}
return null;
}
// Lowercased union of every surface word (all languages) of the meanings that
// carry ROLE_SOFTWARE_REQUIREMENT_CATEGORY. A clause containing any of them
// states a feature requirement. Mirrors requirement_marker_words in
// src/solver_handlers/software_project.rs — no hardcoded marker list; the
// vocabulary lives in data/seed/meanings-software-project.lino.
function requirementMarkerWords() {
return wordsForRole(ROLE_SOFTWARE_REQUIREMENT_CATEGORY)
.filter((word) => word.length > 0)
.map((word) => word.toLowerCase());
}
const GAME_TRACKER_TYPESCRIPT = `type Cooldown = {
name: string;
remainingRounds: number;
};
type UnitState = {
id: string;
name: string;
hp: number;
maxHp: number;
protection: number;
resistance: number;
cooldowns: Cooldown[];
};
type DamageResult = {
damageTaken: number;
prevented: number;
unit: UnitState;
};
export function mitigateDamage(unit: UnitState, rawDamage: number): DamageResult {
const prevented = Math.max(0, unit.protection) + Math.max(0, unit.resistance);
const damageTaken = Math.max(0, rawDamage - prevented);
return {
damageTaken,
prevented,
unit: { ...unit, hp: Math.max(0, unit.hp - damageTaken) },
};
}
export function setStacks(
unit: UnitState,
protection: number,
resistance: number,
): UnitState {
return {
...unit,
protection: Math.max(0, protection),
resistance: Math.max(0, resistance),
};
}
export function tickCooldowns(unit: UnitState): UnitState {
return {
...unit,
cooldowns: unit.cooldowns
.map((cooldown) => ({
...cooldown,
remainingRounds: Math.max(0, cooldown.remainingRounds - 1),
}))
.filter((cooldown) => cooldown.remainingRounds > 0),
};
}`;
const GENERIC_PROJECT_TYPESCRIPT = `type ProjectRecord = {
id: string;
title: string;
status: "open" | "done";
notes: string[];
};
type ProjectCommand =
| { type: "add"; id: string; title: string }
| { type: "note"; id: string; note: string }
| { type: "complete"; id: string };
export function applyCommand(
records: ProjectRecord[],
command: ProjectCommand,
): ProjectRecord[] {
switch (command.type) {
case "add":
return [
...records,
{ id: command.id, title: command.title, status: "open", notes: [] },
];
case "note":
return records.map((record) =>
record.id === command.id
? { ...record, notes: [...record.notes, command.note] }
: record,
);
case "complete":
return records.map((record) =>
record.id === command.id ? { ...record, status: "done" } : record,
);
}
}`;
const GENERIC_PROJECT_JAVASCRIPT = `export function applyCommand(records, command) {
switch (command.type) {
case "add":
return [...records, { id: command.id, title: command.title, status: "open", notes: [] }];
case "note":
return records.map((record) =>
record.id === command.id
? { ...record, notes: [...record.notes, command.note] }
: record,
);
case "complete":
return records.map((record) =>
record.id === command.id ? { ...record, status: "done" } : record,
);
default:
throw new Error("Unknown command: " + command.type);
}
}`;
const GENERIC_PROJECT_PYTHON = `from dataclasses import dataclass, field
@dataclass(frozen=True)
class ProjectRecord:
id: str
title: str
status: str = "open"
notes: tuple[str, ...] = field(default_factory=tuple)
def apply_command(records: tuple[ProjectRecord, ...], command: dict) -> tuple[ProjectRecord, ...]:
if command["type"] == "add":
return (*records, ProjectRecord(id=command["id"], title=command["title"]))
if command["type"] == "note":
return tuple(
ProjectRecord(r.id, r.title, r.status, (*r.notes, command["note"]))
if r.id == command["id"] else r
for r in records
)
if command["type"] == "complete":
return tuple(
ProjectRecord(r.id, r.title, "done", r.notes)
if r.id == command["id"] else r
for r in records
)
raise ValueError(f"Unknown command: {command['type']}")
`;
const GENERIC_PROJECT_RUST = `#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ProjectRecord {
pub id: String,
pub title: String,
pub status: ProjectStatus,
pub notes: Vec<String>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ProjectStatus {
Open,
Done,
}
pub enum ProjectCommand {
Add { id: String, title: String },
Note { id: String, note: String },
Complete { id: String },
}
pub fn apply_command(mut records: Vec<ProjectRecord>, command: ProjectCommand) -> Vec<ProjectRecord> {
match command {
ProjectCommand::Add { id, title } => records.push(ProjectRecord {
id,
title,
status: ProjectStatus::Open,
notes: Vec::new(),
}),
ProjectCommand::Note { id, note } => {
for record in &mut records {
if record.id == id {
record.notes.push(note.clone());
}
}
}
ProjectCommand::Complete { id } => {
for record in &mut records {
if record.id == id {
record.status = ProjectStatus::Done;
}
}
}
}
records
}`;
const PLAYWRIGHT_DOCS_URL = "https://playwright.dev/docs/writing-tests";
const PLAYWRIGHT_STARTER_TYPESCRIPT = `import { test, expect } from '@playwright/test';
test('opens the Playwright docs', async ({ page }) => {
await page.goto('https://playwright.dev/');
await expect(page).toHaveTitle(/Playwright/);
await page.getByRole('link', { name: 'Docs' }).click();
await expect(page.getByRole('heading', { name: /Playwright/ })).toBeVisible();
});`;
function containsAnySubstring(value, needles) {
return needles.some((needle) => value.includes(needle));
}
function containsToken(normalized, token) {
return String(normalized || "").split(/\s+/).includes(token);
}
// Issue #386 Playwright roles — mirror ROLE_PLAYWRIGHT_TOOL_NAME and
// ROLE_PLAYWRIGHT_SCRIPT_CUE in src/seed/roles.rs. The tool name (with its
// 'playright' misspelling, whose `action` names the canonical spelling) and the
// script-authoring cues live in data/seed/meanings-playwright.lino (embedded in
// MEANINGS_LINO above). isPlaywrightScriptRequest matches both roles as raw
// substrings across every language, exactly like the Rust recogniser.
const ROLE_PLAYWRIGHT_TOOL_NAME = "playwright_tool_name";
const ROLE_PLAYWRIGHT_SCRIPT_CUE = "playwright_script_cue";
function isPlaywrightScriptRequest(normalized) {
return (
lexiconMentionsRoleSubstring(ROLE_PLAYWRIGHT_TOOL_NAME, normalized) &&
lexiconMentionsRoleSubstring(ROLE_PLAYWRIGHT_SCRIPT_CUE, normalized)
);
}
// True when the prompt contains a misspelled form of the Playwright name — any
// playwright_tool_name form whose `action` names the canonical spelling. The
// misspelling and its correction live in the seed data, so the handler reports
// the fix without naming either form here. Mirrors
// mentions_playwright_misspelling in src/solver_handlers/playwright_script.rs.
function mentionsPlaywrightMisspelling(normalized) {
return roleWordForms(ROLE_PLAYWRIGHT_TOOL_NAME)
.filter((form) => form.action)
.some((form) => normalized.includes(form.text));
}
function renderPlaywrightClarification(language) {
if (language === "ru") {
return [
"Я могу написать Playwright-скрипт. Уточните URL страницы, действия и ожидаемую проверку.",
"Если нужен пример по умолчанию, я могу взять стартовый сценарий из документации Playwright.",
].join(" ");
}
return [
"I can write a Playwright script. Please provide the page URL, the actions to perform, and the expected assertion.",
"If you want a default example, I can use the starter scenario from the Playwright docs.",
].join(" ");
}
function renderPlaywrightStarter(language, correctedSpelling) {
const lines = [];
if (language === "ru" && correctedSpelling) {
lines.push(
"Я трактую `Playright` как `Playwright` и даю стартовый TypeScript-пример по документации Playwright.",
);
} else if (language === "ru") {
lines.push("Даю стартовый TypeScript-пример по документации Playwright.");
} else if (correctedSpelling) {
lines.push(
"I interpret `Playright` as `Playwright` and will use a starter TypeScript example based on the Playwright docs.",
);
} else {
lines.push(
"I will use a starter TypeScript example based on the Playwright docs.",
);
}
lines.push("");
lines.push(`Source: ${PLAYWRIGHT_DOCS_URL}`);
lines.push("");
lines.push("```typescript");
lines.push(PLAYWRIGHT_STARTER_TYPESCRIPT);
lines.push("```");
lines.push("");
if (language === "ru") {
lines.push("Проверка:");
lines.push("1. `npm init playwright@latest`");
lines.push("2. `npx playwright test`");
lines.push("");
lines.push("Уточните URL, действия и ожидаемый результат, если нужен сценарий под конкретный сайт.");
} else {
lines.push("Check it with:");
lines.push("1. `npm init playwright@latest`");
lines.push("2. `npx playwright test`");
lines.push("");
lines.push("Provide the URL, actions, and expected result if you want a site-specific script.");
}
return lines.join("\n");
}
function tryPlaywrightScript(prompt, preferences = {}, language = "en") {
const normalized = normalizePrompt(prompt);
if (!isPlaywrightScriptRequest(normalized)) return null;
const guessProbability = numericPreference(
preferences && preferences.guessProbability,
0.8,
0,
1,
);
const evidence = [
"script_framework:playwright",
`source:${PLAYWRIGHT_DOCS_URL}`,
`guess_probability:${guessProbability.toFixed(2)}`,
];
const correctedSpelling = mentionsPlaywrightMisspelling(normalized);
if (correctedSpelling) {
evidence.push("spelling_correction:Playright->Playwright");
}
if (guessProbability < 0.5) {
return {
intent: "playwright_script_clarification",
content: renderPlaywrightClarification(language),
confidence: 0.64,
evidence,
};
}
return {
intent: "playwright_script",
content: renderPlaywrightStarter(language, correctedSpelling),
confidence: 0.82,
evidence,
};
}
function detectSoftwareAction(normalized) {
const match = scanSoftwareSurface(normalized, softwareActionTable());
return match ? match.payload : null;
}
function detectSoftwareArtifact(normalized) {
const match = scanSoftwareSurface(normalized, softwareArtifactTable());
return match ? { surface: match.surface, label: match.payload } : null;
}
function extractSoftwareTarget(prompt, artifact) {
const markers = [
`${artifact.surface} for `,
`${artifact.surface} to `,
`${artifact.label} for `,
`${artifact.label} to `,
" for ",
" to ",
];
for (const marker of markers) {
const target = extractAfterMarker(prompt, marker);
if (target) return target;
}
return "the requested environment";
}
function extractAfterMarker(prompt, marker) {
const source = String(prompt || "");
const lower = source.toLowerCase();
const lowerMarker = marker.toLowerCase();
const start = lower.indexOf(lowerMarker);
if (start < 0) return null;
const tail = source.slice(start + lowerMarker.length);
const stopMatch = /[?.,;\n]/.exec(tail);
const stop = stopMatch ? stopMatch.index : tail.length;
const raw = tail
.slice(0, stop)
.split(" with ")[0]
.split(" that ")[0]
.split(" and ")[0]
.trim();
if (!raw) return null;
return capitalizeShortTarget(raw);
}
function capitalizeShortTarget(raw) {
const compact = String(raw || "").trim().split(/\s+/).slice(0, 5).join(" ");
if (!compact) return compact;
if (/[A-ZА-Я]/.test(compact)) return compact;
return compact.charAt(0).toUpperCase() + compact.slice(1);
}
function sentenceCase(raw) {
const trimmed = String(raw || "").trim().replace(/^[-* ]+|[-* ]+$/g, "");
if (!trimmed) return "";
return trimmed.charAt(0).toUpperCase() + trimmed.slice(1);
}
function extractSoftwareFeatures(prompt) {
const markers = requirementMarkerWords();
const features = [];
const segments = String(prompt || "").split(/[.;\n]/);
for (const segment of segments) {
for (const clause of segment.split(",")) {
const cleaned = clause.trim();
if (!cleaned) continue;
const lower = cleaned.toLowerCase();
if (!containsAnySubstring(lower, markers)) continue;
const feature = sentenceCase(cleaned);
if (feature && !features.includes(feature)) features.push(feature);
}
}
if (features.length === 0) {
features.push("Capture state, user commands, persistence, validation, and tests.");
}
return features;
}
// A request is a game-unit tracker only when it pairs a game domain with a
// combat mechanic — both the game_tracker_domain and game_tracker_mechanic
// roles must be evidenced. Mirrors is_game_unit_tracker in
// src/solver_handlers/software_project.rs; the decomposition lives in the
// lexicon, so the code knows only "a tracker needs both a domain and a mechanic".
function isGameUnitTracker(normalized) {
return (
lexiconMentionsRole(ROLE_GAME_TRACKER_DOMAIN, normalized) &&
lexiconMentionsRole(ROLE_GAME_TRACKER_MECHANIC, normalized)
);
}
function classifySoftwareRequirement(requirement, gameTracker) {
const lower = String(requirement || "").toLowerCase();
// A game unit tracker is state by construction, regardless of wording.
if (gameTracker) {
return "state_tracking";
}
// Walk the requirement-category meanings in declaration order; the first
// whose surface word appears classifies the clause. Mirrors
// classify_requirement in src/solver_handlers/software_project.rs. The
// catch-all project_behavior comes last, so it acts as the default.
for (const meaning of meaningsWithRole(ROLE_SOFTWARE_REQUIREMENT_CATEGORY)) {
const label = SOFTWARE_REQUIREMENT_CATEGORY_LABELS[meaning.slug];
if (!label) continue;
if (meaning.words.some((word) => lower.includes(word.toLowerCase()))) {
return label;
}
}
return "project_behavior";
}
function softwareSubtaskTitle(category, requirement) {
switch (category) {
case "state_tracking":
return `Model state fields and pure transitions for ${requirement}`;
case "data_exchange":
return `Define parsers, serializers, and backup flow for ${requirement}`;
case "automation":
return `Schedule deterministic jobs and delivery checks for ${requirement}`;
case "validation":
return `Encode validation rules and failure messages for ${requirement}`;
case "integration":
return `Isolate host API boundaries and mocks for ${requirement}`;
case "user_interface":
return `Design focused views and state updates for ${requirement}`;
default:
return `Implement and test the smallest behavior for ${requirement}`;
}
}
function deriveSoftwareSubtasks(requirements, gameTracker) {
return requirements.map((requirement, index) => {
const category = classifySoftwareRequirement(requirement, gameTracker);
return {
requirementId: `R${index + 1}`,
category,
title: softwareSubtaskTitle(category, requirement),
};
});
}
// Pick the delivery mode by walking the software_delivery_mode meanings in
// declaration order (manual instructions → immediate execution → script
// generation — the order encodes priority) and taking the first one evidenced
// in the request; the default is generated code. Mirrors detect_delivery_mode
// in src/solver_handlers/software_project.rs — the surface words live in the
// lexicon, so the code knows only "a request can ask for a delivery mode".
function detectSoftwareDeliveryMode(normalized) {
const meaning = firstRoleMatch(ROLE_SOFTWARE_DELIVERY_MODE, normalized);
return (meaning && SOFTWARE_DELIVERY_MODE_LABELS[meaning.slug]) || "code_generation";
}
// Resolve the target language by walking the software_implementation_language
// meanings in declaration order (python → rust → javascript) and taking the
// first one named in the request; the default is TypeScript. Mirrors
// detect_implementation_language in src/solver_handlers/software_project.rs.
function detectSoftwareImplementationLanguage(normalized) {
const meaning = firstRoleMatch(ROLE_SOFTWARE_IMPLEMENTATION_LANGUAGE, normalized);
return (meaning && SOFTWARE_IMPLEMENTATION_LANGUAGE_LABELS[meaning.slug]) || "typescript";
}
// Mirrors approval_gates in src/solver_handlers/software_project.rs: the feature,
// step-granularity, and bash-command gates are added when the lexicon evidences
// the matching role, so the gate vocabulary lives once in data.
function softwareApprovalGates(normalized, deliveryMode) {
const gates = ["task_formalization", "implementation_plan"];
if (lexiconMentionsRole(ROLE_SOFTWARE_FEATURE, normalized)) gates.push("requirements");
if (lexiconMentionsRole(ROLE_SOFTWARE_STEP_GRANULARITY, normalized)) gates.push("each_step");
if (deliveryMode === "code_generation") {
gates.push("generated_code");
} else if (deliveryMode === "manual_instructions") {
gates.push("manual_instructions");
} else {
gates.push("generated_script");
gates.push("bash_command");
}
if (lexiconMentionsRole(ROLE_SOFTWARE_BASH_COMMAND, normalized)) {
gates.push("bash_command");
}
return [...new Set(gates)].sort();
}
function softwareImplementationCode(meaning) {
if (meaning.gameTracker) {
return {
label: "TypeScript",
fence: "typescript",
body: GAME_TRACKER_TYPESCRIPT,
};
}
if (meaning.implementationLanguage === "python") {
return { label: "Python", fence: "python", body: GENERIC_PROJECT_PYTHON };
}
if (meaning.implementationLanguage === "rust") {
return { label: "Rust", fence: "rust", body: GENERIC_PROJECT_RUST };
}
if (meaning.implementationLanguage === "javascript") {
return { label: "JavaScript", fence: "javascript", body: GENERIC_PROJECT_JAVASCRIPT };
}
return { label: "TypeScript", fence: "typescript", body: GENERIC_PROJECT_TYPESCRIPT };
}
function softwareDomainLabel(meaning) {
return meaning.gameTracker ? "tabletop_game_unit_tracker" : "software_project";
}
function softwareApprovalLabel(approved) {
return approved ? "approved" : "proposed";
}
function linoString(value) {
return `"${String(value || "")
.replace(/\\/g, "\\\\")
.replace(/"/g, '\\"')
.replace(/\n/g, "\\n")
.replace(/\r/g, "\\r")}"`;
}
function softwareMeaningLino(meaning, approved) {
const lines = ["software_project_request"];
lines.push(` action ${linoString(meaning.action)}`);
lines.push(` artifact ${linoString(meaning.artifact)}`);
lines.push(` artifact_surface ${linoString(meaning.artifactSurface)}`);
lines.push(` target ${linoString(meaning.target)}`);
lines.push(` domain ${linoString(softwareDomainLabel(meaning))}`);
lines.push(` delivery_mode ${meaning.deliveryMode}`);
lines.push(` implementation_language ${linoString(meaning.implementationLanguage)}`);
lines.push(` approval_state ${softwareApprovalLabel(approved)}`);
lines.push(" approval_required true");
for (const gate of meaning.approvalGates) {
lines.push(` approval_gate ${linoString(gate)}`);
}
for (const requirement of meaning.requirements) {
lines.push(` requirement ${linoString(requirement)}`);
lines.push(
` requirement_category ${linoString(
classifySoftwareRequirement(requirement, meaning.gameTracker),
)}`,
);
}
for (const subtask of meaning.subtasks) {
lines.push(
` subtask ${linoString(
`${subtask.requirementId} [${subtask.category}] ${subtask.title}`,
)}`,
);
}
if (meaning.gameTracker) {
lines.push(' state_model "unit_state"');
lines.push(' command "apply_damage"');
lines.push(' command "set_stacks"');
lines.push(' command "tick_cooldowns"');
lines.push(' validation "damage_mitigation_floor_at_zero"');
lines.push(' validation "cooldowns_decrement_without_negative_rounds"');
} else {
lines.push(' state_model "project_records"');
lines.push(' command "create_record"');
lines.push(' command "update_record"');
lines.push(' command "export_state"');
lines.push(' validation "pure_state_transitions_before_host_api"');
}
return lines.join("\n") + "\n";
}
function softwareMeaningKey(meaning) {
return [
`action=${meaning.action}`,
`artifact=${meaning.artifact}`,
`target=${meaning.target}`,
`game_tracker=${meaning.gameTracker}`,
`delivery_mode=${meaning.deliveryMode}`,
`implementation_language=${meaning.implementationLanguage}`,
...meaning.requirements.map((requirement) => `requirement=${requirement}`),
...meaning.subtasks.map((subtask) => `subtask=${subtask.category}:${subtask.title}`),
].join(";");
}
function stableSoftwareMeaningId(meaning) {
let hash = 0xcbf29ce484222325n;
const source = softwareMeaningKey(meaning);
for (let index = 0; index < source.length; index += 1) {
hash ^= BigInt(source.charCodeAt(index));
hash = BigInt.asUintN(64, hash * 0x100000001b3n);
}
return `software_project_request_${hash.toString(16)}`;
}
function formalizeSoftwareProjectRequest(prompt) {
const normalized = normalizePrompt(prompt);
if (normalized.includes("hello") && normalized.includes("world")) return null;
const action = detectSoftwareAction(normalized);
const artifact = detectSoftwareArtifact(normalized);
if (!action || !artifact) return null;
const requirements = extractSoftwareFeatures(prompt);
const gameTracker = isGameUnitTracker(normalized);
const deliveryMode = detectSoftwareDeliveryMode(normalized);
return {
action,
artifactSurface: artifact.surface,
artifact: artifact.label,
target: extractSoftwareTarget(prompt, artifact),
requirements,
subtasks: deriveSoftwareSubtasks(requirements, gameTracker),
deliveryMode,
implementationLanguage: detectSoftwareImplementationLanguage(normalized),
approvalGates: softwareApprovalGates(normalized, deliveryMode),
gameTracker,
};
}
function softwareReasoningSteps(meaning) {
const steps = [
`Classify the impulse as a request to ${meaning.action} a ${meaning.artifact} instead of a fact lookup.`,
`Bind the target environment to ${meaning.target} and keep the first response reviewable.`,
`Extract ${meaning.requirements.length} requirement(s) into the meaning record before planning.`,
`Decompose the requirement graph into ${meaning.subtasks.length} implementation subtask(s) with category labels.`,
`Select delivery mode ${meaning.deliveryMode} and approval gates: ${meaning.approvalGates.join(", ")}.`,
];
if (meaning.gameTracker) {
steps.push(
"Map HP, Protection, Resistance, damage, and cooldown phrases to a unit-state domain model.",
);
}
steps.push("Ask for approval before producing code, scripts, manual instructions, or execution steps.");
return steps;
}
function softwarePlanSteps(meaning) {
const steps = [
"Review the formalized task, requirement graph, approval gates, and delivery mode with the user.",
];
if (meaning.gameTracker) {
steps.push(
`Confirm the ${meaning.target} storage and selected-token API boundaries.`,
"Define `UnitState` with HP, max HP, Protection, Resistance, and cooldowns.",
"Write pure transition functions for damage mitigation, stack edits, and round ticks.",
"Add tests for zero damage, overkill damage, stack changes, and cooldown expiry.",
"Wire the tested core into the extension panel and host persistence.",
);
return steps;
}
steps.push(
`Confirm the host API and data boundaries for ${meaning.target}.`,
"Define the smallest serializable state records for the requirements.",
);
for (const subtask of meaning.subtasks) {
steps.push(`Implement ${subtask.category}: ${subtask.title}.`);
}
steps.push(
`Generate a ${meaning.implementationLanguage} starter core plus language-appropriate repository initialization and checks.`,
);
steps.push("Keep shell, Docker, or WebVM commands behind the configured approval gates.");
return steps;
}
function softwareEvidence(meaning, approved) {
const evidence = [
"formalization:text_to_links_notation",
`meaning:${stableSoftwareMeaningId(meaning)}`,
`software_project:action:${meaning.action}`,
`software_project:artifact:${meaning.artifact}`,
`software_project:target:${meaning.target}`,
`software_project:domain:${softwareDomainLabel(meaning)}`,
`software_project:delivery_mode:${meaning.deliveryMode}`,
`software_project:implementation_language:${meaning.implementationLanguage}`,
`approval_state:${softwareApprovalLabel(approved)}`,
`software_project:strategy:${meaning.gameTracker ? "game_unit_tracker" : "bounded_project_plan"}`,
];
for (const gate of meaning.approvalGates) {
evidence.push(`approval_gate:${gate}`);
}
for (const requirement of meaning.requirements) {
evidence.push(`requirement:${requirement}`);
evidence.push(`requirement_category:${classifySoftwareRequirement(requirement, meaning.gameTracker)}`);
}
for (const subtask of meaning.subtasks) {
evidence.push(`software_project:subtask:${subtask.requirementId}:${subtask.category}:${subtask.title}`);
}
return evidence;
}
function renderSoftwareProjectPlan(meaning) {
const lines = [];
lines.push(
`Implementation plan pending approval for a ${meaning.artifact} targeting ${meaning.target}.`,
);
lines.push("");
lines.push("Formalized meaning:");
lines.push("```lino");
lines.push(softwareMeaningLino(meaning, false).trimEnd());
lines.push("```");
lines.push("");
lines.push("Reasoning steps:");
softwareReasoningSteps(meaning).forEach((step, index) => {
lines.push(`${index + 1}. ${step}`);
});
lines.push("");
lines.push("Requirement model:");
meaning.requirements.forEach((requirement, index) => {
const category = classifySoftwareRequirement(requirement, meaning.gameTracker);
lines.push(`${index + 1}. [${category}] ${requirement}`);
});
lines.push("");
lines.push("Subtasks:");
meaning.subtasks.forEach((subtask, index) => {
lines.push(`${index + 1}. ${subtask.requirementId} -> ${subtask.title}`);
});
lines.push("");
lines.push("Approval gates:");
meaning.approvalGates.forEach((gate) => {
lines.push(`- ${gate}`);
});
lines.push("");
lines.push("Proposed plan:");
softwarePlanSteps(meaning).forEach((step, index) => {
lines.push(`${index + 1}. ${step}`);
});
lines.push("");
lines.push(
"Reply `approve plan` to generate the starter implementation, or describe what to change.",
);
return lines.join("\n");
}
function renderSoftwareProjectImplementation(meaning) {
const lines = [];
lines.push(
`Approved implementation starter for a ${meaning.artifact} targeting ${meaning.target}.`,
);
lines.push("");
lines.push("Formalized meaning:");
lines.push("```lino");
lines.push(softwareMeaningLino(meaning, true).trimEnd());
lines.push("```");
lines.push("");
lines.push("Implementation steps:");
softwarePlanSteps(meaning).forEach((step, index) => {
lines.push(`${index + 1}. ${step}`);
});
lines.push("");
const code = softwareImplementationCode(meaning);
lines.push(`Starter ${code.label} core:`);
lines.push("");
lines.push(`\`\`\`${code.fence}`);
lines.push(code.body);
lines.push("```");
lines.push("");
lines.push("Generated code checks:");
lines.push(`1. Initialize a ${code.label} project in an isolated workspace.`);
lines.push("2. Run the language-native syntax/type check before host integration.");
return lines.join("\n");
}
// Mirror is_approval_prompt in src/solver_handlers/software_project.rs: strip
// leading/trailing non-alphanumerics (Unicode-aware, so a non-Latin go-ahead
// compacts the same way), drop interior sentence punctuation, then match the
// whole compacted prompt against any approval-trigger surface word. The words
// live in data/seed/meanings-software-project.lino, not in code.
function isSoftwareApprovalPrompt(normalized) {
const compact = String(normalized || "")
.trim()
.replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, "")
.replace(/[.!,]/g, "");
return meaningsWithRole(ROLE_SOFTWARE_APPROVAL_TRIGGER).some((meaning) =>
meaning.words.some((word) => compact === word),
);
}
function lastHistoryTurn(history, role) {
if (!Array.isArray(history)) return null;
for (let index = history.length - 1; index >= 0; index -= 1) {
const turn = history[index];
if (turn && turn.role === role && turn.content) return String(turn.content);
}
return null;
}
function priorSoftwareProjectMeaning(history) {
const assistant = lastHistoryTurn(history, "assistant");
if (
!assistant ||
!assistant.includes("software_project_request") ||
!assistant.includes("approve plan")
) {
return null;
}
const user = lastHistoryTurn(history, "user");
return user ? formalizeSoftwareProjectRequest(user) : null;
}
function trySoftwareProjectRequest(prompt, history = []) {
const normalized = normalizePrompt(prompt);
if (isSoftwareApprovalPrompt(normalized)) {
const prior = priorSoftwareProjectMeaning(history);
if (prior) {
return {
intent: "software_project_implementation",
content: renderSoftwareProjectImplementation(prior),
confidence: 0.82,
evidence: softwareEvidence(prior, true),
};
}
}
const meaning = formalizeSoftwareProjectRequest(prompt);
if (!meaning) return null;
return {
intent: "software_project_plan",
content: renderSoftwareProjectPlan(meaning),
confidence: 0.78,
evidence: softwareEvidence(meaning, false),
};
}
// Maps a follow-up kind to the imperative verb used when rendering it. Mirrors
// `FollowUpKind::action` in src/solver_handlers/software_project_followup.rs.
// The surface words that *recognise* each kind no longer live here — they are
// self-describing meanings in data/seed/meanings-software-project.lino, queried
// by detectSoftwareFollowUp via the software_followup_* roles (issue #386).
const SOFTWARE_FOLLOW_UP_ACTIONS = {
verification: "test",
execution: "run",
demonstration: "show",
};
const SOFTWARE_FOLLOW_UP_GATES = ["generated_code", "test_execution", "network_access"];
// Recover the active software-project dialogue from history regardless of
// whether the plan was approved. Mirrors `prior_software_project_dialogue`.
function priorSoftwareProjectDialogue(history) {
const assistant = lastHistoryTurn(history, "assistant");
if (!assistant || !assistant.includes("software_project_request")) {
return null;
}
const approved = assistant.includes("approval_state approved");
const user = lastHistoryTurn(history, "user");
const meaning = user ? formalizeSoftwareProjectRequest(user) : null;
return meaning ? { meaning, approved } : null;
}
// Pull the first domain-like token (e.g. `wikipedia.org`) out of the prompt.
function extractFollowUpTargetSite(prompt) {
for (const raw of String(prompt || "").split(/\s+/)) {
const token = raw.replace(/^[^A-Za-z0-9]+|[^A-Za-z0-9]+$/g, "");
if (!token.includes(".")) continue;
const lastDot = token.lastIndexOf(".");
const host = token.slice(0, lastDot);
const tld = token.slice(lastDot + 1);
if (
tld.length >= 2 &&
/^[A-Za-z]+$/.test(tld) &&
/[A-Za-z]/.test(host)
) {
return token.toLowerCase();
}
}
return null;
}
// Capture the clause after "show me"/"show"/"print"/"display" (capped at 12
// words) so the follow-up records what the user wants surfaced.
function extractFollowUpExpectedOutput(prompt) {
const source = String(prompt || "");
const lower = source.toLowerCase();
for (const marker of ["show me ", "show ", "print ", "display "]) {
const found = lower.indexOf(marker);
if (found < 0) continue;
const start = found + marker.length;
const tail = source.slice(start);
const stopMatch = tail.match(/[.?\n;]/);
const stop = stopMatch ? stopMatch.index : tail.length;
const clause = tail
.slice(0, stop)
.split(/\s+/)
.filter(Boolean)
.slice(0, 12)
.join(" ");
if (clause) return clause;
}
return null;
}
// Recognise which follow-up a prompt evidences by *meaning*, not a hardcoded
// per-language marker table (issue #386). Each follow-up kind is a
// self-describing meaning in data/seed/meanings-software-project.lino; its
// surface words (every supported language) live there, while this code knows
// only the concepts and their precedence — verification outranks execution
// outranks demonstration, so a combined "test it and run it" records the
// stronger goal. Mirrors follow_up_kind in
// src/solver_handlers/software_project_followup.rs.
function detectSoftwareFollowUp(prompt, normalized) {
let kind = null;
for (const [role, candidate] of [
[ROLE_SOFTWARE_FOLLOWUP_VERIFICATION, "verification"],
[ROLE_SOFTWARE_FOLLOWUP_EXECUTION, "execution"],
[ROLE_SOFTWARE_FOLLOWUP_DEMONSTRATION, "demonstration"],
]) {
if (lexiconMentionsRoleSubstring(role, normalized)) {
kind = candidate;
break;
}
}
if (!kind) return null;
return {
kind,
action: SOFTWARE_FOLLOW_UP_ACTIONS[kind],
targetSite: extractFollowUpTargetSite(prompt),
expectedOutput: extractFollowUpExpectedOutput(prompt),
};
}
function followUpMeaningId(meaning, followUp) {
const key = [
`parent=${stableSoftwareMeaningId(meaning)}`,
`kind=${followUp.kind}`,
`site=${followUp.targetSite || ""}`,
`output=${followUp.expectedOutput || ""}`,
].join(";");
return stableBehaviorRuleId("software_project_followup", key);
}
function followUpReasoningSteps(meaning, followUp) {
const steps = [
`Recognize "${followUp.action}" as a ${followUp.kind} request that exercises the ${meaning.artifact} from the active plan, not a fact lookup.`,
];
if (followUp.targetSite) {
steps.push(
`Bind the test target to ${followUp.targetSite} and keep live fetches behind the network_access gate.`,
);
}
if (followUp.expectedOutput) {
steps.push(
`Record the expected output as "${followUp.expectedOutput}" so the test harness can assert it.`,
);
}
steps.push(
"Drive the artifact through a deterministic fixture before any host API or network call.",
);
steps.push(
"Keep code execution behind approval gates because the sandbox cannot run untrusted code.",
);
return steps;
}
function followUpPlanSteps(meaning, followUp) {
const site = followUp.targetSite || "the requested target";
const steps = [
`Generate the ${meaning.artifact} core plus a deterministic test harness with a captured ${site} fixture.`,
"Assert each requirement (parsing, extraction, counting, summary) against the fixture.",
];
if (followUp.expectedOutput) {
steps.push(`Surface ${followUp.expectedOutput} from the fixture run.`);
}
steps.push(
`Run the ${meaning.implementationLanguage} test command once the generated_code gate is approved.`,
);
steps.push(
`Promote the run to live ${site} only after the test_execution and network_access gates pass.`,
);
return steps;
}
function followUpEvidence(meaning, followUp, approved) {
const evidence = [
"formalization:text_to_links_notation",
`meaning:${followUpMeaningId(meaning, followUp)}`,
`software_project:parent:${stableSoftwareMeaningId(meaning)}`,
`software_project:follow_up_kind:${followUp.kind}`,
];
if (followUp.targetSite) {
evidence.push(`software_project:target_site:${followUp.targetSite}`);
}
if (followUp.expectedOutput) {
evidence.push(`software_project:expected_output:${followUp.expectedOutput}`);
}
evidence.push(`approval_state:${softwareApprovalLabel(approved)}`);
for (const gate of SOFTWARE_FOLLOW_UP_GATES) {
evidence.push(`approval_gate:${gate}`);
}
return evidence;
}
function renderSoftwareProjectFollowUp(meaning, followUp, approved) {
const lines = [];
lines.push(
`Recorded a ${followUp.kind} follow-up for the ${meaning.artifact} from the active plan.`,
);
lines.push("");
lines.push("Formalized meaning:");
lines.push("```lino");
lines.push("software_project_followup");
lines.push(` parent_request ${linoString(stableSoftwareMeaningId(meaning))}`);
lines.push(` parent_artifact ${linoString(meaning.artifact)}`);
lines.push(` action ${linoString(followUp.action)}`);
lines.push(` follow_up_kind ${followUp.kind}`);
if (followUp.targetSite) {
lines.push(` target_site ${linoString(followUp.targetSite)}`);
}
if (followUp.expectedOutput) {
lines.push(` expected_output ${linoString(followUp.expectedOutput)}`);
}
lines.push(` delivery_mode ${meaning.deliveryMode}`);
lines.push(` implementation_language ${linoString(meaning.implementationLanguage)}`);
lines.push(` approval_state ${softwareApprovalLabel(approved)}`);
lines.push(" approval_required true");
for (const gate of SOFTWARE_FOLLOW_UP_GATES) {
lines.push(` approval_gate ${linoString(gate)}`);
}
lines.push("```");
lines.push("");
lines.push("Reasoning steps:");
followUpReasoningSteps(meaning, followUp).forEach((step, index) => {
lines.push(`${index + 1}. ${step}`);
});
lines.push("");
lines.push("Verification plan:");
followUpPlanSteps(meaning, followUp).forEach((step, index) => {
lines.push(`${index + 1}. ${step}`);
});
lines.push("");
if (approved) {
lines.push(
"The plan is approved, so the generated starter already includes this test harness. " +
"Running it live needs the test_execution and network_access gates.",
);
} else {
lines.push(
"Reply `approve plan` to generate the artifact plus this test harness. Running it live " +
"against the target needs the test_execution and network_access gates.",
);
}
return lines.join("\n");
}
// Follow-up handler for an active software-project dialogue (issue #341). Runs
// before `tryConceptLookup` so a decomposed step like "test it by scraping
// wikipedia.org and show me the top 10 most frequent words" stays bound to the
// project instead of resolving the `wikipedia` concept or falling to the
// unknown opener. Mirrors `try_software_project_followup` in the Rust solver.
function trySoftwareProjectFollowup(prompt, history = []) {
const normalized = normalizePrompt(prompt);
// Approval prompts stay with the main request handler, which advances to the
// implementation starter.
if (isSoftwareApprovalPrompt(normalized)) return null;
const dialogue = priorSoftwareProjectDialogue(history);
if (!dialogue) return null;
const followUp = detectSoftwareFollowUp(prompt, normalized);
if (!followUp) return null;
return {
intent: "software_project_followup",
content: renderSoftwareProjectFollowUp(dialogue.meaning, followUp, dialogue.approved),
confidence: 0.74,
evidence: followUpEvidence(dialogue.meaning, followUp, dialogue.approved),
};
}
function tryJavaScriptExecution(prompt) {
const program = extractJavaScriptProgram(prompt);
if (program === null) return null;
const logs = [];
const captureConsole = {
log: (...args) =>
logs.push(
args
.map((value) =>
typeof value === "string" ? value : JSON.stringify(value),
)
.join(" "),
),
};
let result;
let error = null;
try {
const runner = new Function(
"console",
`"use strict"; return (function(){ ${program}\n })();`,
);
result = runner(captureConsole);
} catch (err) {
error = err;
}
const lines = [];
lines.push("Execution status: ran in the demo's Web Worker sandbox.");
lines.push("Source:");
lines.push("```javascript");
lines.push(program);
lines.push("```");
if (error) {
lines.push("");
lines.push(`Error: ${error.message || String(error)}`);
} else {
if (logs.length > 0) {
lines.push("");
lines.push("Output:");
lines.push("```text");
lines.push(logs.join("\n"));
lines.push("```");
}
if (result !== undefined) {
lines.push("");
lines.push(`Returned: \`${String(result)}\``);
}
if (logs.length === 0 && result === undefined) {
lines.push("");
lines.push("Program completed without output or return value.");
}
}
lines.push("");
lines.push(
"Note: the browser worker has no DOM or network access, so side effects are limited.",
);
return {
intent: error ? "javascript_execution_error" : "javascript_execution",
content: lines.join("\n"),
confidence: error ? 0.5 : 0.95,
evidence: [
`execution_status:javascript:${error ? "error" : "ran"}`,
"language:javascript",
],
};
}
// `saveAs`, `setupHint`, `runCommand` and `checkCommand` mirror the same fields
// on `coding::catalog::ProgramLanguage` so the demo's novice "How to test it
// yourself" steps match the Rust engine exactly (issue #330). No entry carries
// its alias surfaces inline: the words a prompt must contain to resolve a
// language live in the `program_language_<slug>` meaning (role
// `program_language_alias`) and `programLanguageFromPrompt` reads them by slug
// (issue #386), matching the Rust catalog byte-for-byte through the shared seed.
const WRITE_PROGRAM_LANGUAGES = {
rust: {
name: "Rust",
fence: "rust",
saveAs: "main.rs",
setupHint: "the Rust toolchain from https://rustup.rs",
checkCommand: "rustc main.rs -o main",
runCommand: "./main",
},
python: {
name: "Python",
fence: "python",
saveAs: "main.py",
setupHint: "Python 3 from https://www.python.org/downloads/",
checkCommand: "python3 -m py_compile main.py",
runCommand: "python3 main.py",
},
javascript: {
name: "JavaScript",
fence: "javascript",
saveAs: "main.js",
setupHint: "Node.js from https://nodejs.org/",
checkCommand: "node --check main.js",
runCommand: "node main.js",
},
typescript: {
name: "TypeScript",
fence: "typescript",
saveAs: "hello.ts",
setupHint:
"Node.js from https://nodejs.org/ plus TypeScript via `npm install -g typescript`",
checkCommand: "tsc hello.ts",
runCommand: "node hello.js",
},
go: {
name: "Go",
fence: "go",
saveAs: "main.go",
setupHint: "Go from https://go.dev/dl/",
checkCommand: null,
runCommand: "go run main.go",
},
c: {
name: "C",
fence: "c",
saveAs: "main.c",
setupHint:
"a C compiler such as GCC from https://gcc.gnu.org/ or your package manager",
checkCommand: "gcc main.c -o main",
runCommand: "./main",
},
cpp: {
name: "C++",
fence: "cpp",
saveAs: "main.cpp",
setupHint:
"a C++ compiler such as g++ from https://gcc.gnu.org/ or your package manager",
checkCommand: "g++ main.cpp -o main",
runCommand: "./main",
},
java: {
name: "Java",
fence: "java",
saveAs: "Main.java",
setupHint: "a JDK from https://adoptium.net/",
checkCommand: "javac Main.java",
runCommand: "java Main",
},
csharp: {
name: "C#",
fence: "csharp",
saveAs: "Program.cs",
setupHint: "the .NET SDK from https://dotnet.microsoft.com/download",
checkCommand: "dotnet build",
runCommand: "dotnet run",
},
ruby: {
name: "Ruby",
fence: "ruby",
saveAs: "main.rb",
setupHint: "Ruby from https://www.ruby-lang.org/en/downloads/",
checkCommand: "ruby -c main.rb",
runCommand: "ruby main.rb",
},
};
const WRITE_PROGRAM_TASKS = {
hello_world: {
label: "hello world",
output: "Hello, world!",
},
count_to_three: {
label: "count to three",
output: "1\n2\n3",
},
list_files: {
label: "list files in the current directory",
// Verified output for the documented sample directory containing exactly
// `Cargo.toml`, `README.md`, and `main.rs`. Every template sorts names in
// byte order, so the output is identical across languages (issue #312).
output: "Cargo.toml\nREADME.md\nmain.rs",
},
list_files_arg: {
label: "list files in the directory given as a path argument",
// Issue #324 follow-up: "Сделай так, чтобы программа принимала путь как
// аргумент" (make the program accept a path as an argument). This is the
// path-argument variant of `list_files`; conversation context maps a bare
// "accept a path argument" modification onto it through the program-plan
// rules. Mirrors the Rust `list_files_arg` task.
output: "Cargo.toml\nREADME.md\nmain.rs",
},
list_files_reverse_sort: {
label: "list files in the current directory in reverse-sorted order",
output: "main.rs\nREADME.md\nCargo.toml",
},
list_files_arg_reverse_sort: {
label: "list files from a path argument in reverse-sorted order",
output: "main.rs\nREADME.md\nCargo.toml",
},
// Issue #330: classic branching/looping exercise over 1..=15. Mirrors the Rust
// `fizzbuzz` task; fixed range so the output is deterministic and verifiable.
fizzbuzz: {
label: "FizzBuzz",
output: "1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz",
},
// Issue #330: fixed to 5! = 120 so the verified output is unambiguous (the
// aliases require the number 5). Mirrors the Rust `factorial` task.
factorial: {
label: "factorial of 5",
output: "120",
},
// Issue #330: reverses the literal string "hello" -> "olleh". Mirrors the Rust
// `reverse_string` task; fixed input keeps the output verifiable.
reverse_string: {
label: "string reversal",
output: "olleh",
},
// Issue #330: sums 1..=10 -> 55. Mirrors the Rust `sum_to_ten` task.
sum_to_ten: {
label: "sum from 1 to 10",
output: "55",
},
// Issue #334: a recursive `fibonacci` function evaluated at the 10th term
// (F(1)=F(2)=1 -> F(10)=55). Mirrors the Rust `fibonacci` task; fixed index so
// the output is verifiable.
fibonacci: {
label: "recursive Fibonacci",
output: "55",
},
};
const WRITE_PROGRAM_TEMPLATES = {
hello_world: {
rust: 'fn main() {\n println!("Hello, world!");\n}',
python: 'print("Hello, world!")',
javascript: 'console.log("Hello, world!");',
typescript: 'console.log("Hello, world!");',
go: 'package main\n\nimport "fmt"\n\nfunc main() {\n fmt.Println("Hello, world!")\n}',
c: '#include <stdio.h>\n\nint main(void) {\n puts("Hello, world!");\n return 0;\n}',
cpp: '#include <iostream>\n\nint main() {\n std::cout << "Hello, world!" << std::endl;\n return 0;\n}',
java: 'public class Main {\n public static void main(String[] args) {\n System.out.println("Hello, world!");\n }\n}',
csharp:
'using System;\n\nclass Program {\n static void Main() {\n Console.WriteLine("Hello, world!");\n }\n}',
ruby: 'puts "Hello, world!"',
},
count_to_three: {
rust:
'fn main() {\n for number in 1..=3 {\n println!("{number}");\n }\n}',
python: "for number in range(1, 4):\n print(number)",
javascript:
"for (let number = 1; number <= 3; number += 1) {\n console.log(number);\n}",
typescript:
"for (let number = 1; number <= 3; number += 1) {\n console.log(number);\n}",
go:
'package main\n\nimport "fmt"\n\nfunc main() {\n for number := 1; number <= 3; number++ {\n fmt.Println(number)\n }\n}',
c:
'#include <stdio.h>\n\nint main(void) {\n for (int number = 1; number <= 3; number++) {\n printf("%d\\n", number);\n }\n return 0;\n}',
},
list_files: {
rust:
'use std::fs;\n\nfn main() -> std::io::Result<()> {\n let mut names: Vec<String> = fs::read_dir(".")?\n .filter_map(Result::ok)\n .filter(|entry| entry.path().is_file())\n .map(|entry| entry.file_name().to_string_lossy().into_owned())\n .collect();\n names.sort();\n for name in names {\n println!("{name}");\n }\n Ok(())\n}',
python:
'import os\n\nnames = sorted(name for name in os.listdir(".") if os.path.isfile(name))\nfor name in names:\n print(name)',
javascript:
'const fs = require("fs");\n\nconst names = fs\n .readdirSync(".")\n .filter((name) => fs.statSync(name).isFile())\n .sort();\n\nfor (const name of names) {\n console.log(name);\n}',
typescript:
'import * as fs from "fs";\n\nconst names: string[] = fs\n .readdirSync(".")\n .filter((name) => fs.statSync(name).isFile())\n .sort();\n\nfor (const name of names) {\n console.log(name);\n}',
go:
'package main\n\nimport (\n "fmt"\n "os"\n "sort"\n)\n\nfunc main() {\n entries, err := os.ReadDir(".")\n if err != nil {\n panic(err)\n }\n var names []string\n for _, entry := range entries {\n if !entry.IsDir() {\n names = append(names, entry.Name())\n }\n }\n sort.Strings(names)\n for _, name := range names {\n fmt.Println(name)\n }\n}',
c:
'#include <dirent.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/stat.h>\n\nstatic int compare(const void *a, const void *b) {\n return strcmp(*(const char *const *)a, *(const char *const *)b);\n}\n\nint main(void) {\n DIR *dir = opendir(".");\n if (dir == NULL) {\n return 1;\n }\n char *names[1024];\n size_t count = 0;\n struct dirent *entry;\n while ((entry = readdir(dir)) != NULL && count < 1024) {\n struct stat info;\n if (stat(entry->d_name, &info) == 0 && S_ISREG(info.st_mode)) {\n names[count++] = strdup(entry->d_name);\n }\n }\n closedir(dir);\n qsort(names, count, sizeof(char *), compare);\n for (size_t i = 0; i < count; i++) {\n printf("%s\\n", names[i]);\n free(names[i]);\n }\n return 0;\n}',
cpp:
"#include <algorithm>\n#include <filesystem>\n#include <iostream>\n#include <string>\n#include <vector>\n\nint main() {\n namespace fs = std::filesystem;\n std::vector<std::string> names;\n for (const auto &entry : fs::directory_iterator(\".\")) {\n if (entry.is_regular_file()) {\n names.push_back(entry.path().filename().string());\n }\n }\n std::sort(names.begin(), names.end());\n for (const auto &name : names) {\n std::cout << name << '\\n';\n }\n}",
java:
'import java.io.File;\nimport java.util.Arrays;\n\npublic class Main {\n public static void main(String[] args) {\n File[] entries = new File(".").listFiles();\n if (entries == null) {\n return;\n }\n String[] names = Arrays.stream(entries)\n .filter(File::isFile)\n .map(File::getName)\n .sorted()\n .toArray(String[]::new);\n for (String name : names) {\n System.out.println(name);\n }\n }\n}',
csharp:
'using System;\nusing System.IO;\nusing System.Linq;\n\nclass Program {\n static void Main() {\n var names = Directory.GetFiles(".")\n .Select(Path.GetFileName)\n .OrderBy(name => name, StringComparer.Ordinal);\n foreach (var name in names) {\n Console.WriteLine(name);\n }\n }\n}',
ruby:
'names = Dir.entries(".").select { |name| File.file?(name) }.sort\nnames.each { |name| puts name }',
},
// Issue #324 follow-up: list files in the directory passed as the first
// command-line argument, defaulting to "." when none is supplied. Mirrors the
// Rust `list_files_arg` templates.
list_files_arg: {
rust:
'use std::env;\nuse std::fs;\n\nfn main() {\n let path = env::args().nth(1).unwrap_or_else(|| String::from("."));\n let mut names: Vec<String> = fs::read_dir(&path)\n .expect("failed to read directory")\n .filter_map(|entry| entry.ok())\n .filter(|entry| entry.path().is_file())\n .map(|entry| entry.file_name().to_string_lossy().into_owned())\n .collect();\n names.sort();\n for name in names {\n println!("{name}");\n }\n}',
python:
'import os\nimport sys\n\npath = sys.argv[1] if len(sys.argv) > 1 else "."\nnames = sorted(\n name for name in os.listdir(path) if os.path.isfile(os.path.join(path, name))\n)\nfor name in names:\n print(name)',
javascript:
'const fs = require("fs");\nconst path = require("path");\n\nconst dir = process.argv[2] || ".";\nconst names = fs\n .readdirSync(dir)\n .filter((name) => fs.statSync(path.join(dir, name)).isFile())\n .sort();\n\nfor (const name of names) {\n console.log(name);\n}',
typescript:
'import * as fs from "fs";\nimport * as path from "path";\n\nconst dir: string = process.argv[2] ?? ".";\nconst names: string[] = fs\n .readdirSync(dir)\n .filter((name) => fs.statSync(path.join(dir, name)).isFile())\n .sort();\n\nfor (const name of names) {\n console.log(name);\n}',
go:
'package main\n\nimport (\n "fmt"\n "os"\n "sort"\n)\n\nfunc main() {\n dir := "."\n if len(os.Args) > 1 {\n dir = os.Args[1]\n }\n entries, err := os.ReadDir(dir)\n if err != nil {\n panic(err)\n }\n var names []string\n for _, entry := range entries {\n if !entry.IsDir() {\n names = append(names, entry.Name())\n }\n }\n sort.Strings(names)\n for _, name := range names {\n fmt.Println(name)\n }\n}',
c:
'#include <dirent.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/stat.h>\n\nstatic int compare(const void *a, const void *b) {\n return strcmp(*(const char *const *)a, *(const char *const *)b);\n}\n\nint main(int argc, char *argv[]) {\n const char *path = argc > 1 ? argv[1] : ".";\n DIR *dir = opendir(path);\n if (dir == NULL) {\n return 1;\n }\n char *names[1024];\n size_t count = 0;\n struct dirent *entry;\n while ((entry = readdir(dir)) != NULL && count < 1024) {\n char full[4096];\n snprintf(full, sizeof(full), "%s/%s", path, entry->d_name);\n struct stat info;\n if (stat(full, &info) == 0 && S_ISREG(info.st_mode)) {\n names[count++] = strdup(entry->d_name);\n }\n }\n closedir(dir);\n qsort(names, count, sizeof(char *), compare);\n for (size_t i = 0; i < count; i++) {\n printf("%s\\n", names[i]);\n free(names[i]);\n }\n return 0;\n}',
cpp:
"#include <algorithm>\n#include <filesystem>\n#include <iostream>\n#include <string>\n#include <vector>\n\nint main(int argc, char *argv[]) {\n namespace fs = std::filesystem;\n std::string path = argc > 1 ? argv[1] : \".\";\n std::vector<std::string> names;\n for (const auto &entry : fs::directory_iterator(path)) {\n if (entry.is_regular_file()) {\n names.push_back(entry.path().filename().string());\n }\n }\n std::sort(names.begin(), names.end());\n for (const auto &name : names) {\n std::cout << name << '\\n';\n }\n}",
java:
'import java.io.File;\nimport java.util.Arrays;\n\npublic class Main {\n public static void main(String[] args) {\n String path = args.length > 0 ? args[0] : ".";\n File[] entries = new File(path).listFiles();\n if (entries == null) {\n return;\n }\n String[] names = Arrays.stream(entries)\n .filter(File::isFile)\n .map(File::getName)\n .sorted()\n .toArray(String[]::new);\n for (String name : names) {\n System.out.println(name);\n }\n }\n}',
csharp:
'using System;\nusing System.IO;\nusing System.Linq;\n\nclass Program {\n static void Main(string[] args) {\n var path = args.Length > 0 ? args[0] : ".";\n var names = Directory.GetFiles(path)\n .Select(Path.GetFileName)\n .OrderBy(name => name, StringComparer.Ordinal);\n foreach (var name in names) {\n Console.WriteLine(name);\n }\n }\n}',
ruby:
'path = ARGV[0] || "."\nnames = Dir.entries(path).select { |name| File.file?(File.join(path, name)) }.sort\nnames.each { |name| puts name }',
},
list_files_reverse_sort: {
rust:
'use std::fs;\n\nfn main() -> std::io::Result<()> {\n let mut names: Vec<String> = fs::read_dir(".")?\n .filter_map(Result::ok)\n .filter(|entry| entry.path().is_file())\n .map(|entry| entry.file_name().to_string_lossy().into_owned())\n .collect();\n names.sort_by(|a, b| b.cmp(a));\n for name in names {\n println!("{name}");\n }\n Ok(())\n}',
python:
'import os\n\nnames = sorted(\n (name for name in os.listdir(".") if os.path.isfile(name)),\n reverse=True,\n)\nfor name in names:\n print(name)',
javascript:
'const fs = require("fs");\n\nconst names = fs\n .readdirSync(".")\n .filter((name) => fs.statSync(name).isFile())\n .sort()\n .reverse();\n\nfor (const name of names) {\n console.log(name);\n}',
typescript:
'import * as fs from "fs";\n\nconst names: string[] = fs\n .readdirSync(".")\n .filter((name) => fs.statSync(name).isFile())\n .sort()\n .reverse();\n\nfor (const name of names) {\n console.log(name);\n}',
go:
'package main\n\nimport (\n "fmt"\n "os"\n "sort"\n)\n\nfunc main() {\n entries, err := os.ReadDir(".")\n if err != nil {\n panic(err)\n }\n var names []string\n for _, entry := range entries {\n if !entry.IsDir() {\n names = append(names, entry.Name())\n }\n }\n sort.Sort(sort.Reverse(sort.StringSlice(names)))\n for _, name := range names {\n fmt.Println(name)\n }\n}',
c:
'#include <dirent.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/stat.h>\n\nstatic int compare_desc(const void *a, const void *b) {\n return strcmp(*(const char *const *)b, *(const char *const *)a);\n}\n\nint main(void) {\n DIR *dir = opendir(".");\n if (dir == NULL) {\n return 1;\n }\n char *names[1024];\n size_t count = 0;\n struct dirent *entry;\n while ((entry = readdir(dir)) != NULL && count < 1024) {\n struct stat info;\n if (stat(entry->d_name, &info) == 0 && S_ISREG(info.st_mode)) {\n names[count++] = strdup(entry->d_name);\n }\n }\n closedir(dir);\n qsort(names, count, sizeof(char *), compare_desc);\n for (size_t i = 0; i < count; i++) {\n printf("%s\\n", names[i]);\n free(names[i]);\n }\n return 0;\n}',
cpp:
"#include <algorithm>\n#include <filesystem>\n#include <iostream>\n#include <string>\n#include <vector>\n\nint main() {\n namespace fs = std::filesystem;\n std::vector<std::string> names;\n for (const auto &entry : fs::directory_iterator(\".\")) {\n if (entry.is_regular_file()) {\n names.push_back(entry.path().filename().string());\n }\n }\n std::sort(names.rbegin(), names.rend());\n for (const auto &name : names) {\n std::cout << name << '\\n';\n }\n}",
java:
'import java.io.File;\nimport java.util.Arrays;\nimport java.util.Comparator;\n\npublic class Main {\n public static void main(String[] args) {\n File[] entries = new File(".").listFiles();\n if (entries == null) {\n return;\n }\n String[] names = Arrays.stream(entries)\n .filter(File::isFile)\n .map(File::getName)\n .sorted(Comparator.reverseOrder())\n .toArray(String[]::new);\n for (String name : names) {\n System.out.println(name);\n }\n }\n}',
csharp:
'using System;\nusing System.IO;\nusing System.Linq;\n\nclass Program {\n static void Main() {\n var names = Directory.GetFiles(".")\n .Select(Path.GetFileName)\n .OrderByDescending(name => name, StringComparer.Ordinal);\n foreach (var name in names) {\n Console.WriteLine(name);\n }\n }\n}',
ruby:
'names = Dir.entries(".").select { |name| File.file?(name) }.sort.reverse\nnames.each { |name| puts name }',
},
list_files_arg_reverse_sort: {
rust:
'use std::env;\nuse std::fs;\n\nfn main() {\n let path = env::args().nth(1).unwrap_or_else(|| String::from("."));\n let mut names: Vec<String> = fs::read_dir(&path)\n .expect("failed to read directory")\n .filter_map(|entry| entry.ok())\n .filter(|entry| entry.path().is_file())\n .map(|entry| entry.file_name().to_string_lossy().into_owned())\n .collect();\n names.sort_by(|a, b| b.cmp(a));\n for name in names {\n println!("{name}");\n }\n}',
python:
'import os\nimport sys\n\npath = sys.argv[1] if len(sys.argv) > 1 else "."\nnames = sorted(\n (\n name\n for name in os.listdir(path)\n if os.path.isfile(os.path.join(path, name))\n ),\n reverse=True,\n)\nfor name in names:\n print(name)',
javascript:
'const fs = require("fs");\nconst path = require("path");\n\nconst dir = process.argv[2] || ".";\nconst names = fs\n .readdirSync(dir)\n .filter((name) => fs.statSync(path.join(dir, name)).isFile())\n .sort()\n .reverse();\n\nfor (const name of names) {\n console.log(name);\n}',
typescript:
'import * as fs from "fs";\nimport * as path from "path";\n\nconst dir: string = process.argv[2] ?? ".";\nconst names: string[] = fs\n .readdirSync(dir)\n .filter((name) => fs.statSync(path.join(dir, name)).isFile())\n .sort()\n .reverse();\n\nfor (const name of names) {\n console.log(name);\n}',
go:
'package main\n\nimport (\n "fmt"\n "os"\n "sort"\n)\n\nfunc main() {\n dir := "."\n if len(os.Args) > 1 {\n dir = os.Args[1]\n }\n entries, err := os.ReadDir(dir)\n if err != nil {\n panic(err)\n }\n var names []string\n for _, entry := range entries {\n if !entry.IsDir() {\n names = append(names, entry.Name())\n }\n }\n sort.Sort(sort.Reverse(sort.StringSlice(names)))\n for _, name := range names {\n fmt.Println(name)\n }\n}',
c:
'#include <dirent.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/stat.h>\n\nstatic int compare_desc(const void *a, const void *b) {\n return strcmp(*(const char *const *)b, *(const char *const *)a);\n}\n\nint main(int argc, char *argv[]) {\n const char *path = argc > 1 ? argv[1] : ".";\n DIR *dir = opendir(path);\n if (dir == NULL) {\n return 1;\n }\n char *names[1024];\n size_t count = 0;\n struct dirent *entry;\n while ((entry = readdir(dir)) != NULL && count < 1024) {\n char full[4096];\n snprintf(full, sizeof(full), "%s/%s", path, entry->d_name);\n struct stat info;\n if (stat(full, &info) == 0 && S_ISREG(info.st_mode)) {\n names[count++] = strdup(entry->d_name);\n }\n }\n closedir(dir);\n qsort(names, count, sizeof(char *), compare_desc);\n for (size_t i = 0; i < count; i++) {\n printf("%s\\n", names[i]);\n free(names[i]);\n }\n return 0;\n}',
cpp:
"#include <algorithm>\n#include <filesystem>\n#include <iostream>\n#include <string>\n#include <vector>\n\nint main(int argc, char *argv[]) {\n namespace fs = std::filesystem;\n std::string path = argc > 1 ? argv[1] : \".\";\n std::vector<std::string> names;\n for (const auto &entry : fs::directory_iterator(path)) {\n if (entry.is_regular_file()) {\n names.push_back(entry.path().filename().string());\n }\n }\n std::sort(names.rbegin(), names.rend());\n for (const auto &name : names) {\n std::cout << name << '\\n';\n }\n}",
java:
'import java.io.File;\nimport java.util.Arrays;\nimport java.util.Comparator;\n\npublic class Main {\n public static void main(String[] args) {\n String path = args.length > 0 ? args[0] : ".";\n File[] entries = new File(path).listFiles();\n if (entries == null) {\n return;\n }\n String[] names = Arrays.stream(entries)\n .filter(File::isFile)\n .map(File::getName)\n .sorted(Comparator.reverseOrder())\n .toArray(String[]::new);\n for (String name : names) {\n System.out.println(name);\n }\n }\n}',
csharp:
'using System;\nusing System.IO;\nusing System.Linq;\n\nclass Program {\n static void Main(string[] args) {\n var path = args.Length > 0 ? args[0] : ".";\n var names = Directory.GetFiles(path)\n .Select(Path.GetFileName)\n .OrderByDescending(name => name, StringComparer.Ordinal);\n foreach (var name in names) {\n Console.WriteLine(name);\n }\n }\n}',
ruby:
'path = ARGV[0] || "."\nnames = Dir.entries(path).select { |name| File.file?(File.join(path, name)) }.sort.reverse\nnames.each { |name| puts name }',
},
fizzbuzz: {
rust:
"fn main() {\n for number in 1..=15 {\n if number % 15 == 0 {\n println!(\"FizzBuzz\");\n } else if number % 3 == 0 {\n println!(\"Fizz\");\n } else if number % 5 == 0 {\n println!(\"Buzz\");\n } else {\n println!(\"{number}\");\n }\n }\n}",
python:
"for number in range(1, 16):\n if number % 15 == 0:\n print(\"FizzBuzz\")\n elif number % 3 == 0:\n print(\"Fizz\")\n elif number % 5 == 0:\n print(\"Buzz\")\n else:\n print(number)",
javascript:
"for (let number = 1; number <= 15; number += 1) {\n if (number % 15 === 0) {\n console.log(\"FizzBuzz\");\n } else if (number % 3 === 0) {\n console.log(\"Fizz\");\n } else if (number % 5 === 0) {\n console.log(\"Buzz\");\n } else {\n console.log(number);\n }\n}",
typescript:
"for (let number = 1; number <= 15; number += 1) {\n if (number % 15 === 0) {\n console.log(\"FizzBuzz\");\n } else if (number % 3 === 0) {\n console.log(\"Fizz\");\n } else if (number % 5 === 0) {\n console.log(\"Buzz\");\n } else {\n console.log(number);\n }\n}",
go:
"package main\n\nimport \"fmt\"\n\nfunc main() {\n for number := 1; number <= 15; number++ {\n switch {\n case number%15 == 0:\n fmt.Println(\"FizzBuzz\")\n case number%3 == 0:\n fmt.Println(\"Fizz\")\n case number%5 == 0:\n fmt.Println(\"Buzz\")\n default:\n fmt.Println(number)\n }\n }\n}",
c:
"#include <stdio.h>\n\nint main(void) {\n for (int number = 1; number <= 15; number++) {\n if (number % 15 == 0) {\n puts(\"FizzBuzz\");\n } else if (number % 3 == 0) {\n puts(\"Fizz\");\n } else if (number % 5 == 0) {\n puts(\"Buzz\");\n } else {\n printf(\"%d\\n\", number);\n }\n }\n return 0;\n}",
cpp:
"#include <iostream>\n\nint main() {\n for (int number = 1; number <= 15; number++) {\n if (number % 15 == 0) {\n std::cout << \"FizzBuzz\\n\";\n } else if (number % 3 == 0) {\n std::cout << \"Fizz\\n\";\n } else if (number % 5 == 0) {\n std::cout << \"Buzz\\n\";\n } else {\n std::cout << number << '\\n';\n }\n }\n}",
java:
"public class Main {\n public static void main(String[] args) {\n for (int number = 1; number <= 15; number++) {\n if (number % 15 == 0) {\n System.out.println(\"FizzBuzz\");\n } else if (number % 3 == 0) {\n System.out.println(\"Fizz\");\n } else if (number % 5 == 0) {\n System.out.println(\"Buzz\");\n } else {\n System.out.println(number);\n }\n }\n }\n}",
csharp:
"using System;\n\nclass Program {\n static void Main() {\n for (int number = 1; number <= 15; number++) {\n if (number % 15 == 0) {\n Console.WriteLine(\"FizzBuzz\");\n } else if (number % 3 == 0) {\n Console.WriteLine(\"Fizz\");\n } else if (number % 5 == 0) {\n Console.WriteLine(\"Buzz\");\n } else {\n Console.WriteLine(number);\n }\n }\n }\n}",
ruby:
"(1..15).each do |number|\n if (number % 15).zero?\n puts \"FizzBuzz\"\n elsif (number % 3).zero?\n puts \"Fizz\"\n elsif (number % 5).zero?\n puts \"Buzz\"\n else\n puts number\n end\nend",
},
factorial: {
rust:
"fn main() {\n let mut result: u64 = 1;\n for number in 1..=5 {\n result *= number;\n }\n println!(\"{result}\");\n}",
python:
"result = 1\nfor number in range(1, 6):\n result *= number\nprint(result)",
javascript:
"let result = 1;\nfor (let number = 1; number <= 5; number += 1) {\n result *= number;\n}\nconsole.log(result);",
typescript:
"let result = 1;\nfor (let number = 1; number <= 5; number += 1) {\n result *= number;\n}\nconsole.log(result);",
go:
"package main\n\nimport \"fmt\"\n\nfunc main() {\n result := 1\n for number := 1; number <= 5; number++ {\n result *= number\n }\n fmt.Println(result)\n}",
c:
"#include <stdio.h>\n\nint main(void) {\n unsigned long long result = 1;\n for (int number = 1; number <= 5; number++) {\n result *= number;\n }\n printf(\"%llu\\n\", result);\n return 0;\n}",
cpp:
"#include <iostream>\n\nint main() {\n unsigned long long result = 1;\n for (int number = 1; number <= 5; number++) {\n result *= number;\n }\n std::cout << result << '\\n';\n}",
java:
"public class Main {\n public static void main(String[] args) {\n long result = 1;\n for (int number = 1; number <= 5; number++) {\n result *= number;\n }\n System.out.println(result);\n }\n}",
csharp:
"using System;\n\nclass Program {\n static void Main() {\n long result = 1;\n for (int number = 1; number <= 5; number++) {\n result *= number;\n }\n Console.WriteLine(result);\n }\n}",
ruby:
"result = (1..5).reduce(1, :*)\nputs result",
},
reverse_string: {
rust:
"fn main() {\n let text = \"hello\";\n let reversed: String = text.chars().rev().collect();\n println!(\"{reversed}\");\n}",
python:
"text = \"hello\"\nprint(text[::-1])",
javascript:
"const text = \"hello\";\nconsole.log(text.split(\"\").reverse().join(\"\"));",
typescript:
"const text: string = \"hello\";\nconsole.log(text.split(\"\").reverse().join(\"\"));",
go:
"package main\n\nimport \"fmt\"\n\nfunc main() {\n text := \"hello\"\n runes := []rune(text)\n for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n runes[i], runes[j] = runes[j], runes[i]\n }\n fmt.Println(string(runes))\n}",
c:
"#include <stdio.h>\n#include <string.h>\n\nint main(void) {\n char text[] = \"hello\";\n size_t length = strlen(text);\n for (size_t i = 0; i < length / 2; i++) {\n char temp = text[i];\n text[i] = text[length - 1 - i];\n text[length - 1 - i] = temp;\n }\n puts(text);\n return 0;\n}",
cpp:
"#include <algorithm>\n#include <iostream>\n#include <string>\n\nint main() {\n std::string text = \"hello\";\n std::reverse(text.begin(), text.end());\n std::cout << text << '\\n';\n}",
java:
"public class Main {\n public static void main(String[] args) {\n String text = \"hello\";\n System.out.println(new StringBuilder(text).reverse().toString());\n }\n}",
csharp:
"using System;\n\nclass Program {\n static void Main() {\n var text = \"hello\".ToCharArray();\n Array.Reverse(text);\n Console.WriteLine(new string(text));\n }\n}",
ruby:
"text = \"hello\"\nputs text.reverse",
},
sum_to_ten: {
rust:
"fn main() {\n let total: u32 = (1..=10).sum();\n println!(\"{total}\");\n}",
python:
"total = sum(range(1, 11))\nprint(total)",
javascript:
"let total = 0;\nfor (let number = 1; number <= 10; number += 1) {\n total += number;\n}\nconsole.log(total);",
typescript:
"let total = 0;\nfor (let number = 1; number <= 10; number += 1) {\n total += number;\n}\nconsole.log(total);",
go:
"package main\n\nimport \"fmt\"\n\nfunc main() {\n total := 0\n for number := 1; number <= 10; number++ {\n total += number\n }\n fmt.Println(total)\n}",
c:
"#include <stdio.h>\n\nint main(void) {\n int total = 0;\n for (int number = 1; number <= 10; number++) {\n total += number;\n }\n printf(\"%d\\n\", total);\n return 0;\n}",
cpp:
"#include <iostream>\n\nint main() {\n int total = 0;\n for (int number = 1; number <= 10; number++) {\n total += number;\n }\n std::cout << total << '\\n';\n}",
java:
"public class Main {\n public static void main(String[] args) {\n int total = 0;\n for (int number = 1; number <= 10; number++) {\n total += number;\n }\n System.out.println(total);\n }\n}",
csharp:
"using System;\n\nclass Program {\n static void Main() {\n int total = 0;\n for (int number = 1; number <= 10; number++) {\n total += number;\n }\n Console.WriteLine(total);\n }\n}",
ruby:
"total = (1..10).sum\nputs total",
},
// Issue #334: recursive `fibonacci` function evaluated at the 10th term (55).
fibonacci: {
rust:
"fn fibonacci(n: u64) -> u64 {\n if n <= 2 {\n 1\n } else {\n fibonacci(n - 1) + fibonacci(n - 2)\n }\n}\n\nfn main() {\n println!(\"{}\", fibonacci(10));\n}",
python:
"def fibonacci(n):\n if n <= 2:\n return 1\n return fibonacci(n - 1) + fibonacci(n - 2)\n\n\nprint(fibonacci(10))",
javascript:
"function fibonacci(n) {\n if (n <= 2) {\n return 1;\n }\n return fibonacci(n - 1) + fibonacci(n - 2);\n}\n\nconsole.log(fibonacci(10));",
typescript:
"function fibonacci(n: number): number {\n if (n <= 2) {\n return 1;\n }\n return fibonacci(n - 1) + fibonacci(n - 2);\n}\n\nconsole.log(fibonacci(10));",
go:
"package main\n\nimport \"fmt\"\n\nfunc fibonacci(n int) int {\n if n <= 2 {\n return 1\n }\n return fibonacci(n-1) + fibonacci(n-2)\n}\n\nfunc main() {\n fmt.Println(fibonacci(10))\n}",
c:
"#include <stdio.h>\n\nunsigned long long fibonacci(int n) {\n if (n <= 2) {\n return 1;\n }\n return fibonacci(n - 1) + fibonacci(n - 2);\n}\n\nint main(void) {\n printf(\"%llu\\n\", fibonacci(10));\n return 0;\n}",
cpp:
"#include <iostream>\n\nunsigned long long fibonacci(int n) {\n if (n <= 2) {\n return 1;\n }\n return fibonacci(n - 1) + fibonacci(n - 2);\n}\n\nint main() {\n std::cout << fibonacci(10) << '\\n';\n}",
java:
"public class Main {\n static long fibonacci(int n) {\n if (n <= 2) {\n return 1;\n }\n return fibonacci(n - 1) + fibonacci(n - 2);\n }\n\n public static void main(String[] args) {\n System.out.println(fibonacci(10));\n }\n}",
csharp:
"using System;\n\nclass Program {\n static long Fibonacci(int n) {\n if (n <= 2) {\n return 1;\n }\n return Fibonacci(n - 1) + Fibonacci(n - 2);\n }\n\n static void Main() {\n Console.WriteLine(Fibonacci(10));\n }\n}",
ruby:
"def fibonacci(n)\n return 1 if n <= 2\n\n fibonacci(n - 1) + fibonacci(n - 2)\nend\n\nputs fibonacci(10)",
},
};
function normalizeProgramPrompt(prompt) {
return normalizePrompt(String(prompt || "").replace(/c\+\+/gi, " cpp ").replace(/c#/gi, " csharp "));
}
// CJK scripts have no inter-word spaces, so the whitespace-based phrase/token
// matchers never isolate a CJK word. When the expected alias itself contains a
// CJK ideograph we fall back to a substring test (issue #312). Mirrors
// `coding::catalog::contains_cjk` on the Rust side.
function containsCjk(text) {
return /[㐀-䶿一-鿿豈--ヿ-ㄯ]/.test(
String(text || ""),
);
}
// Devanagari (Hindi, …) is written without spaces between words, so the
// whitespace-based phrase/token matchers never isolate a Devanagari word —
// exactly as for CJK above. Mirrors `coding::catalog::contains_devanagari` on
// the Rust side (range U+0900–U+097F): lets a handler split a role's word forms
// by script (Devanagari vs. Han) straight from the seed, so the head-final
// Hindi and Chinese extraction strategies never name a raw word (issue #386).
function containsDevanagari(text) {
return /[ऀ-ॿ]/.test(String(text || ""));
}
// Whether every character of `text` is ASCII. Mirrors Rust's `str::is_ascii`:
// the calculator-domain signal builder shapes a surface differently by script,
// matching an ASCII code on a word boundary but a non-ASCII surface as a raw
// substring (issue #386).
function isAsciiText(text) {
return /^[\x00-\x7f]*$/.test(String(text || ""));
}
function containsProgramToken(normalized, token) {
if (containsCjk(token)) return String(normalized || "").includes(token);
return String(normalized || "")
.split(/\s+/)
.includes(token);
}
function containsProgramPhrase(normalized, phrase) {
if (containsCjk(phrase)) return normalized.includes(phrase);
return (
normalized === phrase ||
normalized.startsWith(`${phrase} `) ||
normalized.endsWith(` ${phrase}`) ||
normalized.includes(` ${phrase} `)
);
}
function programTaskFromPrompt(normalized) {
// The request phrasings live in each task's `program_task_<slug>` meaning, not
// inline on WRITE_PROGRAM_TASKS — read them by slug (issue #386). Declaration
// order (Object.keys) is the catalog priority order, identical to Rust.
return (
Object.keys(WRITE_PROGRAM_TASKS).find((slug) =>
wordsForMeaning(`program_task_${slug}`).some((alias) =>
containsProgramPhrase(normalized, alias),
),
) || null
);
}
// Issue #386: the function words that introduce an *unknown* implementation
// language ("write a program in <name>", "на языке <name>") are seed data, not
// literals baked into the worker. Mirror src/intent_formalization.rs by sourcing
// the head-initial English/Russian surfaces of the target-preposition and
// "language" noun roles from the lexicon. The WRITE_PROGRAM_LANGUAGES catalog
// scan below already resolves every *known* language across all four supported
// languages; this fallback only reads the bare name trailing the marker, so it
// consults the two head-initial languages whose name follows the marker (the
// head-final Hindi/Chinese surfaces are carried in the seed for coverage but
// place the name before the marker, which this scan does not chase).
const ROLE_IMPLEMENTATION_LANGUAGE_PREPOSITION =
"implementation_language_preposition";
const ROLE_IMPLEMENTATION_LANGUAGE_NOUN = "implementation_language_noun";
function programLanguageFromPrompt(normalized) {
const tokens = normalized.split(/\s+/).filter(Boolean);
// Each language's alias surfaces live in its `program_language_<slug>` meaning,
// not inline on WRITE_PROGRAM_LANGUAGES — read them by slug (issue #386). Names
// are single tokens, matched on whitespace boundaries exactly as in Rust.
for (const slug of Object.keys(WRITE_PROGRAM_LANGUAGES)) {
const surfaces = wordsForMeaning(`program_language_${slug}`);
if (surfaces.some((alias) => tokens.includes(alias))) return slug;
}
const prepositionSurfaces = wordsForRoleInLanguages(
ROLE_IMPLEMENTATION_LANGUAGE_PREPOSITION,
["en", "ru"],
);
const languageNounSurfaces = wordsForRoleInLanguages(
ROLE_IMPLEMENTATION_LANGUAGE_NOUN,
["en", "ru"],
);
for (let index = 0; index < tokens.length - 1; index += 1) {
if (!prepositionSurfaces.includes(tokens[index])) continue;
if (languageNounSurfaces.includes(tokens[index + 1])) {
return tokens[index + 2] || null;
}
return tokens[index + 1];
}
return null;
}
// ---------------------------------------------------------------------------
// Issue #324 R4/R7: the program-modification step as a data-driven Links
// Notation substitution pipeline. This mirrors `src/program_plan.rs` (the
// pipeline) and `src/substitution.rs` (the engine). The rule text below is
// byte-identical to `data/seed/program-plan-rules.lino`; the parity experiment
// (`experiments/issue-324-js-worker.mjs`) keeps the two copies in lockstep.
//
// Adding a new modifier transform is rule data; recognition is constrained by
// the operation slugs declared in that rule data.
// ---------------------------------------------------------------------------
const PROGRAM_PLAN_RULES_LINO = [
"substitution_rules",
' id "program_plan_rules"',
' rule "path_argument_list_files"',
' order "10"',
' event "manual"',
' when "request:modifier -> path_argument"',
' replace "request:task -> list_files"',
' with "request:task -> list_files_arg"',
' rule "path_argument_list_files_reverse_sort"',
' order "10"',
' event "manual"',
' when "request:modifier -> path_argument"',
' replace "request:task -> list_files_reverse_sort"',
' with "request:task -> list_files_arg_reverse_sort"',
' rule "reverse_sort_list_files"',
' order "20"',
' event "manual"',
' when "request:modifier -> reverse_sort"',
' replace "request:task -> list_files"',
' with "request:task -> list_files_reverse_sort"',
' rule "reverse_sort_list_files_arg"',
' order "20"',
' event "manual"',
' when "request:modifier -> reverse_sort"',
' replace "request:task -> list_files_arg"',
' with "request:task -> list_files_arg_reverse_sort"',
"",
].join("\n");
const TASK_NODE = "request:task";
const MODIFIER_NODE = "request:modifier";
// Issue #386: the FULL multilingual operation vocabulary, embedded inline and
// byte-identical to data/seed/operation-vocabulary.lino (regenerated by
// experiments/issue-386-sync-worker-lexicon.mjs). The JS mirror of
// OperationVocabulary in src/seed/operation_vocabulary.rs: the CODE matches
// canonical concept tokens (write / function / similar_elements / reverse_sort …),
// while the per-language surface phrases live once here in the seed data — never
// a hardcoded per-language word list in code.
const OPERATION_VOCABULARY_LINO = [
"operation_vocabulary",
' operation "uppercase"',
' language "en"',
' phrase "uppercase"',
' phrase "upper case"',
' language "ru"',
' phrase "верхний регистр"',
' phrase "заглавными буквами"',
' phrase "прописными буквами"',
' combo "верхний+регистр"',
' language "hi"',
' phrase "बड़े अक्षर"',
' phrase "अपरकेस"',
' language "zh"',
' phrase "大写"',
' operation "lowercase"',
' language "en"',
' phrase "lowercase"',
' phrase "lower case"',
' language "ru"',
' phrase "нижний регистр"',
' phrase "строчными буквами"',
' combo "нижний+регистр"',
' language "hi"',
' phrase "छोटे अक्षर"',
' phrase "लोअरकेस"',
' language "zh"',
' phrase "小写"',
' operation "replace"',
' language "en"',
' phrase "replace"',
' language "ru"',
' phrase "замен"',
' language "hi"',
' phrase "बदल"',
' language "zh"',
' phrase "替换"',
' operation "reverse_words"',
' language "en"',
' phrase "reverse words"',
' phrase "reverse the words"',
' language "ru"',
' phrase "обратный порядок слов"',
' combo "переверни+слова"',
' combo "обрати+слова"',
' combo "разверни+слова"',
' language "hi"',
' phrase "शब्दों को उल्टा"',
' combo "शब्द+उल्टा"',
' language "zh"',
' phrase "反转单词"',
' phrase "倒转单词"',
' phrase "颠倒单词"',
' operation "extract_email"',
' language "en"',
' combo "extract+email"',
' combo "extract+e-mail"',
' language "ru"',
' combo "извлеки+имейл"',
' combo "извлеки+почт"',
' combo "извлечь+имейл"',
' combo "найди+имейл"',
' language "hi"',
' combo "ईमेल+निकाल"',
' language "zh"',
' phrase "提取邮箱"',
' phrase "提取电子邮件"',
' phrase "提取邮件"',
' operation "count_occurrences"',
' language "en"',
' phrase "count occurrences"',
' language "ru"',
' phrase "количество вхождений"',
' combo "посчитай+вхождени"',
' combo "подсчитай+вхождени"',
' combo "сколько+раз"',
' language "hi"',
' phrase "कितनी बार"',
' combo "बार+गिन"',
' language "zh"',
' phrase "出现次数"',
' phrase "统计出现"',
' phrase "计算出现"',
' operation "count_unique_words"',
' language "en"',
' phrase "count unique words"',
' phrase "count distinct words"',
' language "ru"',
' phrase "количество уникальных слов"',
' combo "уникальн+слов"',
' combo "различн+слов"',
' language "hi"',
' combo "अद्वितीय+शब्द"',
' combo "विशिष्ट+शब्द"',
' language "zh"',
' phrase "唯一单词"',
' phrase "不同单词"',
' phrase "统计唯一"',
' operation "deduplicate_lines"',
' language "en"',
' phrase "deduplicate lines"',
' phrase "dedupe lines"',
' combo "deduplicate+line"',
' language "ru"',
' combo "дубликат+строк"',
' combo "дедупликац+строк"',
' language "hi"',
' combo "डुप्लिकेट+लाइन"',
' combo "दोहराव+लाइन"',
' language "zh"',
' phrase "去重行"',
' phrase "行去重"',
' phrase "删除重复行"',
' operation "sort_lines"',
' language "en"',
' phrase "sort lines"',
' phrase "sort the lines"',
' combo "sort+line"',
' language "ru"',
' combo "сортир+строк"',
' language "hi"',
' combo "लाइन+क्रमबद्ध"',
' combo "लाइनों+क्रमबद्ध"',
' language "zh"',
' phrase "排序行"',
' phrase "行排序"',
' phrase "对行排序"',
' operation "path_argument"',
' language "en"',
' phrase "path argument"',
' phrase "path as an argument"',
' combo "path+argument"',
' language "ru"',
' combo "путь+аргумент"',
' combo "путь+аргумента"',
' combo "путь+аргументом"',
' language "hi"',
' phrase "पथ को तर्क"',
' combo "पथ+तर्क"',
' language "zh"',
' phrase "路径作为参数"',
' combo "路径+参数"',
' operation "reverse_sort"',
' language "en"',
' phrase "reverse sort"',
' phrase "reverse sorted"',
' phrase "sort in reverse order"',
' phrase "sort the results in reverse order"',
' phrase "reverse order"',
' phrase "descending order"',
' combo "sort+reverse"',
' combo "sort+descending"',
' language "ru"',
' phrase "в обратном порядке"',
' combo "сортиров+обратн"',
' combo "отсортир+обратн"',
' language "hi"',
' phrase "उल्टे क्रम"',
' combo "क्रमबद्ध+उल्टे"',
' combo "क्रमबद्ध+उल्टा"',
' language "zh"',
' phrase "相反顺序排序"',
' combo "排序+相反"',
' combo "排序+反向"',
' combo "排序+倒序"',
' operation "cancel_reverse_sort"',
' inverse "reverse_sort"',
' language "en"',
' phrase "cancel sort"',
' phrase "cancel the sort"',
' phrase "cancel sorting"',
' phrase "cancel the sorting"',
' phrase "undo sort"',
' phrase "undo the sort"',
' phrase "undo sorting"',
' phrase "undo the sorting"',
' phrase "remove sort"',
' phrase "remove the sort"',
' phrase "remove sorting"',
' phrase "remove the sorting"',
' phrase "no sorting"',
' phrase "without sorting"',
' combo "cancel+sort"',
' combo "undo+sort"',
' combo "remove+sort"',
' language "ru"',
' phrase "отмени сортировку"',
' phrase "отмените сортировку"',
' phrase "убери сортировку"',
' phrase "уберите сортировку"',
' phrase "без сортировки"',
' combo "отмени+сортиров"',
' combo "отмените+сортиров"',
' combo "отменить+сортиров"',
' combo "убери+сортиров"',
' combo "уберите+сортиров"',
' combo "убрать+сортиров"',
' combo "без+сортиров"',
' language "hi"',
' phrase "सॉर्ट हटाओ"',
' phrase "क्रम हटाओ"',
' phrase "सॉर्ट रद्द करो"',
' combo "सॉर्ट+हटा"',
' combo "क्रमबद्ध+हटा"',
' combo "सॉर्ट+रद्द"',
' language "zh"',
' phrase "取消排序"',
' phrase "撤销排序"',
' phrase "去掉排序"',
' phrase "取消排序顺序"',
' combo "取消+排序"',
' combo "撤销+排序"',
' operation "function"',
' language "en"',
' phrase "function"',
' language "ru"',
' phrase "функция"',
' phrase "функцию"',
' phrase "функции"',
' language "hi"',
' phrase "फ़ंक्शन"',
' phrase "फंक्शन"',
' language "zh"',
' phrase "函数"',
' operation "implement"',
' language "en"',
' phrase "implement"',
' language "ru"',
' phrase "реализуй"',
' phrase "реализовать"',
' phrase "реализуйте"',
' language "hi"',
' phrase "लागू करें"',
' phrase "लागू करो"',
' language "zh"',
' phrase "实现"',
' operation "write"',
' language "en"',
' phrase "write"',
' language "ru"',
' phrase "напиши"',
' phrase "напишите"',
' phrase "написать"',
' language "hi"',
' phrase "लिखें"',
' phrase "लिखो"',
' language "zh"',
' phrase "编写"',
' phrase "写"',
' operation "return"',
' language "en"',
' phrase "return"',
' language "ru"',
' phrase "верни"',
' phrase "верните"',
' phrase "возвращает"',
' language "hi"',
' phrase "लौटाएँ"',
' phrase "लौटाएं"',
' phrase "वापस करें"',
' language "zh"',
' phrase "返回"',
' operation "tuple"',
' language "en"',
' phrase "tuple"',
' language "ru"',
' phrase "кортеж"',
' language "hi"',
' phrase "टपल"',
' language "zh"',
' phrase "元组"',
' operation "numbers"',
' language "en"',
' phrase "numbers"',
' phrase "number"',
' language "ru"',
' phrase "числа"',
' phrase "чисел"',
' language "hi"',
' phrase "संख्याएँ"',
' phrase "संख्याएं"',
' phrase "संख्या"',
' language "zh"',
' phrase "数字"',
' phrase "数值"',
' operation "vowels"',
' language "en"',
' phrase "vowels"',
' phrase "vowel"',
' language "ru"',
' phrase "гласные"',
' phrase "гласных"',
' language "hi"',
' phrase "स्वर"',
' phrase "स्वरों"',
' language "zh"',
' phrase "元音"',
' operation "count_vowels"',
' language "en"',
' phrase "count vowels"',
' phrase "number of vowels"',
' phrase "count_vowels"',
' language "ru"',
' phrase "посчитай гласные"',
' phrase "количество гласных"',
' language "hi"',
' phrase "स्वर गिनें"',
' phrase "स्वरों की संख्या"',
' language "zh"',
' phrase "统计元音"',
' phrase "元音数量"',
' operation "similar_elements"',
' language "en"',
' phrase "similar elements"',
' phrase "similar_elements"',
' language "ru"',
' phrase "общие элементы"',
' phrase "похожие элементы"',
' language "hi"',
' phrase "समान तत्व"',
' language "zh"',
' phrase "相同元素"',
' phrase "相似元素"',
' operation "distinct_numbers"',
' language "en"',
' phrase "distinct numbers"',
' language "ru"',
' phrase "различные числа"',
' phrase "разных числа"',
' language "hi"',
' phrase "अलग संख्याएँ"',
' phrase "अलग संख्याएं"',
' language "zh"',
' phrase "不同数字"',
' phrase "不同数值"',
' operation "differ"',
' language "en"',
' phrase "differ"',
' language "ru"',
' phrase "отличаются"',
' phrase "разница"',
' language "hi"',
' phrase "अंतर"',
' language "zh"',
' phrase "相差"',
' phrase "差"',
' operation "threshold"',
' language "en"',
' phrase "threshold"',
' language "ru"',
' phrase "порог"',
' phrase "порога"',
' language "hi"',
' phrase "सीमा"',
' language "zh"',
' phrase "阈值"',
].join("\n");
let cachedOperationVocabulary = null;
// Parse the embedded operation vocabulary into language-pooled triggers
// ({ slug, phrases, combos, inverse? }). Mirrors operation_vocabulary() in
// src/seed/operation_vocabulary.rs; phrases/combos are pooled across every
// language because operationFormMatches (below) is language-agnostic.
function operationVocabulary() {
if (cachedOperationVocabulary) return cachedOperationVocabulary;
const root = parseLinoTree(OPERATION_VOCABULARY_LINO);
const container =
root.children.find((child) => child.name === "operation_vocabulary") || root;
const operations = [];
for (const operationNode of container.children) {
if (operationNode.name !== "operation") continue;
const phrases = [];
const combos = [];
let inverse = null;
for (const child of operationNode.children) {
if (child.name === "inverse") inverse = child.value;
else if (child.name === "language") {
for (const form of child.children) {
if (form.name === "phrase") phrases.push(form.value);
else if (form.name === "combo") {
combos.push(
form.value
.split("+")
.map((token) => token.trim())
.filter(Boolean),
);
}
}
}
}
const operation = { slug: operationNode.value, phrases, combos };
if (inverse) operation.inverse = inverse;
operations.push(operation);
}
cachedOperationVocabulary = operations;
return cachedOperationVocabulary;
}
let cachedProgramModifierSlugs = null;
function literalPatternValue(node) {
return node && node.kind === "literal" ? node.value : null;
}
function programModifierSlugs() {
if (cachedProgramModifierSlugs) return cachedProgramModifierSlugs;
const slugs = new Set();
for (const rule of programPlanRules().rules) {
for (const condition of rule.conditions || []) {
const from = literalPatternValue(condition.from);
const to = literalPatternValue(condition.to);
if (from === MODIFIER_NODE && to) slugs.add(to);
}
}
cachedProgramModifierSlugs = slugs;
return slugs;
}
function operationFormMatches(normalized, operation) {
const source = String(normalized || "");
return (
(operation.phrases || []).some((phrase) => source.includes(phrase)) ||
(operation.combos || []).some((combo) =>
combo.every((token) => source.includes(String(token || ""))),
)
);
}
// Issue #386: every canonical operation token whose phrasing appears in
// `normalized`, in declaration order. Mirrors OperationVocabulary::detect in
// src/seed/operation_vocabulary.rs (substring match, so a native verb still
// matches when punctuation such as the danda `।` is glued to it).
function detectOperations(normalized) {
const detected = [];
for (const operation of operationVocabulary()) {
if (operationFormMatches(normalized, operation)) detected.push(operation.slug);
}
return detected;
}
// Issue #386: append canonical English operation tokens to a normalized prompt so
// handlers keep matching canonical concepts while accepting native verbs from
// data/seed/operation-vocabulary.lino. Mirrors
// OperationVocabulary::canonicalized_prompt — additive (never removes text), so
// English prompts are unchanged and multilingual prompts gain boundary-matchable
// tokens (e.g. a Hindi "लिखें।" yields an appended " write").
function canonicalizedPrompt(normalized) {
const detected = detectOperations(normalized);
if (!detected.length) return String(normalized || "");
let out = String(normalized || "");
for (const canonical of detected) {
out += ` ${canonical}`;
const phrase = canonical.replace(/_/g, " ");
if (phrase !== canonical) out += ` ${phrase}`;
}
return out;
}
// Issue #386: the language-independent *meaning* lexicon — the JS mirror of
// `data/seed/meanings.lino` and `src/seed/meanings.rs`. Recognition references
// semantic *roles* (which surface words evidence a program artifact / a program
// modification, in any language), never a hardcoded per-language word list. This
// is an inline, byte-identical copy of the canonical seed (the same convention
// as PROGRAM_PLAN_RULES_LINO) so the worker stays self-contained when no seed has
// been fetched; parity is guarded by `experiments/issue-386-js-cancel-sort.mjs`.
const MEANINGS_LINO = [
"meanings",
' meaning "result"',
' gloss "the value or data a computation produces"',
' wiktionary "result"',
' defined_by "output"',
' role "program_artifact"',
' lexeme "en"',
' word "result"',
' description "English noun for the value or data a computation produces; the lemma surface for the result concept."',
' word "results"',
' description "English noun, the plural form of result, for several values a computation produces."',
' lexeme "ru"',
' word "результат"',
' description "Russian noun (romanized rezultat) in the nominative for a computation result; the lemma surface for the result concept."',
' word "результата"',
' description "Russian noun (romanized rezultata), the genitive singular of result, naming the same computation result."',
' word "результаты"',
' description "Russian noun (romanized rezultaty), the nominative plural of result, for several computation results."',
' word "результатов"',
' description "Russian noun (romanized rezultatov), the genitive plural of result, for several computation results."',
' lexeme "hi"',
' word "परिणाम"',
' description "Hindi noun (romanized parinaam) for the value or data a computation produces; the lemma surface for the result concept."',
' word "परिणामों"',
' description "Hindi noun (romanized parinaamon), an oblique plural of result, for several computation results."',
' word "नतीजा"',
' description "Hindi noun (romanized nateeja) for an outcome or result; an alternative Hindi surface for the result concept."',
' word "नतीजे"',
' description "Hindi noun (romanized nateeje), the plural or oblique of nateeja, for outcomes or results."',
' lexeme "zh"',
' word "结果"',
' description "Chinese noun (pinyin jieguo) for the value or outcome a computation produces; the Chinese surface for the result concept."',
' meaning "output"',
' gloss "what a program emits — prints or returns — when it runs"',
' wiktionary "output"',
' defined_by "result"',
' defined_by "program"',
' role "program_artifact"',
' lexeme "en"',
' word "output"',
' description "English noun for what a program emits or returns when it runs; the lemma surface for the output concept."',
' lexeme "ru"',
' word "вывод"',
' description "Russian noun (romanized vyvod) for the output a program emits; the Russian surface for the output concept."',
' lexeme "hi"',
' word "आउटपुट"',
' description "Hindi noun (romanized aautaput, a loanword from English output) for what a program emits; the Hindi surface for the output concept."',
' lexeme "zh"',
' word "输出"',
' description "Chinese noun and verb (pinyin shuchu) for the output a program emits; the Chinese surface for the output concept."',
' meaning "program"',
" gloss \"a set of instructions a computer executes — the broad program genus. Beyond naming a program artifact and a program kind, it carries program_genus: the script-authoring recogniser reads that role to step aside whenever a prompt names a whole program, so a 'write a program' request keeps its richer parametric formalization instead of collapsing into a bare script.\"",
' wiktionary "program"',
' defined_by "code"',
' defined_by "entity"',
' role "program_artifact"',
' role "program_kind"',
' role "program_genus"',
' lexeme "en"',
' word "program"',
' description "English noun for a set of instructions a computer executes; the lemma surface for the program concept."',
' word "programme"',
' description "English noun, the British spelling of program, for the same set of executable instructions."',
' lexeme "ru"',
' word "программа"',
' description "Russian noun (romanized programma) in the nominative for a computer program; the lemma surface for the program concept."',
' word "программу"',
' description "Russian noun (romanized programmu), the accusative singular of program, naming the same computer program."',
' word "программе"',
' description "Russian noun (romanized programme), the dative or prepositional singular of program, naming the same computer program."',
' word "программы"',
' description "Russian noun (romanized programmy), the genitive singular or nominative plural of program, naming computer programs."',
' word "программку"',
' description "Russian noun (romanized programmku), the accusative of a diminutive of program, for a little program."',
' lexeme "hi"',
' word "प्रोग्राम"',
' description "Hindi noun (romanized program, a loanword) for a set of instructions a computer executes; the Hindi surface for the program concept."',
' lexeme "zh"',
' word "程序"',
' description "Chinese noun (pinyin chengxu) for a computer program or procedure; the Chinese surface for the program concept."',
' meaning "script"',
" gloss \"a short program, usually interpreted rather than compiled. It carries program_artifact and program_kind like any authorable artifact, and additionally script_or_code_artifact — the narrow noun side of 'write a script', the role the script-authoring recogniser pairs with an author verb to route a bare script request (as opposed to a whole program).\"",
' wiktionary "script"',
' defined_by "program"',
' defined_by "code"',
' role "program_artifact"',
' role "program_kind"',
' role "script_or_code_artifact"',
' lexeme "en"',
' word "script"',
' description "English noun for a short program that is usually interpreted rather than compiled; the lemma surface for the script concept."',
' lexeme "ru"',
' word "скрипт"',
' description "Russian noun (romanized skript) for a script or short program; the Russian surface for the script concept."',
' lexeme "hi"',
' word "स्क्रिप्ट"',
' description "Hindi noun (romanized skript, a loanword) for a short interpreted program; the Hindi surface for the script concept."',
' lexeme "zh"',
' word "脚本"',
' description "Chinese noun (pinyin jiaoben) for a script or short program; the Chinese surface for the script concept."',
' meaning "code"',
" gloss \"the text of a program, written in a programming language. Like script it carries program_artifact, program_kind, and script_or_code_artifact — so 'write me some code' pairs the same narrow artifact role with an author verb and routes a bare script request rather than a whole-program formalization.\"",
' wiktionary "code"',
' defined_by "program"',
' role "program_artifact"',
' role "program_kind"',
' role "script_or_code_artifact"',
' lexeme "en"',
' word "code"',
' description "English noun for the text of a program written in a programming language; the lemma surface for the code concept."',
' lexeme "ru"',
' word "код"',
' description "Russian noun (romanized kod) in the nominative for program code; the lemma surface for the code concept."',
' word "кода"',
' description "Russian noun (romanized koda), the genitive singular of code, naming the same program code."',
' word "коде"',
' description "Russian noun (romanized kode), the prepositional singular of code, naming the same program code."',
' lexeme "hi"',
' word "कोड"',
' description "Hindi noun (romanized kod, a loanword from English code) for the text of a program; the Hindi surface for the code concept."',
' lexeme "zh"',
' word "代码"',
' description "Chinese noun (pinyin daima) for program code; the Chinese surface for the code concept."',
' meaning "hello_world"',
" gloss \"the canonical hello-world archetype: the codebase's minimal first program, whose only job is to print the greeting 'hello world'. It is defined_by program (the smallest whole program) and code (its few lines of source), and carries hello_world_reference — the role the script-authoring recogniser reads to step aside, so naming the hello-world example routes through the dedicated program-synthesis path rather than the bare script route. Surface forms are the adjacent two-word greeting in each language, matched as a phrase (substring in CJK) so a stray 'hello' or 'world' alone never fires it.\"",
' wiktionary "hello world"',
' defined_by "program"',
' defined_by "code"',
' role "hello_world_reference"',
' lexeme "en"',
' word "hello world"',
" description \"English two-word phrase naming the archetypal first-program output; matched as a phrase so it fires only on the adjacent greeting, not a stray 'hello' or 'world'.\"",
' lexeme "ru"',
' word "привет мир"',
' description "Russian phrase (romanized privet mir, hello world) naming the archetypal first-program output."',
' word "хелло ворлд"',
" description \"Russian transliteration (romanized khello vorld) of the English 'hello world', as commonly written in programming tutorials.\"",
' lexeme "hi"',
' word "नमस्ते दुनिया"',
' description "Hindi phrase (romanized namaste duniya, hello world) naming the archetypal first-program output."',
' word "हैलो वर्ल्ड"',
" description \"Hindi transliteration (romanized hailo varld) of the English 'hello world', as commonly written in programming tutorials.\"",
' lexeme "zh"',
' word "你好世界"',
' description "Chinese phrase (pinyin nihao shijie, hello world) naming the archetypal first-program output; matched as a substring."',
' word "你好,世界"',
' description "Chinese phrase (pinyin nihao, shijie) with the conventional comma, the form often shown in programming tutorials."',
' meaning "sort"',
' gloss "to arrange items into an order; the resulting arrangement"',
' wiktionary "sort"',
' defined_by "order"',
' defined_by "action"',
' role "program_artifact"',
' role "program_modification"',
' lexeme "en"',
' word "sort"',
' description "English verb to arrange items into an order, and the noun for the resulting arrangement; the lemma surface for the sort concept."',
' word "sorts"',
' description "English verb, the third-person singular present of sort, for arranging items into an order."',
' word "sorting"',
' description "English gerund or present participle of sort, naming the act of arranging items into an order."',
' word "sorted"',
' description "English verb, the past tense or past participle of sort, for items that have been arranged into an order."',
' lexeme "ru"',
' word "сортировка"',
' description "Russian noun (romanized sortirovka) in the nominative for a sort or sorting; the lemma surface for the sort concept."',
' word "сортировку"',
' description "Russian noun (romanized sortirovku), the accusative singular of sorting, naming the same sort operation."',
' word "сортировки"',
' description "Russian noun (romanized sortirovki), the genitive singular or plural of sorting, naming sort operations."',
' word "сортировке"',
' description "Russian noun (romanized sortirovke), the dative or prepositional singular of sorting, naming the same sort operation."',
' word "сортировкой"',
' description "Russian noun (romanized sortirovkoy), the instrumental singular of sorting, naming the same sort operation."',
' word "сортировать"',
' description "Russian verb (romanized sortirovat), the imperfective infinitive, meaning to sort or arrange items into an order."',
' word "отсортируй"',
' description "Russian verb (romanized otsortiruy), the perfective informal imperative, commanding to sort the items."',
' word "отсортируйте"',
' description "Russian verb (romanized otsortiruyte), the perfective polite or plural imperative, commanding to sort the items."',
' word "отсортировать"',
' description "Russian verb (romanized otsortirovat), the perfective infinitive, meaning to sort or arrange items into an order."',
' lexeme "hi"',
' word "सॉर्ट"',
' description "Hindi verb or noun (romanized sort, a loanword) for sorting or arranging items into an order; the Hindi surface for the sort concept."',
' word "क्रमबद्ध"',
' description "Hindi adjective (romanized kramabaddh) meaning ordered or sorted; the native Hindi surface for arranged into an order."',
' lexeme "zh"',
' word "排序"',
' description "Chinese verb and noun (pinyin paixu) for sorting or arranging items into an order; the Chinese surface for the sort concept."',
' meaning "order"',
' gloss "an arrangement that follows a rule; to arrange so"',
' wiktionary "order"',
' defined_by "sort"',
' role "program_artifact"',
' role "program_modification"',
' lexeme "en"',
' word "order"',
' description "English noun for an arrangement that follows a rule, and the verb to arrange so; the lemma surface for the order concept."',
' word "ordering"',
' description "English gerund or present participle of order, naming the act or result of arranging items."',
' word "reorder"',
' description "English verb meaning to order again or rearrange; a re- prefixed surface for the order concept."',
' lexeme "ru"',
' word "порядок"',
' description "Russian noun (romanized poryadok) for an order or arrangement; the lemma surface for the order concept."',
' word "упорядочи"',
' description "Russian verb (romanized uporyadochi), the informal imperative, commanding to put items into order."',
' lexeme "hi"',
' word "क्रम"',
' description "Hindi noun (romanized kram) for an order, sequence, or arrangement; the Hindi surface for the order concept."',
' lexeme "zh"',
' word "顺序"',
' description "Chinese noun (pinyin shunxu) for order or sequence; the Chinese surface for the order concept."',
' meaning "reverse"',
' gloss "to put into the opposite order"',
' wiktionary "reverse"',
' defined_by "order"',
' role "program_modification"',
' lexeme "en"',
' word "reverse"',
' description "English verb meaning to put into the opposite order; the lemma surface for the reverse concept."',
' word "reversed"',
' description "English verb, the past tense or past participle of reverse, for items put into the opposite order."',
' lexeme "ru"',
' word "обратный"',
' description "Russian adjective (romanized obratny) in the nominative masculine meaning reverse or opposite; the lemma surface for the reverse concept."',
' word "обратном"',
' description "Russian adjective (romanized obratnom), the prepositional masculine or neuter of reverse, meaning opposite (as in reverse order)."',
' word "обратную"',
' description "Russian adjective (romanized obratnuyu), the accusative feminine of reverse, meaning opposite (as in reverse order)."',
' word "обратного"',
' description "Russian adjective (romanized obratnogo), the genitive masculine or neuter of reverse, meaning opposite."',
' lexeme "hi"',
' word "उल्टा"',
' description "Hindi adjective (romanized ulta) meaning reverse, opposite, or inverted; the lemma surface for the reverse concept."',
' word "उल्टे"',
' description "Hindi adjective (romanized ulte), the oblique or plural form of ulta, meaning reverse or inverted."',
' lexeme "zh"',
' word "反向"',
' description "Chinese adjective and verb (pinyin fanxiang) meaning reverse or opposite direction; the Chinese surface for the reverse concept."',
' word "相反"',
' description "Chinese adjective (pinyin xiangfan) meaning opposite or contrary; an alternative Chinese surface for the reverse concept."',
' word "倒序"',
' description "Chinese noun and verb (pinyin daoxu) meaning reverse order; a Chinese surface for putting items into the opposite order."',
' meaning "cancel"',
' gloss "to undo or remove a previously applied modification"',
' wiktionary "cancel"',
' defined_by "reverse"',
' defined_by "modify"',
' role "program_modification"',
' lexeme "en"',
' word "cancel"',
' description "English verb meaning to undo or remove a previously applied modification; the lemma surface for the cancel concept."',
' word "undo"',
' description "English verb meaning to reverse a previous action; a synonym surface for the cancel concept."',
' word "remove"',
' description "English verb meaning to take away or delete; a synonym surface for cancelling a modification."',
' word "revert"',
' description "English verb meaning to return to a previous state; a synonym surface for the cancel concept."',
' lexeme "ru"',
' word "отмени"',
' description "Russian verb (romanized otmeni), the informal imperative, commanding to cancel or undo a modification."',
' word "отмените"',
' description "Russian verb (romanized otmenite), the polite or plural imperative, commanding to cancel or undo a modification."',
' word "отменить"',
' description "Russian verb (romanized otmenit), the perfective infinitive, meaning to cancel or undo a modification."',
' word "убери"',
' description "Russian verb (romanized uberi), the informal imperative, commanding to remove or take away something."',
' word "уберите"',
' description "Russian verb (romanized uberite), the polite or plural imperative, commanding to remove or take away something."',
' word "убрать"',
' description "Russian verb (romanized ubrat), the perfective infinitive, meaning to remove or take away something."',
' lexeme "hi"',
' word "रद्द"',
' description "Hindi adjective and verb stem (romanized radd) meaning cancelled or to cancel; the lemma surface for the cancel concept."',
' word "हटाओ"',
' description "Hindi verb (romanized hatao), the informal imperative, commanding to remove or take away something."',
' word "हटाएं"',
' description "Hindi verb (romanized hataen), the polite imperative, commanding to remove or take away something."',
' word "हटा"',
' description "Hindi verb (romanized hata), a stem or past form of remove, meaning removed or take away."',
' lexeme "zh"',
' word "取消"',
' description "Chinese verb (pinyin quxiao) meaning to cancel or call off; the lemma surface for the cancel concept."',
' word "撤销"',
' description "Chinese verb (pinyin chexiao) meaning to revoke or undo; an alternative Chinese surface for the cancel concept."',
' word "去掉"',
' description "Chinese verb (pinyin qudiao) meaning to remove or get rid of; a Chinese surface for removing a modification."',
' word "去除"',
' description "Chinese verb (pinyin quchu) meaning to remove or eliminate; a Chinese surface for removing a modification."',
' meaning "modify"',
' gloss "to change an existing thing into a different state"',
' wiktionary "modify"',
' defined_by "update"',
' defined_by "action"',
' role "program_modification"',
' lexeme "en"',
' word "change"',
' description "English verb meaning to make something different; a synonym surface for the modify concept."',
' word "modify"',
' description "English verb meaning to change an existing thing into a different state; the lemma surface for the modify concept."',
' word "alter"',
' description "English verb meaning to change or adjust; a synonym surface for the modify concept."',
' lexeme "ru"',
' word "измени"',
' description "Russian verb (romanized izmeni), the informal imperative, commanding to change or modify something."',
' word "изменить"',
' description "Russian verb (romanized izmenit), the perfective infinitive, meaning to change or modify something."',
' word "измените"',
' description "Russian verb (romanized izmenite), the polite or plural imperative, commanding to change or modify something."',
' lexeme "hi"',
' word "बदलें"',
' description "Hindi verb (romanized badlen), the polite imperative, commanding to change or modify something."',
' word "बदलो"',
' description "Hindi verb (romanized badlo), the informal imperative, commanding to change or modify something."',
' lexeme "zh"',
' word "修改"',
' description "Chinese verb (pinyin xiugai) meaning to modify or revise; the lemma surface for the modify concept."',
' word "改"',
' description "Chinese verb (pinyin gai) meaning to change or alter; a shorter Chinese surface for the modify concept."',
' meaning "update"',
' gloss "to bring something to a newer state"',
' wiktionary "update"',
' defined_by "modify"',
' role "program_modification"',
' lexeme "en"',
' word "update"',
' description "English verb meaning to bring something to a newer state; the lemma surface for the update concept."',
' lexeme "ru"',
' word "обнови"',
' description "Russian verb (romanized obnovi), the informal imperative, commanding to update or bring something to a newer state."',
' word "обновить"',
' description "Russian verb (romanized obnovit), the perfective infinitive, meaning to update or bring something to a newer state."',
' word "обновите"',
' description "Russian verb (romanized obnovite), the polite or plural imperative, commanding to update something."',
' lexeme "hi"',
' word "अपडेट"',
' description "Hindi verb or noun (romanized apadet, a loanword from English update) for updating to a newer state; the Hindi surface for the update concept."',
' lexeme "zh"',
' word "更新"',
' description "Chinese verb and noun (pinyin gengxin) meaning to update or renew; the Chinese surface for the update concept."',
' meaning "make"',
' gloss "to produce or build a program or its output"',
' wiktionary "make"',
' defined_by "program"',
' defined_by "output"',
' role "program_modification"',
' role "program_request"',
' role "software_authoring_action"',
' lexeme "en"',
' word "make"',
' description "English verb meaning to produce or build a program or its output; the lemma surface for the make concept."',
' lexeme "ru"',
' word "сделай"',
' description "Russian verb (romanized sdelay), the perfective informal imperative, commanding to make or produce something."',
' word "сделайте"',
' description "Russian verb (romanized sdelayte), the perfective polite or plural imperative, commanding to make or produce something."',
' word "сделать"',
' description "Russian verb (romanized sdelat), the perfective infinitive, meaning to make or produce something."',
' lexeme "hi"',
' word "बनाओ"',
' description "Hindi verb (romanized banao), the informal imperative, commanding to make or build something."',
' word "बनाएं"',
' description "Hindi verb (romanized banaen), the polite imperative, commanding to make or build something."',
' lexeme "zh"',
' word "制作"',
' description "Chinese verb (pinyin zhizuo) meaning to make or produce; the Chinese surface for the make concept."',
' meaning "function"',
' gloss "a named, reusable block of program code that performs a task"',
' wiktionary "function"',
' defined_by "code"',
' defined_by "program"',
' role "program_artifact"',
' role "program_kind"',
' lexeme "en"',
' word "function"',
' description "English noun for a named, reusable block of program code that performs a task; the lemma surface for the function concept."',
' word "func"',
' description "English noun, a common abbreviation of function, for the same reusable block of code."',
' lexeme "ru"',
' word "функция"',
' description "Russian noun (romanized funktsiya) in the nominative for a code function; the lemma surface for the function concept."',
' word "функцию"',
' description "Russian noun (romanized funktsiyu), the accusative singular of function, naming the same code function."',
' lexeme "hi"',
' word "फ़ंक्शन"',
' description "Hindi noun (romanized funkshan, a loanword) for a reusable block of code; the Hindi surface for the function concept."',
' word "फंक्शन"',
' description "Hindi noun (romanized funkshan), a spelling variant without the nuqta, for the same code function."',
' lexeme "zh"',
' word "函数"',
' description "Chinese noun (pinyin hanshu) for a function in code or mathematics; the Chinese surface for the function concept."',
' meaning "write"',
" gloss \"to author a program or its code. It carries program_request (the general verb side of 'write a <kind>') and software_authoring_action, and additionally script_authoring_verb — the narrow verb the script-authoring recogniser pairs with a script-or-code artifact noun. That role lives on write alone, not on create/show/generate, so only an explicit author verb can route a bare script request.\"",
' wiktionary "write"',
' defined_by "code"',
' defined_by "program"',
' role "program_request"',
' role "software_authoring_action"',
' role "script_authoring_verb"',
' lexeme "en"',
' word "write"',
' description "English verb meaning to author a program or its code; the lemma surface for the write concept."',
' lexeme "ru"',
' word "напиши"',
' description "Russian verb (romanized napishi), the perfective informal imperative, commanding to write or author code."',
' word "напишите"',
' description "Russian verb (romanized napishite), the perfective polite or plural imperative, commanding to write or author code."',
' word "написать"',
" description \"Russian verb (romanized napisat'), the perfective infinitive, naming the act of writing or authoring code (as in 'написать скрипт', to write a script).\"",
' lexeme "hi"',
' word "लिखो"',
' description "Hindi verb (romanized likho), the informal imperative, commanding to write or author something."',
' word "लिखें"',
' description "Hindi verb (romanized likhen), the polite imperative, commanding to write or author something."',
' lexeme "zh"',
' word "编写"',
' description "Chinese verb (pinyin bianxie) meaning to write or compose code; the lemma surface for the write concept."',
' word "写"',
' description "Chinese verb (pinyin xie) meaning to write; a shorter Chinese surface for the write concept."',
' meaning "create"',
' gloss "to bring a program or its artifact into existence"',
' wiktionary "create"',
' defined_by "make"',
' defined_by "program"',
' role "program_request"',
' role "software_authoring_action"',
' lexeme "en"',
' word "create"',
' description "English verb meaning to bring a program or its artifact into existence; the lemma surface for the create concept."',
' lexeme "ru"',
' word "создай"',
' description "Russian verb (romanized sozday), the perfective informal imperative, commanding to create or bring something into existence."',
' word "создайте"',
' description "Russian verb (romanized sozdayte), the perfective polite or plural imperative, commanding to create something."',
' lexeme "hi"',
' word "बनाओ"',
' description "Hindi verb (romanized banao), the informal imperative, commanding to create or make something."',
' word "बनाएं"',
' description "Hindi verb (romanized banaen), the polite imperative, commanding to create or make something."',
' lexeme "zh"',
' word "创建"',
' description "Chinese verb (pinyin chuangjian) meaning to create or establish; the Chinese surface for the create concept."',
' meaning "show"',
" gloss \"to display a program's output or result\"",
' wiktionary "show"',
' defined_by "output"',
' defined_by "result"',
' role "program_request"',
' lexeme "en"',
' word "show"',
" description \"English verb meaning to display a program's output or result; the lemma surface for the show concept.\"",
' lexeme "ru"',
' word "покажи"',
' description "Russian verb (romanized pokazhi), the perfective informal imperative, commanding to show or display something."',
' word "покажите"',
' description "Russian verb (romanized pokazhite), the perfective polite or plural imperative, commanding to show or display something."',
' lexeme "hi"',
' word "दिखाओ"',
' description "Hindi verb (romanized dikhao), the informal imperative, commanding to show or display something."',
' word "दिखाएं"',
' description "Hindi verb (romanized dikhaen), the polite imperative, commanding to show or display something."',
' lexeme "zh"',
' word "显示"',
' description "Chinese verb (pinyin xianshi) meaning to display or show; the Chinese surface for the show concept."',
' meaning "generate"',
' gloss "to produce a program or output mechanically"',
' wiktionary "generate"',
' defined_by "output"',
' defined_by "program"',
' role "program_request"',
' role "software_authoring_action"',
' lexeme "en"',
' word "generate"',
' description "English verb meaning to produce a program or output mechanically; the lemma surface for the generate concept."',
' lexeme "ru"',
' word "сгенерируй"',
' description "Russian verb (romanized sgeneriruy), the perfective informal imperative, commanding to generate or produce something."',
' word "сгенерируйте"',
' description "Russian verb (romanized sgeneriruyte), the perfective polite or plural imperative, commanding to generate something."',
' lexeme "hi"',
' word "उत्पन्न"',
' description "Hindi verb stem and adjective (romanized utpann) meaning generated or to produce; the native Hindi surface for the generate concept."',
' word "जनरेट"',
' description "Hindi verb (romanized janaret, a loanword from English generate) for generating something; the Hindi surface for the generate concept."',
' lexeme "zh"',
' word "生成"',
' description "Chinese verb (pinyin shengcheng) meaning to generate or produce; the Chinese surface for the generate concept."',
' meaning "build"',
' gloss "to assemble a program from its parts"',
' wiktionary "build"',
' defined_by "make"',
' defined_by "program"',
' role "program_request"',
' role "software_authoring_action"',
' lexeme "en"',
' word "build"',
' description "English verb meaning to assemble a program from its parts; the lemma surface for the build concept."',
' lexeme "ru"',
' word "построй"',
' description "Russian verb (romanized postroy), the perfective informal imperative, commanding to build or construct something."',
' word "собери"',
' description "Russian verb (romanized soberi), the perfective informal imperative, commanding to assemble or build something from parts."',
' lexeme "hi"',
' word "बनाओ"',
' description "Hindi verb (romanized banao), the informal imperative, commanding to build or make something."',
' word "बनाएं"',
' description "Hindi verb (romanized banaen), the polite imperative, commanding to build or make something."',
' lexeme "zh"',
' word "构建"',
' description "Chinese verb (pinyin goujian) meaning to build or construct; the Chinese surface for the build concept."',
"meanings",
' meaning "quantity"',
' gloss "an amount of something that can be measured or counted"',
' wiktionary "quantity"',
' defined_by "unit"',
' defined_by "property"',
' role "measurement_concept"',
' lexeme "en"',
' word "quantity"',
' description "English noun for an amount of something that can be measured or counted; the general measurement concept."',
' lexeme "ru"',
' word "количество"',
' description "Russian noun (romanized kolichestvo) for an amount or quantity; the Russian surface for the quantity concept."',
' lexeme "hi"',
' word "मात्रा"',
' description "Hindi noun (romanized matra) for an amount or quantity; the Hindi surface for the quantity concept."',
' lexeme "zh"',
' word "数量"',
' description "Chinese noun (pinyin shuliang) for an amount or quantity; the Chinese surface for the quantity concept."',
' meaning "unit"',
' gloss "a standard amount used to measure a quantity"',
' wiktionary "unit"',
' defined_by "quantity"',
' role "measurement_concept"',
' lexeme "en"',
' word "unit"',
' description "English noun for a standard amount used to measure a quantity; the general unit concept."',
' lexeme "ru"',
' word "единица"',
' description "Russian noun (romanized edinitsa) for a unit; the Russian surface for the unit concept."',
' lexeme "hi"',
' word "इकाई"',
' description "Hindi noun (romanized ikai) for a unit; the Hindi surface for the unit concept."',
' lexeme "zh"',
' word "单位"',
' description "Chinese noun (pinyin danwei) for a unit; the Chinese surface for the unit concept."',
' meaning "cardinal_number"',
' gloss "a number used to count how many things there are: zero, one, two, three, and so on. The genus of the individual counting numbers, each defined as a kind of cardinal number rather than listed in code."',
' wiktionary "cardinal number"',
' defined_by "quantity"',
' role "numeric_concept"',
' lexeme "en"',
' word "cardinal number"',
" description \"English term for a counting number that answers the question 'how many'; the genus of the individual cardinals.\"",
' word "number"',
' description "English noun for a number used in counting; the everyday surface for the counting-number concept."',
' lexeme "ru"',
' word "количественное число"',
' description "Russian term (romanized kolichestvennoe chislo) for a cardinal counting number; the Russian surface for the cardinal-number concept."',
' lexeme "hi"',
' word "गणन संख्या"',
' description "Hindi term (romanized ganan sankhya) for a cardinal counting number; the Hindi surface for the cardinal-number concept."',
' lexeme "zh"',
' word "基数"',
' description "Chinese term (pinyin jishu) for a cardinal counting number; the Chinese surface for the cardinal-number concept."',
' meaning "zero"',
' gloss "the cardinal number zero (0), the count of an empty collection."',
' wiktionary "zero"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "zero"',
' description "English spelled form of the cardinal number zero."',
' word "0"',
" description \"Western Arabic numeral for zero; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "ноль"',
" description \"Russian spelled form (romanized nol') of the cardinal number zero.\"",
' word "нуль"',
" description \"Russian spelled form (romanized nul'), a variant spelling, of the cardinal number zero.\"",
' lexeme "hi"',
' word "शून्य"',
' description "Hindi spelled form (romanized shunya) of the cardinal number zero."',
' lexeme "zh"',
' word "零"',
' description "Chinese spelled form (pinyin ling) of the cardinal number zero."',
' meaning "one"',
' gloss "the cardinal number one (1), one more than zero."',
' wiktionary "one"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "one"',
' description "English spelled form of the cardinal number one."',
' word "1"',
" description \"Western Arabic numeral for one; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "один"',
' description "Russian spelled form (romanized odin), masculine, of the cardinal number one."',
' word "одна"',
' description "Russian spelled form (romanized odna), feminine, of the cardinal number one."',
' word "одно"',
' description "Russian spelled form (romanized odno), neuter, of the cardinal number one."',
' lexeme "hi"',
' word "एक"',
' description "Hindi spelled form (romanized ek) of the cardinal number one."',
' lexeme "zh"',
' word "一"',
' description "Chinese spelled form (pinyin yi) of the cardinal number one."',
' meaning "two"',
' gloss "the cardinal number two (2), one more than one."',
' wiktionary "two"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "two"',
' description "English spelled form of the cardinal number two."',
' word "2"',
" description \"Western Arabic numeral for two; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "два"',
' description "Russian spelled form (romanized dva), masculine and neuter, of the cardinal number two."',
' word "две"',
' description "Russian spelled form (romanized dve), feminine, of the cardinal number two."',
' lexeme "hi"',
' word "दो"',
' description "Hindi spelled form (romanized do) of the cardinal number two."',
' lexeme "zh"',
' word "二"',
' description "Chinese spelled form (pinyin er) of the cardinal number two."',
' meaning "three"',
' gloss "the cardinal number three (3), one more than two."',
' wiktionary "three"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "three"',
' description "English spelled form of the cardinal number three."',
' word "3"',
" description \"Western Arabic numeral for three; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "три"',
' description "Russian spelled form (romanized tri) of the cardinal number three."',
' lexeme "hi"',
' word "तीन"',
' description "Hindi spelled form (romanized teen) of the cardinal number three."',
' lexeme "zh"',
' word "三"',
' description "Chinese spelled form (pinyin san) of the cardinal number three."',
' meaning "four"',
' gloss "the cardinal number four (4), one more than three."',
' wiktionary "four"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "four"',
' description "English spelled form of the cardinal number four."',
' word "4"',
" description \"Western Arabic numeral for four; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "четыре"',
' description "Russian spelled form (romanized chetyre) of the cardinal number four."',
' lexeme "hi"',
' word "चार"',
' description "Hindi spelled form (romanized char) of the cardinal number four."',
' lexeme "zh"',
' word "四"',
' description "Chinese spelled form (pinyin si) of the cardinal number four."',
' meaning "five"',
' gloss "the cardinal number five (5), one more than four."',
' wiktionary "five"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "five"',
' description "English spelled form of the cardinal number five."',
' word "5"',
" description \"Western Arabic numeral for five; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "пять"',
" description \"Russian spelled form (romanized pyat') of the cardinal number five.\"",
' lexeme "hi"',
' word "पाँच"',
' description "Hindi spelled form (romanized panch) of the cardinal number five."',
' lexeme "zh"',
' word "五"',
' description "Chinese spelled form (pinyin wu) of the cardinal number five."',
' meaning "six"',
' gloss "the cardinal number six (6), one more than five."',
' wiktionary "six"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "six"',
' description "English spelled form of the cardinal number six."',
' word "6"',
" description \"Western Arabic numeral for six; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "шесть"',
" description \"Russian spelled form (romanized shest') of the cardinal number six.\"",
' lexeme "hi"',
' word "छह"',
' description "Hindi spelled form (romanized chhah) of the cardinal number six."',
' lexeme "zh"',
' word "六"',
' description "Chinese spelled form (pinyin liu) of the cardinal number six."',
' meaning "seven"',
' gloss "the cardinal number seven (7), one more than six."',
' wiktionary "seven"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "seven"',
' description "English spelled form of the cardinal number seven."',
' word "7"',
" description \"Western Arabic numeral for seven; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "семь"',
" description \"Russian spelled form (romanized sem') of the cardinal number seven.\"",
' lexeme "hi"',
' word "सात"',
' description "Hindi spelled form (romanized saat) of the cardinal number seven."',
' lexeme "zh"',
' word "七"',
' description "Chinese spelled form (pinyin qi) of the cardinal number seven."',
' meaning "eight"',
' gloss "the cardinal number eight (8), one more than seven."',
' wiktionary "eight"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "eight"',
' description "English spelled form of the cardinal number eight."',
' word "8"',
" description \"Western Arabic numeral for eight; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "восемь"',
" description \"Russian spelled form (romanized vosem') of the cardinal number eight.\"",
' lexeme "hi"',
' word "आठ"',
' description "Hindi spelled form (romanized aath) of the cardinal number eight."',
' lexeme "zh"',
' word "八"',
' description "Chinese spelled form (pinyin ba) of the cardinal number eight."',
' meaning "nine"',
' gloss "the cardinal number nine (9), one more than eight."',
' wiktionary "nine"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "nine"',
' description "English spelled form of the cardinal number nine."',
' word "9"',
" description \"Western Arabic numeral for nine; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "девять"',
" description \"Russian spelled form (romanized devyat') of the cardinal number nine.\"",
' lexeme "hi"',
' word "नौ"',
' description "Hindi spelled form (romanized nau) of the cardinal number nine."',
' lexeme "zh"',
' word "九"',
' description "Chinese spelled form (pinyin jiu) of the cardinal number nine."',
' meaning "ten"',
' gloss "the cardinal number ten (10), one more than nine."',
' wiktionary "ten"',
' defined_by "cardinal_number"',
' role "cardinal_number_word"',
' lexeme "en"',
' word "ten"',
' description "English spelled form of the cardinal number ten."',
' word "10"',
" description \"Western Arabic numeral for ten; the script-independent numeral surface, from which the cardinal's integer value is read.\"",
' lexeme "ru"',
' word "десять"',
" description \"Russian spelled form (romanized desyat') of the cardinal number ten.\"",
' lexeme "hi"',
' word "दस"',
' description "Hindi spelled form (romanized das) of the cardinal number ten."',
' lexeme "zh"',
' word "十"',
' description "Chinese spelled form (pinyin shi) of the cardinal number ten."',
' meaning "length"',
' gloss "the physical dimension of distance or extent"',
' wiktionary "length"',
' defined_by "quantity"',
' role "physical_dimension"',
' lexeme "en"',
' word "length"',
' description "English noun for the physical dimension of distance or extent; the length dimension."',
' lexeme "ru"',
' word "длина"',
' description "Russian noun (romanized dlina) for length; the Russian surface for the length dimension."',
' lexeme "hi"',
' word "लंबाई"',
' description "Hindi noun (romanized lambai) for length; the Hindi surface for the length dimension."',
' lexeme "zh"',
' word "长度"',
' description "Chinese noun (pinyin changdu) for length; the Chinese surface for the length dimension."',
' meaning "data_storage"',
' gloss "the physical dimension of how much information is stored"',
' wiktionary "data"',
' defined_by "quantity"',
' role "physical_dimension"',
' lexeme "en"',
' word "data storage"',
' description "English noun phrase for the dimension of how much information is stored; the data-storage dimension."',
' lexeme "ru"',
' word "хранение данных"',
' description "Russian noun phrase (romanized khranenie dannykh) for data storage; the Russian surface for the data-storage dimension."',
' lexeme "hi"',
' word "डेटा भंडारण"',
' description "Hindi noun phrase (romanized deta bhandaran) for data storage; the Hindi surface for the data-storage dimension."',
' lexeme "zh"',
' word "数据存储"',
' description "Chinese noun phrase (pinyin shuju cunchu) for data storage; the Chinese surface for the data-storage dimension."',
' meaning "mass"',
' gloss "the physical dimension of how much matter an object contains"',
' wiktionary "mass"',
' defined_by "quantity"',
' role "physical_dimension"',
' lexeme "en"',
' word "mass"',
' description "English noun for the dimension of how much matter an object contains; the mass dimension."',
' lexeme "ru"',
' word "масса"',
' description "Russian noun (romanized massa) for mass; the Russian surface for the mass dimension."',
' lexeme "hi"',
' word "द्रव्यमान"',
' description "Hindi noun (romanized dravyaman) for mass; the Hindi surface for the mass dimension."',
' lexeme "zh"',
' word "质量"',
' description "Chinese noun (pinyin zhiliang) for mass; the Chinese surface for the mass dimension."',
' meaning "time"',
' gloss "the physical dimension of duration"',
' wiktionary "time"',
' defined_by "quantity"',
' role "physical_dimension"',
' lexeme "en"',
' word "time"',
' description "English noun for the physical dimension of duration; the time dimension."',
' lexeme "ru"',
' word "время"',
' description "Russian noun (romanized vremya) for time; the Russian surface for the time dimension."',
' lexeme "hi"',
' word "समय"',
' description "Hindi noun (romanized samay) for time; the Hindi surface for the time dimension."',
' lexeme "zh"',
' word "时间"',
' description "Chinese noun (pinyin shijian) for time; the Chinese surface for the time dimension."',
' meaning "temperature"',
' gloss "the physical dimension of thermal energy"',
' wiktionary "temperature"',
' defined_by "quantity"',
' role "physical_dimension"',
' lexeme "en"',
' word "temperature"',
' description "English noun for the physical dimension of thermal energy; the temperature dimension."',
' lexeme "ru"',
' word "температура"',
' description "Russian noun (romanized temperatura) for temperature; the Russian surface for the temperature dimension."',
' lexeme "hi"',
' word "तापमान"',
' description "Hindi noun (romanized tapman) for temperature; the Hindi surface for the temperature dimension."',
' lexeme "zh"',
' word "温度"',
' description "Chinese noun (pinyin wendu) for temperature; the Chinese surface for the temperature dimension."',
' meaning "meter"',
' gloss "the base unit of length"',
' wiktionary "metre"',
' defined_by "length"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "meter"',
' description "English noun for the base unit of length (American spelling); a full-word form of the metre."',
' word "metre"',
' description "English noun for the base unit of length (British spelling); a full-word form of the metre."',
' word "meters"',
' description "English noun, the plural of meter; the base unit of length in the length dimension."',
' word "metres"',
' description "English noun, the plural of metre; the base unit of length in the length dimension."',
' lexeme "ru"',
' word "метр"',
' description "Russian noun (romanized metr) for the metre, the base unit of length; the Russian surface for the meter."',
' word "метра"',
' description "Russian noun (romanized metra), an inflected genitive form of metre; a case form of the base unit of length."',
' word "метров"',
' description "Russian noun (romanized metrov), the genitive plural of metre; a case form of the base unit of length."',
' lexeme "hi"',
' word "मीटर"',
' description "Hindi noun (romanized mitar) for the metre, the base unit of length; the Hindi surface for the meter."',
' lexeme "zh"',
' word "米"',
' description "Chinese noun (pinyin mi) for the metre, the base unit of length; the Chinese surface for the meter."',
' meaning "kilometer"',
' gloss "a unit of length equal to one thousand metres"',
' wiktionary "kilometre"',
' defined_by "length"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "km"',
' description "English abbreviation, the symbol for kilometre, a unit of length equal to one thousand metres."',
' word "kilometer"',
' description "English noun for a unit of length of one thousand metres (American spelling); a full-word form."',
' word "kilometre"',
' description "English noun for a unit of length of one thousand metres (British spelling); a full-word form."',
' word "kilometers"',
' description "English noun, the plural of kilometer; a unit of length equal to one thousand metres."',
' word "kilometres"',
' description "English noun, the plural of kilometre; a unit of length equal to one thousand metres."',
' lexeme "ru"',
' word "километр"',
' description "Russian noun (romanized kilometr) for the kilometre, a unit of length of one thousand metres."',
' word "километра"',
' description "Russian noun (romanized kilometra), an inflected genitive form of kilometre; a case form of the unit of length."',
' word "километров"',
' description "Russian noun (romanized kilometrov), the genitive plural of kilometre; a case form of the unit of length."',
' lexeme "hi"',
' word "किलोमीटर"',
' description "Hindi noun (romanized kilomitar) for the kilometre, a unit of length of one thousand metres."',
' lexeme "zh"',
' word "千米"',
' description "Chinese noun (pinyin qianmi) for the kilometre, a unit of length of one thousand metres."',
' word "公里"',
' description "Chinese noun (pinyin gongli) for the kilometre; a common alternative surface for the unit of length."',
' meaning "centimeter"',
' gloss "a unit of length equal to one hundredth of a metre"',
' wiktionary "centimetre"',
' defined_by "length"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "cm"',
' description "English abbreviation, the symbol for centimetre, a unit of length equal to one hundredth of a metre."',
' word "centimeter"',
' description "English noun for a unit of length of one hundredth of a metre (American spelling); a full-word form."',
' word "centimetre"',
' description "English noun for a unit of length of one hundredth of a metre (British spelling); a full-word form."',
' lexeme "ru"',
' word "сантиметр"',
' description "Russian noun (romanized santimetr) for the centimetre, a unit of length of one hundredth of a metre."',
' lexeme "hi"',
' word "सेंटीमीटर"',
' description "Hindi noun (romanized sentimitar) for the centimetre, a unit of length of one hundredth of a metre."',
' lexeme "zh"',
' word "厘米"',
' description "Chinese noun (pinyin limi) for the centimetre, a unit of length of one hundredth of a metre."',
' meaning "millimeter"',
' gloss "a unit of length equal to one thousandth of a metre"',
' wiktionary "millimetre"',
' defined_by "length"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "mm"',
' description "English abbreviation, the symbol for millimetre, a unit of length equal to one thousandth of a metre."',
' word "millimeter"',
' description "English noun for a unit of length of one thousandth of a metre (American spelling); a full-word form."',
' word "millimetre"',
' description "English noun for a unit of length of one thousandth of a metre (British spelling); a full-word form."',
' lexeme "ru"',
' word "миллиметр"',
' description "Russian noun (romanized millimetr) for the millimetre, a unit of length of one thousandth of a metre."',
' lexeme "hi"',
' word "मिलीमीटर"',
' description "Hindi noun (romanized millimitar) for the millimetre, a unit of length of one thousandth of a metre."',
' lexeme "zh"',
' word "毫米"',
' description "Chinese noun (pinyin haomi) for the millimetre, a unit of length of one thousandth of a metre."',
' meaning "byte"',
' gloss "a unit of digital information, eight bits"',
' wiktionary "byte"',
' defined_by "data_storage"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "byte"',
' description "English noun for a unit of digital information of eight bits; the base unit of data storage."',
' word "bytes"',
' description "English noun, the plural of byte; units of digital information of eight bits each."',
' lexeme "ru"',
' word "байт"',
' description "Russian noun (romanized bait) for the byte, a unit of digital information of eight bits."',
' word "байта"',
' description "Russian noun (romanized baita), an inflected genitive form of byte; a case form of the data-storage unit."',
' word "байтов"',
' description "Russian noun (romanized baitov), the genitive plural of byte; a case form of the data-storage unit."',
' lexeme "hi"',
' word "बाइट"',
' description "Hindi noun (romanized bait) for the byte, a unit of digital information of eight bits."',
' lexeme "zh"',
' word "字节"',
' description "Chinese noun (pinyin zijie) for the byte, a unit of digital information of eight bits."',
' meaning "kilobyte"',
' gloss "a unit of digital information of about one thousand bytes. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "kilobyte"',
' defined_by "data_storage"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "kb"',
' description "English abbreviation, the symbol for kilobyte, a unit of digital information of about one thousand bytes."',
' word "kilobyte"',
' description "English noun for a unit of digital information of about one thousand bytes; a full-word form."',
' word "kilobytes"',
' description "English noun, the plural of kilobyte; units of digital information of about one thousand bytes each."',
' lexeme "ru"',
' word "килобайт"',
' description "Russian noun (romanized kilobait) for the kilobyte, a unit of digital information of about one thousand bytes."',
' lexeme "hi"',
' word "किलोबाइट"',
' description "Hindi noun (romanized kilobait) for the kilobyte, a unit of digital information of about one thousand bytes."',
' lexeme "zh"',
' word "千字节"',
' description "Chinese noun (pinyin qian zijie) for the kilobyte, a unit of digital information of about one thousand bytes."',
' meaning "megabyte"',
' gloss "a unit of digital information of about one million bytes. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "megabyte"',
' defined_by "data_storage"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "mb"',
' description "English abbreviation, the symbol for megabyte, a unit of digital information of about one million bytes."',
' word "megabyte"',
' description "English noun for a unit of digital information of about one million bytes; a full-word form."',
' word "megabytes"',
' description "English noun, the plural of megabyte; units of digital information of about one million bytes each."',
' lexeme "ru"',
' word "мегабайт"',
' description "Russian noun (romanized megabait) for the megabyte, a unit of digital information of about one million bytes."',
' lexeme "hi"',
' word "मेगाबाइट"',
' description "Hindi noun (romanized megabait) for the megabyte, a unit of digital information of about one million bytes."',
' lexeme "zh"',
' word "兆字节"',
' description "Chinese noun (pinyin zhao zijie) for the megabyte, a unit of digital information of about one million bytes."',
' meaning "gigabyte"',
' gloss "a unit of digital information of about one billion bytes"',
' wiktionary "gigabyte"',
' defined_by "data_storage"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "gb"',
' description "English abbreviation, the symbol for gigabyte, a unit of digital information of about one billion bytes."',
' word "gigabyte"',
' description "English noun for a unit of digital information of about one billion bytes; a full-word form."',
' word "gigabytes"',
' description "English noun, the plural of gigabyte; units of digital information of about one billion bytes each."',
' lexeme "ru"',
' word "гигабайт"',
' description "Russian noun (romanized gigabait) for the gigabyte, a unit of digital information of about one billion bytes."',
' lexeme "hi"',
' word "गीगाबाइट"',
' description "Hindi noun (romanized gigabait) for the gigabyte, a unit of digital information of about one billion bytes."',
' lexeme "zh"',
' word "吉字节"',
' description "Chinese noun (pinyin ji zijie) for the gigabyte, a unit of digital information of about one billion bytes."',
' meaning "terabyte"',
' gloss "a unit of digital information of about one trillion bytes"',
' wiktionary "terabyte"',
' defined_by "data_storage"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "tb"',
' description "English abbreviation, the symbol for terabyte, a unit of digital information of about one trillion bytes."',
' word "terabyte"',
' description "English noun for a unit of digital information of about one trillion bytes; a full-word form."',
' word "terabytes"',
' description "English noun, the plural of terabyte; units of digital information of about one trillion bytes each."',
' lexeme "ru"',
' word "терабайт"',
' description "Russian noun (romanized terabait) for the terabyte, a unit of digital information of about one trillion bytes."',
' lexeme "hi"',
' word "टेराबाइट"',
' description "Hindi noun (romanized terabait) for the terabyte, a unit of digital information of about one trillion bytes."',
' lexeme "zh"',
' word "太字节"',
' description "Chinese noun (pinyin tai zijie) for the terabyte, a unit of digital information of about one trillion bytes."',
' meaning "bit"',
' gloss "the smallest unit of digital information"',
' wiktionary "bit"',
' defined_by "data_storage"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "bit"',
' description "English noun for the smallest unit of digital information; the base binary digit of data storage."',
' word "bits"',
' description "English noun, the plural of bit; the smallest units of digital information."',
' lexeme "ru"',
' word "бит"',
' description "Russian noun (romanized bit) for the bit, the smallest unit of digital information."',
' word "бита"',
' description "Russian noun (romanized bita), an inflected genitive form of bit; a case form of the smallest data-storage unit."',
' word "битов"',
' description "Russian noun (romanized bitov), the genitive plural of bit; a case form of the smallest data-storage unit."',
' lexeme "hi"',
' word "बिट"',
' description "Hindi noun (romanized bit) for the bit, the smallest unit of digital information."',
' lexeme "zh"',
' word "比特"',
' description "Chinese noun (pinyin bite) for the bit, the smallest unit of digital information."',
' meaning "kilogram"',
' gloss "the base unit of mass. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "kilogram"',
' defined_by "mass"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "kg"',
' description "English abbreviation, the symbol for kilogram, the base unit of mass; a calculation_domain_term matched whole-token."',
' word "kilogram"',
' description "English noun for the base unit of mass (American spelling); a full-word form of the kilogram."',
' word "kilograms"',
' description "English noun, the plural of kilogram; the base unit of mass in the mass dimension."',
' lexeme "ru"',
' word "кг"',
' description "Russian abbreviation (romanized kg), the symbol for kilogram, the base unit of mass; a calculation_domain_term matched as a raw substring."',
' word "килограмм"',
' description "Russian noun (romanized kilogramm) for the kilogram, the base unit of mass."',
' lexeme "hi"',
' word "किलोग्राम"',
' description "Hindi noun (romanized kilogram) for the kilogram, the base unit of mass."',
' lexeme "zh"',
' word "千克"',
' description "Chinese noun (pinyin qianke) for the kilogram, the base unit of mass."',
' word "公斤"',
' description "Chinese noun (pinyin gongjin) for the kilogram; a common alternative surface for the base unit of mass."',
' meaning "gram"',
' gloss "a unit of mass equal to one thousandth of a kilogram. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "gram"',
' defined_by "mass"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "gram"',
' description "English noun for a unit of mass equal to one thousandth of a kilogram; a full-word form."',
' word "grams"',
' description "English noun, the plural of gram; units of mass of one thousandth of a kilogram each."',
' lexeme "ru"',
' word "грамм"',
' description "Russian noun (romanized gramm) for the gram, a unit of mass of one thousandth of a kilogram."',
' lexeme "hi"',
' word "ग्राम"',
' description "Hindi noun (romanized gram) for the gram, a unit of mass of one thousandth of a kilogram."',
' lexeme "zh"',
' word "克"',
' description "Chinese noun (pinyin ke) for the gram, a unit of mass of one thousandth of a kilogram."',
' meaning "pound"',
' gloss "a unit of mass used in imperial measure"',
' wiktionary "pound"',
' defined_by "mass"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "pound"',
' description "English noun for a unit of mass used in imperial measure; a mass unit in the mass dimension."',
' word "pounds"',
' description "English noun, the plural of pound; units of mass used in imperial measure."',
' lexeme "ru"',
' word "фунт"',
' description "Russian noun (romanized funt) for the pound, a unit of mass used in imperial measure."',
' lexeme "hi"',
' word "पाउंड"',
' description "Hindi noun (romanized paund) for the pound, a unit of mass used in imperial measure."',
' lexeme "zh"',
' word "磅"',
' description "Chinese noun (pinyin bang) for the pound, a unit of mass used in imperial measure."',
' meaning "ton"',
' gloss "a unit of mass equal to one thousand kilograms. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "tonne"',
' defined_by "mass"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "ton"',
' description "English noun for a unit of mass equal to one thousand kilograms; a calculation_domain_term matched whole-token."',
' word "tons"',
' description "English noun, the plural of ton; units of mass of one thousand kilograms each."',
' word "tonne"',
' description "English noun, the metric spelling of ton; a unit of mass of one thousand kilograms."',
' lexeme "ru"',
' word "тонна"',
' description "Russian noun (romanized tonna) for the ton, a unit of mass of one thousand kilograms; a calculation_domain_term matched as a raw substring."',
' word "тонны"',
' description "Russian noun (romanized tonny), an inflected form of ton; a case form of the unit of mass, matched as a raw substring."',
' word "тонн"',
' description "Russian noun (romanized tonn), the genitive plural of ton; a case form of the unit of mass, matched as a raw substring."',
' lexeme "hi"',
' word "टन"',
' description "Hindi noun (romanized tan) for the ton, a unit of mass of one thousand kilograms; a calculation_domain_term matched as a raw substring."',
' lexeme "zh"',
' word "吨"',
' description "Chinese noun (pinyin dun) for the ton, a unit of mass of one thousand kilograms; a calculation_domain_term matched as a raw substring."',
' meaning "second"',
' gloss "the base unit of time. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "second"',
' defined_by "time"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "second"',
' description "English noun for the base unit of time; the base unit in the time dimension."',
' word "seconds"',
' description "English noun, the plural of second; the base units of time."',
' lexeme "ru"',
' word "секунда"',
' description "Russian noun (romanized sekunda) for the second, the base unit of time."',
' word "секунды"',
' description "Russian noun (romanized sekundy), an inflected form of second; a case form of the base unit of time."',
' word "секунд"',
' description "Russian noun (romanized sekund), the genitive plural of second; a case form of the base unit of time."',
' lexeme "hi"',
' word "सेकंड"',
' description "Hindi noun (romanized sekand) for the second, the base unit of time."',
' lexeme "zh"',
' word "秒"',
' description "Chinese noun (pinyin miao) for the second, the base unit of time."',
' meaning "minute"',
' gloss "a unit of time equal to sixty seconds. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "minute"',
' defined_by "time"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "minute"',
' description "English noun for a unit of time equal to sixty seconds; a time unit in the time dimension."',
' word "minutes"',
' description "English noun, the plural of minute; units of time of sixty seconds each."',
' lexeme "ru"',
' word "минута"',
' description "Russian noun (romanized minuta) for the minute, a unit of time equal to sixty seconds."',
' word "минуты"',
' description "Russian noun (romanized minuty), an inflected form of minute; a case form of the unit of time."',
' word "минут"',
' description "Russian noun (romanized minut), the genitive plural of minute; a case form of the unit of time."',
' lexeme "hi"',
' word "मिनट"',
' description "Hindi noun (romanized minat) for the minute, a unit of time equal to sixty seconds."',
' lexeme "zh"',
' word "分钟"',
' description "Chinese noun (pinyin fenzhong) for the minute, a unit of time equal to sixty seconds."',
' meaning "hour"',
' gloss "a unit of time equal to sixty minutes. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "hour"',
' defined_by "time"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "hour"',
' description "English noun for a unit of time equal to sixty minutes; a time unit in the time dimension."',
' word "hours"',
' description "English noun, the plural of hour; units of time of sixty minutes each."',
' lexeme "ru"',
' word "час"',
' description "Russian noun (romanized chas) for the hour, a unit of time equal to sixty minutes."',
' word "часа"',
' description "Russian noun (romanized chasa), an inflected genitive form of hour; a case form of the unit of time."',
' word "часов"',
' description "Russian noun (romanized chasov), the genitive plural of hour; a case form of the unit of time."',
' lexeme "hi"',
' word "घंटा"',
' description "Hindi noun (romanized ghanta) for the hour, a unit of time equal to sixty minutes."',
' lexeme "zh"',
' word "小时"',
' description "Chinese noun (pinyin xiaoshi) for the hour, a unit of time equal to sixty minutes."',
' meaning "millisecond"',
' gloss "a unit of time equal to one thousandth of a second. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "millisecond"',
' defined_by "time"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "ms"',
' description "English abbreviation, the symbol for millisecond, a unit of time of one thousandth of a second; a calculation_domain_term matched whole-token."',
' word "millisecond"',
' description "English noun for a unit of time equal to one thousandth of a second; a full-word form."',
' word "milliseconds"',
' description "English noun, the plural of millisecond; units of time of one thousandth of a second each."',
' lexeme "ru"',
' word "миллисекунда"',
' description "Russian noun (romanized millisekunda) for the millisecond, a unit of time of one thousandth of a second; matched as a raw substring."',
' word "миллисекунд"',
' description "Russian noun (romanized millisekund), the genitive plural of millisecond; a case form of the unit of time, matched as a raw substring."',
' lexeme "hi"',
' word "मिलीसेकंड"',
' description "Hindi noun (romanized milisekand) for the millisecond, a unit of time of one thousandth of a second; matched as a raw substring."',
' lexeme "zh"',
' word "毫秒"',
' description "Chinese noun (pinyin haomiao) for the millisecond, a unit of time of one thousandth of a second; matched as a raw substring."',
' meaning "day"',
' gloss "a unit of time equal to twenty-four hours. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "day"',
' defined_by "time"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "day"',
' description "English noun for a unit of time equal to twenty-four hours; a calculation_domain_term matched whole-token."',
' word "days"',
' description "English noun, the plural of day; units of time of twenty-four hours each."',
' lexeme "ru"',
' word "день"',
' description "Russian noun (romanized den) for the day, a unit of time of twenty-four hours; matched as a raw substring."',
' word "дня"',
' description "Russian noun (romanized dnya), an inflected genitive form of day; a case form of the unit of time, matched as a raw substring."',
' word "дней"',
' description "Russian noun (romanized dney), the genitive plural of day; a case form of the unit of time, matched as a raw substring."',
' lexeme "hi"',
' word "दिन"',
' description "Hindi noun (romanized din) for the day, a unit of time of twenty-four hours; matched as a raw substring."',
' lexeme "zh"',
' word "天"',
' description "Chinese noun (pinyin tian) for the day, a unit of time of twenty-four hours; matched as a raw substring."',
' word "日"',
' description "Chinese noun (pinyin ri) for the day, a calendar-day unit of time; matched as a raw substring."',
' meaning "month"',
' gloss "a unit of time of about thirty days, one of the twelve divisions of a year. Also a calculation_domain_term, so it signals a calculation when it appears beside a number."',
' wiktionary "month"',
' defined_by "time"',
' defined_by "unit"',
' role "measurement_unit"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "month"',
' description "English noun for a unit of time of about thirty days; a calculation_domain_term matched whole-token."',
' word "months"',
' description "English noun, the plural of month; units of time of about thirty days each."',
' lexeme "ru"',
' word "месяц"',
' description "Russian noun (romanized mesyats) for the month, a unit of time of about thirty days; matched as a raw substring."',
' word "месяца"',
' description "Russian noun (romanized mesyatsa), an inflected genitive form of month; a case form of the unit of time, matched as a raw substring."',
' word "месяцев"',
' description "Russian noun (romanized mesyatsev), the genitive plural of month; a case form of the unit of time, matched as a raw substring."',
' lexeme "hi"',
' word "महीना"',
' description "Hindi noun (romanized mahina) for the month, a unit of time of about thirty days; matched as a raw substring."',
' word "महीने"',
' description "Hindi noun (romanized mahine), an inflected form of month; a case form of the unit of time, matched as a raw substring."',
' lexeme "zh"',
' word "月"',
' description "Chinese noun (pinyin yue) for the month, a unit of time and one of the twelve divisions of a year; matched as a raw substring."',
' word "个月"',
' description "Chinese measure-word phrase (pinyin ge yue) counting months as a duration; matched as a raw substring."',
' meaning "celsius"',
' gloss "a unit of temperature on the Celsius scale"',
' wiktionary "Celsius"',
' defined_by "temperature"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "celsius"',
' description "English noun for a unit of temperature on the Celsius scale; a temperature unit in the temperature dimension."',
' lexeme "ru"',
' word "цельсий"',
' description "Russian noun (romanized tselsiy) for Celsius, a unit of temperature on the Celsius scale."',
' lexeme "hi"',
' word "सेल्सियस"',
' description "Hindi noun (romanized selsiyas) for Celsius, a unit of temperature on the Celsius scale."',
' lexeme "zh"',
' word "摄氏度"',
' description "Chinese noun (pinyin sheshidu) for degrees Celsius, a unit of temperature on the Celsius scale."',
' meaning "fahrenheit"',
' gloss "a unit of temperature on the Fahrenheit scale"',
' wiktionary "Fahrenheit"',
' defined_by "temperature"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "fahrenheit"',
' description "English noun for a unit of temperature on the Fahrenheit scale; a temperature unit in the temperature dimension."',
' lexeme "ru"',
' word "фаренгейт"',
' description "Russian noun (romanized farengeyt) for Fahrenheit, a unit of temperature on the Fahrenheit scale."',
' lexeme "hi"',
' word "फ़ारेनहाइट"',
' description "Hindi noun (romanized farenhait) for Fahrenheit, a unit of temperature on the Fahrenheit scale."',
' lexeme "zh"',
' word "华氏度"',
' description "Chinese noun (pinyin huashidu) for degrees Fahrenheit, a unit of temperature on the Fahrenheit scale."',
' meaning "kelvin"',
' gloss "the base unit of temperature on the Kelvin scale"',
' wiktionary "kelvin"',
' defined_by "temperature"',
' defined_by "unit"',
' role "measurement_unit"',
' lexeme "en"',
' word "kelvin"',
' description "English noun for the base unit of temperature on the Kelvin scale; the base unit in the temperature dimension."',
' lexeme "ru"',
' word "кельвин"',
' description "Russian noun (romanized kelvin) for the kelvin, the base unit of temperature on the Kelvin scale."',
' lexeme "hi"',
' word "केल्विन"',
' description "Hindi noun (romanized kelvin) for the kelvin, the base unit of temperature on the Kelvin scale."',
' lexeme "zh"',
' word "开尔文"',
' description "Chinese noun (pinyin kaierwen) for the kelvin, the base unit of temperature on the Kelvin scale."',
"meanings",
' meaning "monday"',
' gloss "the first day of the working week in the ISO weekday cycle"',
' wiktionary "Monday"',
' defined_by "calendar_day"',
' role "calendar_weekday"',
' lexeme "en"',
' word "monday"',
' description "English noun for the first day of the ISO weekday cycle."',
' word "mon"',
' description "English abbreviation for Monday, the first day of the ISO weekday cycle."',
' lexeme "ru"',
' word "понедельник"',
' description "Russian noun (romanized ponedelnik) for Monday, the first ISO weekday, in the nominative case."',
' word "понедельника"',
' description "Russian noun (romanized ponedelnika) for Monday, the genitive case form of the first ISO weekday."',
' word "понедельником"',
' description "Russian noun (romanized ponedelnikom) for Monday, the instrumental case form of the first ISO weekday."',
' word "понедельнику"',
' description "Russian noun (romanized ponedelniku) for Monday, the dative case form of the first ISO weekday."',
' word "понедельнике"',
' description "Russian noun (romanized ponedelnike) for Monday, the prepositional case form of the first ISO weekday."',
' lexeme "hi"',
' word "सोमवार"',
' description "Hindi noun (romanized somvar) for Monday, the first day of the ISO weekday cycle."',
' lexeme "zh"',
' word "星期一"',
' description "Chinese noun (pinyin xingqiyi) for Monday, the first day of the ISO weekday cycle."',
' word "周一"',
' description "Chinese noun (pinyin zhouyi) for Monday, a colloquial surface for the first ISO weekday."',
' meaning "tuesday"',
' gloss "the second day of the ISO weekday cycle, after Monday"',
' wiktionary "Tuesday"',
' defined_by "calendar_day"',
' role "calendar_weekday"',
' lexeme "en"',
' word "tuesday"',
' description "English noun for the second day of the ISO weekday cycle, after Monday."',
' word "tue"',
' description "English abbreviation for Tuesday, the second day of the ISO weekday cycle."',
' word "tues"',
' description "English abbreviation for Tuesday, an alternative short form of the second ISO weekday."',
' lexeme "ru"',
' word "вторник"',
' description "Russian noun (romanized vtornik) for Tuesday, the second ISO weekday, in the nominative case."',
' word "вторника"',
' description "Russian noun (romanized vtornika) for Tuesday, the genitive case form of the second ISO weekday."',
' word "вторником"',
' description "Russian noun (romanized vtornikom) for Tuesday, the instrumental case form of the second ISO weekday."',
' word "вторнику"',
' description "Russian noun (romanized vtorniku) for Tuesday, the dative case form of the second ISO weekday."',
' word "вторнике"',
' description "Russian noun (romanized vtornike) for Tuesday, the prepositional case form of the second ISO weekday."',
' lexeme "hi"',
' word "मंगलवार"',
' description "Hindi noun (romanized mangalvar) for Tuesday, the second day of the ISO weekday cycle."',
' lexeme "zh"',
' word "星期二"',
' description "Chinese noun (pinyin xingqier) for Tuesday, the second day of the ISO weekday cycle."',
' word "周二"',
' description "Chinese noun (pinyin zhouer) for Tuesday, a colloquial surface for the second ISO weekday."',
' meaning "wednesday"',
' gloss "the third day of the ISO weekday cycle, after Tuesday"',
' wiktionary "Wednesday"',
' defined_by "calendar_day"',
' role "calendar_weekday"',
' lexeme "en"',
' word "wednesday"',
' description "English noun for the third day of the ISO weekday cycle, after Tuesday."',
' word "wed"',
' description "English abbreviation for Wednesday, the third day of the ISO weekday cycle."',
' lexeme "ru"',
' word "среда"',
' description "Russian noun (romanized sreda) for Wednesday, the third ISO weekday, in the nominative case."',
' word "среды"',
' description "Russian noun (romanized sredy) for Wednesday, the genitive case form of the third ISO weekday."',
' word "среде"',
' description "Russian noun (romanized srede) for Wednesday, the dative or prepositional case form of the third ISO weekday."',
' word "среду"',
' description "Russian noun (romanized sredu) for Wednesday, the accusative case form of the third ISO weekday."',
' word "средой"',
' description "Russian noun (romanized sredoy) for Wednesday, the instrumental case form of the third ISO weekday."',
' lexeme "hi"',
' word "बुधवार"',
' description "Hindi noun (romanized budhvar) for Wednesday, the third day of the ISO weekday cycle."',
' lexeme "zh"',
' word "星期三"',
' description "Chinese noun (pinyin xingqisan) for Wednesday, the third day of the ISO weekday cycle."',
' word "周三"',
' description "Chinese noun (pinyin zhousan) for Wednesday, a colloquial surface for the third ISO weekday."',
' meaning "thursday"',
' gloss "the fourth day of the ISO weekday cycle, after Wednesday"',
' wiktionary "Thursday"',
' defined_by "calendar_day"',
' role "calendar_weekday"',
' lexeme "en"',
' word "thursday"',
' description "English noun for the fourth day of the ISO weekday cycle, after Wednesday."',
' word "thu"',
' description "English abbreviation for Thursday, the fourth day of the ISO weekday cycle."',
' word "thur"',
' description "English abbreviation for Thursday, an alternative short form of the fourth ISO weekday."',
' word "thurs"',
' description "English abbreviation for Thursday, another short form of the fourth ISO weekday."',
' lexeme "ru"',
' word "четверг"',
' description "Russian noun (romanized chetverg) for Thursday, the fourth ISO weekday, in the nominative case."',
' word "четверга"',
' description "Russian noun (romanized chetverga) for Thursday, the genitive case form of the fourth ISO weekday."',
' word "четвергом"',
' description "Russian noun (romanized chetvergom) for Thursday, the instrumental case form of the fourth ISO weekday."',
' word "четвергу"',
' description "Russian noun (romanized chetvergu) for Thursday, the dative case form of the fourth ISO weekday."',
' word "четверге"',
' description "Russian noun (romanized chetverge) for Thursday, the prepositional case form of the fourth ISO weekday."',
' lexeme "hi"',
' word "गुरुवार"',
' description "Hindi noun (romanized guruvar) for Thursday, the fourth day of the ISO weekday cycle."',
' lexeme "zh"',
' word "星期四"',
' description "Chinese noun (pinyin xingqisi) for Thursday, the fourth day of the ISO weekday cycle."',
' word "周四"',
' description "Chinese noun (pinyin zhousi) for Thursday, a colloquial surface for the fourth ISO weekday."',
' meaning "friday"',
' gloss "the fifth day of the ISO weekday cycle, after Thursday"',
' wiktionary "Friday"',
' defined_by "calendar_day"',
' role "calendar_weekday"',
' lexeme "en"',
' word "friday"',
' description "English noun for the fifth day of the ISO weekday cycle, after Thursday."',
' word "fri"',
' description "English abbreviation for Friday, the fifth day of the ISO weekday cycle."',
' lexeme "ru"',
' word "пятница"',
' description "Russian noun (romanized pyatnitsa) for Friday, the fifth ISO weekday, in the nominative case."',
' word "пятницы"',
' description "Russian noun (romanized pyatnitsy) for Friday, the genitive case form of the fifth ISO weekday."',
' word "пятнице"',
' description "Russian noun (romanized pyatnitse) for Friday, the dative or prepositional case form of the fifth ISO weekday."',
' word "пятницу"',
' description "Russian noun (romanized pyatnitsu) for Friday, the accusative case form of the fifth ISO weekday."',
' word "пятницей"',
' description "Russian noun (romanized pyatnitsey) for Friday, the instrumental case form of the fifth ISO weekday."',
' lexeme "hi"',
' word "शुक्रवार"',
' description "Hindi noun (romanized shukravar) for Friday, the fifth day of the ISO weekday cycle."',
' lexeme "zh"',
' word "星期五"',
' description "Chinese noun (pinyin xingqiwu) for Friday, the fifth day of the ISO weekday cycle."',
' word "周五"',
' description "Chinese noun (pinyin zhouwu) for Friday, a colloquial surface for the fifth ISO weekday."',
' meaning "saturday"',
' gloss "the sixth day of the ISO weekday cycle, after Friday"',
' wiktionary "Saturday"',
' defined_by "calendar_day"',
' role "calendar_weekday"',
' lexeme "en"',
' word "saturday"',
' description "English noun for the sixth day of the ISO weekday cycle, after Friday."',
' word "sat"',
' description "English abbreviation for Saturday, the sixth day of the ISO weekday cycle."',
' lexeme "ru"',
' word "суббота"',
' description "Russian noun (romanized subbota) for Saturday, the sixth ISO weekday, in the nominative case."',
' word "субботы"',
' description "Russian noun (romanized subboty) for Saturday, the genitive case form of the sixth ISO weekday."',
' word "субботе"',
' description "Russian noun (romanized subbote) for Saturday, the dative or prepositional case form of the sixth ISO weekday."',
' word "субботу"',
' description "Russian noun (romanized subbotu) for Saturday, the accusative case form of the sixth ISO weekday."',
' word "субботой"',
' description "Russian noun (romanized subbotoy) for Saturday, the instrumental case form of the sixth ISO weekday."',
' lexeme "hi"',
' word "शनिवार"',
' description "Hindi noun (romanized shanivar) for Saturday, the sixth day of the ISO weekday cycle."',
' lexeme "zh"',
' word "星期六"',
' description "Chinese noun (pinyin xingqiliu) for Saturday, the sixth day of the ISO weekday cycle."',
' word "周六"',
' description "Chinese noun (pinyin zhouliu) for Saturday, a colloquial surface for the sixth ISO weekday."',
' meaning "sunday"',
' gloss "the seventh day of the ISO weekday cycle, after Saturday"',
' wiktionary "Sunday"',
' defined_by "calendar_day"',
' role "calendar_weekday"',
' lexeme "en"',
' word "sunday"',
' description "English noun for the seventh day of the ISO weekday cycle, after Saturday."',
' word "sun"',
' description "English abbreviation for Sunday, the seventh day of the ISO weekday cycle."',
' lexeme "ru"',
' word "воскресенье"',
' description "Russian noun (romanized voskresenye) for Sunday, the seventh ISO weekday, in the nominative case."',
' word "воскресенья"',
' description "Russian noun (romanized voskresenya) for Sunday, the genitive case form of the seventh ISO weekday."',
' word "воскресенью"',
' description "Russian noun (romanized voskresenyu) for Sunday, the dative case form of the seventh ISO weekday."',
' word "воскресеньем"',
' description "Russian noun (romanized voskresenyem) for Sunday, the instrumental case form of the seventh ISO weekday."',
' lexeme "hi"',
' word "रविवार"',
' description "Hindi noun (romanized ravivar) for Sunday, the seventh day of the ISO weekday cycle."',
' lexeme "zh"',
' word "星期日"',
' description "Chinese noun (pinyin xingqiri) for Sunday, the seventh day of the ISO weekday cycle."',
' word "星期天"',
' description "Chinese noun (pinyin xingqitian) for Sunday, a colloquial surface for the seventh ISO weekday."',
' word "周日"',
' description "Chinese noun (pinyin zhouri) for Sunday, a colloquial surface for the seventh ISO weekday."',
' meaning "calendar_day"',
' gloss "a single named day; the unit a weekday-relation question asks about"',
' wiktionary "day"',
' defined_by "calendar_week"',
' defined_by "calendar_date"',
' defined_by "concept"',
' role "calendar_day_reference"',
' lexeme "en"',
' word "day"',
' description "English noun for a single named day, the unit a weekday-relation question asks about."',
' word "weekday"',
' description "English noun for a day of the week; a more specific surface for a single named day."',
' word "week day"',
' description "English two-word spelling of weekday, naming a single day of the week."',
' lexeme "ru"',
' word "день"',
' description "Russian noun (romanized den) for a day, in the nominative or accusative case."',
' word "дня"',
' description "Russian noun (romanized dnya) for a day, the genitive case form."',
' word "дни"',
' description "Russian noun (romanized dni) for days, the nominative plural form."',
' word "дней"',
' description "Russian noun (romanized dney) for days, the genitive plural form."',
' lexeme "hi"',
' word "दिन"',
' description "Hindi noun (romanized din) for a day, the unit a weekday-relation question asks about."',
' lexeme "zh"',
' word "星期几"',
' description "Chinese phrase (pinyin xingqiji) meaning which day of the week, the interrogative surface for a named day."',
' word "日子"',
' description "Chinese noun (pinyin rizi) for a day or date, a colloquial surface for a single named day."',
' meaning "calendar_date"',
' gloss "a calendar date — the year-month-day coordinate of a day"',
' wiktionary "date"',
' defined_by "calendar_day"',
' role "calendar_day_reference"',
' lexeme "en"',
' word "date"',
' description "English noun for a calendar date, the year-month-day coordinate of a day."',
' lexeme "ru"',
' word "дата"',
' description "Russian noun (romanized data) for a date, in the nominative case."',
' word "дату"',
' description "Russian noun (romanized datu) for a date, the accusative case form."',
' word "число"',
' description "Russian noun (romanized chislo) for a day-of-month number; a surface for a calendar date."',
' lexeme "hi"',
' word "तारीख"',
' description "Hindi noun (romanized tarikh) for a date, the year-month-day coordinate of a day."',
' word "दिनांक"',
' description "Hindi noun (romanized dinank) for a date; a more formal surface for a calendar date."',
' lexeme "zh"',
' word "日期"',
' description "Chinese noun (pinyin riqi) for a date, the year-month-day coordinate of a day."',
' word "几号"',
' description "Chinese phrase (pinyin jihao) meaning which day of the month, an interrogative surface for a date."',
' meaning "calendar_week"',
' gloss "the seven-day cycle the weekdays belong to"',
' wiktionary "week"',
' defined_by "calendar_day"',
' role "calendar_day_reference"',
' lexeme "en"',
' word "week"',
' description "English noun for the seven-day cycle the weekdays belong to."',
' lexeme "ru"',
' word "неделя"',
' description "Russian noun (romanized nedelya) for a week, in the nominative case."',
' word "недели"',
' description "Russian noun (romanized nedeli) for a week, the genitive singular or nominative plural form."',
' word "неделе"',
' description "Russian noun (romanized nedele) for a week, the dative or prepositional case form."',
' word "неделю"',
' description "Russian noun (romanized nedelyu) for a week, the accusative case form."',
' word "неделей"',
' description "Russian noun (romanized nedeley) for a week, the instrumental case form."',
' word "недель"',
' description "Russian noun (romanized nedel) for weeks, the genitive plural form."',
' lexeme "hi"',
' word "सप्ताह"',
' description "Hindi noun (romanized saptah) for a week, the seven-day cycle the weekdays belong to."',
' lexeme "zh"',
' word "星期"',
' description "Chinese noun (pinyin xingqi) for a week, the seven-day cycle the weekdays belong to."',
' word "周"',
' description "Chinese noun (pinyin zhou) for a week, a shorter surface for the seven-day cycle."',
' meaning "calendar_following"',
" gloss \"the relation 'the day that comes after' — a +1 step in the weekday cycle\"",
' wiktionary "after"',
' defined_by "calendar_day"',
' role "calendar_direction_next"',
' lexeme "en"',
' word "after"',
' description "English preposition for the relation the day that comes after, a +1 step in the weekday cycle."',
' word "comes after"',
' description "English verb phrase for following in sequence, naming the +1 step in the weekday cycle."',
' word "day after"',
' description "English noun phrase for the day that follows, a +1 step in the weekday cycle."',
' word "next day"',
' description "English noun phrase for the following day, a +1 step in the weekday cycle."',
' word "following day"',
' description "English noun phrase for the day that comes after, a +1 step in the weekday cycle."',
' word "following weekday"',
' description "English noun phrase for the weekday that comes after, a +1 step in the weekday cycle."',
' word "follows"',
' description "English verb for coming after in sequence, naming the +1 step in the weekday cycle."',
' lexeme "ru"',
' word "после"',
' description "Russian preposition (romanized posle) meaning after, naming the +1 step in the weekday cycle."',
' word "наступает после"',
' description "Russian verb phrase (romanized nastupayet posle) meaning comes after, naming the +1 step in the weekday cycle."',
' word "следующий день"',
' description "Russian noun phrase (romanized sleduyushchiy den) meaning the next day, a +1 step in the weekday cycle."',
' word "следующая"',
' description "Russian adjective (romanized sleduyushchaya) meaning following, the feminine form naming the +1 step."',
' word "следом за"',
' description "Russian phrase (romanized sledom za) meaning right after, naming the +1 step in the weekday cycle."',
' lexeme "hi"',
' word "के बाद"',
' description "Hindi postposition (romanized ke baad) meaning after, naming the +1 step in the weekday cycle."',
' word "बाद"',
' description "Hindi adverb (romanized baad) meaning after or later, naming the +1 step in the weekday cycle."',
' word "अगला"',
' description "Hindi adjective (romanized agla) meaning next, the masculine form naming the +1 step."',
' word "अगले"',
' description "Hindi adjective (romanized agle) meaning next, an oblique or plural form naming the +1 step."',
' lexeme "zh"',
' word "之后"',
' description "Chinese phrase (pinyin zhihou) meaning after, naming the +1 step in the weekday cycle."',
' word "后"',
' description "Chinese word (pinyin hou) meaning after or behind, a shorter surface for the +1 step."',
' word "下一个"',
' description "Chinese phrase (pinyin xiayige) meaning the next one, naming the +1 step in the weekday cycle."',
' word "下一天"',
' description "Chinese phrase (pinyin xiayitian) meaning the next day, a +1 step in the weekday cycle."',
' meaning "calendar_preceding"',
" gloss \"the relation 'the day that comes before' — a -1 step in the weekday cycle\"",
' wiktionary "before"',
' defined_by "calendar_day"',
' role "calendar_direction_previous"',
' lexeme "en"',
' word "before"',
' description "English preposition for the relation the day that comes before, a -1 step in the weekday cycle."',
' word "comes before"',
' description "English verb phrase for preceding in sequence, naming the -1 step in the weekday cycle."',
' word "day before"',
' description "English noun phrase for the day that precedes, a -1 step in the weekday cycle."',
' word "previous day"',
' description "English noun phrase for the preceding day, a -1 step in the weekday cycle."',
' word "previous weekday"',
' description "English noun phrase for the preceding weekday, a -1 step in the weekday cycle."',
' word "precedes"',
' description "English verb for coming before in sequence, naming the -1 step in the weekday cycle."',
' lexeme "ru"',
' word "перед"',
' description "Russian preposition (romanized pered) meaning before, naming the -1 step in the weekday cycle."',
' word "предыдущий день"',
' description "Russian noun phrase (romanized predydushchiy den) meaning the previous day, a -1 step in the weekday cycle."',
' word "предыдущая"',
' description "Russian adjective (romanized predydushchaya) meaning previous, the feminine form naming the -1 step."',
' word "предшествует"',
' description "Russian verb (romanized predshestvuyet) meaning precedes, naming the -1 step in the weekday cycle."',
' lexeme "hi"',
' word "से पहले"',
' description "Hindi postposition (romanized se pehle) meaning before, naming the -1 step in the weekday cycle."',
' word "के पहले"',
' description "Hindi postposition (romanized ke pehle) meaning before, an alternative surface for the -1 step."',
' word "पहले"',
' description "Hindi adverb (romanized pehle) meaning before or earlier, naming the -1 step in the weekday cycle."',
' word "पिछला"',
' description "Hindi adjective (romanized pichhla) meaning previous, the masculine form naming the -1 step."',
' lexeme "zh"',
' word "之前"',
' description "Chinese phrase (pinyin zhiqian) meaning before, naming the -1 step in the weekday cycle."',
' word "前"',
' description "Chinese word (pinyin qian) meaning before or front, a shorter surface for the -1 step."',
' word "上一个"',
' description "Chinese phrase (pinyin shangyige) meaning the previous one, naming the -1 step in the weekday cycle."',
' word "上一天"',
' description "Chinese phrase (pinyin shangyitian) meaning the previous day, a -1 step in the weekday cycle."',
' meaning "calendar_today"',
' gloss "the present day relative to the system clock"',
' wiktionary "today"',
' defined_by "calendar_day"',
' role "calendar_today"',
' lexeme "en"',
' word "today"',
' description "English noun and adverb for the present day relative to the system clock."',
' lexeme "ru"',
' word "сегодня"',
' description "Russian adverb (romanized segodnya) for today, the present day relative to the system clock."',
' lexeme "hi"',
' word "आज"',
' description "Hindi adverb (romanized aaj) for today, the present day relative to the system clock."',
' lexeme "zh"',
' word "今天"',
' description "Chinese noun (pinyin jintian) for today, the present day relative to the system clock."',
' meaning "calendar_interrogative"',
' gloss "an interrogative or imperative asking which day — the question side of a calendar query"',
' wiktionary "what"',
' defined_by "calendar_day"',
' role "calendar_question"',
' lexeme "en"',
' word "what"',
' description "English interrogative pronoun asking which day, the question side of a calendar query."',
' word "which"',
' description "English interrogative determiner selecting which day, the question side of a calendar query."',
' word "tell me"',
' description "English imperative phrase requesting which day, the question side of a calendar query."',
' word "show"',
' description "English imperative verb requesting which day be displayed, the question side of a calendar query."',
' word "?"',
' description "Question mark punctuation marking an interrogative, the question side of a calendar query."',
' lexeme "ru"',
' word "какой"',
' description "Russian interrogative (romanized kakoy) meaning which, the masculine form asking which day."',
' word "какая"',
' description "Russian interrogative (romanized kakaya) meaning which, the feminine form asking which day."',
' word "какое"',
' description "Russian interrogative (romanized kakoye) meaning which, the neuter form asking which day."',
' word "скажи"',
' description "Russian imperative (romanized skazhi) meaning tell me, requesting which day."',
' word "покажи"',
' description "Russian imperative (romanized pokazhi) meaning show, requesting which day be displayed."',
' lexeme "hi"',
' word "कौन"',
' description "Hindi interrogative pronoun (romanized kaun) meaning who or which, asking which day."',
' word "क्या"',
' description "Hindi interrogative (romanized kya) meaning what, the question side of a calendar query."',
' word "बताओ"',
' description "Hindi imperative (romanized batao) meaning tell me, requesting which day."',
' word "दिखाओ"',
' description "Hindi imperative (romanized dikhao) meaning show, requesting which day be displayed."',
' lexeme "zh"',
' word "什么"',
' description "Chinese interrogative (pinyin shenme) meaning what, the question side of a calendar query."',
' word "几"',
' description "Chinese interrogative (pinyin ji) meaning how many or which number, asking which day."',
' word "告诉"',
' description "Chinese verb (pinyin gaosu) meaning tell, requesting which day."',
' word "显示"',
' description "Chinese verb (pinyin xianshi) meaning show or display, requesting which day be displayed."',
"meanings",
' meaning "money"',
' gloss "money or currency in general — a medium of exchange. This genus groups the currency-related meanings (the us_dollar currency and the exchange_rate between currencies) so they are built from a shared concept rather than listed independently. The monetary_concept role is structural: no handler queries it directly; it exists so the ontology records that these meanings are kinds of money."',
' wiktionary "money"',
' defined_by "concept"',
' role "monetary_concept"',
' lexeme "en"',
' word "money"',
' description "English noun for the medium of exchange; the monetary_concept genus lexicalized in English."',
' word "currency"',
' description "English noun for a system of money in circulation; the monetary_concept genus lexicalized in English."',
' lexeme "ru"',
' word "деньги"',
' description "Russian noun (romanized dengi, money); the monetary_concept genus lexicalized in Russian."',
' word "валюта"',
' description "Russian noun (romanized valyuta, currency); the monetary_concept genus lexicalized in Russian."',
' lexeme "hi"',
' word "पैसा"',
' description "Hindi noun (romanized paisa, money); the monetary_concept genus lexicalized in Hindi."',
' word "मुद्रा"',
' description "Hindi noun (romanized mudra, currency); the monetary_concept genus lexicalized in Hindi."',
' lexeme "zh"',
' word "货币"',
' description "Chinese noun (pinyin huobi, currency); the monetary_concept genus lexicalized in Chinese."',
' word "钱"',
' description "Chinese noun (pinyin qian, money); the monetary_concept genus lexicalized in Chinese."',
' meaning "exchange_rate"',
' gloss "the exchange rate between two currencies — the price of one currency expressed in another, also called a currency rate. The exchange_rate_reference role marks the surface forms that signal a prompt is talking about a currency conversion rate; the calculator rate-basis handler requires this together with a us_dollar reference and a calculation_basis phrase before it answers with the rate the calculator uses for USD to RUB. Matched as raw substrings so inflected and compound forms are caught in every supported language."',
' wiktionary "exchange rate"',
' defined_by "money"',
' defined_by "relation"',
' role "exchange_rate_reference"',
' lexeme "en"',
' word "exchange rate"',
' description "English compound noun for the price of one currency in another; an exchange_rate_reference matched as a raw substring."',
' word "currency rate"',
' description "English synonym for an exchange rate; an exchange_rate_reference matched as a raw substring."',
' lexeme "ru"',
' word "курс"',
' description "Russian noun (romanized kurs, rate or exchange rate); an exchange_rate_reference matched as a raw substring so курс, курса and курсе are all caught."',
' lexeme "hi"',
' word "विनिमय दर"',
' description "Hindi compound (romanized vinimay dar, exchange rate); an exchange_rate_reference matched as a raw substring."',
' lexeme "zh"',
' word "汇率"',
' description "Chinese noun (pinyin huilu, exchange rate); an exchange_rate_reference matched as a raw substring."',
' meaning "us_dollar"',
' gloss "the United States dollar, the currency abbreviated USD. The currency_usd_reference role marks the surface forms — including two common Russian misspellings — that signal a prompt mentions US dollars; the calculator rate-basis handler requires this together with an exchange_rate reference and a calculation_basis phrase before it answers with the rate the calculator uses for USD to RUB. Matched as raw substrings so inflected forms are caught in every supported language. Also a calculation_domain_term, so a dollar reference beside a number signals a calculation to the calculator router (ASCII codes whole-token, other scripts as raw substrings)."',
' wiktionary "dollar"',
' defined_by "money"',
' role "currency_usd_reference"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "usd"',
' description "English ISO 4217 code for the United States dollar; a currency_usd_reference matched as a raw substring."',
' word "dollar"',
' description "English noun for the United States dollar; a currency_usd_reference matched as a raw substring so dollars is also caught."',
' word "dollars"',
" description \"English plural of dollar; a currency_usd_reference matched as a raw substring, kept explicitly so the surface list mirrors the original recognizer's USD markers.\"",
' lexeme "ru"',
' word "доллар"',
' description "Russian noun (romanized dollar); a currency_usd_reference matched as a raw substring so доллара and долларах are caught."',
' word "долар"',
' description "Russian misspelling with one l (romanized dolar) of доллар; a currency_usd_reference matched as a raw substring so the typo is still recognised."',
' word "долор"',
' description "Russian misspelling (romanized dolor) of доллар; a currency_usd_reference matched as a raw substring so the typo is still recognised."',
' lexeme "hi"',
' word "डॉलर"',
' description "Hindi noun (romanized dolar, dollar); a currency_usd_reference matched as a raw substring."',
' lexeme "zh"',
' word "美元"',
' description "Chinese noun (pinyin meiyuan, US dollar); a currency_usd_reference matched as a raw substring."',
' meaning "euro"',
' gloss "the euro, the currency abbreviated EUR. The currency_eur_reference role marks the surface forms that name the euro; the compound-interest handler reads it as a whole token to decide whether to convert a final amount into euros, and the calculation rate handlers read it to recognise a euro currency code. Defined as a kind of money. Also a calculation_domain_term, so a euro reference beside a number signals a calculation to the calculator router (ASCII codes whole-token, other scripts as raw substrings)."',
' wiktionary "euro"',
' defined_by "money"',
' role "currency_eur_reference"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "eur"',
' description "English ISO 4217 code for the euro; a currency_eur_reference matched as a token-bounded word."',
' word "euro"',
' description "English noun for the euro; a currency_eur_reference matched as a token-bounded word."',
' word "euros"',
' description "English plural of euro; a currency_eur_reference matched as a token-bounded word, kept explicitly because token-bounded matching does not derive the plural from the singular."',
' lexeme "ru"',
' word "евро"',
' description "Russian noun (romanized evro, euro), indeclinable; a currency_eur_reference matched as a token-bounded word."',
' lexeme "hi"',
' word "यूरो"',
' description "Hindi noun (romanized yuro, euro); a currency_eur_reference matched as a token-bounded word."',
' lexeme "zh"',
' word "欧元"',
' description "Chinese noun (pinyin ouyuan, euro); a currency_eur_reference matched as a token-bounded word."',
' meaning "ruble"',
' gloss "the Russian ruble, the currency abbreviated RUB. The currency_rub_reference role marks the surface forms that name the ruble; the calculation rate handlers and the compound-interest worker read it as a whole token to recognise a ruble currency code. Defined as a kind of money. Also a calculation_domain_term, so a ruble reference beside a number signals a calculation to the calculator router (ASCII codes whole-token, other scripts as raw substrings)."',
' wiktionary "ruble"',
' defined_by "money"',
' role "currency_rub_reference"',
' role "calculation_domain_term"',
' lexeme "en"',
' word "rub"',
' description "English ISO 4217 code for the Russian ruble; a currency_rub_reference matched as a token-bounded word."',
' word "ruble"',
' description "English noun for the Russian ruble; a currency_rub_reference matched as a token-bounded word."',
' word "rubles"',
' description "English plural of ruble; a currency_rub_reference matched as a token-bounded word, kept explicitly because token-bounded matching does not derive the plural from the singular."',
' lexeme "ru"',
' word "рубль"',
' description "Russian noun (romanized rubl, ruble); a currency_rub_reference matched as a token-bounded word."',
' word "рублей"',
' description "Russian genitive-plural noun (romanized rubley, rubles), the form used after most numbers; a currency_rub_reference matched as a token-bounded word."',
' word "руб"',
' description "Russian abbreviation (romanized rub) of рубль; a currency_rub_reference matched as a token-bounded word."',
' lexeme "hi"',
' word "रूबल"',
' description "Hindi noun (romanized rubal, ruble); a currency_rub_reference matched as a token-bounded word."',
' lexeme "zh"',
' word "卢布"',
' description "Chinese noun (pinyin lubu, ruble); a currency_rub_reference matched as a token-bounded word."',
' meaning "calculation_basis"',
' gloss "a phrase asking which value, rate, or method the assistant uses, applies, or takes as the basis when it calculates — the question side of a prompt like which rate do you use for calculations. The calculation_basis_reference role marks these surface forms; the calculator rate-basis handler requires this together with an exchange_rate reference and a us_dollar reference before it answers with the rate the calculator uses for USD to RUB. The forms are inflectable stems and fixed phrases matched as raw substrings, so they are caught regardless of surrounding inflection in every supported language."',
' wiktionary "calculation"',
' defined_by "action"',
' defined_by "inquiry"',
' role "calculation_basis_reference"',
' lexeme "en"',
' word "calculation"',
' description "English noun for the act of computing; a calculation_basis_reference matched as a raw substring so calculations is also caught."',
' word "calculations"',
' description "English plural of calculation; a calculation_basis_reference matched as a raw substring, kept explicitly so the surface list mirrors the original recognizer."',
' word "do you use"',
' description "English interrogative fragment asking which value the assistant uses; a calculation_basis_reference matched as a raw substring."',
' word "used for"',
' description "English fragment asking what a rate is used for; a calculation_basis_reference matched as a raw substring."',
' word "your rate"',
" description \"English fragment asking about the assistant's own rate; a calculation_basis_reference matched as a raw substring.\"",
' lexeme "ru"',
' word "при расчет"',
' description "Russian fragment (romanized pri raschet, during calculation) without the ё; a calculation_basis_reference matched as a raw substring so при расчете and при расчетах are caught."',
' word "при расчёт"',
' description "Russian fragment (romanized pri raschyot, during calculation) with the ё; a calculation_basis_reference matched as a raw substring so при расчёте and при расчётах are caught."',
' word "в расчет"',
' description "Russian fragment (romanized v raschet, into the calculation) without the ё; a calculation_basis_reference matched as a raw substring."',
' word "в расчёт"',
' description "Russian fragment (romanized v raschyot, into the calculation) with the ё; a calculation_basis_reference matched as a raw substring."',
' word "для расчет"',
' description "Russian fragment (romanized dlya raschet, for the calculation) without the ё; a calculation_basis_reference matched as a raw substring."',
' word "для расчёт"',
' description "Russian fragment (romanized dlya raschyot, for the calculation) with the ё; a calculation_basis_reference matched as a raw substring."',
' word "у тебя"',
' description "Russian fragment (romanized u tebya, that you have or that you use); a calculation_basis_reference matched as a raw substring."',
' word "использ"',
' description "Russian verb stem (romanized ispolz, of использовать, to use); a calculation_basis_reference matched as a raw substring so используешь and используете are caught."',
' word "берешь"',
' description "Russian second-person verb (romanized beresh, you take) without the ё; a calculation_basis_reference matched as a raw substring."',
' word "берёшь"',
' description "Russian second-person verb (romanized beryosh, you take) with the ё; a calculation_basis_reference matched as a raw substring."',
' word "примен"',
' description "Russian verb stem (romanized primen, of применять, to apply); a calculation_basis_reference matched as a raw substring so применяешь and применяете are caught."',
' lexeme "hi"',
' word "गणना"',
' description "Hindi noun (romanized ganana, calculation); a calculation_basis_reference matched as a raw substring."',
' word "उपयोग"',
' description "Hindi noun (romanized upayog, use); a calculation_basis_reference matched as a raw substring."',
' lexeme "zh"',
' word "计算"',
' description "Chinese verb (pinyin jisuan, to calculate); a calculation_basis_reference matched as a raw substring."',
' word "使用"',
' description "Chinese verb (pinyin shiyong, to use); a calculation_basis_reference matched as a raw substring."',
' meaning "arithmetic_operation"',
' gloss "an arithmetic operation that combines numbers into a result: addition, subtraction, multiplication, division, modulo. The genus of the individual spelled operators, each defined as a kind of arithmetic operation rather than listed in code. The numeric_concept role is structural: no handler queries the genus directly; it exists so the ontology records that these operators are kinds of arithmetic operation."',
' wiktionary "arithmetic operation"',
' defined_by "action"',
' role "numeric_concept"',
' lexeme "en"',
' word "arithmetic operation"',
' description "English term for an operation that combines numbers into a result; the genus of the individual spelled operators."',
' word "operator"',
' description "English noun for the symbol or word naming an arithmetic operation; the everyday surface for the operation concept."',
' lexeme "ru"',
' word "арифметическая операция"',
' description "Russian term (romanized arifmeticheskaya operatsiya) for an arithmetic operation; the Russian surface for the arithmetic-operation concept."',
' lexeme "hi"',
' word "अंकगणितीय संक्रिया"',
' description "Hindi term (romanized ankaganitiya sankriya) for an arithmetic operation; the Hindi surface for the arithmetic-operation concept."',
' lexeme "zh"',
' word "算术运算"',
' description "Chinese term (pinyin suanshu yunsuan) for an arithmetic operation; the Chinese surface for the arithmetic-operation concept."',
' meaning "addition"',
' gloss "the arithmetic operation of adding two numbers, written with the plus sign. The arithmetic_operator_word role marks the spelled operator surfaces; contains_word_operator reads them to decide whether a prompt names an arithmetic operator in words rather than symbols. Matched as a token-bounded word, with CJK surfaces matched as a substring because those scripts have no inter-word spaces."',
' wiktionary "addition"',
' defined_by "arithmetic_operation"',
' role "arithmetic_operator_word"',
' lexeme "en"',
' word "plus"',
' description "English spelled form of the addition operator; an arithmetic_operator_word matched as a token-bounded word."',
' word "+"',
" description \"ASCII plus sign for the addition operator; the script-independent operator surface the arithmetic evaluator consumes, from which the operation's machine symbol is read.\"",
' lexeme "ru"',
' word "плюс"',
' description "Russian spelled form (romanized plyus) of the addition operator; an arithmetic_operator_word matched as a token-bounded word."',
' lexeme "hi"',
' word "जोड़"',
' description "Hindi spelled form (romanized jod, add) of the addition operator; an arithmetic_operator_word matched as a token-bounded word."',
' lexeme "zh"',
' word "加上"',
' description "Chinese spelled form (pinyin jiashang, add) of the addition operator; an arithmetic_operator_word matched as a substring."',
' meaning "subtraction"',
' gloss "the arithmetic operation of subtracting one number from another, written with the minus sign. The arithmetic_operator_word role marks the spelled operator surfaces; contains_word_operator reads them to decide whether a prompt names an arithmetic operator in words rather than symbols. Matched as a token-bounded word, with CJK surfaces matched as a substring because those scripts have no inter-word spaces."',
' wiktionary "subtraction"',
' defined_by "arithmetic_operation"',
' role "arithmetic_operator_word"',
' lexeme "en"',
' word "minus"',
' description "English spelled form of the subtraction operator; an arithmetic_operator_word matched as a token-bounded word."',
' word "-"',
" description \"ASCII hyphen-minus for the subtraction operator; the script-independent operator surface the arithmetic evaluator consumes, from which the operation's machine symbol is read.\"",
' lexeme "ru"',
' word "минус"',
' description "Russian spelled form (romanized minus) of the subtraction operator; an arithmetic_operator_word matched as a token-bounded word."',
' lexeme "hi"',
' word "घटा"',
' description "Hindi spelled form (romanized ghata, subtract) of the subtraction operator; an arithmetic_operator_word matched as a token-bounded word."',
' lexeme "zh"',
' word "减去"',
' description "Chinese spelled form (pinyin jianqu, subtract) of the subtraction operator; an arithmetic_operator_word matched as a substring."',
' meaning "multiplication"',
' gloss "the arithmetic operation of multiplying two numbers, written with the times sign. The arithmetic_operator_word role marks the spelled operator surfaces; contains_word_operator reads them to decide whether a prompt names an arithmetic operator in words rather than symbols. Matched as a token-bounded word, with CJK surfaces matched as a substring because those scripts have no inter-word spaces."',
' wiktionary "multiplication"',
' defined_by "arithmetic_operation"',
' role "arithmetic_operator_word"',
' lexeme "en"',
' word "times"',
' description "English spelled form of the multiplication operator; an arithmetic_operator_word matched as a token-bounded word."',
' word "multiplied by"',
' description "English spelled phrase for the multiplication operator; an arithmetic_operator_word matched as a token-bounded phrase."',
' word "*"',
" description \"ASCII asterisk for the multiplication operator; the script-independent operator surface the arithmetic evaluator consumes, from which the operation's machine symbol is read.\"",
' lexeme "ru"',
' word "умножить"',
' description "Russian verb (romanized umnozhit, multiply); an arithmetic_operator_word matched as a token-bounded word."',
' word "умножь"',
' description "Russian imperative (romanized umnozh, multiply); an arithmetic_operator_word matched as a token-bounded word."',
' word "умножить на"',
' description "Russian phrase (romanized umnozhit na, multiply by); an arithmetic_operator_word matched as a token-bounded phrase, kept explicitly to mirror the original recognizer."',
' lexeme "hi"',
' word "गुणा"',
' description "Hindi spelled form (romanized guna, multiply) of the multiplication operator; an arithmetic_operator_word matched as a token-bounded word."',
' lexeme "zh"',
' word "乘以"',
' description "Chinese spelled form (pinyin chengyi, multiply by) of the multiplication operator; an arithmetic_operator_word matched as a substring."',
' meaning "division"',
' gloss "the arithmetic operation of dividing one number by another, written with the division sign. The arithmetic_operator_word role marks the spelled operator surfaces; contains_word_operator reads them to decide whether a prompt names an arithmetic operator in words rather than symbols. Matched as a token-bounded word, with CJK surfaces matched as a substring because those scripts have no inter-word spaces."',
' wiktionary "division"',
' defined_by "arithmetic_operation"',
' role "arithmetic_operator_word"',
' lexeme "en"',
' word "divided by"',
' description "English spelled phrase for the division operator; an arithmetic_operator_word matched as a token-bounded phrase."',
' word "/"',
" description \"ASCII slash for the division operator; the script-independent operator surface the arithmetic evaluator consumes, from which the operation's machine symbol is read.\"",
' lexeme "ru"',
' word "разделить на"',
' description "Russian phrase (romanized razdelit na, divide by); an arithmetic_operator_word matched as a token-bounded phrase."',
' word "делить на"',
' description "Russian phrase (romanized delit na, divide by); an arithmetic_operator_word matched as a token-bounded phrase."',
' lexeme "hi"',
' word "भाग"',
' description "Hindi spelled form (romanized bhag, divide) of the division operator; an arithmetic_operator_word matched as a token-bounded word."',
' lexeme "zh"',
' word "除以"',
' description "Chinese spelled form (pinyin chuyi, divide by) of the division operator; an arithmetic_operator_word matched as a substring."',
' meaning "modulo"',
' gloss "the arithmetic operation that yields the remainder of a division, written with the percent sign in the evaluator. The arithmetic_operator_word role marks the spelled operator surfaces; contains_word_operator reads them to decide whether a prompt names an arithmetic operator in words rather than symbols. Matched as a token-bounded word, with CJK surfaces matched as a substring because those scripts have no inter-word spaces."',
' wiktionary "modulo"',
' defined_by "arithmetic_operation"',
' role "arithmetic_operator_word"',
' lexeme "en"',
' word "modulo"',
' description "English spelled form of the modulo operator; an arithmetic_operator_word matched as a token-bounded word."',
' word "mod"',
' description "English abbreviation of modulo; an arithmetic_operator_word matched as a token-bounded word."',
' word "%"',
" description \"ASCII percent sign for the modulo operator; the script-independent operator surface the arithmetic evaluator consumes, from which the operation's machine symbol is read. The evaluator writes modulo as percent, matching rewrite_percent_of which leaves a bare percent not followed by of as the modulo operator.\"",
' lexeme "ru"',
' word "по модулю"',
' description "Russian phrase (romanized po modulyu, modulo) of the modulo operator; an arithmetic_operator_word matched as a token-bounded phrase."',
' lexeme "hi"',
' word "मॉड्यूलो"',
' description "Hindi spelled form (romanized modyulo) of the modulo operator; an arithmetic_operator_word matched as a token-bounded word."',
' lexeme "zh"',
' word "取模"',
' description "Chinese spelled form (pinyin qumo, take modulo) of the modulo operator; an arithmetic_operator_word matched as a substring."',
' meaning "calculation_request"',
" gloss \"a natural-language cue that asks for an arithmetic calculation, whether an imperative ('calculate', 'посчитай') or a question opener ('what is', 'сколько будет'). strip_calculation_wrappers removes these cues from the front of a prompt so the bare expression remains, and the explicit flag it sets lets even a digit-only expression count as a calculation. Each surface is rebuilt into a strip prefix: space-delimited scripts gain a trailing space so the cue strips only on a word boundary (calculate never eats the start of calculated), while CJK surfaces strip as-is because those scripts have no inter-word spaces. The Chinese surfaces are listed longest first so a more specific cue strips before a shorter one it contains.\"",
' wiktionary "calculation"',
' defined_by "action"',
' defined_by "inquiry"',
' role "calculation_request_cue"',
' lexeme "en"',
' word "please calculate"',
' description "English polite imperative asking for a calculation; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "please compute"',
' description "English polite imperative asking to compute a value; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "can you calculate"',
' description "English polite question asking the assistant to calculate; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "can you compute"',
' description "English polite question asking the assistant to compute; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "could you calculate"',
' description "English deferential question asking the assistant to calculate; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "could you compute"',
' description "English deferential question asking the assistant to compute; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "what is"',
' description "English question opener asking for the value of an expression; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
" word \"what's\"",
' description "English contracted question opener (what is); a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "what does"',
" description \"English question opener leading 'what does X equal'; a calculation_request_cue stripped from the front of a prompt on a word boundary.\"",
' word "calculate"',
' description "English bare imperative to calculate; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "compute"',
' description "English bare imperative to compute; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "evaluate"',
' description "English bare imperative to evaluate an expression; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "how much is"',
' description "English quantity question opener; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "solve"',
' description "English bare imperative to solve an expression or equation; a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' lexeme "ru"',
' word "сколько будет"',
' description "Russian question opener (romanized skolko budet, how much will it be); a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "посчитай"',
' description "Russian informal imperative (romanized poschitay, count it up); a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "посчитайте"',
' description "Russian polite-plural imperative (romanized poschitayte, count it up); a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "вычисли"',
' description "Russian informal imperative (romanized vychisli, compute it); a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "вычислите"',
' description "Russian polite-plural imperative (romanized vychislite, compute it); a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "рассчитай"',
' description "Russian informal imperative (romanized rasschitay, calculate it); a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "рассчитайте"',
' description "Russian polite-plural imperative (romanized rasschitayte, calculate it); a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' lexeme "zh"',
' word "请计算"',
' description "Chinese polite imperative (pinyin qing jisuan, please calculate); a calculation_request_cue stripped from the front as a substring since Chinese has no inter-word spaces."',
' word "请算一下"',
' description "Chinese polite imperative (pinyin qing suan yixia, please do a calculation); a calculation_request_cue stripped from the front as a substring since Chinese has no inter-word spaces."',
' word "计算一下"',
' description "Chinese imperative (pinyin jisuan yixia, do a calculation); a calculation_request_cue stripped from the front as a substring since Chinese has no inter-word spaces."',
' word "算一下"',
' description "Chinese imperative (pinyin suan yixia, work it out); a calculation_request_cue stripped from the front as a substring since Chinese has no inter-word spaces."',
' word "计算"',
' description "Chinese verb (pinyin jisuan, calculate); a calculation_request_cue stripped from the front as a substring since Chinese has no inter-word spaces."',
' lexeme "hi"',
' word "कृपया गणना करें"',
' description "Hindi polite imperative (romanized kripya ganana karen, please calculate); a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' word "गणना करें"',
' description "Hindi imperative (romanized ganana karen, do the calculation); a calculation_request_cue stripped from the front of a prompt on a word boundary."',
' meaning "politeness"',
' gloss "a politeness or courtesy marker that softens a request without adding any task content, such as please, for me, пожалуйста, कृपया, or 请. strip_calculation_wrappers removes these markers from the end of a calculation prompt so the bare expression remains. Each surface is rebuilt into a strip suffix: space-delimited scripts gain a leading space so the cue strips only on a word boundary, while CJK surfaces strip as-is because those scripts have no inter-word spaces. Defined as a property of a request — a quality it carries rather than its content."',
' wiktionary "politeness"',
' defined_by "property"',
' role "politeness_cue"',
' lexeme "en"',
' word "please"',
' description "English courtesy word that softens a request; a politeness_cue stripped from the end of a prompt on a word boundary."',
' word "for me"',
' description "English courtesy phrase (do this for me) that softens a request; a politeness_cue stripped from the end of a prompt on a word boundary."',
' lexeme "ru"',
' word "пожалуйста"',
' description "Russian courtesy word (romanized pozhaluysta, please); a politeness_cue stripped from the end of a prompt on a word boundary."',
' lexeme "hi"',
' word "कृपया"',
' description "Hindi courtesy word (romanized kripya, please); a politeness_cue stripped from the end of a prompt on a word boundary."',
' lexeme "zh"',
' word "请"',
' description "Chinese courtesy word (pinyin qing, please); a politeness_cue stripped from the end as a substring since Chinese has no inter-word spaces."',
' meaning "calculation_result_query"',
' gloss "a trailing cue that asks for the computed result of the preceding arithmetic expression, whether an equals word or sign (equal, equals, =, равно), a how-much-is-it question (是多少, 等于多少, कितना है, क्या है), or a head-final do-the-calculation imperative (की गणना करें). strip_calculation_wrappers removes these cues from the end of a prompt so the bare expression remains. Each surface is rebuilt into a strip suffix: space-delimited scripts gain a leading space so the cue strips only on a word boundary, the bare equals sign also strips with no leading space so a compact 2*2+2= is recognised, and CJK surfaces strip as-is because those scripts have no inter-word spaces. Defined as both an action and an inquiry — it both invokes the calculation and asks for its value."',
' wiktionary "equal"',
' defined_by "action"',
' defined_by "inquiry"',
' role "calculation_result_query_cue"',
' lexeme "en"',
' word "equal"',
' description "English equals word asking for the value of the preceding expression; a calculation_result_query_cue stripped from the end of a prompt on a word boundary."',
' word "equals"',
' description "English equals word (third person) asking for the value of the preceding expression; a calculation_result_query_cue stripped from the end of a prompt on a word boundary."',
' word "="',
' description "The equals sign; the script-independent symbol surface that asks for the value of the preceding expression, a calculation_result_query_cue stripped from the end of a prompt both bare (so a compact 2*2+2= is recognised) and on a word boundary."',
' lexeme "ru"',
' word "равно"',
' description "Russian equals word (romanized ravno, equals); a calculation_result_query_cue stripped from the end of a prompt on a word boundary."',
' lexeme "zh"',
' word "是多少"',
' description "Chinese question tail (pinyin shi duoshao, is how much); a calculation_result_query_cue stripped from the end as a substring since Chinese has no inter-word spaces."',
' word "等于多少"',
' description "Chinese question tail (pinyin dengyu duoshao, equals how much); a calculation_result_query_cue stripped from the end as a substring since Chinese has no inter-word spaces."',
' word "等于几"',
' description "Chinese question tail (pinyin dengyu ji, equals how many); a calculation_result_query_cue stripped from the end as a substring since Chinese has no inter-word spaces."',
' lexeme "hi"',
' word "कितना है"',
' description "Hindi question tail (romanized kitna hai, how much is it); a calculation_result_query_cue stripped from the end of a prompt on a word boundary."',
' word "क्या है"',
' description "Hindi question tail (romanized kya hai, what is it); a calculation_result_query_cue stripped from the end of a prompt on a word boundary."',
' word "की गणना करें"',
' description "Hindi head-final imperative (romanized ki ganana karen, do the calculation of); a calculation_result_query_cue stripped from the end of a prompt on a word boundary."',
' meaning "quantity_conversion"',
" gloss \"a cue that a prompt is converting one quantity into another — a currency or unit conversion (convert dollars to euros, 100 km into miles). has_calculation_signal otherwise rejects a prompt that pairs a currency symbol with letters and is not an explicit calculate command, treating it as prose that merely mentions money; a quantity_conversion_cue exempts it, because a conversion is itself a calculation. Each surface is matched whole-token through mentions_role: in space-delimited scripts the cue must stand on a word boundary (so to and into match the marker, never a substring of another word), while Chinese surfaces match as a substring since that script has no inter-word spaces. Distinct from conversion_action, the money-specific verb the compound-interest handler matches as a raw substring: this meaning is the calculator router's general conversion signal and includes the bare target markers to and into, so it must stay whole-token. Defined as an action that establishes a relation between a source and a target quantity.\"",
' wiktionary "conversion"',
' defined_by "action"',
' defined_by "relation"',
' role "quantity_conversion_cue"',
' lexeme "en"',
' word "to"',
' description "English target marker (convert dollars to euros); a quantity_conversion_cue matched whole-token so it signals a conversion only on a word boundary, never inside another word."',
' word "into"',
' description "English target marker (convert 100 km into miles); a quantity_conversion_cue matched whole-token so it signals a conversion only on a word boundary."',
' word "convert"',
' description "English verb to change one quantity into another; a quantity_conversion_cue matched whole-token."',
' word "exchange"',
' description "English verb to trade one currency for another; a quantity_conversion_cue matched whole-token."',
' lexeme "ru"',
' word "конвертировать"',
' description "Russian verb (romanized konvertirovat, to convert); a quantity_conversion_cue matched whole-token on a word boundary."',
' word "обмен"',
' description "Russian noun (romanized obmen, exchange); a quantity_conversion_cue matched whole-token on a word boundary."',
' lexeme "hi"',
' word "बदलें"',
' description "Hindi verb (romanized badlen, change or convert); a quantity_conversion_cue matched whole-token on a word boundary."',
' word "परिवर्तित"',
' description "Hindi adjective (romanized parivartit, converted); a quantity_conversion_cue matched whole-token on a word boundary."',
' lexeme "zh"',
' word "转换"',
' description "Chinese verb (pinyin zhuanhuan, to convert); a quantity_conversion_cue matched as a substring since Chinese has no inter-word spaces."',
' word "兑换"',
' description "Chinese verb (pinyin duihuan, to exchange currency); a quantity_conversion_cue matched as a substring since Chinese has no inter-word spaces."',
' word "换成"',
' description "Chinese verb phrase (pinyin huancheng, to change into); a quantity_conversion_cue matched as a substring since Chinese has no inter-word spaces."',
' meaning "mathematical_function"',
' gloss "a named mathematical operation that maps one or more input numbers to a result, such as a square root, a trigonometric function, or a logarithm. The genus of the individual function names, each defined as a kind of mathematical function rather than listed in code. The numeric_concept role is structural: no handler queries the genus directly; it records that these names are kinds of mathematical function."',
' wiktionary "function"',
' defined_by "function"',
' role "numeric_concept"',
' lexeme "en"',
' word "mathematical function"',
' description "English term for a named operation that maps input numbers to a result; the genus of the individual function names."',
' lexeme "ru"',
' word "математическая функция"',
' description "Russian term (romanized matematicheskaya funktsiya) for a mathematical function; the Russian surface for the mathematical-function concept."',
' lexeme "hi"',
' word "गणितीय फलन"',
' description "Hindi term (romanized ganitiya phalan) for a mathematical function; the Hindi surface for the mathematical-function concept."',
' lexeme "zh"',
' word "数学函数"',
' description "Chinese term (pinyin shuxue hanshu) for a mathematical function; the Chinese surface for the mathematical-function concept."',
' meaning "square_root"',
' gloss "the square-root function, which returns the non-negative number whose square is the input. A math_function_name: the calculator router treats its name beside a number, as in sqrt(16), as a calculation signal. ASCII names are matched on a leading word boundary so they are recognised even when they abut a parenthesis; other scripts are matched as raw substrings."',
' wiktionary "square root"',
' defined_by "mathematical_function"',
' role "math_function_name"',
' lexeme "en"',
' word "sqrt"',
' description "English abbreviation for the square-root function; a math_function_name matched on a leading word boundary so sqrt(16) is recognised."',
' word "square root"',
' description "English name for the function returning the number whose square is the input; a math_function_name matched on a leading word boundary."',
' lexeme "ru"',
' word "квадратный корень"',
' description "Russian term (romanized kvadratnyy koren, square root); a math_function_name matched as a raw substring."',
' word "корень"',
' description "Russian noun (romanized koren, root), the short name of the square-root function; a math_function_name matched as a raw substring."',
' lexeme "hi"',
' word "वर्गमूल"',
' description "Hindi noun (romanized vargamul, square root); a math_function_name matched as a raw substring."',
' lexeme "zh"',
' word "平方根"',
' description "Chinese noun (pinyin pingfanggen, square root); a math_function_name matched as a raw substring."',
' meaning "sine"',
' gloss "the sine trigonometric function. A math_function_name: the calculator router treats its name beside a number as a calculation signal. ASCII names are matched on a leading word boundary; other scripts as raw substrings."',
' wiktionary "sine"',
' defined_by "mathematical_function"',
' role "math_function_name"',
' lexeme "en"',
' word "sin"',
' description "English abbreviation for the sine function; a math_function_name matched on a leading word boundary."',
' word "sine"',
' description "English name for the sine trigonometric function; a math_function_name matched on a leading word boundary."',
' lexeme "ru"',
' word "синус"',
' description "Russian noun (romanized sinus, sine); a math_function_name matched as a raw substring."',
' lexeme "hi"',
' word "ज्या"',
' description "Hindi noun (romanized jya, sine); a math_function_name matched as a raw substring."',
' lexeme "zh"',
' word "正弦"',
' description "Chinese noun (pinyin zhengxian, sine); a math_function_name matched as a raw substring."',
' meaning "cosine"',
' gloss "the cosine trigonometric function. A math_function_name: the calculator router treats its name beside a number as a calculation signal. ASCII names are matched on a leading word boundary; other scripts as raw substrings."',
' wiktionary "cosine"',
' defined_by "mathematical_function"',
' role "math_function_name"',
' lexeme "en"',
' word "cos"',
' description "English abbreviation for the cosine function; a math_function_name matched on a leading word boundary."',
' word "cosine"',
' description "English name for the cosine trigonometric function; a math_function_name matched on a leading word boundary."',
' lexeme "ru"',
' word "косинус"',
' description "Russian noun (romanized kosinus, cosine); a math_function_name matched as a raw substring."',
' lexeme "hi"',
' word "कोज्या"',
' description "Hindi noun (romanized kojya, cosine); a math_function_name matched as a raw substring."',
' lexeme "zh"',
' word "余弦"',
' description "Chinese noun (pinyin yuxian, cosine); a math_function_name matched as a raw substring."',
' meaning "tangent"',
' gloss "the tangent trigonometric function. A math_function_name: the calculator router treats its name beside a number as a calculation signal. ASCII names are matched on a leading word boundary; other scripts as raw substrings."',
' wiktionary "tangent"',
' defined_by "mathematical_function"',
' role "math_function_name"',
' lexeme "en"',
' word "tan"',
' description "English abbreviation for the tangent function; a math_function_name matched on a leading word boundary."',
' word "tangent"',
' description "English name for the tangent trigonometric function; a math_function_name matched on a leading word boundary."',
' lexeme "ru"',
' word "тангенс"',
' description "Russian noun (romanized tangens, tangent); a math_function_name matched as a raw substring."',
' lexeme "hi"',
' word "स्पर्शज्या"',
' description "Hindi noun (romanized sparshajya, tangent); a math_function_name matched as a raw substring."',
' lexeme "zh"',
' word "正切"',
' description "Chinese noun (pinyin zhengqie, tangent); a math_function_name matched as a raw substring."',
' meaning "logarithm"',
' gloss "the logarithm function, the inverse of exponentiation. A math_function_name: the calculator router treats its name beside a number as a calculation signal. ASCII names are matched on a leading word boundary; other scripts as raw substrings."',
' wiktionary "logarithm"',
' defined_by "mathematical_function"',
' role "math_function_name"',
' lexeme "en"',
' word "log"',
' description "English abbreviation for the logarithm function; a math_function_name matched on a leading word boundary."',
' word "logarithm"',
' description "English name for the logarithm function, the inverse of exponentiation; a math_function_name matched on a leading word boundary."',
' lexeme "ru"',
' word "логарифм"',
' description "Russian noun (romanized logarifm, logarithm); a math_function_name matched as a raw substring."',
' lexeme "hi"',
' word "लघुगणक"',
' description "Hindi noun (romanized laghuganak, logarithm); a math_function_name matched as a raw substring."',
' lexeme "zh"',
' word "对数"',
' description "Chinese noun (pinyin duishu, logarithm); a math_function_name matched as a raw substring."',
' meaning "natural_logarithm"',
' gloss "the natural logarithm function, the logarithm to base e. A math_function_name: the calculator router treats its name beside a number as a calculation signal. ASCII names are matched on a leading word boundary; other scripts as raw substrings."',
' wiktionary "natural logarithm"',
' defined_by "mathematical_function"',
' role "math_function_name"',
' lexeme "en"',
' word "ln"',
' description "English abbreviation for the natural logarithm, the logarithm to base e; a math_function_name matched on a leading word boundary."',
' word "natural logarithm"',
' description "English name for the logarithm to base e; a math_function_name matched on a leading word boundary."',
' lexeme "ru"',
' word "натуральный логарифм"',
' description "Russian term (romanized naturalnyy logarifm, natural logarithm); a math_function_name matched as a raw substring."',
' lexeme "hi"',
' word "प्राकृतिक लघुगणक"',
' description "Hindi term (romanized prakritik laghuganak, natural logarithm); a math_function_name matched as a raw substring."',
' lexeme "zh"',
' word "自然对数"',
' description "Chinese term (pinyin ziran duishu, natural logarithm); a math_function_name matched as a raw substring."',
"meanings",
' meaning "knowledge_relation"',
' gloss "a relation in the knowledge base that maps a subject to a value; the genus of every fact-query relation below"',
' wiktionary "relation"',
' defined_by "knowledge_subject"',
' defined_by "knowledge_value"',
' defined_by "relation"',
' role "knowledge_relation"',
' lexeme "en"',
' word "relation"',
' description "English noun for a link in the knowledge base that maps a subject to a value; the genus of the fact-query relations."',
' word "property"',
' description "English noun for an attribute that maps a subject to a value; a synonym surface for the knowledge relation."',
' lexeme "ru"',
' word "отношение"',
' description "Russian noun (romanized otnosheniye) for a relation that maps a subject to a value; the Russian surface for the knowledge relation."',
' word "свойство"',
' description "Russian noun (romanized svoystvo) for a property mapping a subject to a value; an alternative Russian surface for the knowledge relation."',
' lexeme "hi"',
' word "संबंध"',
' description "Hindi noun (romanized sambandh) for a relation that maps a subject to a value; the Hindi surface for the knowledge relation."',
' word "गुण"',
' description "Hindi noun (romanized gun) for a property or attribute; an alternative Hindi surface for the knowledge relation."',
' lexeme "zh"',
' word "关系"',
' description "Chinese noun (pinyin guanxi) for a relation that maps a subject to a value; the Chinese surface for the knowledge relation."',
' word "属性"',
' description "Chinese noun (pinyin shuxing) for an attribute or property; an alternative Chinese surface for the knowledge relation."',
' meaning "knowledge_subject"',
' gloss "the entity a knowledge-base question is about — the subject a fact relation maps to a value"',
' wiktionary "subject"',
' defined_by "knowledge_relation"',
' role "knowledge_subject"',
' lexeme "en"',
' word "subject"',
' description "English noun for the entity a knowledge-base question is about; the subject a fact relation maps to a value."',
' word "entity"',
' description "English noun for the thing being asked about; a synonym surface for the knowledge subject."',
' word "topic"',
' description "English noun for what a question concerns; an alternative surface for the knowledge subject."',
' lexeme "ru"',
' word "субъект"',
' description "Russian noun (romanized subyekt) for the subject of a question; the Russian surface for the knowledge subject."',
' word "сущность"',
' description "Russian noun (romanized sushchnost) for the entity being asked about; an alternative Russian surface for the knowledge subject."',
' word "предмет"',
' description "Russian noun (romanized predmet) for the topic of a question; another Russian surface for the knowledge subject."',
' lexeme "hi"',
' word "विषय"',
' description "Hindi noun (romanized vishay) for the topic or subject of a question; the Hindi surface for the knowledge subject."',
' word "इकाई"',
' description "Hindi noun (romanized ikai) for the entity being asked about; an alternative Hindi surface for the knowledge subject."',
' lexeme "zh"',
' word "主体"',
' description "Chinese noun (pinyin zhuti) for the subject of a question; the Chinese surface for the knowledge subject."',
' word "实体"',
' description "Chinese noun (pinyin shiti) for the entity being asked about; an alternative Chinese surface for the knowledge subject."',
' meaning "knowledge_value"',
' gloss "the value a fact relation yields for its subject — the answer to the question"',
' wiktionary "value"',
' defined_by "knowledge_relation"',
' role "knowledge_value"',
' lexeme "en"',
' word "value"',
' description "English noun for the value a fact relation yields for its subject; the answer to the question."',
' word "answer"',
' description "English noun for the response to a question; a synonym surface for the knowledge value."',
' lexeme "ru"',
' word "значение"',
' description "Russian noun (romanized znacheniye) for the value a relation yields; the Russian surface for the knowledge value."',
' word "ответ"',
' description "Russian noun (romanized otvet) for the answer to a question; an alternative Russian surface for the knowledge value."',
' lexeme "hi"',
' word "मान"',
' description "Hindi noun (romanized maan) for the value a relation yields; the Hindi surface for the knowledge value."',
' word "उत्तर"',
' description "Hindi noun (romanized uttar) for the answer to a question; an alternative Hindi surface for the knowledge value."',
' lexeme "zh"',
' word "值"',
' description "Chinese noun (pinyin zhi) for the value a relation yields; the Chinese surface for the knowledge value."',
' word "答案"',
' description "Chinese noun (pinyin daan) for the answer to a question; an alternative Chinese surface for the knowledge value."',
' meaning "capital"',
' gloss "the relation linking a country to its capital city (Wikidata P36)"',
' wiktionary "capital"',
' defined_by "knowledge_relation"',
' role "fact_relation"',
' lexeme "en"',
' word "capital"',
' description "English noun for the seat-of-government city of a country; the surface for the capital-of relation."',
' lexeme "ru"',
' word "столица"',
' description "Russian noun (romanized stolitsa), nominative singular, for a capital city; the Russian surface for the capital-of relation."',
' word "столицы"',
' description "Russian noun (romanized stolitsy), genitive singular or nominative plural of capital; an inflected surface for the capital-of relation."',
' word "столицей"',
' description "Russian noun (romanized stolitsey), instrumental singular of capital; an inflected surface for the capital-of relation."',
' lexeme "hi"',
' word "राजधानी"',
' description "Hindi noun (romanized rajdhani) for a capital city; the Hindi surface for the capital-of relation."',
' lexeme "zh"',
' word "首都"',
' description "Chinese noun (pinyin shoudu) for a capital city; the Chinese surface for the capital-of relation."',
' meaning "population"',
' gloss "the relation linking a place to how many people live there (Wikidata P1082)"',
' wiktionary "population"',
' defined_by "knowledge_relation"',
' role "fact_relation"',
' lexeme "en"',
' word "population"',
' description "English noun for how many people live in a place; the surface for the population relation."',
' word "how many people"',
' description "English interrogative phrase asking the count of inhabitants; a question surface for the population relation."',
' lexeme "ru"',
' word "население"',
' description "Russian noun (romanized naseleniye) for the population of a place; the Russian surface for the population relation."',
' lexeme "hi"',
' word "जनसंख्या"',
' description "Hindi noun (romanized jansankhya) for population; the Hindi surface for the population relation."',
' word "आबादी"',
' description "Hindi noun (romanized aabaadi) for population or inhabitants; an alternative Hindi surface for the population relation."',
' lexeme "zh"',
' word "人口"',
' description "Chinese noun (pinyin renkou) for population; the Chinese surface for the population relation."',
' meaning "currency"',
' gloss "the relation linking a country to its official currency (Wikidata P38)"',
' wiktionary "currency"',
' defined_by "knowledge_relation"',
' role "fact_relation"',
' lexeme "en"',
' word "currency"',
' description "English noun for the official money of a country; the surface for the currency relation."',
' lexeme "ru"',
' word "валюта"',
' description "Russian noun (romanized valyuta) for currency; the Russian surface for the currency relation."',
' lexeme "hi"',
' word "मुद्रा"',
' description "Hindi noun (romanized mudra) for currency; the Hindi surface for the currency relation."',
' lexeme "zh"',
' word "货币"',
' description "Chinese noun (pinyin huobi) for currency, in simplified characters; the Chinese surface for the currency relation."',
' word "貨幣"',
' description "Chinese noun (pinyin huobi) for currency, in traditional characters; an alternative Chinese surface for the currency relation."',
' meaning "official_language"',
' gloss "the relation linking a country to its official language (Wikidata P37)"',
' wiktionary "language"',
' defined_by "knowledge_relation"',
' role "fact_relation"',
' lexeme "en"',
' word "official language"',
" description \"English noun phrase for a country's officially designated language; the surface for the official-language relation.\"",
' word "what language"',
' description "English interrogative phrase asking which language is official; a question surface for the official-language relation."',
' lexeme "ru"',
' word "государственный язык"',
' description "Russian noun phrase (romanized gosudarstvennyy yazyk) for the state language; the Russian surface for the official-language relation."',
' word "официальный язык"',
' description "Russian noun phrase (romanized ofitsialnyy yazyk) for the official language; an alternative Russian surface for the official-language relation."',
' lexeme "hi"',
' word "राजभाषा"',
' description "Hindi noun (romanized rajbhasha) for the official or state language; the Hindi surface for the official-language relation."',
' word "आधिकारिक भाषा"',
' description "Hindi noun phrase (romanized aadhikaarik bhasha) for the official language; an alternative Hindi surface for the official-language relation."',
' lexeme "zh"',
' word "官方语言"',
' description "Chinese noun phrase (pinyin guanfang yuyan) for the official language, in simplified characters; the Chinese surface for the official-language relation."',
' word "官方語言"',
' description "Chinese noun phrase (pinyin guanfang yuyan) for the official language, in traditional characters; an alternative Chinese surface for the official-language relation."',
' meaning "continent"',
' gloss "the relation linking a place to the continent it lies on (Wikidata P30)"',
' wiktionary "continent"',
' defined_by "knowledge_relation"',
' role "fact_relation"',
' lexeme "en"',
' word "continent"',
' description "English noun for one of the large landmasses a place lies on; the surface for the continent relation."',
' lexeme "ru"',
' word "континент"',
' description "Russian noun (romanized kontinent) for a continent; the Russian surface for the continent relation."',
' lexeme "hi"',
' word "महाद्वीप"',
' description "Hindi noun (romanized mahadweep) for a continent; the Hindi surface for the continent relation."',
' lexeme "zh"',
' word "大洲"',
' description "Chinese noun (pinyin dazhou) for a continent; the Chinese surface for the continent relation."',
' meaning "author_of_book"',
' gloss "the relation linking a book to the author who wrote it (Wikidata P50)"',
' wiktionary "author"',
' defined_by "knowledge_relation"',
' role "fact_relation"',
' lexeme "en"',
' word "who wrote"',
' description "English interrogative phrase asking which person authored a book; a question surface for the author-of-book relation."',
' word "author"',
' description "English noun for the person who wrote a book; the surface for the author-of-book relation."',
' word "written by"',
' description "English passive phrase naming the writer of a book; an alternative surface for the author-of-book relation."',
' lexeme "ru"',
' word "кто написал"',
' description "Russian interrogative phrase (romanized kto napisal) asking who wrote a book; a question surface for the author-of-book relation."',
' word "написал"',
' description "Russian verb (romanized napisal), past tense of to write, for authored a book; a surface for the author-of-book relation."',
' word "автор"',
' description "Russian noun (romanized avtor) for the author of a book; an alternative Russian surface for the author-of-book relation."',
' lexeme "hi"',
' word "किसने लिखी"',
' description "Hindi interrogative phrase (romanized kisne likhi) asking who wrote it, agreeing with a feminine book noun; a question surface for the author-of-book relation."',
' word "किसने लिखा"',
' description "Hindi interrogative phrase (romanized kisne likha) asking who wrote it, masculine agreement; an alternative question surface for the author-of-book relation."',
' word "लेखक"',
' description "Hindi noun (romanized lekhak) for the author or writer; the Hindi surface for the author-of-book relation."',
' lexeme "zh"',
' word "是谁写的"',
' description "Chinese interrogative phrase (pinyin shi shei xie de) asking who wrote it; a question surface for the author-of-book relation."',
' word "作者"',
' description "Chinese noun (pinyin zuozhe) for the author of a book; the Chinese surface for the author-of-book relation."',
' meaning "painter_of_painting"',
' gloss "the relation linking a painting to the painter who created it (Wikidata P170)"',
' wiktionary "painter"',
' defined_by "knowledge_relation"',
' role "fact_relation"',
' lexeme "en"',
' word "who painted"',
' description "English interrogative phrase asking which person created a painting; a question surface for the painter-of-painting relation."',
' word "painted"',
' description "English verb, past tense of to paint, for created a painting; a surface for the painter-of-painting relation."',
' word "painter"',
' description "English noun for the person who painted a painting; the surface for the painter-of-painting relation."',
' word "artist"',
' description "English noun for the creator of a painting; a synonym surface for the painter-of-painting relation."',
' lexeme "ru"',
' word "кто написал"',
' description "Russian interrogative phrase (romanized kto napisal) asking who painted it, since napisal also covers painting a picture; a question surface for the painter-of-painting relation."',
' word "написал"',
' description "Russian verb (romanized napisal), past tense used for painting a picture; a surface for the painter-of-painting relation."',
' word "художник"',
' description "Russian noun (romanized khudozhnik) for the painter or artist; the Russian surface for the painter-of-painting relation."',
' lexeme "hi"',
' word "किसने बनाई"',
' description "Hindi interrogative phrase (romanized kisne banai) asking who made it, agreeing with a feminine painting noun; a question surface for the painter-of-painting relation."',
' word "चित्रकार"',
' description "Hindi noun (romanized chitrakar) for a painter; the Hindi surface for the painter-of-painting relation."',
' word "कलाकार"',
' description "Hindi noun (romanized kalakar) for an artist; an alternative Hindi surface for the painter-of-painting relation."',
' lexeme "zh"',
' word "谁画的"',
' description "Chinese interrogative phrase (pinyin shei hua de) asking who painted it; a question surface for the painter-of-painting relation."',
' word "画家"',
' description "Chinese noun (pinyin huajia) for a painter; the Chinese surface for the painter-of-painting relation."',
' meaning "built_year"',
' gloss "the relation linking a structure to the year it was built (Wikidata P571)"',
' wiktionary "build"',
' defined_by "knowledge_relation"',
' role "fact_relation"',
' lexeme "en"',
' word "when"',
' description "English interrogative adverb asking the year a structure was built; a question surface for the built-year relation."',
' word "built"',
' description "English verb, past participle of to build, for constructed in a given year; a surface for the built-year relation."',
' word "construction"',
' description "English noun for the building of a structure; an alternative surface for the built-year relation."',
' lexeme "ru"',
' word "когда"',
' description "Russian interrogative adverb (romanized kogda) asking when a structure was built; a question surface for the built-year relation."',
' word "построена"',
' description "Russian verb (romanized postroyena), feminine past participle of to build, for was built; a surface for the built-year relation."',
' word "построили"',
' description "Russian verb (romanized postroili), plural past tense of to build, for they built; an alternative surface for the built-year relation."',
' lexeme "hi"',
' word "बनी"',
' description "Hindi verb (romanized bani), feminine past form of to be made, for was built; a surface for the built-year relation."',
' word "बनाई"',
' description "Hindi verb (romanized banai), feminine past form of to make, for was built; an alternative surface for the built-year relation."',
' word "कब"',
' description "Hindi interrogative adverb (romanized kab) asking when something was built; a question surface for the built-year relation."',
' lexeme "zh"',
' word "何时"',
' description "Chinese interrogative phrase (pinyin heshi) asking at what time it was built; a question surface for the built-year relation."',
' word "建于"',
' description "Chinese verb phrase (pinyin jianyu) for built in a given year; a surface for the built-year relation."',
' word "建造"',
' description "Chinese verb (pinyin jianzao) for to build or construct; an alternative surface for the built-year relation."',
' meaning "physical_constant"',
' gloss "the relation linking a named physical constant to its value (e.g. the speed of light)"',
' wiktionary "constant"',
' defined_by "knowledge_relation"',
' role "fact_relation"',
' lexeme "en"',
' word "speed of light"',
' description "English noun phrase naming a physical constant, the speed at which light travels; an example surface for the physical-constant relation."',
' word "what is"',
' description "English interrogative phrase asking the value of a named constant; a question surface for the physical-constant relation."',
' word "how fast"',
' description "English interrogative phrase asking the magnitude of a speed constant; an alternative question surface for the physical-constant relation."',
' lexeme "ru"',
' word "скорость света"',
' description "Russian noun phrase (romanized skorost sveta) for the speed of light; an example surface for the physical-constant relation."',
' word "какова"',
" description \"Russian interrogative pronoun (romanized kakova), feminine, asking what a constant's value is; a question surface for the physical-constant relation.\"",
' word "чему равна"',
' description "Russian interrogative phrase (romanized chemu ravna) asking what a quantity equals; an alternative question surface for the physical-constant relation."',
' lexeme "hi"',
' word "प्रकाश की गति"',
' description "Hindi noun phrase (romanized prakash ki gati) for the speed of light; an example surface for the physical-constant relation."',
' word "कितनी"',
' description "Hindi interrogative adjective (romanized kitni), feminine, asking how much a quantity is; a question surface for the physical-constant relation."',
' lexeme "zh"',
' word "光速"',
' description "Chinese noun (pinyin guangsu) for the speed of light; an example surface for the physical-constant relation."',
' word "是多少"',
' description "Chinese interrogative phrase (pinyin shi duoshao) asking what amount a constant is; a question surface for the physical-constant relation."',
"meanings",
' meaning "software_followup"',
' gloss "exercising an already-designed software artifact — verifying, executing, or demonstrating it; the genus of the follow-up kinds below"',
' wiktionary "follow-up"',
' defined_by "software_followup_verification"',
' defined_by "software_followup_execution"',
' defined_by "software_followup_demonstration"',
' defined_by "action"',
' role "software_followup"',
' lexeme "en"',
' word "follow-up"',
' description "English noun for exercising an already-designed artifact by verifying, running, or demonstrating it; the genus of the follow-up kinds."',
' word "exercise"',
' description "English verb for putting a finished artifact through its paces; a synonym surface for the follow-up action."',
' lexeme "ru"',
' word "продолжение"',
' description "Russian noun (romanized prodolzheniye) for a continuation or follow-up; the Russian surface for exercising a finished artifact."',
' word "отработка"',
' description "Russian noun (romanized otrabotka) for putting something through its paces; an alternative Russian surface for the follow-up action."',
' lexeme "hi"',
' word "अनुवर्ती"',
' description "Hindi adjective (romanized anuvarti) for follow-up or subsequent; the Hindi surface for exercising a finished artifact."',
' word "अभ्यास"',
' description "Hindi noun (romanized abhyas) for practice or exercise; an alternative Hindi surface for the follow-up action."',
' lexeme "zh"',
' word "后续"',
' description "Chinese noun (pinyin houxu) for a follow-up or subsequent step; the Chinese surface for exercising a finished artifact."',
' word "演练"',
' description "Chinese verb (pinyin yanlian) for rehearsing or drilling; an alternative Chinese surface for the follow-up action."',
' meaning "software_followup_verification"',
' gloss "a follow-up that verifies the just-designed artifact behaves correctly (test it, run the tests, …)"',
' wiktionary "verification"',
' defined_by "software_followup"',
' role "software_followup_verification"',
' lexeme "en"',
' word "test it"',
' description "English imperative phrase asking to verify the just-designed artifact behaves correctly; a verification follow-up surface."',
' word "test the"',
' description "English phrase fragment introducing the artifact to be verified; a verification follow-up surface."',
' word "test this"',
' description "English imperative phrase asking to verify this artifact; a verification follow-up surface."',
' word "verify"',
' description "English verb for confirming the artifact behaves correctly; the base verification follow-up surface."',
' word "check it"',
' description "English imperative phrase asking to inspect the artifact for correctness; a verification follow-up surface."',
' word "check that"',
' description "English phrase fragment introducing what should be checked for correctness; a verification follow-up surface."',
' word "run the tests"',
" description \"English imperative phrase asking to execute the artifact's test suite; a verification follow-up surface.\"",
' lexeme "ru"',
' word "протестируй"',
' description "Russian imperative verb (romanized protestiruy) meaning test it; a verification follow-up surface."',
' word "протестировать"',
' description "Russian infinitive verb (romanized protestirovat) meaning to test; the infinitive form of the verification verb."',
' word "проверь"',
' description "Russian imperative verb (romanized prover) meaning check or verify; a verification follow-up surface."',
' word "тестируй"',
' description "Russian imperative verb (romanized testiruy) meaning test; an imperfective verification follow-up surface."',
' lexeme "hi"',
' word "परीक्षण"',
' description "Hindi noun (romanized parikshan) for testing or examination; a verification follow-up surface."',
' word "जाँच"',
' description "Hindi noun (romanized janch) for a check or inspection; a verification follow-up surface."',
' word "जांच"',
' description "Hindi noun (romanized janch) for a check or inspection; an alternative spelling of the verification surface."',
' lexeme "zh"',
' word "测试"',
' description "Chinese verb (pinyin ceshi) for testing; a verification follow-up surface."',
' word "检验"',
' description "Chinese verb (pinyin jianyan) for inspecting or verifying; a verification follow-up surface."',
' word "检查"',
' description "Chinese verb (pinyin jiancha) for checking or examining; a verification follow-up surface."',
' meaning "software_followup_execution"',
' gloss "a follow-up that runs or executes the just-designed artifact (run it, execute it, …)"',
' wiktionary "execution"',
' defined_by "software_followup"',
' role "software_followup_execution"',
' lexeme "en"',
' word "run it"',
' description "English imperative phrase asking to execute the just-designed artifact; an execution follow-up surface."',
' word "run this"',
' description "English imperative phrase asking to execute this artifact; an execution follow-up surface."',
' word "run the"',
' description "English phrase fragment introducing the artifact to execute; an execution follow-up surface."',
' word "execute it"',
' description "English imperative phrase asking to run the artifact; an execution follow-up surface."',
' word "execute the"',
' description "English phrase fragment introducing the artifact to run; an execution follow-up surface."',
' word "try it"',
' description "English imperative phrase asking to run the artifact to see it work; an execution follow-up surface."',
' lexeme "ru"',
' word "запусти"',
' description "Russian imperative verb (romanized zapusti) meaning run or launch it; an execution follow-up surface."',
' word "выполни"',
' description "Russian imperative verb (romanized vypolni) meaning execute or carry out; an execution follow-up surface."',
' lexeme "hi"',
' word "चलाओ"',
' description "Hindi imperative verb (romanized chalao) meaning run it; an execution follow-up surface."',
' word "निष्पादित"',
' description "Hindi adjective (romanized nishpadit) meaning executed; an execution follow-up surface."',
' lexeme "zh"',
' word "运行"',
' description "Chinese verb (pinyin yunxing) for running an artifact; an execution follow-up surface."',
' word "执行"',
' description "Chinese verb (pinyin zhixing) for executing; an execution follow-up surface."',
' meaning "software_followup_demonstration"',
" gloss \"a follow-up that demonstrates the just-designed artifact's output (show me, demo it, …)\"",
' wiktionary "demonstration"',
' defined_by "software_followup"',
' role "software_followup_demonstration"',
' lexeme "en"',
' word "demo it"',
" description \"English imperative phrase asking to demonstrate the artifact's output; a demonstration follow-up surface.\"",
' word "show me"',
" description \"English imperative phrase asking to display the artifact's output to the user; a demonstration follow-up surface.\"",
' word "show the"',
' description "English phrase fragment introducing the output to display; a demonstration follow-up surface."',
' word "print the"',
" description \"English phrase fragment asking to print the artifact's output; a demonstration follow-up surface.\"",
' lexeme "ru"',
' word "покажи"',
' description "Russian imperative verb (romanized pokazhi) meaning show me; a demonstration follow-up surface."',
' lexeme "hi"',
' word "दिखाओ"',
' description "Hindi imperative verb (romanized dikhao) meaning show it; a demonstration follow-up surface."',
' lexeme "zh"',
' word "显示"',
' description "Chinese verb (pinyin xianshi) for displaying or showing; a demonstration follow-up surface."',
' word "展示"',
' description "Chinese verb (pinyin zhanshi) for demonstrating or exhibiting; a demonstration follow-up surface."',
' meaning "output_display_request"',
" gloss \"a request to display a specific output, naming what the user wants surfaced after a show-me/print/display verb. Each surface is a prefix carrying the … (U+2026) slot at the end; the clause that follows the slot — up to the first sentence-ending punctuation and capped at twelve words — is the expected output. The opener is matched anywhere in the prompt, not only at the start, so 'test it and show me the result' still captures 'the result'.\"",
' wiktionary "display"',
' defined_by "software_followup"',
' defined_by "action"',
' role "output_display_request"',
' lexeme "en"',
' word "show me …"',
' description "English request to display output; the clause naming what to surface follows the … slot."',
' word "show …"',
" description \"English request to display output written without 'me'; the clause follows the … slot. Declared after 'show me …' so the longer opener is tried first.\"",
' word "print …"',
' description "English request to print output; the clause naming what to surface follows the … slot."',
' word "display …"',
' description "English request to display output; the clause naming what to surface follows the … slot."',
' lexeme "ru"',
' word "покажи мне …"',
' description "Russian request to display output (romanized pokazhi mne) meaning show me; the clause follows the … slot."',
' word "покажи …"',
' description "Russian request to display output (romanized pokazhi) meaning show; the clause follows the … slot."',
' word "выведи …"',
' description "Russian request to print output (romanized vyvedi) meaning output or print; the clause follows the … slot."',
' lexeme "hi"',
' word "मुझे दिखाओ …"',
' description "Hindi request to display output (romanized mujhe dikhao) meaning show me; the clause follows the … slot."',
' word "दिखाओ …"',
' description "Hindi request to display output (romanized dikhao) meaning show; the clause follows the … slot."',
' lexeme "zh"',
' word "给我看…"',
' description "Chinese request to display output (pinyin gei wo kan) meaning show me, with no trailing space; the clause follows the … slot."',
' word "显示…"',
' description "Chinese request to display output (pinyin xianshi) meaning display, with no trailing space; the clause follows the … slot."',
' meaning "implement"',
' gloss "to author a software artifact by implementing it — an authoring action alongside write/build/create"',
' wiktionary "implement"',
' defined_by "code"',
' defined_by "program"',
' role "software_authoring_action"',
' lexeme "en"',
' word "implement"',
' description "English verb for authoring a software artifact by realizing it in code; an authoring-action surface."',
' lexeme "ru"',
' word "реализуй"',
' description "Russian imperative verb (romanized realizuy) meaning implement it; an authoring-action surface."',
' word "реализовать"',
' description "Russian infinitive verb (romanized realizovat) meaning to implement; the infinitive form of the authoring verb."',
' lexeme "hi"',
' word "लागू"',
' description "Hindi adjective (romanized lagu) meaning applied or implemented; an authoring-action surface."',
' lexeme "zh"',
' word "实现"',
' description "Chinese verb (pinyin shixian) for implementing or realizing; an authoring-action surface."',
' meaning "develop"',
' gloss "to author a software artifact by developing it over time — an authoring action"',
' wiktionary "develop"',
' defined_by "program"',
' role "software_authoring_action"',
' lexeme "en"',
' word "develop"',
' description "English verb for authoring a software artifact by building it up over time; an authoring-action surface."',
' lexeme "ru"',
' word "разработай"',
' description "Russian imperative verb (romanized razrabotay) meaning develop it; an authoring-action surface."',
' word "разработать"',
' description "Russian infinitive verb (romanized razrabotat) meaning to develop; the infinitive form of the authoring verb."',
' lexeme "hi"',
' word "विकसित"',
' description "Hindi adjective (romanized vikasit) meaning developed; an authoring-action surface."',
' lexeme "zh"',
' word "开发"',
' description "Chinese verb (pinyin kaifa) for developing software; an authoring-action surface."',
' meaning "design"',
' gloss "to author a software artifact by designing its shape — an authoring action"',
' wiktionary "design"',
' defined_by "program"',
' role "software_authoring_action"',
' lexeme "en"',
' word "design"',
' description "English verb for authoring a software artifact by shaping its design; an authoring-action surface."',
' lexeme "ru"',
' word "спроектируй"',
' description "Russian imperative verb (romanized sproektiruy) meaning design it; an authoring-action surface."',
' word "создай дизайн"',
' description "Russian imperative phrase (romanized sozday dizayn) meaning create a design; an authoring-action surface."',
' lexeme "hi"',
' word "डिज़ाइन"',
' description "Hindi noun (romanized dizain, a loanword) for design; an authoring-action surface."',
' lexeme "zh"',
' word "设计"',
' description "Chinese verb (pinyin sheji) for designing; an authoring-action surface."',
' meaning "scaffold"',
' gloss "to author a software artifact by scaffolding its skeleton — an authoring action"',
' wiktionary "scaffold"',
' defined_by "code"',
' defined_by "program"',
' role "software_authoring_action"',
' lexeme "en"',
' word "scaffold"',
' description "English verb for authoring a software artifact by generating its skeleton; an authoring-action surface."',
' lexeme "ru"',
' word "создай каркас"',
' description "Russian imperative phrase (romanized sozday karkas) meaning create a skeleton; an authoring-action surface."',
' word "сгенерируй каркас"',
' description "Russian imperative phrase (romanized sgeneriruy karkas) meaning generate a skeleton; an authoring-action surface."',
' lexeme "hi"',
' word "ढाँचा बनाओ"',
' description "Hindi imperative phrase (romanized dhancha banao) meaning build a framework; an authoring-action surface."',
' lexeme "zh"',
' word "搭建"',
' description "Chinese verb (pinyin dajian) for setting up or scaffolding a structure; an authoring-action surface."',
' meaning "software_artifact"',
' gloss "a thing software development produces that an authoring request can ask for — the genus of the artifact kinds below"',
' wiktionary "artifact"',
' defined_by "artifact_application"',
' defined_by "artifact_tool"',
' defined_by "entity"',
' role "software_artifact"',
' lexeme "en"',
' word "software artifact"',
' description "English noun phrase for a thing software development produces; the genus of the artifact kinds below."',
' word "deliverable"',
' description "English noun for a produced item to be handed over; a synonym surface for a software artifact."',
' lexeme "ru"',
' word "программный продукт"',
' description "Russian noun phrase (romanized programmnyy produkt) for a software product; the Russian surface for a software artifact."',
' word "артефакт"',
' description "Russian noun (romanized artefakt) for an artifact; an alternative Russian surface for a software artifact."',
' lexeme "hi"',
' word "सॉफ़्टवेयर कलाकृति"',
' description "Hindi noun phrase (romanized software kalakriti) for a software artifact; the Hindi surface for a produced software item."',
' lexeme "zh"',
' word "软件制品"',
' description "Chinese noun (pinyin ruanjian zhipin) for a software artifact; the Chinese surface for a produced software item."',
' meaning "artifact_browser_extension"',
' gloss "a browser extension — software that augments a web browser; canonical label `browser extension`"',
' wiktionary "extension"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "browser extension"',
' description "English noun phrase for software that augments a web browser; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "расширение браузера"',
' description "Russian noun phrase (romanized rasshireniye brauzera) for a browser extension; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "ब्राउज़र एक्सटेंशन"',
' description "Hindi noun phrase (romanized brauzar extension, a loanword) for a browser extension; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "浏览器扩展"',
' description "Chinese noun (pinyin liulanqi kuozhan) for a browser extension; the Chinese surface for this artifact kind."',
' meaning "artifact_command_line_tool"',
' gloss "a command-line tool driven from a terminal; canonical label `command-line tool`"',
' wiktionary "command-line"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "command line tool"',
' description "English noun phrase for a tool driven from a terminal; the canonical label for this artifact kind."',
' word "cli tool"',
' description "English noun phrase abbreviating command-line tool; a synonym surface for this artifact kind."',
' lexeme "ru"',
' word "консольная утилита"',
' description "Russian noun phrase (romanized konsolnaya utilita) for a console utility; the Russian surface for this artifact kind."',
' word "утилита командной строки"',
' description "Russian noun phrase (romanized utilita komandnoy stroki) for a command-line utility; an alternative Russian surface for this artifact kind."',
' lexeme "hi"',
' word "कमांड लाइन टूल"',
' description "Hindi noun phrase (romanized command line tool, a loanword) for a command-line tool; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "命令行工具"',
' description "Chinese noun (pinyin minglinghang gongju) for a command-line tool; the Chinese surface for this artifact kind."',
' meaning "artifact_github_action"',
' gloss "a GitHub Action automation workflow; canonical label `action`"',
' wiktionary "action"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "github action"',
' description "English noun phrase for a GitHub Action automation workflow; the canonical surface for this artifact kind."',
' lexeme "ru"',
' word "действие github"',
' description "Russian noun phrase (romanized deystviye github) for a GitHub Action; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "गिटहब एक्शन"',
' description "Hindi noun phrase (romanized github action, a loanword) for a GitHub Action; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "github 操作"',
' description "Chinese noun (pinyin github caozuo) for a GitHub Action; the Chinese surface for this artifact kind."',
' meaning "artifact_mobile_app"',
' gloss "a mobile application for phones or tablets; canonical label `mobile app`"',
' wiktionary "app"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "mobile app"',
' description "English noun phrase for an application for phones or tablets; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "мобильное приложение"',
' description "Russian noun phrase (romanized mobilnoye prilozheniye) for a mobile application; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "मोबाइल ऐप"',
' description "Hindi noun phrase (romanized mobile app, a loanword) for a mobile application; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "移动应用"',
' description "Chinese noun (pinyin yidong yingyong) for a mobile application; the Chinese surface for this artifact kind."',
' meaning "artifact_web_app"',
' gloss "a web application served in a browser; canonical label `web app`"',
' wiktionary "web"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "web app"',
' description "English noun phrase for an application served in a browser; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "веб приложение"',
' description "Russian noun phrase (romanized veb prilozheniye) for a web application; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "वेब ऐप"',
' description "Hindi noun phrase (romanized web app, a loanword) for a web application; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "网页应用"',
' description "Chinese noun (pinyin wangye yingyong) for a web application; the Chinese surface for this artifact kind."',
' meaning "artifact_application"',
' gloss "a general software application; canonical label `application`"',
' wiktionary "application"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "application"',
' description "English noun for a general software application; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "приложение"',
' description "Russian noun (romanized prilozheniye) for an application; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "एप्लिकेशन"',
' description "Hindi noun (romanized application, a loanword) for an application; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "应用程序"',
' description "Chinese noun (pinyin yingyong chengxu) for an application program; the Chinese surface for this artifact kind."',
' meaning "artifact_extension"',
' gloss "an extension or add-on that augments a host program; canonical label `extension`"',
' wiktionary "extension"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "extension"',
' description "English noun for an add-on that augments a host program; the canonical label for this artifact kind."',
' word "add on"',
' description "English noun for a component that adds to a host program; a synonym surface for an extension."',
' word "addon"',
' description "English noun (single-word spelling) for an add-on; a synonym surface for an extension."',
' lexeme "ru"',
' word "расширение"',
' description "Russian noun (romanized rasshireniye) for an extension; the Russian surface for this artifact kind."',
' word "дополнение"',
' description "Russian noun (romanized dopolneniye) for an add-on or supplement; an alternative Russian surface for an extension."',
' lexeme "hi"',
' word "एक्सटेंशन"',
' description "Hindi noun (romanized extension, a loanword) for an extension; the Hindi surface for this artifact kind."',
' word "ऐड-ऑन"',
' description "Hindi noun (romanized add-on, a loanword) for an add-on; an alternative Hindi surface for an extension."',
' lexeme "zh"',
' word "扩展"',
' description "Chinese noun (pinyin kuozhan) for an extension; the Chinese surface for this artifact kind."',
' word "扩展程序"',
' description "Chinese noun (pinyin kuozhan chengxu) for an extension program; an alternative Chinese surface for an extension."',
' meaning "artifact_dashboard"',
' gloss "a dashboard that visualises state at a glance; canonical label `dashboard`"',
' wiktionary "dashboard"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "dashboard"',
' description "English noun for a screen that visualises state at a glance; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "панель управления"',
' description "Russian noun phrase (romanized panel upravleniya) for a control dashboard; the Russian surface for this artifact kind."',
' word "дашборд"',
' description "Russian noun (romanized dashbord, a loanword) for a dashboard; an alternative Russian surface for this artifact kind."',
' lexeme "hi"',
' word "डैशबोर्ड"',
' description "Hindi noun (romanized dashboard, a loanword) for a dashboard; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "仪表板"',
' description "Chinese noun (pinyin yibiaoban) for a dashboard; the Chinese surface for this artifact kind."',
' meaning "artifact_scraper"',
' gloss "a scraper that extracts data from pages or feeds; canonical label `scraper`"',
' wiktionary "scraper"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "scraper"',
' description "English noun for a tool that extracts data from pages or feeds; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "скрапер"',
' description "Russian noun (romanized skraper, a loanword) for a scraper; the Russian surface for this artifact kind."',
' word "парсер"',
' description "Russian noun (romanized parser, a loanword) for a parser; an alternative Russian surface for a scraper."',
' lexeme "hi"',
' word "स्क्रैपर"',
' description "Hindi noun (romanized scraper, a loanword) for a scraper; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "爬虫"',
' description "Chinese noun (pinyin pachong) for a web crawler or scraper; the Chinese surface for this artifact kind."',
' meaning "artifact_library"',
' gloss "a reusable code library; canonical label `library`"',
' wiktionary "library"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "library"',
' description "English noun for a reusable code library; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "библиотека"',
' description "Russian noun (romanized biblioteka) for a library; the nominative Russian surface for this artifact kind."',
' word "библиотеку"',
' description "Russian noun (romanized biblioteku) for a library; the accusative-case form of the library surface."',
' lexeme "hi"',
' word "लाइब्रेरी"',
' description "Hindi noun (romanized library, a loanword) for a code library; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "库"',
' description "Chinese noun (pinyin ku) for a code library; the Chinese surface for this artifact kind."',
' meaning "artifact_website"',
' gloss "a website of linked pages; canonical label `website`"',
' wiktionary "website"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "website"',
' description "English noun for a site of linked web pages; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "сайт"',
' description "Russian noun (romanized sayt) for a website; the Russian surface for this artifact kind."',
' word "веб сайт"',
' description "Russian noun phrase (romanized veb sayt) for a website; an alternative Russian surface for this artifact kind."',
' lexeme "hi"',
' word "वेबसाइट"',
' description "Hindi noun (romanized website, a loanword) for a website; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "网站"',
' description "Chinese noun (pinyin wangzhan) for a website; the Chinese surface for this artifact kind."',
' meaning "artifact_plugin"',
' gloss "a plugin that extends a host application; canonical label `plugin`"',
' wiktionary "plugin"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "plugin"',
' description "English noun for a component that extends a host application; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "плагин"',
' description "Russian noun (romanized plagin, a loanword) for a plugin; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "प्लगइन"',
' description "Hindi noun (romanized plugin, a loanword) for a plugin; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "插件"',
' description "Chinese noun (pinyin chajian) for a plugin; the Chinese surface for this artifact kind."',
' meaning "artifact_service"',
' gloss "a long-running service or daemon; canonical label `service`"',
' wiktionary "service"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "service"',
' description "English noun for a long-running service or daemon; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "сервис"',
' description "Russian noun (romanized servis, a loanword) for a service; the Russian surface for this artifact kind."',
' word "служба"',
' description "Russian noun (romanized sluzhba) for a service or daemon; the nominative Russian surface for this artifact kind."',
' word "службу"',
' description "Russian noun (romanized sluzhbu) for a service; the accusative-case form of the service surface."',
' lexeme "hi"',
' word "सेवा"',
' description "Hindi noun (romanized seva) for a service; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "服务"',
' description "Chinese noun (pinyin fuwu) for a service; the Chinese surface for this artifact kind."',
' meaning "artifact_bot"',
' gloss "a bot that automates a chat or task; canonical label `bot`"',
' wiktionary "bot"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "bot"',
' description "English noun for a program that automates a chat or task; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "бот"',
' description "Russian noun (romanized bot, a loanword) for a bot; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "बॉट"',
' description "Hindi noun (romanized bot, a loanword) for a bot; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "机器人"',
' description "Chinese noun (pinyin jiqiren) literally robot, used for a bot; the Chinese surface for this artifact kind."',
' meaning "artifact_app"',
' gloss "an app — a generic application; canonical label `app`"',
' wiktionary "app"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "app"',
' description "English noun abbreviating application; the canonical label for this generic artifact kind."',
' lexeme "ru"',
' word "приложение"',
' description "Russian noun (romanized prilozheniye) for an application; the Russian surface for this generic artifact kind."',
' lexeme "hi"',
' word "ऐप"',
' description "Hindi noun (romanized app, a loanword) for an app; the Hindi surface for this generic artifact kind."',
' lexeme "zh"',
' word "应用"',
' description "Chinese noun (pinyin yingyong) for an application; the Chinese surface for this generic artifact kind."',
' meaning "artifact_api"',
' gloss "an API — a programmatic interface; canonical label `API`"',
' wiktionary "API"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "api"',
' description "English noun, the initialism API, for a programmatic interface; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "апи"',
' description "Russian noun (romanized api, a loanword) for an API; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "एपीआई"',
' description "Hindi noun (romanized api, a loanword) for an API; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "接口"',
' description "Chinese noun (pinyin jiekou) for an interface or API; the Chinese surface for this artifact kind."',
' meaning "artifact_sdk"',
' gloss "an SDK — a software development kit; canonical label `SDK`"',
' wiktionary "SDK"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "sdk"',
' description "English noun, the initialism SDK, for a software development kit; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "сдк"',
' description "Russian noun (romanized sdk, a loanword) for an SDK; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "एसडीके"',
' description "Hindi noun (romanized sdk, a loanword) for an SDK; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "开发包"',
' description "Chinese noun (pinyin kaifabao) for a development kit; the Chinese surface for this artifact kind."',
' meaning "artifact_tool"',
' gloss "a general tool or utility; canonical label `tool`"',
' wiktionary "tool"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "tool"',
' description "English noun for a general tool or utility; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "инструмент"',
' description "Russian noun (romanized instrument) for a tool; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "टूल"',
' description "Hindi noun (romanized tool, a loanword) for a tool; the Hindi surface for this artifact kind."',
' word "उपकरण"',
' description "Hindi noun (romanized upakaran) for an instrument or utility; an alternative Hindi surface for a tool."',
' lexeme "zh"',
' word "工具"',
' description "Chinese noun (pinyin gongju) for a tool; the Chinese surface for this artifact kind."',
' meaning "artifact_mod"',
' gloss "a mod that alters a game or program; canonical label `mod`"',
' wiktionary "mod"',
' defined_by "software_artifact"',
' role "software_artifact_kind"',
' lexeme "en"',
' word "mod"',
' description "English noun for a modification that alters a game or program; the canonical label for this artifact kind."',
' lexeme "ru"',
' word "мод"',
' description "Russian noun (romanized mod, a loanword) for a game modification; the Russian surface for this artifact kind."',
' lexeme "hi"',
' word "मॉड"',
' description "Hindi noun (romanized mod, a loanword) for a game modification; the Hindi surface for this artifact kind."',
' lexeme "zh"',
' word "模组"',
' description "Chinese noun (pinyin mozu) for a game mod; the Chinese surface for this artifact kind."',
' meaning "software_feature"',
' gloss "a capability a software request asks the artifact to have — the genus of the requirement categories below; a clause naming one is a feature requirement, and the category it names classifies the resulting subtask"',
' wiktionary "feature"',
' defined_by "requirement_state_tracking"',
' defined_by "requirement_project_behavior"',
' defined_by "property"',
' role "software_feature"',
' lexeme "en"',
' word "feature"',
' description "English noun for a capability a request asks the artifact to have; the genus of the requirement categories below."',
' word "features"',
' description "English noun, the plural of feature, for capabilities a request asks for; a plural surface of the feature concept."',
' word "requirement"',
' description "English noun for a stated capability the artifact must satisfy; a synonym surface for a feature."',
' word "requirements"',
' description "English noun, the plural of requirement, for stated capabilities; a plural synonym surface for features."',
' lexeme "ru"',
' word "функция"',
' description "Russian noun (romanized funktsiya) for a feature or function; the Russian surface for the feature concept."',
' word "требование"',
' description "Russian noun (romanized trebovaniye) for a requirement; an alternative Russian surface for a feature."',
' lexeme "hi"',
' word "सुविधा"',
' description "Hindi noun (romanized suvidha) for a feature or facility; the Hindi surface for the feature concept."',
' word "आवश्यकता"',
' description "Hindi noun (romanized avashyakta) for a requirement or necessity; an alternative Hindi surface for a feature."',
' lexeme "zh"',
' word "功能"',
' description "Chinese noun (pinyin gongneng) for a feature or function; the Chinese surface for the feature concept."',
' word "需求"',
' description "Chinese noun (pinyin xuqiu) for a requirement or demand; an alternative Chinese surface for a feature."',
' meaning "requirement_state_tracking"',
' gloss "a feature that tracks evolving state — counters, status, damage, cooldowns; canonical category `state_tracking`"',
' wiktionary "state"',
' defined_by "software_feature"',
' role "software_requirement_category"',
' lexeme "en"',
' word "track"',
' description "English verb for following evolving state over time; a state-tracking requirement cue."',
' word "hp"',
' description "English noun, the initialism for hit points, a tracked combat counter; a state-tracking requirement cue."',
' word "status"',
' description "English noun for a tracked condition or state; a state-tracking requirement cue."',
' word "damage"',
' description "English noun for tracked harm applied to a unit; a state-tracking requirement cue."',
' word "cooldown"',
' description "English noun for a tracked recharge timer between uses; a state-tracking requirement cue."',
' lexeme "ru"',
' word "состояние"',
' description "Russian noun (romanized sostoyaniye) for state or condition; a state-tracking requirement cue."',
' word "урон"',
' description "Russian noun (romanized uron) for damage; a state-tracking requirement cue."',
' word "откат"',
' description "Russian noun (romanized otkat) for a cooldown; a state-tracking requirement cue."',
' lexeme "hi"',
' word "स्थिति"',
' description "Hindi noun (romanized sthiti) for state or status; a state-tracking requirement cue."',
' word "क्षति"',
' description "Hindi noun (romanized kshati) for damage or harm; a state-tracking requirement cue."',
' lexeme "zh"',
' word "状态"',
' description "Chinese noun (pinyin zhuangtai) for state or status; a state-tracking requirement cue."',
' word "伤害"',
' description "Chinese noun (pinyin shanghai) for damage; a state-tracking requirement cue."',
' word "冷却"',
' description "Chinese noun (pinyin lengque) for a cooldown; a state-tracking requirement cue."',
' meaning "requirement_data_exchange"',
' gloss "a feature that moves data in or out — import, export, backups, reports; canonical category `data_exchange`"',
' wiktionary "data"',
' defined_by "software_feature"',
' role "software_requirement_category"',
' lexeme "en"',
' word "import"',
' description "English noun or verb for bringing data in; a data-exchange requirement cue."',
' word "export"',
' description "English noun or verb for sending data out; a data-exchange requirement cue."',
' word "csv"',
' description "English noun, the initialism for comma-separated values, a data-exchange file format; a data-exchange requirement cue."',
' word "backup"',
' description "English noun for a saved copy of data; a data-exchange requirement cue."',
' word "report"',
' description "English noun for a generated data summary; a data-exchange requirement cue."',
' word "calendar"',
' description "English noun for exported or imported schedule data; a data-exchange requirement cue."',
' lexeme "ru"',
' word "импорт"',
' description "Russian noun (romanized import) for importing data; a data-exchange requirement cue."',
' word "экспорт"',
' description "Russian noun (romanized eksport) for exporting data; a data-exchange requirement cue."',
' word "резервная копия"',
' description "Russian noun phrase (romanized rezervnaya kopiya) for a backup copy; a data-exchange requirement cue."',
' word "отчёт"',
' description "Russian noun (romanized otchyot) for a report; a data-exchange requirement cue."',
' lexeme "hi"',
' word "आयात"',
' description "Hindi noun (romanized aayat) for import; a data-exchange requirement cue."',
' word "निर्यात"',
' description "Hindi noun (romanized niryat) for export; a data-exchange requirement cue."',
' word "रिपोर्ट"',
' description "Hindi noun (romanized report, a loanword) for a report; a data-exchange requirement cue."',
' lexeme "zh"',
' word "导入"',
' description "Chinese verb (pinyin daoru) for importing data; a data-exchange requirement cue."',
' word "导出"',
' description "Chinese verb (pinyin daochu) for exporting data; a data-exchange requirement cue."',
' word "备份"',
' description "Chinese noun (pinyin beifen) for a backup; a data-exchange requirement cue."',
' word "报告"',
' description "Chinese noun (pinyin baogao) for a report; a data-exchange requirement cue."',
' meaning "requirement_automation"',
' gloss "a feature that runs on a schedule or trigger — reminders, notifications, jobs; canonical category `automation`"',
' wiktionary "automation"',
' defined_by "software_feature"',
' role "software_requirement_category"',
' lexeme "en"',
' word "reminder"',
' description "English noun for a scheduled prompt to the user; an automation requirement cue."',
' word "notification"',
' description "English noun for a triggered alert message; an automation requirement cue."',
' word "schedule"',
' description "English noun or verb for timing recurring work; an automation requirement cue."',
' word "weekly"',
' description "English adjective for a once-a-week recurrence; an automation requirement cue."',
' lexeme "ru"',
' word "напоминание"',
' description "Russian noun (romanized napominaniye) for a reminder; an automation requirement cue."',
' word "уведомление"',
' description "Russian noun (romanized uvedomleniye) for a notification; an automation requirement cue."',
' word "расписание"',
' description "Russian noun (romanized raspisaniye) for a schedule; an automation requirement cue."',
' lexeme "hi"',
' word "अनुस्मारक"',
' description "Hindi noun (romanized anusmarak) for a reminder; an automation requirement cue."',
' word "सूचना"',
' description "Hindi noun (romanized soochna) for a notification; an automation requirement cue."',
' lexeme "zh"',
' word "提醒"',
' description "Chinese noun or verb (pinyin tixing) for a reminder; an automation requirement cue."',
' word "通知"',
' description "Chinese noun (pinyin tongzhi) for a notification; an automation requirement cue."',
' word "计划"',
' description "Chinese noun (pinyin jihua) for a plan or schedule; an automation requirement cue."',
' meaning "requirement_validation"',
' gloss "a feature that validates input or invariants — checks, conflicts, audits; canonical category `validation`"',
' wiktionary "validation"',
' defined_by "software_feature"',
' role "software_requirement_category"',
' lexeme "en"',
' word "validate"',
' description "English verb for checking input or invariants for correctness; a validation requirement cue."',
' word "check"',
' description "English verb for inspecting input against a rule; a validation requirement cue."',
' word "conflict"',
' description "English noun for a clash between values that validation must catch; a validation requirement cue."',
' word "audit"',
' description "English noun for a systematic correctness review; a validation requirement cue."',
' lexeme "ru"',
' word "проверка"',
' description "Russian noun (romanized proverka) for a check or validation; a validation requirement cue."',
' word "проверь"',
' description "Russian imperative verb (romanized prover) meaning check or validate; a validation requirement cue."',
' word "аудит"',
' description "Russian noun (romanized audit, a loanword) for an audit; a validation requirement cue."',
' lexeme "hi"',
' word "सत्यापन"',
' description "Hindi noun (romanized satyapan) for verification or validation; a validation requirement cue."',
' word "जाँच"',
' description "Hindi noun (romanized janch) for a check or inspection; a validation requirement cue."',
' lexeme "zh"',
' word "验证"',
' description "Chinese verb (pinyin yanzheng) for validating or verifying; a validation requirement cue."',
' word "检查"',
' description "Chinese verb (pinyin jiancha) for checking; a validation requirement cue."',
' word "审计"',
' description "Chinese noun (pinyin shenji) for an audit; a validation requirement cue."',
' meaning "requirement_integration"',
' gloss "a feature that integrates with an external host — an API or third-party service; canonical category `integration`"',
' wiktionary "integration"',
' defined_by "software_feature"',
' role "software_requirement_category"',
' lexeme "en"',
' word "api"',
' description "English noun, the initialism API, for a programmatic interface to integrate with; an integration requirement cue."',
' word "discord"',
' description "English proper noun for the Discord chat platform to integrate with; an integration requirement cue."',
' word "telegram"',
' description "English proper noun for the Telegram messaging platform to integrate with; an integration requirement cue."',
' word "github"',
' description "English proper noun for the GitHub platform to integrate with; an integration requirement cue."',
' word "browser"',
' description "English noun for a web browser host to integrate with; an integration requirement cue."',
' lexeme "ru"',
' word "интеграция"',
' description "Russian noun (romanized integratsiya) for integration; an integration requirement cue."',
' word "апи"',
' description "Russian noun (romanized api, a loanword) for an API; an integration requirement cue."',
' word "браузер"',
' description "Russian noun (romanized brauzer, a loanword) for a browser; an integration requirement cue."',
' lexeme "hi"',
' word "एकीकरण"',
' description "Hindi noun (romanized ekikaran) for integration; an integration requirement cue."',
' word "एपीआई"',
' description "Hindi noun (romanized api, a loanword) for an API; an integration requirement cue."',
' lexeme "zh"',
' word "集成"',
' description "Chinese noun (pinyin jicheng) for integration; an integration requirement cue."',
' word "接口"',
' description "Chinese noun (pinyin jiekou) for an interface or API; an integration requirement cue."',
' word "浏览器"',
' description "Chinese noun (pinyin liulanqi) for a browser; an integration requirement cue."',
' meaning "requirement_user_interface"',
' gloss "a feature that presents state to a person — dashboards, charts, filters; canonical category `user_interface`"',
' wiktionary "interface"',
' defined_by "software_feature"',
' role "software_requirement_category"',
' lexeme "en"',
' word "dashboard"',
' description "English noun for a screen presenting state at a glance; a user-interface requirement cue."',
' word "chart"',
' description "English noun for a graphical plot of data; a user-interface requirement cue."',
' word "filter"',
' description "English noun for a control that narrows what is shown; a user-interface requirement cue."',
' word "progress"',
' description "English noun for a visual progress indicator; a user-interface requirement cue."',
' lexeme "ru"',
' word "панель"',
' description "Russian noun (romanized panel) for a panel or dashboard; a user-interface requirement cue."',
' word "график"',
' description "Russian noun (romanized grafik) for a chart or graph; a user-interface requirement cue."',
' word "фильтр"',
' description "Russian noun (romanized filtr) for a filter; a user-interface requirement cue."',
' lexeme "hi"',
' word "डैशबोर्ड"',
' description "Hindi noun (romanized dashboard, a loanword) for a dashboard; a user-interface requirement cue."',
' word "चार्ट"',
' description "Hindi noun (romanized chart, a loanword) for a chart; a user-interface requirement cue."',
' lexeme "zh"',
' word "仪表板"',
' description "Chinese noun (pinyin yibiaoban) for a dashboard; a user-interface requirement cue."',
' word "图表"',
' description "Chinese noun (pinyin tubiao) for a chart or graph; a user-interface requirement cue."',
' word "筛选"',
' description "Chinese verb (pinyin shaixuan) for filtering or screening; a user-interface requirement cue."',
' meaning "requirement_project_behavior"',
' gloss "a feature that adds general project behavior not covered by a more specific category — the catch-all classified last; canonical category `project_behavior`"',
' wiktionary "behavior"',
' defined_by "software_feature"',
' role "software_requirement_category"',
' lexeme "en"',
' word "add"',
' description "English verb for introducing general new behavior; a catch-all project-behavior cue."',
' word "admin"',
' description "English noun for administrative functionality; a catch-all project-behavior cue."',
' word "customer"',
' description "English noun for customer-related functionality; a catch-all project-behavior cue."',
' word "date"',
' description "English noun for date-handling functionality; a catch-all project-behavior cue."',
' word "email"',
' description "English noun for email-related functionality; a catch-all project-behavior cue."',
' word "expense"',
' description "English noun for expense-tracking functionality; a catch-all project-behavior cue."',
' word "file"',
' description "English noun for file-handling functionality; a catch-all project-behavior cue."',
' word "history"',
' description "English noun for history or audit-trail functionality; a catch-all project-behavior cue."',
' word "invoice"',
' description "English noun for invoicing functionality; a catch-all project-behavior cue."',
' word "log"',
' description "English noun for logging functionality; a catch-all project-behavior cue."',
' word "maintenance"',
' description "English noun for maintenance functionality; a catch-all project-behavior cue."',
' word "payment"',
' description "English noun for payment-handling functionality; a catch-all project-behavior cue."',
' word "protection"',
' description "English noun for protective functionality; a catch-all project-behavior cue."',
' word "record"',
' description "English noun for record-keeping functionality; a catch-all project-behavior cue."',
' word "rename"',
' description "English verb for renaming functionality; a catch-all project-behavior cue."',
' word "resistance"',
' description "English noun for resistance-related functionality; a catch-all project-behavior cue."',
' word "retry"',
' description "English verb for retry functionality; a catch-all project-behavior cue."',
' word "scrape"',
' description "English verb for scraping functionality; a catch-all project-behavior cue."',
' word "stack"',
' description "English noun for stack-related functionality; a catch-all project-behavior cue."',
' word "sync"',
' description "English verb for synchronization functionality; a catch-all project-behavior cue."',
' word "tracking"',
' description "English noun for general tracking functionality; a catch-all project-behavior cue."',
' word "upload"',
' description "English verb for upload functionality; a catch-all project-behavior cue."',
' lexeme "ru"',
' word "добавить"',
' description "Russian infinitive verb (romanized dobavit) meaning to add; a catch-all project-behavior cue."',
' word "клиент"',
' description "Russian noun (romanized klient) for a customer or client; a catch-all project-behavior cue."',
' word "файл"',
' description "Russian noun (romanized fayl) for a file; a catch-all project-behavior cue."',
' word "загрузка"',
' description "Russian noun (romanized zagruzka) for an upload or download; a catch-all project-behavior cue."',
' lexeme "hi"',
' word "जोड़ें"',
' description "Hindi imperative verb (romanized joden) meaning add; a catch-all project-behavior cue."',
' word "फ़ाइल"',
' description "Hindi noun (romanized file, a loanword) for a file; a catch-all project-behavior cue."',
' lexeme "zh"',
' word "添加"',
' description "Chinese verb (pinyin tianjia) for adding; a catch-all project-behavior cue."',
' word "文件"',
' description "Chinese noun (pinyin wenjian) for a file; a catch-all project-behavior cue."',
' word "上传"',
' description "Chinese verb (pinyin shangchuan) for uploading; a catch-all project-behavior cue."',
' meaning "software_delivery"',
' gloss "how the assistant should deliver a software solution — the genus of the delivery modes below; the default is generated code, the others are selected only when their mode is evidenced in the request"',
' wiktionary "delivery"',
' defined_by "software_artifact"',
' defined_by "delivery_manual_instructions"',
' role "software_delivery"',
' lexeme "en"',
' word "delivery"',
' description "English noun for how a software solution is handed over; the genus of the delivery modes below."',
' lexeme "ru"',
' word "доставка"',
' description "Russian noun (romanized dostavka) for delivery; the Russian surface for the delivery concept."',
' lexeme "hi"',
' word "वितरण"',
' description "Hindi noun (romanized vitaran) for delivery or distribution; the Hindi surface for the delivery concept."',
' lexeme "zh"',
' word "交付"',
' description "Chinese noun or verb (pinyin jiaofu) for delivery or handover; the Chinese surface for the delivery concept."',
' meaning "delivery_manual_instructions"',
' gloss "deliver step-by-step manual instructions for a person to follow instead of writing code; canonical mode `manual_instructions`"',
' wiktionary "instruction"',
' defined_by "software_delivery"',
' role "software_delivery_mode"',
' lexeme "en"',
' word "manual instruction"',
' description "English noun phrase for a single step-by-step instruction for a person; a manual-instructions delivery cue."',
' word "manual instructions"',
' description "English noun phrase, plural, for step-by-step instructions for a person to follow; the canonical manual-instructions delivery cue."',
' word "instruction"',
' description "English noun for a directive to follow; a manual-instructions delivery cue."',
' word "instructions"',
' description "English noun, the plural of instruction, for a set of directives; a manual-instructions delivery cue."',
' word "no code"',
' description "English phrase signalling delivery without writing source; a manual-instructions delivery cue."',
' lexeme "ru"',
' word "инструкция"',
' description "Russian noun (romanized instruktsiya) for an instruction; a manual-instructions delivery cue."',
' word "инструкции"',
' description "Russian noun (romanized instruktsii) for instructions; the plural form of the instruction surface."',
' word "вручную"',
' description "Russian adverb (romanized vruchnuyu) meaning manually or by hand; a manual-instructions delivery cue."',
' lexeme "hi"',
' word "निर्देश"',
' description "Hindi noun (romanized nirdesh) for an instruction or directive; a manual-instructions delivery cue."',
' word "मैनुअल"',
' description "Hindi adjective (romanized manual, a loanword) meaning manual; a manual-instructions delivery cue."',
' lexeme "zh"',
' word "手动说明"',
' description "Chinese noun phrase (pinyin shoudong shuoming) for manual instructions; the canonical manual-instructions delivery cue."',
' word "说明"',
' description "Chinese noun (pinyin shuoming) for an explanation or instructions; a manual-instructions delivery cue."',
' meaning "delivery_immediate_execution"',
' gloss "build the solution and run it immediately in the sandbox (WebVM) rather than handing back source; canonical mode `immediate_execution`"',
' wiktionary "execute"',
' defined_by "software_delivery"',
' role "software_delivery_mode"',
' lexeme "en"',
' word "execute"',
' description "English verb for running the built solution immediately; an immediate-execution delivery cue."',
' word "run command"',
' description "English noun phrase for a command to run immediately; an immediate-execution delivery cue."',
' word "run commands"',
' description "English noun phrase, plural, for commands to run immediately; an immediate-execution delivery cue."',
' word "run it"',
' description "English imperative phrase asking to run the solution immediately; an immediate-execution delivery cue."',
' word "webvm"',
' description "English proper noun for the WebVM in-browser sandbox where the solution runs; an immediate-execution delivery cue."',
' lexeme "ru"',
' word "выполни"',
' description "Russian imperative verb (romanized vypolni) meaning execute or carry out; an immediate-execution delivery cue."',
' word "запусти команду"',
' description "Russian imperative phrase (romanized zapusti komandu) meaning run a command; an immediate-execution delivery cue."',
' lexeme "hi"',
' word "निष्पादित करें"',
' description "Hindi imperative phrase (romanized nishpadit karen) meaning execute it; an immediate-execution delivery cue."',
' word "चलाएँ"',
' description "Hindi imperative verb (romanized chalaen) meaning run it; an immediate-execution delivery cue."',
' lexeme "zh"',
' word "立即运行"',
' description "Chinese phrase (pinyin liji yunxing) meaning run immediately; an immediate-execution delivery cue."',
' word "执行"',
' description "Chinese verb (pinyin zhixing) for executing; an immediate-execution delivery cue."',
' meaning "delivery_script_generation"',
' gloss "deliver an executable shell script or set of commands rather than application source; canonical mode `script_generation`"',
' wiktionary "script"',
' defined_by "software_delivery"',
' role "software_delivery_mode"',
' lexeme "en"',
' word "bash"',
' description "English proper noun for the Bash shell whose script is delivered; a script-generation delivery cue."',
' word "shell"',
' description "English noun for a command-line shell whose script is delivered; a script-generation delivery cue."',
' word "script"',
' description "English noun for an executable script delivered instead of application source; the canonical script-generation delivery cue."',
' word "scripts"',
' description "English noun, the plural of script, for executable scripts; a script-generation delivery cue."',
' word "commands"',
' description "English noun for a set of shell commands delivered to run; a script-generation delivery cue."',
' lexeme "ru"',
' word "скрипт"',
' description "Russian noun (romanized skript, a loanword) for a script; a script-generation delivery cue."',
' word "оболочка"',
' description "Russian noun (romanized obolochka) for a shell; a script-generation delivery cue."',
' word "команды"',
' description "Russian noun (romanized komandy) for commands; a script-generation delivery cue."',
' lexeme "hi"',
' word "स्क्रिप्ट"',
' description "Hindi noun (romanized script, a loanword) for a script; a script-generation delivery cue."',
' word "शेल"',
' description "Hindi noun (romanized shell, a loanword) for a shell; a script-generation delivery cue."',
' lexeme "zh"',
' word "脚本"',
' description "Chinese noun (pinyin jiaoben) for a script; the canonical script-generation delivery cue."',
' word "外壳脚本"',
' description "Chinese noun phrase (pinyin waike jiaoben) for a shell script; a script-generation delivery cue."',
' meaning "software_language"',
' gloss "the programming language a software implementation targets — the genus of the languages below; the default is TypeScript, the others are selected when the language is named in the request"',
' wiktionary "programming language"',
' defined_by "software_artifact"',
' defined_by "language_python"',
' role "software_language"',
' lexeme "en"',
' word "programming language"',
' description "English noun phrase for the language a software implementation targets; the genus of the languages below."',
' lexeme "ru"',
' word "язык программирования"',
' description "Russian noun phrase (romanized yazyk programmirovaniya) for a programming language; the Russian surface for this genus."',
' lexeme "hi"',
' word "प्रोग्रामिंग भाषा"',
' description "Hindi noun phrase (romanized programming bhasha) for a programming language; the Hindi surface for this genus."',
' lexeme "zh"',
' word "编程语言"',
' description "Chinese noun (pinyin biancheng yuyan) for a programming language; the Chinese surface for this genus."',
' meaning "language_python"',
' gloss "the Python programming language and its web frameworks (Django, FastAPI); canonical target `python`"',
' wiktionary "Python"',
' defined_by "software_language"',
' role "software_implementation_language"',
' lexeme "en"',
' word "python"',
' description "English proper noun for the Python programming language; the canonical target for this implementation language."',
' word "django"',
' description "English proper noun for Django, a Python web framework; a surface evidencing the Python target."',
' word "fastapi"',
' description "English proper noun for FastAPI, a Python web framework; a surface evidencing the Python target."',
' lexeme "ru"',
' word "питон"',
' description "Russian noun (romanized piton) for Python; the Russian surface for the Python target."',
' word "пайтон"',
' description "Russian noun (romanized payton) for Python; an alternative Russian transliteration of the Python target."',
' lexeme "hi"',
' word "पायथन"',
' description "Hindi noun (romanized python, a loanword) for the Python language; the Hindi surface for the Python target."',
' lexeme "zh"',
' word "python"',
' description "The Latin-script name Python used in Chinese text for the Python language; the Chinese surface for the Python target."',
' meaning "language_rust"',
' gloss "the Rust programming language and its Cargo toolchain; canonical target `rust`"',
' wiktionary "Rust"',
' defined_by "software_language"',
' role "software_implementation_language"',
' lexeme "en"',
' word "rust"',
' description "English proper noun for the Rust programming language; the canonical target for this implementation language."',
' word "cargo"',
' description "English proper noun for Cargo, the Rust build tool and package manager; a surface evidencing the Rust target."',
' lexeme "ru"',
' word "раст"',
' description "Russian noun (romanized rast) for the Rust language; the Russian surface for the Rust target."',
' lexeme "hi"',
' word "रस्ट"',
' description "Hindi noun (romanized rust, a loanword) for the Rust language; the Hindi surface for the Rust target."',
' lexeme "zh"',
' word "rust"',
' description "The Latin-script name Rust used in Chinese text for the Rust language; the Chinese surface for the Rust target."',
' meaning "language_javascript"',
' gloss "the JavaScript programming language and its Node.js runtime; canonical target `javascript`"',
' wiktionary "JavaScript"',
' defined_by "software_language"',
' role "software_implementation_language"',
' lexeme "en"',
' word "javascript"',
' description "English proper noun for the JavaScript programming language; the canonical target for this implementation language."',
' word "node"',
' description "English proper noun for Node.js, the JavaScript runtime; a surface evidencing the JavaScript target."',
' lexeme "ru"',
' word "джаваскрипт"',
' description "Russian noun (romanized dzhavaskript) for JavaScript; the Russian surface for the JavaScript target."',
' lexeme "hi"',
' word "जावास्क्रिप्ट"',
' description "Hindi noun (romanized javascript, a loanword) for the JavaScript language; the Hindi surface for the JavaScript target."',
' lexeme "zh"',
' word "javascript"',
' description "The Latin-script name JavaScript used in Chinese text for the JavaScript language; the Chinese surface for the JavaScript target."',
' meaning "implementation_language_preposition"',
" gloss \"the function word that marks which programming language an implementation should target — 'write a program in Rust', 'на Python'; the unknown-language extractor reads the language name that follows it. Head-initial English/Russian place the name after the marker (the only direction the positional extractor consults); the head-final Hindi/Chinese forms are described for completeness.\"",
' wiktionary "in"',
' defined_by "software_language"',
' role "implementation_language_preposition"',
' lexeme "en"',
' word "in"',
" description \"English preposition marking the target programming language, as in 'write it in <language>'; the language name follows it.\"",
' lexeme "ru"',
' word "на"',
" description \"Russian preposition (romanized na) marking the target programming language, as in 'на <language>'; the language name follows it.\"",
' lexeme "hi"',
' word "में"',
" description \"Hindi postposition (romanized mein) marking the target programming language; head-final Hindi places the language name before it ('<language> में').\"",
' lexeme "zh"',
' word "用"',
" description \"Chinese coverb (pinyin yong, 'using') marking the target programming language, as in '用 <language> 写'; the language name follows it.\"",
' meaning "implementation_language_noun"',
" gloss \"the head noun 'language' that may sit between the target preposition and the language name — 'in the language Brainfuck', 'на языке Brainfuck'; when present the unknown-language extractor skips it to read the name that follows.\"",
' wiktionary "language"',
' defined_by "software_language"',
' role "implementation_language_noun"',
' lexeme "en"',
' word "language"',
' description "English noun naming the programming-language slot; when it follows the target preposition the language name comes after it."',
' lexeme "ru"',
' word "языке"',
' description "Russian noun (romanized yazyke, the prepositional case of yazyk) naming the programming-language slot; the language name follows it."',
' lexeme "hi"',
' word "भाषा"',
' description "Hindi noun (romanized bhasha) naming the programming-language slot; the language name accompanies it."',
' lexeme "zh"',
' word "语言"',
' description "Chinese noun (pinyin yuyan) naming the programming-language slot; the language name accompanies it."',
' meaning "tabletop_game_tracker"',
" gloss \"a request to track a tabletop/RPG game piece's combat state — the genus pairing a game domain with a combat mechanic; only when both appear is it a game-unit tracker (which forces state_tracking subtasks and a damage-mitigation surface)\"",
' wiktionary "tabletop game"',
' defined_by "game_tracker_domain"',
' defined_by "game_tracker_mechanic"',
' role "tabletop_game_tracker"',
' lexeme "en"',
' word "tabletop game tracker"',
" description \"English noun phrase for a request to track a tabletop game piece's combat state; the genus pairing a game domain with a combat mechanic.\"",
' lexeme "ru"',
' word "трекер настольной игры"',
' description "Russian noun phrase (romanized treker nastolnoy igry) for a tabletop game tracker; the Russian surface for this genus."',
' lexeme "hi"',
' word "टेबलटॉप गेम ट्रैकर"',
' description "Hindi noun phrase (romanized tabletop game tracker, a loanword) for a tabletop game tracker; the Hindi surface for this genus."',
' lexeme "zh"',
' word "桌游追踪器"',
' description "Chinese noun (pinyin zhuoyou zhuizongqi) for a tabletop-game tracker; the Chinese surface for this genus."',
' meaning "game_tracker_domain"',
' gloss "a tabletop/RPG game domain whose pieces carry combat state — a D&D unit, a token, a wargame piece, an Owlbear scene"',
' wiktionary "tabletop game"',
' defined_by "tabletop_game_tracker"',
' role "game_tracker_domain"',
' lexeme "en"',
' word "dnd"',
' description "English proper noun, the abbreviation for Dungeons and Dragons, a tabletop RPG domain; a game-tracker domain cue."',
' word "wargame"',
' description "English noun for a tabletop war game whose pieces carry combat state; a game-tracker domain cue."',
' word "tabletop"',
' description "English noun for a tabletop game domain; a game-tracker domain cue."',
' word "unit"',
' description "English noun for a game piece or unit carrying combat state; a game-tracker domain cue."',
' word "token"',
' description "English noun for a playing token representing a piece; a game-tracker domain cue."',
' word "owlbear"',
' description "English proper noun for Owlbear Rodeo, a virtual tabletop scene tool; a game-tracker domain cue."',
' lexeme "ru"',
' word "настольная игра"',
' description "Russian noun phrase (romanized nastolnaya igra) for a tabletop game; a game-tracker domain cue."',
' word "фишка"',
' description "Russian noun (romanized fishka) for a game token or chip; a game-tracker domain cue."',
' word "жетон"',
' description "Russian noun (romanized zheton) for a token; a game-tracker domain cue."',
' lexeme "hi"',
' word "टेबलटॉप"',
' description "Hindi noun (romanized tabletop, a loanword) for a tabletop game; a game-tracker domain cue."',
' word "मोहरा"',
' description "Hindi noun (romanized mohra) for a game piece or pawn; a game-tracker domain cue."',
' lexeme "zh"',
' word "桌游"',
' description "Chinese noun (pinyin zhuoyou) for a tabletop game; a game-tracker domain cue."',
' word "棋子"',
' description "Chinese noun (pinyin qizi) for a game piece; a game-tracker domain cue."',
' word "战棋"',
' description "Chinese noun (pinyin zhanqi) for a tactical war game; a game-tracker domain cue."',
' meaning "game_tracker_mechanic"',
' gloss "a combat mechanic a tabletop tracker follows — hit points, damage, protection, resistance, cooldowns; shares ground with the state_tracking requirement"',
' wiktionary "hit points"',
' defined_by "tabletop_game_tracker"',
' defined_by "requirement_state_tracking"',
' role "game_tracker_mechanic"',
' lexeme "en"',
' word "hp"',
' description "English noun, the initialism for hit points, a tracked combat health value; a game-tracker mechanic cue."',
' word "damage"',
' description "English noun for harm a tracker subtracts from health; a game-tracker mechanic cue."',
' word "protection"',
' description "English noun for a defensive buffer the tracker accounts for; a game-tracker mechanic cue."',
' word "resistance"',
' description "English noun for damage reduction the tracker applies; a game-tracker mechanic cue."',
' word "cooldown"',
' description "English noun for a recharge timer between ability uses; a game-tracker mechanic cue."',
' word "cooldowns"',
' description "English noun, the plural of cooldown, for recharge timers; a game-tracker mechanic cue."',
' lexeme "ru"',
' word "хп"',
' description "Russian noun (romanized khp) for hit points; a game-tracker mechanic cue."',
' word "урон"',
' description "Russian noun (romanized uron) for damage; a game-tracker mechanic cue."',
' word "защита"',
' description "Russian noun (romanized zashchita) for protection or defence; a game-tracker mechanic cue."',
' word "сопротивление"',
' description "Russian noun (romanized soprotivleniye) for resistance; a game-tracker mechanic cue."',
' word "откат"',
' description "Russian noun (romanized otkat) for a cooldown; a game-tracker mechanic cue."',
' lexeme "hi"',
' word "एचपी"',
' description "Hindi noun (romanized hp, a loanword) for hit points; a game-tracker mechanic cue."',
' word "क्षति"',
' description "Hindi noun (romanized kshati) for damage; a game-tracker mechanic cue."',
' word "रक्षा"',
' description "Hindi noun (romanized raksha) for protection or defence; a game-tracker mechanic cue."',
' lexeme "zh"',
' word "生命值"',
' description "Chinese noun (pinyin shengmingzhi) for hit points or health value; a game-tracker mechanic cue."',
' word "伤害"',
' description "Chinese noun (pinyin shanghai) for damage; a game-tracker mechanic cue."',
' word "防护"',
' description "Chinese noun (pinyin fanghu) for protection; a game-tracker mechanic cue."',
' word "抗性"',
' description "Chinese noun (pinyin kangxing) for resistance; a game-tracker mechanic cue."',
' word "冷却"',
' description "Chinese noun (pinyin lengque) for a cooldown; a game-tracker mechanic cue."',
' meaning "software_approval"',
" gloss \"the user's approval interaction in a software dialogue — the genus pairing a whole-prompt go-ahead with the granularity at which approval is requested\"",
' wiktionary "approval"',
' defined_by "software_approval_trigger"',
' defined_by "software_step_granularity"',
' defined_by "concept"',
' role "software_approval"',
' lexeme "en"',
' word "approval"',
" description \"English noun for the user's go-ahead in a software dialogue; the genus pairing a go-ahead with its granularity.\"",
' lexeme "ru"',
' word "одобрение"',
' description "Russian noun (romanized odobreniye) for approval; the Russian surface for the approval concept."',
' lexeme "hi"',
' word "अनुमोदन"',
' description "Hindi noun (romanized anumodan) for approval; the Hindi surface for the approval concept."',
' lexeme "zh"',
' word "批准"',
' description "Chinese noun or verb (pinyin pizhun) for approval; the Chinese surface for the approval concept."',
' meaning "software_approval_trigger"',
' gloss "a whole-prompt go-ahead that moves a software dialogue from plan to implementation — approve, yes, proceed, go ahead, do it; matched against the entire compacted prompt, not a passing mention"',
' wiktionary "approve"',
' defined_by "software_approval"',
' role "software_approval_trigger"',
' lexeme "en"',
' word "approve"',
' description "English verb for giving the go-ahead to move from plan to implementation; the base approval-trigger surface."',
' word "approved"',
' description "English adjective or past form of approve confirming the go-ahead; an approval-trigger surface."',
' word "approve plan"',
' description "English phrase explicitly approving the plan; an approval-trigger surface."',
' word "yes"',
' description "English affirmative giving the go-ahead; an approval-trigger surface."',
' word "yes proceed"',
' description "English phrase affirming and asking to proceed; an approval-trigger surface."',
' word "proceed"',
' description "English verb asking to move forward with implementation; an approval-trigger surface."',
' word "go ahead"',
' description "English phrase granting permission to proceed; an approval-trigger surface."',
' word "looks good"',
' description "English phrase signalling approval of the plan; an approval-trigger surface."',
' word "do it"',
' description "English imperative phrase granting the go-ahead; an approval-trigger surface."',
' word "start implementation"',
' description "English phrase asking to begin implementing; an approval-trigger surface."',
' word "generate code"',
' description "English phrase asking to produce the code; an approval-trigger surface."',
' word "convert to code"',
' description "English phrase asking to turn the plan into code; an approval-trigger surface."',
' lexeme "ru"',
' word "одобряю"',
' description "Russian verb (romanized odobryayu) meaning I approve; an approval-trigger surface."',
' word "да"',
' description "Russian affirmative (romanized da) meaning yes; an approval-trigger surface."',
' word "приступай"',
' description "Russian imperative verb (romanized pristupay) meaning get started; an approval-trigger surface."',
' word "поехали"',
' description "Russian phrase (romanized poyekhali) meaning let us go; an approval-trigger surface."',
' lexeme "hi"',
' word "स्वीकृत"',
' description "Hindi adjective (romanized sweekrit) meaning approved; an approval-trigger surface."',
' word "हाँ"',
' description "Hindi affirmative (romanized han) meaning yes; an approval-trigger surface."',
' word "आगे बढ़ो"',
' description "Hindi imperative phrase (romanized aage badho) meaning go ahead; an approval-trigger surface."',
' lexeme "zh"',
' word "批准"',
' description "Chinese verb (pinyin pizhun) for approving; an approval-trigger surface."',
' word "同意"',
' description "Chinese verb (pinyin tongyi) for agreeing or consenting; an approval-trigger surface."',
' word "开始"',
' description "Chinese verb (pinyin kaishi) for starting or beginning; an approval-trigger surface."',
' meaning "software_step_granularity"',
' gloss "a request to approve the work step by step rather than all at once — adds the each_step approval gate"',
' wiktionary "step"',
' defined_by "software_approval"',
' role "software_step_granularity"',
' lexeme "en"',
' word "each step"',
' description "English phrase asking to approve every step individually; an each-step granularity cue."',
' word "step by step"',
' description "English phrase asking to proceed one step at a time; an each-step granularity cue."',
' lexeme "ru"',
' word "каждый шаг"',
' description "Russian phrase (romanized kazhdyy shag) meaning each step; an each-step granularity cue."',
' word "пошагово"',
' description "Russian adverb (romanized poshagovo) meaning step by step; an each-step granularity cue."',
' lexeme "hi"',
' word "हर चरण"',
' description "Hindi phrase (romanized har charan) meaning each step; an each-step granularity cue."',
' word "चरण दर चरण"',
' description "Hindi phrase (romanized charan dar charan) meaning step by step; an each-step granularity cue."',
' lexeme "zh"',
' word "每一步"',
' description "Chinese phrase (pinyin mei yi bu) meaning each step; an each-step granularity cue."',
' word "逐步"',
' description "Chinese adverb (pinyin zhubu) meaning step by step; an each-step granularity cue."',
' meaning "software_bash_command"',
' gloss "a shell or command-line surface the work touches — a shell, bash, a command, Docker, WebVM; adds the bash_command approval gate"',
' wiktionary "shell"',
' defined_by "software_delivery"',
' role "software_bash_command"',
' lexeme "en"',
' word "shell"',
' description "English noun for a command-line shell the work touches; a bash-command surface cue."',
' word "bash"',
' description "English proper noun for the Bash shell the work touches; a bash-command surface cue."',
' word "command"',
' description "English noun for a single shell command the work touches; a bash-command surface cue."',
' word "commands"',
' description "English noun, the plural of command, for shell commands the work touches; a bash-command surface cue."',
' word "docker"',
' description "English proper noun for Docker, a container command-line surface; a bash-command surface cue."',
' word "webvm"',
' description "English proper noun for the WebVM in-browser sandbox with a shell; a bash-command surface cue."',
' lexeme "ru"',
' word "оболочка"',
' description "Russian noun (romanized obolochka) for a shell; a bash-command surface cue."',
' word "команда"',
' description "Russian noun (romanized komanda) for a command; a bash-command surface cue."',
' word "команды"',
' description "Russian noun (romanized komandy) for commands; the plural form of the command surface."',
' lexeme "hi"',
' word "शेल"',
' description "Hindi noun (romanized shell, a loanword) for a shell; a bash-command surface cue."',
' word "कमांड"',
' description "Hindi noun (romanized command, a loanword) for a command; a bash-command surface cue."',
' lexeme "zh"',
' word "外壳"',
' description "Chinese noun (pinyin waike) for a shell; a bash-command surface cue."',
' word "命令"',
' description "Chinese noun (pinyin mingling) for a command; a bash-command surface cue."',
' word "docker"',
' description "The Latin-script name Docker used in Chinese text for the container tool; a bash-command surface cue."',
"meanings",
' meaning "program_synthesis"',
' gloss "deriving a small program — a function — from a specification and verifying it; the genus of the subject, domain, action, signal, and task meanings below"',
' wiktionary "synthesis"',
' defined_by "function"',
' defined_by "code"',
' defined_by "implement"',
' role "program_synthesis"',
' lexeme "en"',
' word "program synthesis"',
' description "English noun phrase for deriving a program from a specification; the root surface of this program-synthesis sub-ontology."',
' word "function synthesis"',
' description "English noun phrase for deriving a single function from a specification; a near-synonym surface for program synthesis."',
' lexeme "ru"',
' word "синтез программ"',
' description "Russian noun phrase (romanized sintez programm) for synthesis of programs; the Russian surface for program synthesis."',
' word "синтез функции"',
' description "Russian noun phrase (romanized sintez funktsii) for synthesis of a function; a near-synonym Russian surface for program synthesis."',
' lexeme "hi"',
' word "प्रोग्राम संश्लेषण"',
' description "Hindi noun phrase (romanized program sanshleshan) for program synthesis; the Hindi surface for deriving a program from a specification."',
' lexeme "zh"',
' word "程序合成"',
' description "Chinese noun phrase (pinyin chengxu hecheng) for program synthesis; the Chinese surface for deriving a program from a specification."',
' meaning "synthesis_subject_function"',
" gloss \"the function a synthesis request asks to be written — the subject of 'implement a function …'\"",
' wiktionary "function"',
' defined_by "program_synthesis"',
' defined_by "function"',
' role "program_synthesis_subject"',
' lexeme "en"',
' word "function"',
' description "English noun for a named block of code to be written; the subject of a synthesis request."',
' word "func"',
' description "English noun, a clipped abbreviation of function; a shorter synonym surface for the function subject."',
' lexeme "ru"',
' word "функция"',
' description "Russian noun (romanized funktsiya) for a function in the nominative case; the Russian surface for the function subject."',
' word "функцию"',
' description "Russian noun (romanized funktsiyu) for a function in the accusative case; the object form used after request verbs like implement."',
' lexeme "hi"',
' word "फ़ंक्शन"',
' description "Hindi noun (romanized function, a loanword) for a code function; the Hindi surface for the function subject."',
' word "फंक्शन"',
' description "Hindi noun (romanized function, a loanword) for a code function; a spelling variant surface for the function subject."',
' lexeme "zh"',
' word "函数"',
' description "Chinese noun (pinyin hanshu) for a function; the Chinese surface for the function subject."',
' meaning "synthesis_domain_python"',
' gloss "Python named as the target language of a synthesis request — a domain signal"',
' wiktionary "Python"',
' defined_by "program_synthesis"',
' defined_by "language_python"',
' role "program_synthesis_domain"',
' lexeme "en"',
' word "python"',
' description "English proper noun naming the Python programming language; a domain signal for the target language of synthesis."',
' lexeme "ru"',
' word "питон"',
' description "Russian noun (romanized piton) naming the Python language; the Russian surface for the Python domain signal."',
' word "пайтон"',
' description "Russian noun (romanized payton) naming the Python language; a transliteration variant surface for the Python domain signal."',
' lexeme "hi"',
' word "पायथन"',
' description "Hindi proper noun (romanized python) naming the Python language; the Hindi surface for the Python domain signal."',
' lexeme "zh"',
' word "python"',
' description "English-script proper noun naming the Python language as used in Chinese text; the Chinese-context surface for the Python domain signal."',
' meaning "synthesis_domain_tuple"',
' gloss "a tuple — an immutable ordered sequence; a data-structure domain signal for synthesis"',
' wiktionary "tuple"',
' defined_by "program_synthesis"',
' defined_by "code"',
' role "program_synthesis_domain"',
' lexeme "en"',
' word "tuple"',
' description "English noun for an immutable ordered sequence; a data-structure domain signal for synthesis."',
' word "tuples"',
' description "English noun, the plural of tuple; the plural surface for the tuple domain signal."',
' lexeme "ru"',
' word "кортеж"',
' description "Russian noun (romanized kortezh) for a tuple in the singular; the Russian surface for the tuple domain signal."',
' word "кортежи"',
' description "Russian noun (romanized kortezhi) for tuples in the plural; the plural surface for the tuple domain signal."',
' lexeme "hi"',
' word "टपल"',
' description "Hindi noun (romanized tuple, a loanword) for a tuple; the Hindi surface for the tuple domain signal."',
' lexeme "zh"',
' word "元组"',
' description "Chinese noun (pinyin yuanzu) for a tuple; the Chinese surface for the tuple domain signal."',
' meaning "synthesis_domain_numbers"',
' gloss "the numbers a synthesized function operates over — a data domain signal"',
' wiktionary "number"',
' defined_by "program_synthesis"',
' defined_by "result"',
' role "program_synthesis_domain"',
' lexeme "en"',
' word "numbers"',
' description "English noun, the plural of number, for the numeric data a synthesized function operates over; a data domain signal."',
' lexeme "ru"',
' word "числа"',
' description "Russian noun (romanized chisla) for numbers in the nominative plural; the Russian surface for the numbers domain signal."',
' word "чисел"',
' description "Russian noun (romanized chisel) for numbers in the genitive plural; the of-numbers form of the numbers domain signal."',
' lexeme "hi"',
' word "संख्याएँ"',
' description "Hindi noun (romanized sankhyaen) for numbers in the plural; the Hindi surface for the numbers domain signal."',
' word "संख्याओं"',
' description "Hindi noun (romanized sankhyaon) for numbers in the oblique plural; the of-numbers form of the numbers domain signal."',
' lexeme "zh"',
' word "数字"',
' description "Chinese noun (pinyin shuzi) for numbers or digits; the Chinese surface for the numbers domain signal."',
' meaning "synthesis_domain_vowels"',
' gloss "the vowels a synthesized text function counts — a data domain signal"',
' wiktionary "vowel"',
' defined_by "program_synthesis"',
' defined_by "result"',
' role "program_synthesis_domain"',
' lexeme "en"',
' word "vowels"',
' description "English noun, the plural of vowel, for the vowels a text function counts; a data domain signal."',
' word "vowel"',
' description "English noun for a single vowel; the singular surface for the vowels domain signal."',
' lexeme "ru"',
' word "гласные"',
' description "Russian noun (romanized glasnye) for vowels in the nominative plural; the Russian surface for the vowels domain signal."',
' word "гласных"',
' description "Russian noun (romanized glasnykh) for vowels in the genitive plural; the of-vowels form of the vowels domain signal."',
' lexeme "hi"',
' word "स्वर"',
' description "Hindi noun (romanized svar) for a vowel or vowels; the Hindi surface for the vowels domain signal."',
' word "स्वरों"',
' description "Hindi noun (romanized svaron) for vowels in the oblique plural; the of-vowels form of the vowels domain signal."',
' lexeme "zh"',
' word "元音"',
' description "Chinese noun (pinyin yuanyin) for a vowel; the Chinese surface for the vowels domain signal."',
' meaning "synthesis_action_implement"',
" gloss \"the request verb 'implement' that asks a function be synthesized\"",
' wiktionary "implement"',
' defined_by "program_synthesis"',
' defined_by "implement"',
' role "program_synthesis_action"',
' lexeme "en"',
' word "implement"',
' description "English verb meaning to build or realize code; the request verb asking that a function be synthesized."',
' lexeme "ru"',
' word "реализуй"',
' description "Russian verb (romanized realizuy) for implement in the informal imperative; the Russian request surface asking a function be synthesized."',
' word "реализовать"',
' description "Russian verb (romanized realizovat) for implement in the infinitive; an alternative Russian surface for the implement request verb."',
' lexeme "hi"',
' word "लागू"',
' description "Hindi word (romanized lagu) meaning to put into effect or implement; the Hindi surface for the implement request verb."',
' lexeme "zh"',
' word "实现"',
' description "Chinese verb (pinyin shixian) for implement or realize; the Chinese surface for the implement request verb."',
' meaning "synthesis_action_write"',
" gloss \"the request verb 'write' that asks a function be synthesized\"",
' wiktionary "write"',
' defined_by "program_synthesis"',
' defined_by "write"',
' role "program_synthesis_action"',
' lexeme "en"',
' word "write"',
' description "English verb meaning to compose code; the request verb asking that a function be synthesized."',
' lexeme "ru"',
' word "напиши"',
' description "Russian verb (romanized napishi) for write in the informal imperative; the Russian request surface asking a function be written."',
' word "напишите"',
' description "Russian verb (romanized napishite) for write in the formal or plural imperative; a polite surface for the write request verb."',
' lexeme "hi"',
' word "लिखो"',
' description "Hindi verb (romanized likho) for write in the informal imperative; the Hindi request surface asking a function be written."',
' word "लिखें"',
' description "Hindi verb (romanized likhen) for write in the polite imperative; a formal surface for the write request verb."',
' lexeme "zh"',
' word "编写"',
' description "Chinese verb (pinyin bianxie) for write or compose code; the Chinese surface for the write request verb."',
' word "写"',
' description "Chinese verb (pinyin xie) for write; a shorter single-character surface for the write request verb."',
' meaning "synthesis_action_return"',
" gloss \"the specification verb 'return' that states what a synthesized function yields\"",
' wiktionary "return"',
' defined_by "program_synthesis"',
' defined_by "output"',
' defined_by "result"',
' role "program_synthesis_action"',
' lexeme "en"',
' word "return"',
' description "English verb meaning to yield a value from a function; the specification verb stating what the function produces."',
' word "returns"',
' description "English verb, the third-person singular of return; the it-returns surface for the return specification verb."',
' lexeme "ru"',
' word "верни"',
' description "Russian verb (romanized verni) for return in the informal imperative; the Russian surface for the return specification verb."',
' word "вернуть"',
' description "Russian verb (romanized vernut) for return in the infinitive; an alternative Russian surface for the return specification verb."',
' word "возврати"',
' description "Russian verb (romanized vozvrati) for return in the imperative; another Russian surface for the return specification verb."',
' lexeme "hi"',
' word "लौटाएँ"',
' description "Hindi verb (romanized lautaen) for return in the polite imperative; the Hindi surface for the return specification verb."',
' word "लौटाओ"',
' description "Hindi verb (romanized lautao) for return in the informal imperative; an alternative Hindi surface for the return specification verb."',
' word "लौटा"',
' description "Hindi verb (romanized lauta) for return in the bare or past form; another Hindi surface for the return specification verb."',
' lexeme "zh"',
' word "返回"',
' description "Chinese verb (pinyin fanhui) for return or send back a value; the Chinese surface for the return specification verb."',
' meaning "signal_distinct_numbers"',
" gloss \"the 'distinct numbers' phrase that signals the pairwise-threshold task\"",
' wiktionary "distinct"',
' defined_by "program_synthesis"',
' defined_by "synthesis_domain_numbers"',
' role "program_synthesis_signal"',
' lexeme "en"',
' word "distinct numbers"',
' description "English noun phrase for numbers that are all different; the signal phrase for the pairwise-threshold task."',
' lexeme "ru"',
' word "различные числа"',
' description "Russian noun phrase (romanized razlichnye chisla) for distinct numbers; the Russian signal surface for the pairwise-threshold task."',
' word "разные числа"',
' description "Russian noun phrase (romanized raznye chisla) for different numbers; a colloquial variant surface for the distinct-numbers signal."',
' lexeme "hi"',
' word "अलग संख्याएँ"',
' description "Hindi noun phrase (romanized alag sankhyaen) for distinct numbers; the Hindi signal surface for the pairwise-threshold task."',
' lexeme "zh"',
' word "不同的数字"',
' description "Chinese noun phrase (pinyin butong de shuzi) for distinct numbers; the Chinese signal surface for the pairwise-threshold task."',
' meaning "signal_difference"',
" gloss \"the 'differ' relation that signals comparing values in the pairwise-threshold task\"",
' wiktionary "differ"',
' defined_by "program_synthesis"',
' role "program_synthesis_signal"',
' lexeme "en"',
' word "differ"',
' description "English verb meaning to be unlike; the signal relation for comparing values in the pairwise-threshold task."',
' word "differs"',
' description "English verb, the third-person singular of differ; the it-differs surface for the difference signal."',
' word "difference"',
' description "English noun for the result of comparing two values; the nominal surface for the difference signal."',
' lexeme "ru"',
' word "отличаются"',
' description "Russian verb (romanized otlichayutsya) for they differ; the Russian surface for the difference signal."',
' word "различаются"',
' description "Russian verb (romanized razlichayutsya) for they differ; an alternative Russian surface for the difference signal."',
' word "разница"',
' description "Russian noun (romanized raznitsa) for difference; the nominal Russian surface for the difference signal."',
' lexeme "hi"',
' word "भिन्न"',
' description "Hindi adjective (romanized bhinn) for different or distinct; the Hindi surface for the difference signal."',
' word "अंतर"',
' description "Hindi noun (romanized antar) for difference or gap; the nominal Hindi surface for the difference signal."',
' lexeme "zh"',
' word "不同"',
' description "Chinese adjective (pinyin butong) for different or not the same; the Chinese surface for the difference signal."',
' word "差异"',
' description "Chinese noun (pinyin chayi) for difference or disparity; the nominal Chinese surface for the difference signal."',
' meaning "signal_threshold"',
" gloss \"the 'threshold' bound that signals the pairwise-threshold task\"",
' wiktionary "threshold"',
' defined_by "program_synthesis"',
' role "program_synthesis_signal"',
' lexeme "en"',
' word "threshold"',
' description "English noun for a limiting bound or cutoff value; the signal phrase for the pairwise-threshold task."',
' word "thresholds"',
' description "English noun, the plural of threshold; the plural surface for the threshold signal."',
' lexeme "ru"',
' word "порог"',
' description "Russian noun (romanized porog) for a threshold in the nominative; the Russian surface for the threshold signal."',
' word "порога"',
' description "Russian noun (romanized poroga) for a threshold in the genitive; the of-threshold form of the threshold signal."',
' lexeme "hi"',
' word "सीमा"',
' description "Hindi noun (romanized seema) for a limit or boundary; the Hindi surface for the threshold signal."',
' word "थ्रेशोल्ड"',
' description "Hindi noun (romanized threshold, a loanword) for a threshold; a borrowed-term surface for the threshold signal."',
' lexeme "zh"',
' word "阈值"',
' description "Chinese noun (pinyin yuzhi) for a threshold value; the Chinese surface for the threshold signal."',
' meaning "signal_similar_elements"',
" gloss \"the 'similar elements' phrase that signals the tuple-intersection task\"",
' wiktionary "similar"',
' defined_by "program_synthesis"',
' defined_by "synthesis_subject_function"',
' role "program_synthesis_signal"',
' lexeme "en"',
' word "similar elements"',
' description "English noun phrase for elements shared by two collections; the signal phrase for the tuple-intersection task."',
' lexeme "ru"',
' word "похожие элементы"',
' description "Russian noun phrase (romanized pokhozhie elementy) for similar elements; the Russian signal surface for the tuple-intersection task."',
' word "одинаковые элементы"',
' description "Russian noun phrase (romanized odinakovye elementy) for identical elements; a variant surface for the similar-elements signal."',
' lexeme "hi"',
' word "समान तत्व"',
' description "Hindi noun phrase (romanized saman tatva) for similar elements; the Hindi signal surface for the tuple-intersection task."',
' lexeme "zh"',
' word "相似元素"',
' description "Chinese noun phrase (pinyin xiangsi yuansu) for similar elements; the Chinese signal surface for the tuple-intersection task."',
' meaning "signal_count_vowels"',
" gloss \"the 'count vowels' / 'number of vowels' phrases that signal the vowel-counting task\"",
' wiktionary "vowel"',
' defined_by "program_synthesis"',
' defined_by "synthesis_domain_vowels"',
' role "program_synthesis_signal"',
' lexeme "en"',
' word "count vowels"',
' description "English verb phrase for tallying the vowels in a text; the signal phrase for the vowel-counting task."',
' word "number of vowels"',
' description "English noun phrase for the count of vowels; an alternative signal phrase for the vowel-counting task."',
' lexeme "ru"',
' word "количество гласных"',
' description "Russian noun phrase (romanized kolichestvo glasnykh) for the number of vowels; the Russian signal surface for the vowel-counting task."',
' word "число гласных"',
' description "Russian noun phrase (romanized chislo glasnykh) for the number of vowels; a variant surface for the count-vowels signal."',
' lexeme "hi"',
' word "स्वरों की संख्या"',
' description "Hindi noun phrase (romanized svaron ki sankhya) for the number of vowels; the Hindi signal surface for the vowel-counting task."',
' lexeme "zh"',
' word "元音数量"',
' description "Chinese noun phrase (pinyin yuanyin shuliang) for the number of vowels; the Chinese signal surface for the vowel-counting task."',
' word "元音的数量"',
' description "Chinese noun phrase (pinyin yuanyin de shuliang) for the number of vowels; a variant surface for the count-vowels signal."',
' meaning "has_close_elements"',
' gloss "the HumanEval/0 task: true when any two distinct numbers are within a threshold — recognized by the distinct-numbers, difference, and threshold signals (its slug is the canonical function name)"',
' wiktionary "close"',
' defined_by "signal_distinct_numbers"',
' defined_by "signal_difference"',
' defined_by "signal_threshold"',
' role "program_synthesis_task"',
' lexeme "en"',
' word "has_close_elements"',
' description "English function-name identifier for the HumanEval/0 task; the canonical slug naming the within-threshold task."',
' lexeme "ru"',
' word "has_close_elements"',
' description "The canonical function-name identifier for the HumanEval/0 task, kept in English under the Russian lexeme since the slug is language-neutral code."',
' lexeme "hi"',
' word "has_close_elements"',
' description "The canonical function-name identifier for the HumanEval/0 task, kept in English under the Hindi lexeme since the slug is language-neutral code."',
' lexeme "zh"',
' word "has_close_elements"',
' description "The canonical function-name identifier for the HumanEval/0 task, kept in English under the Chinese lexeme since the slug is language-neutral code."',
' meaning "similar_elements"',
' gloss "the MBPP/2 task: the intersection of two tuples in deterministic order — recognized by the similar-elements signal (its slug is the canonical function name)"',
' wiktionary "similar"',
' defined_by "signal_similar_elements"',
' role "program_synthesis_task"',
' lexeme "en"',
' word "similar_elements"',
' description "English function-name identifier for the MBPP/2 task; the canonical slug naming the tuple-intersection task."',
' lexeme "ru"',
' word "similar_elements"',
' description "The canonical function-name identifier for the MBPP/2 task, kept in English under the Russian lexeme since the slug is language-neutral code."',
' lexeme "hi"',
' word "similar_elements"',
' description "The canonical function-name identifier for the MBPP/2 task, kept in English under the Hindi lexeme since the slug is language-neutral code."',
' lexeme "zh"',
' word "similar_elements"',
' description "The canonical function-name identifier for the MBPP/2 task, kept in English under the Chinese lexeme since the slug is language-neutral code."',
' meaning "count_vowels"',
' gloss "the vowel-counting task: how many vowels a text contains — recognized by the count-vowels signal (its slug is the canonical function name)"',
' wiktionary "count"',
' defined_by "signal_count_vowels"',
' role "program_synthesis_task"',
' lexeme "en"',
' word "count_vowels"',
' description "English function-name identifier for the vowel-counting task; the canonical slug naming how many vowels a text contains."',
' lexeme "ru"',
' word "count_vowels"',
' description "The canonical function-name identifier for the vowel-counting task, kept in English under the Russian lexeme since the slug is language-neutral code."',
' lexeme "hi"',
' word "count_vowels"',
' description "The canonical function-name identifier for the vowel-counting task, kept in English under the Hindi lexeme since the slug is language-neutral code."',
' lexeme "zh"',
' word "count_vowels"',
' description "The canonical function-name identifier for the vowel-counting task, kept in English under the Chinese lexeme since the slug is language-neutral code."',
"meanings",
' meaning "assistant"',
' gloss "the deterministic symbolic AI that answers the user — it speaks about itself and produces every answer"',
' wiktionary "assistant"',
' defined_by "answer"',
' defined_by "self_reference"',
' defined_by "entity"',
' role "conversational_entity"',
' lexeme "en"',
' word "assistant"',
' description "English noun for the deterministic symbolic AI that answers the user; the bare surface for the assistant concept."',
' word "ai assistant"',
' description "English phrase naming the assistant as an AI-driven helper; an explicit surface for the assistant concept."',
' lexeme "ru"',
' word "ассистент"',
' description "Russian noun (romanized assistent) for an assistant; the Russian surface for the assistant concept."',
' word "помощник"',
' description "Russian noun (romanized pomoshchnik) for a helper; an alternative Russian surface for the assistant concept."',
' lexeme "hi"',
' word "सहायक"',
' description "Hindi noun (romanized sahayak) for a helper or assistant; the Hindi surface for the assistant concept."',
' lexeme "zh"',
' word "助手"',
' description "Chinese noun (pinyin zhushou) for an assistant or helper; the Chinese surface for the assistant concept."',
' word "助理"',
' description "Chinese noun (pinyin zhuli) for an assistant or aide; an alternative Chinese surface for the assistant concept."',
' meaning "user"',
' gloss "the person who addresses the assistant — the author of every inquiry"',
' wiktionary "user"',
' defined_by "inquiry"',
' defined_by "entity"',
' role "conversational_entity"',
' lexeme "en"',
' word "user"',
' description "English noun for the person who addresses the assistant; the surface for the user concept."',
' lexeme "ru"',
' word "пользователь"',
' description "Russian noun (romanized polzovatel) for a user; the Russian surface for the user concept."',
' lexeme "hi"',
' word "उपयोगकर्ता"',
' description "Hindi noun (romanized upayogkarta) for a user; the Hindi surface for the user concept."',
' lexeme "zh"',
' word "用户"',
' description "Chinese noun (pinyin yonghu) for a user; the Chinese surface for the user concept."',
' meaning "inquiry"',
' gloss "a question or request a user makes, expecting an answer from the assistant"',
' wiktionary "inquiry"',
' defined_by "answer"',
' defined_by "user"',
' role "conversational_act"',
' lexeme "en"',
' word "inquiry"',
' description "English noun for a question or request expecting an answer; the surface for the inquiry concept."',
' word "question"',
' description "English noun for a sentence that asks for information; a synonym surface for the inquiry concept."',
' word "request"',
' description "English noun for an act of asking the assistant to do something; an alternative surface for the inquiry concept."',
' lexeme "ru"',
' word "вопрос"',
' description "Russian noun (romanized vopros) for a question; the Russian surface for the inquiry concept."',
' word "запрос"',
' description "Russian noun (romanized zapros) for a request or query; an alternative Russian surface for the inquiry concept."',
' lexeme "hi"',
' word "प्रश्न"',
' description "Hindi noun (romanized prashn) for a question; the Hindi surface for the inquiry concept."',
' word "अनुरोध"',
' description "Hindi noun (romanized anurodh) for a request; an alternative Hindi surface for the inquiry concept."',
' lexeme "zh"',
' word "询问"',
' description "Chinese noun and verb (pinyin xunwen) for an inquiry or to ask; the Chinese surface for the inquiry concept."',
' word "请求"',
' description "Chinese noun and verb (pinyin qingqiu) for a request; an alternative Chinese surface for the inquiry concept."',
' meaning "answer"',
' gloss "the reply the assistant returns to an inquiry"',
' wiktionary "answer"',
' defined_by "inquiry"',
' defined_by "assistant"',
' role "conversational_act"',
' lexeme "en"',
' word "answer"',
' description "English noun for the reply the assistant returns to an inquiry; the surface for the answer concept."',
' word "response"',
' description "English noun for a reaction or reply to an inquiry; a synonym surface for the answer concept."',
' word "reply"',
' description "English noun for what is said back in answer to an inquiry; an alternative surface for the answer concept."',
' lexeme "ru"',
' word "ответ"',
' description "Russian noun (romanized otvet) for an answer or reply; the Russian surface for the answer concept."',
' lexeme "hi"',
' word "उत्तर"',
' description "Hindi noun (romanized uttar) for an answer; the Hindi surface for the answer concept."',
' word "जवाब"',
' description "Hindi noun (romanized javab) for a reply; an alternative Hindi surface for the answer concept."',
' lexeme "zh"',
' word "回答"',
' description "Chinese noun and verb (pinyin huida) for an answer or to answer; the Chinese surface for the answer concept."',
' word "答复"',
' description "Chinese noun and verb (pinyin dafu) for a reply or to reply; an alternative Chinese surface for the answer concept."',
' meaning "self_reference"',
' gloss "a reference the assistant makes to itself — the grammatical object of questions about the assistant"',
' wiktionary "self"',
' defined_by "assistant"',
' role "conversational_concept"',
' lexeme "en"',
' word "yourself"',
' description "English reflexive pronoun addressing the assistant itself; a surface for the self-reference concept."',
' word "myself"',
' description "English reflexive pronoun by which the assistant refers to itself; a surface for the self-reference concept."',
' lexeme "ru"',
' word "себе"',
' description "Russian reflexive pronoun (romanized sebe) in the dative or prepositional case meaning to or about oneself; a surface for the self-reference concept."',
' word "себя"',
' description "Russian reflexive pronoun (romanized sebya) in the accusative or genitive case meaning oneself; a surface for the self-reference concept."',
' lexeme "hi"',
' word "स्वयं"',
' description "Hindi reflexive pronoun (romanized svayam) meaning oneself; a surface for the self-reference concept."',
' word "खुद"',
' description "Hindi reflexive pronoun (romanized khud) meaning oneself; an alternative surface for the self-reference concept."',
' lexeme "zh"',
' word "自己"',
' description "Chinese reflexive pronoun (pinyin ziji) meaning oneself; the Chinese surface for the self-reference concept."',
' meaning "capability"',
' gloss "something the assistant is able to do — a feature it can perform in answer to a request"',
' wiktionary "capability"',
' defined_by "assistant"',
' defined_by "answer"',
' role "conversational_concept"',
' lexeme "en"',
' word "capability"',
' description "English noun for something the assistant is able to do; the surface for the capability concept."',
' word "ability"',
' description "English noun for the capacity to perform something; a synonym surface for the capability concept."',
' lexeme "ru"',
' word "возможность"',
' description "Russian noun (romanized vozmozhnost) for a possibility or capability; the Russian surface for the capability concept."',
' word "умение"',
' description "Russian noun (romanized umeniye) for a skill or ability; an alternative Russian surface for the capability concept."',
' lexeme "hi"',
' word "क्षमता"',
' description "Hindi noun (romanized kshamata) for a capability or capacity; the Hindi surface for the capability concept."',
' lexeme "zh"',
' word "能力"',
' description "Chinese noun (pinyin nengli) for an ability or capability; the Chinese surface for the capability concept."',
' word "功能"',
' description "Chinese noun (pinyin gongneng) for a function or feature; an alternative Chinese surface for the capability concept."',
' meaning "knowledge"',
' gloss "what the assistant knows — the facts available to it"',
' wiktionary "knowledge"',
' defined_by "assistant"',
' defined_by "fact"',
' role "conversational_concept"',
' lexeme "en"',
' word "knowledge"',
' description "English noun for what the assistant knows; the surface for the knowledge concept."',
' lexeme "ru"',
' word "знание"',
' description "Russian noun (romanized znaniye) for knowledge; the Russian surface for the knowledge concept."',
' lexeme "hi"',
' word "ज्ञान"',
' description "Hindi noun (romanized gyan) for knowledge; the Hindi surface for the knowledge concept."',
' lexeme "zh"',
' word "知识"',
' description "Chinese noun (pinyin zhishi) for knowledge; the Chinese surface for the knowledge concept."',
' meaning "fact"',
' gloss "a known true statement that the assistant can recall as part of its knowledge"',
' wiktionary "fact"',
' defined_by "knowledge"',
' role "conversational_concept"',
' role "knowledge_inventory_noun"',
' lexeme "en"',
' word "fact"',
' description "English noun for a known true statement the assistant can recall; the singular surface for the fact concept."',
' word "facts"',
' description "English plural noun for known true statements; the plural surface for the fact concept."',
' lexeme "ru"',
' word "факт"',
' description "Russian noun (romanized fakt) for a fact; the singular Russian surface for the fact concept."',
' word "факты"',
' description "Russian plural noun (romanized fakty) for facts; the plural Russian surface for the fact concept."',
' lexeme "hi"',
' word "तथ्य"',
' description "Hindi noun (romanized tathya) for a fact; the Hindi surface for the fact concept."',
' lexeme "zh"',
' word "事实"',
' description "Chinese noun (pinyin shishi) for a fact; the simplified Chinese surface for the fact concept."',
' word "事實"',
' description "Chinese noun (pinyin shishi) for a fact; the traditional Chinese surface for the fact concept."',
' meaning "knowledge_inventory_probe"',
' gloss "an interrogative or enumerating cue that asks the assistant to surface the items it holds"',
' wiktionary "enumerate"',
' defined_by "inquiry"',
' role "knowledge_inventory_interrogative"',
' lexeme "en"',
' word "what"',
' description "English interrogative pronoun opening a request to name the items the assistant holds."',
' word "which"',
' description "English interrogative determiner selecting among the items the assistant holds."',
' word "list"',
' description "English verb asking the assistant to enumerate the items it holds."',
' word "show"',
' description "English verb asking the assistant to display the items it holds."',
' lexeme "ru"',
' word "какие"',
' description "Russian interrogative determiner (romanized kakie) asking which items the assistant holds."',
' word "что"',
' description "Russian interrogative pronoun (romanized chto) asking what the assistant holds."',
' word "перечисли"',
' description "Russian imperative verb (romanized perechisli) asking the assistant to enumerate the items it holds."',
' word "покажи"',
' description "Russian imperative verb (romanized pokazhi) asking the assistant to display the items it holds."',
' word "назови"',
' description "Russian imperative verb (romanized nazovi) asking the assistant to name the items it holds."',
' lexeme "hi"',
' word "कौन"',
' description "Hindi interrogative (romanized kaun) asking which items the assistant holds."',
' word "क्या"',
' description "Hindi interrogative (romanized kya) asking what the assistant holds."',
' word "सूची"',
' description "Hindi noun (romanized soochee) for a list, asking the assistant to enumerate the items it holds."',
' word "सूचीबद्ध"',
' description "Hindi adjective (romanized soocheebaddh) meaning listed, asking the assistant to enumerate the items it holds."',
' word "बताओ"',
' description "Hindi imperative verb (romanized batao) asking the assistant to tell the items it holds."',
' word "दिखाओ"',
' description "Hindi imperative verb (romanized dikhao) asking the assistant to show the items it holds."',
' lexeme "zh"',
' word "哪些"',
' description "Chinese interrogative (pinyin naxie) selecting which items the assistant holds."',
' word "什么"',
' description "Chinese interrogative (pinyin shenme) asking what the assistant holds; simplified surface."',
' word "什麼"',
' description "Chinese interrogative (pinyin shenme) asking what the assistant holds; traditional surface."',
' word "你知道"',
' description "Chinese phrase (pinyin ni zhidao) meaning you-know, asking what the assistant holds."',
' word "您知道"',
' description "Chinese phrase (pinyin nin zhidao) meaning you-know (polite), asking what the assistant holds."',
' word "你有"',
' description "Chinese phrase (pinyin ni you) meaning you-have, asking what the assistant holds."',
' word "您有"',
' description "Chinese phrase (pinyin nin you) meaning you-have (polite), asking what the assistant holds."',
' meaning "assistant_knowing"',
' gloss "second-person attribution of knowing or having — the assistant being the one that holds the knowledge"',
' wiktionary "know"',
' defined_by "knowledge"',
' defined_by "assistant"',
' role "knowledge_possession"',
' lexeme "en"',
' word "you know"',
' description "English second-person phrase attributing the knowing to the assistant."',
' word "do you know"',
' description "English second-person interrogative phrase attributing the knowing to the assistant."',
' word "you have"',
' description "English second-person phrase attributing possession of the knowledge to the assistant."',
' word "available to you"',
' description "English phrase describing knowledge accessible to the assistant."',
' word "in your knowledge"',
" description \"English phrase locating the facts inside the assistant's knowledge.\"",
' word "known to you"',
' description "English phrase attributing the known facts to the assistant."',
' lexeme "ru"',
' word "ты знаешь"',
' description "Russian second-person phrase (romanized ty znaesh) attributing the knowing to the assistant."',
' word "знаешь"',
' description "Russian second-person verb (romanized znaesh) attributing the knowing to the assistant."',
' word "тебе известно"',
' description "Russian phrase (romanized tebe izvestno) meaning it-is-known-to-you, attributing the knowing to the assistant."',
' word "тебе известны"',
' description "Russian phrase (romanized tebe izvestny) meaning they-are-known-to-you, attributing the knowing to the assistant."',
' word "тебе известен"',
' description "Russian phrase (romanized tebe izvesten) meaning it-is-known-to-you (masculine), attributing the knowing to the assistant."',
' word "у тебя есть"',
' description "Russian phrase (romanized u tebya est) meaning you-have, attributing possession to the assistant."',
' word "твои знания"',
' description "Russian phrase (romanized tvoi znaniya) meaning your-knowledge, attributing the knowledge to the assistant."',
' word "что ты знаешь"',
' description "Russian phrase (romanized chto ty znaesh) meaning what-you-know, attributing the knowing to the assistant."',
' lexeme "hi"',
' word "तुम"',
' description "Hindi second-person pronoun (romanized tum) attributing the knowing to the assistant."',
' word "आप"',
' description "Hindi second-person pronoun (romanized aap, polite) attributing the knowing to the assistant."',
' word "जानते"',
' description "Hindi verb (romanized jaante) meaning know (masculine), attributing the knowing to the assistant."',
' word "जानती"',
' description "Hindi verb (romanized jaantee) meaning know (feminine), attributing the knowing to the assistant."',
' word "आपके"',
' description "Hindi possessive (romanized aapke) meaning your, attributing possession to the assistant."',
' word "तुम्हारे"',
' description "Hindi possessive (romanized tumhaare) meaning your, attributing possession to the assistant."',
' lexeme "zh"',
' word "你知道"',
' description "Chinese phrase (pinyin ni zhidao) meaning you-know, attributing the knowing to the assistant."',
' word "您知道"',
' description "Chinese phrase (pinyin nin zhidao) meaning you-know (polite), attributing the knowing to the assistant."',
' word "你有"',
' description "Chinese phrase (pinyin ni you) meaning you-have, attributing possession to the assistant."',
' word "您有"',
' description "Chinese phrase (pinyin nin you) meaning you-have (polite), attributing possession to the assistant."',
' meaning "knowledge_inventory_query"',
' gloss "a complete standalone phrasing that asks the assistant what it knows about the world, even without the word fact"',
' wiktionary "knowledge"',
' defined_by "knowledge"',
' defined_by "fact"',
' role "knowledge_inventory_phrase"',
' lexeme "en"',
' word "what do you know in general"',
' description "English standalone phrasing asking the assistant for its general knowledge inventory."',
' word "what do you know about the world"',
' description "English standalone phrasing asking the assistant for its knowledge about the world."',
' word "what is known to you"',
' description "English standalone phrasing asking the assistant for everything it knows."',
' word "what knowledge do you have"',
' description "English standalone phrasing asking the assistant to surface the knowledge it holds."',
' lexeme "ru"',
' word "что тебе вообще известно"',
' description "Russian standalone phrasing (romanized chto tebe voobshche izvestno) asking the assistant for everything it knows."',
' word "что тебе известно"',
' description "Russian standalone phrasing (romanized chto tebe izvestno) asking the assistant what it knows."',
' word "что ты вообще знаешь"',
' description "Russian standalone phrasing (romanized chto ty voobshche znaesh) asking the assistant for its general knowledge."',
' word "что ты знаешь об окружающем мире"',
' description "Russian standalone phrasing (romanized chto ty znaesh ob okruzhayushchem mire) asking the assistant about the surrounding world."',
' word "известно об окружающем мире"',
' description "Russian standalone phrasing (romanized izvestno ob okruzhayushchem mire) asking what is known about the surrounding world."',
' word "знаешь про окружающий мир"',
' description "Russian standalone phrasing (romanized znaesh pro okruzhayushchiy mir) asking what the assistant knows about the surrounding world."',
' word "знаешь об окружающем мире"',
' description "Russian standalone phrasing (romanized znaesh ob okruzhayushchem mire) asking what the assistant knows about the surrounding world."',
' lexeme "hi"',
' word "आप क्या जानते हैं"',
' description "Hindi standalone phrasing (romanized aap kya jaante hain) asking what the assistant knows."',
' word "तुम क्या जानते हो"',
' description "Hindi standalone phrasing (romanized tum kya jaante ho) asking what the assistant knows."',
' word "आपको क्या पता है"',
' description "Hindi standalone phrasing (romanized aapko kya pata hai) asking what is known to the assistant."',
' lexeme "zh"',
' word "你知道什么"',
' description "Chinese standalone phrasing (pinyin ni zhidao shenme) asking what the assistant knows; simplified surface."',
' word "您知道什么"',
' description "Chinese standalone phrasing (pinyin nin zhidao shenme) asking what the assistant knows (polite); simplified surface."',
' word "你知道哪些"',
' description "Chinese standalone phrasing (pinyin ni zhidao naxie) asking which items the assistant knows."',
' meaning "introduction"',
' gloss "presenting who one is — the assistant describing itself in answer to a get-acquainted request"',
' wiktionary "introduction"',
' defined_by "self_reference"',
' defined_by "answer"',
' role "conversational_concept"',
' lexeme "en"',
' word "introduction"',
' description "English noun for presenting who one is; the surface for the introduction concept."',
' lexeme "ru"',
' word "знакомство"',
' description "Russian noun (romanized znakomstvo) for an acquaintance or introduction; the Russian surface for the introduction concept."',
' lexeme "hi"',
' word "परिचय"',
' description "Hindi noun (romanized parichay) for an introduction or acquaintance; the Hindi surface for the introduction concept."',
' lexeme "zh"',
' word "介绍"',
' description "Chinese noun and verb (pinyin jieshao) for an introduction or to introduce; the Chinese surface for the introduction concept."',
' meaning "clarification"',
' gloss "making clear something the user did not understand — an answer that resolves confusion about a prior turn"',
' wiktionary "clarification"',
' defined_by "inquiry"',
' defined_by "answer"',
' role "conversational_concept"',
' lexeme "en"',
' word "clarification"',
' description "English noun for making clear something not understood; the surface for the clarification concept."',
' lexeme "ru"',
' word "разъяснение"',
' description "Russian noun (romanized razyasneniye) for a clarification or explanation; the Russian surface for the clarification concept."',
' lexeme "hi"',
' word "स्पष्टीकरण"',
' description "Hindi noun (romanized spashtikaran) for a clarification; the Hindi surface for the clarification concept."',
' lexeme "zh"',
' word "澄清"',
' description "Chinese noun and verb (pinyin chengqing) for a clarification or to clarify; the Chinese surface for the clarification concept."',
' meaning "understanding"',
' gloss "grasping the meaning of something; its absence is what a clarification request signals"',
' wiktionary "understanding"',
' defined_by "clarification"',
' defined_by "knowledge"',
' role "conversational_concept"',
' lexeme "en"',
' word "understanding"',
' description "English noun for grasping the meaning of something; the surface for the understanding concept."',
' lexeme "ru"',
' word "понимание"',
' description "Russian noun (romanized ponimaniye) for understanding; the Russian surface for the understanding concept."',
' lexeme "hi"',
' word "समझ"',
' description "Hindi noun (romanized samajh) for understanding; the Hindi surface for the understanding concept."',
' lexeme "zh"',
' word "理解"',
' description "Chinese noun and verb (pinyin lijie) for understanding or to understand; the Chinese surface for the understanding concept."',
' meaning "clarification_request"',
' gloss "the user signalling they did not understand the assistant and asking it to make the prior answer clear"',
' wiktionary "understand"',
' defined_by "clarification"',
' defined_by "understanding"',
' defined_by "inquiry"',
' role "clarification_request"',
' lexeme "en"',
' word "i don t understand"',
' description "English phrase a speaker uses to signal they do not understand and to ask the assistant to make the prior answer clear; an apostrophe-spaced spelling of I dont understand."',
' word "i dont understand"',
' description "English phrase a speaker uses to signal they do not understand the assistant; an apostrophe-free spelling variant."',
' word "i didn t understand"',
' description "English phrase a speaker uses to signal they did not understand the prior answer; a past-tense apostrophe-spaced variant."',
' word "i didnt understand"',
' description "English phrase a speaker uses to signal they did not understand the prior answer; a past-tense apostrophe-free variant."',
' word "don t understand"',
' description "English phrase a speaker uses to signal a lack of understanding; a subjectless apostrophe-spaced variant."',
' word "dont understand"',
' description "English phrase a speaker uses to signal a lack of understanding; a subjectless apostrophe-free variant."',
' word "didn t understand"',
' description "English phrase a speaker uses to signal they did not understand; a subjectless past-tense apostrophe-spaced variant."',
' word "didnt understand"',
' description "English phrase a speaker uses to signal they did not understand; a subjectless past-tense apostrophe-free variant."',
' word "what do you mean"',
' description "English phrase a speaker uses to ask the assistant to clarify what it meant; a surface for the clarification request."',
' word "i m confused"',
' description "English phrase a speaker uses to express confusion and seek clarification; an apostrophe-spaced spelling of I am confused."',
' word "im confused"',
' description "English phrase a speaker uses to express confusion and seek clarification; a contracted spelling variant."',
' word "i am confused"',
' description "English phrase a speaker uses to express confusion and seek clarification; the full uncontracted form."',
' lexeme "ru"',
' word "не понял"',
' description "Russian phrase (romanized ne ponyal) a male speaker uses to say I did not understand and seek clarification."',
' word "не понимаю"',
' description "Russian phrase (romanized ne ponimayu) a speaker uses to say I do not understand and seek clarification."',
' word "не поняла"',
' description "Russian phrase (romanized ne ponyala) a female speaker uses to say I did not understand and seek clarification."',
' word "не понятно"',
' description "Russian phrase (romanized ne ponyatno) a speaker uses to say it is not clear; a spaced spelling of the impersonal form."',
' word "непонятно"',
' description "Russian word (romanized neponyatno) a speaker uses to say it is unclear; the joined spelling of the impersonal form."',
' lexeme "hi"',
' word "समझ नहीं आया"',
' description "Hindi phrase (romanized samajh nahin aaya) a speaker uses to say it was not understood; a masculine-agreement variant signalling a clarification request."',
' word "समझ नहीं आई"',
' description "Hindi phrase (romanized samajh nahin aai) a speaker uses to say it was not understood; a feminine-agreement variant signalling a clarification request."',
' lexeme "zh"',
' word "我不明白"',
' description "Chinese phrase (pinyin wo bu mingbai) a speaker uses to say I do not understand and seek clarification."',
' word "我不懂"',
' description "Chinese phrase (pinyin wo bu dong) a speaker uses to say I do not get it; a more colloquial clarification request."',
' word "听不懂"',
' description "Chinese phrase (pinyin ting bu dong) a speaker uses to say I cannot understand what is heard; a clarification request about something said."',
' meaning "capability_query"',
' gloss "the user asking what the assistant is able to do — a request to enumerate its capabilities"',
' wiktionary "capability"',
' defined_by "capability"',
' defined_by "inquiry"',
' role "capability_query"',
' lexeme "en"',
' word "what can you do"',
' description "English phrase a speaker uses to ask what the assistant is capable of; the canonical surface for the capability query."',
' word "what you can do"',
" description \"English phrase a speaker uses to ask after the assistant's capabilities; a word-order variant of what can you do.\"",
' word "what are your capabilities"',
' description "English phrase a speaker uses to ask the assistant to enumerate its capabilities; a formal surface for the capability query."',
' word "what are you capable of"',
' description "English phrase a speaker uses to ask what the assistant is able to do; a synonym surface for the capability query."',
' word "what do you do"',
" description \"English phrase a speaker uses to ask about the assistant's function or role; a broad surface for the capability query.\"",
' word "show me what you can do"',
' description "English phrase a speaker uses to ask the assistant to demonstrate its capabilities; an imperative surface for the capability query."',
' word "what features do you have"',
' description "English phrase a speaker uses to ask which features the assistant offers; a feature-framed surface for the capability query."',
' word "how can you help"',
' description "English phrase a speaker uses to ask in what ways the assistant can help; a help-framed surface for the capability query."',
' word "what are your features"',
' description "English phrase a speaker uses to ask the assistant to list its features; a feature-framed surface for the capability query."',
' lexeme "ru"',
' word "что ты умеешь"',
' description "Russian phrase (romanized chto ty umeesh) a speaker uses to ask what the assistant can do; the canonical surface for the capability query."',
' word "чем ты можешь"',
' description "Russian phrase (romanized chem ty mozhesh) a speaker uses to ask with what the assistant can help; a surface for the capability query."',
' word "чём ты можешь"',
' description "Russian phrase (romanized chyom ty mozhesh) a speaker uses to ask in what the assistant can help; a yo-spelled variant for the capability query."',
' word "что ты можешь"',
' description "Russian phrase (romanized chto ty mozhesh) a speaker uses to ask what the assistant can do; a can-framed surface for the capability query."',
' word "что умеет"',
' description "Russian phrase (romanized chto umeet) a speaker uses to ask what it can do; a third-person subjectless surface for the capability query."',
' word "что можешь"',
' description "Russian phrase (romanized chto mozhesh) a speaker uses to ask what you can do; a subjectless surface for the capability query."',
' word "в чем ты можешь быть полезен"',
' description "Russian phrase (romanized v chem ty mozhesh byt polezen) a speaker uses to ask in what way the assistant can be useful; a usefulness-framed surface for the capability query."',
' word "в чём ты можешь быть полезен"',
' description "Russian phrase (romanized v chyom ty mozhesh byt polezen) a speaker uses to ask in what way the assistant can be useful; a yo-spelled variant for the capability query."',
' word "твои возможности"',
' description "Russian phrase (romanized tvoi vozmozhnosti) a speaker uses to ask after your capabilities; a noun-phrase surface for the capability query."',
' word "что за дичь"',
' description "Russian slang phrase (romanized chto za dich) a speaker uses to exclaim what is this nonsense; a colloquial surface treated as a capability query."',
' word "что это такое"',
' description "Russian phrase (romanized chto eto takoye) a speaker uses to ask what this is; a what-is-it surface treated as a capability query."',
' word "что происходит"',
' description "Russian phrase (romanized chto proiskhodit) a speaker uses to ask what is going on; a surface treated as a capability query."',
' word "что ты делаешь"',
' description "Russian phrase (romanized chto ty delaesh) a speaker uses to ask what the assistant does; a do-framed surface for the capability query."',
' lexeme "hi"',
' word "आप क्या कर सकते"',
' description "Hindi phrase (romanized aap kya kar sakte) a speaker uses to ask what the assistant can do; a polite-form surface for the capability query."',
' word "तुम क्या कर सकते"',
' description "Hindi phrase (romanized tum kya kar sakte) a speaker uses to ask what you can do; an informal-form surface for the capability query."',
' word "क्या क्या कर सकते"',
' description "Hindi phrase (romanized kya kya kar sakte) a speaker uses to ask what all you can do; a surface enumerating capabilities."',
' lexeme "zh"',
' word "你能做什么"',
' description "Chinese phrase (pinyin ni neng zuo shenme) a speaker uses to ask what the assistant can do; the canonical surface for the capability query."',
' word "你会做什么"',
' description "Chinese phrase (pinyin ni hui zuo shenme) a speaker uses to ask what the assistant knows how to do; a skill-framed surface for the capability query."',
' word "你有什么功能"',
' description "Chinese phrase (pinyin ni you shenme gongneng) a speaker uses to ask what features the assistant has; a feature-framed surface for the capability query."',
' word "你能干什么"',
' description "Chinese phrase (pinyin ni neng gan shenme) a speaker uses to ask what the assistant can do; a colloquial surface for the capability query."',
' meaning "capability_query_more"',
' gloss "the user asking what else the assistant can do — a follow-up that requests capabilities beyond those already named"',
' wiktionary "else"',
' defined_by "capability_query"',
' defined_by "capability"',
' role "capability_query_more"',
' lexeme "en"',
' word "what else can you do"',
' description "English phrase a speaker uses to ask what further things the assistant can do beyond those already named; the canonical surface for the follow-up capability query."',
' word "what else do you do"',
' description "English phrase a speaker uses to ask what other things the assistant does; a synonym surface for the follow-up capability query."',
' word "what other things can you do"',
' description "English phrase a speaker uses to ask for additional capabilities; an explicit surface for the follow-up capability query."',
' lexeme "ru"',
' word "что ещё ты умеешь"',
' description "Russian phrase (romanized chto eshchyo ty umeesh) a speaker uses to ask what else the assistant can do; a yo-spelled surface for the follow-up capability query."',
' word "что еще ты умеешь"',
' description "Russian phrase (romanized chto eshche ty umeesh) a speaker uses to ask what else the assistant can do; an e-spelled variant for the follow-up capability query."',
' word "что ещё можешь"',
' description "Russian phrase (romanized chto eshchyo mozhesh) a speaker uses to ask what else you can do; a subjectless yo-spelled surface for the follow-up capability query."',
' word "что еще можешь"',
' description "Russian phrase (romanized chto eshche mozhesh) a speaker uses to ask what else you can do; a subjectless e-spelled variant for the follow-up capability query."',
' word "что ты ещё умеешь"',
' description "Russian phrase (romanized chto ty eshchyo umeesh) a speaker uses to ask what else the assistant can do; a yo-spelled word-order variant for the follow-up capability query."',
' word "что ты еще умеешь"',
' description "Russian phrase (romanized chto ty eshche umeesh) a speaker uses to ask what else the assistant can do; an e-spelled word-order variant for the follow-up capability query."',
' lexeme "hi"',
' word "और आप क्या कर सकते"',
' description "Hindi phrase (romanized aur aap kya kar sakte) a speaker uses to ask what else the assistant can do; a polite-form surface for the follow-up capability query."',
' word "और क्या कर सकते"',
' description "Hindi phrase (romanized aur kya kar sakte) a speaker uses to ask what else you can do; a surface for the follow-up capability query."',
' lexeme "zh"',
' word "你还能做什么"',
' description "Chinese phrase (pinyin ni hai neng zuo shenme) a speaker uses to ask what else the assistant can do; the canonical surface for the follow-up capability query."',
' word "你还会做什么"',
' description "Chinese phrase (pinyin ni hai hui zuo shenme) a speaker uses to ask what else the assistant knows how to do; a skill-framed surface for the follow-up capability query."',
' meaning "self_fact_query"',
' gloss "the user asking the assistant to list the facts it knows about itself"',
' wiktionary "fact"',
' defined_by "fact"',
' defined_by "self_reference"',
' defined_by "inquiry"',
' role "self_fact_query"',
' lexeme "en"',
' word "facts you know about yourself"',
' description "English phrase a speaker uses to ask the assistant to list the facts it knows about itself; the canonical surface for the self-fact query."',
' word "facts about yourself"',
' description "English phrase a speaker uses to ask for facts concerning the assistant itself; a shorter surface for the self-fact query."',
' word "self facts"',
' description "English phrase a speaker uses as a terse label for facts the assistant knows about itself; a compact surface for the self-fact query."',
' word "list all facts you know about yourself"',
' description "English phrase a speaker uses to ask the assistant to enumerate every fact it knows about itself; an imperative surface for the self-fact query."',
' lexeme "ru"',
' word "какие факты ты знаешь о себе"',
' description "Russian phrase (romanized kakie fakty ty znaesh o sebe) a speaker uses to ask which facts the assistant knows about itself; the canonical surface for the self-fact query."',
' word "факты о себе"',
' description "Russian phrase (romanized fakty o sebe) a speaker uses to ask for facts about oneself; a shorter surface for the self-fact query."',
' lexeme "hi"',
' word "अपने बारे में तथ्य"',
' description "Hindi phrase (romanized apne baare mein tathya) a speaker uses to ask for facts about the assistant itself; the canonical surface for the self-fact query."',
' word "स्वयं के बारे में तथ्य"',
' description "Hindi phrase (romanized svayam ke baare mein tathya) a speaker uses to ask for facts about oneself; a more formal surface for the self-fact query."',
' lexeme "zh"',
' word "关于你自己的事实"',
' description "Chinese phrase (pinyin guanyu ni ziji de shishi) a speaker uses to ask for facts about the assistant itself; the canonical surface for the self-fact query."',
' word "自我事实"',
' description "Chinese phrase (pinyin ziwo shishi) a speaker uses as a terse label for facts about oneself; a compact surface for the self-fact query."',
' meaning "self_introduction_request"',
' gloss "the user asking the assistant to introduce itself or to get acquainted"',
' wiktionary "introduce"',
' defined_by "introduction"',
' defined_by "self_reference"',
' defined_by "inquiry"',
' role "self_introduction_request"',
' lexeme "en"',
' word "tell me about yourself"',
' description "English phrase a speaker uses to ask the assistant to describe itself; the canonical surface for the self-introduction request."',
' word "introduce yourself"',
' description "English phrase a speaker uses to ask the assistant to present who it is; an imperative surface for the self-introduction request."',
' word "let s get acquainted"',
' description "English phrase a speaker uses to propose getting acquainted; an apostrophe-spaced spelling of lets get acquainted."',
' word "lets get acquainted"',
' description "English phrase a speaker uses to propose getting acquainted; an apostrophe-free spelling variant for the self-introduction request."',
' word "let us get acquainted"',
' description "English phrase a speaker uses to propose getting acquainted; the full uncontracted form for the self-introduction request."',
' word "let s get to know each other"',
' description "English phrase a speaker uses to propose mutual acquaintance; a longer surface for the self-introduction request."',
' lexeme "ru"',
' word "расскажи о себе"',
' description "Russian phrase (romanized rasskazhi o sebe) a speaker uses to ask the assistant to tell about itself; the canonical surface for the self-introduction request."',
' word "расскажи мне о себе"',
' description "Russian phrase (romanized rasskazhi mne o sebe) a speaker uses to ask the assistant to tell me about itself; an explicit-object surface for the self-introduction request."',
' word "расскажи про себя"',
' description "Russian phrase (romanized rasskazhi pro sebya) a speaker uses to ask the assistant to tell about itself; a pro-framed variant for the self-introduction request."',
' word "опиши себя"',
' description "Russian phrase (romanized opishi sebya) a speaker uses to ask the assistant to describe itself; a describe-framed surface for the self-introduction request."',
' word "представься"',
' description "Russian phrase (romanized predstavsya) a speaker uses to ask the assistant to introduce itself; an imperative surface for the self-introduction request."',
' word "давай знакомиться"',
' description "Russian phrase (romanized davay znakomitsya) a speaker uses to propose getting acquainted; an informal surface for the self-introduction request."',
' word "давай познакомимся"',
' description "Russian phrase (romanized davay poznakomimsya) a speaker uses to propose that we get acquainted; an informal surface for the self-introduction request."',
' word "давайте познакомимся"',
' description "Russian phrase (romanized davayte poznakomimsya) a speaker uses to politely propose that we get acquainted; a polite-form surface for the self-introduction request."',
' lexeme "hi"',
' word "अपने बारे में बताओ"',
' description "Hindi phrase (romanized apne baare mein batao) a speaker uses to ask the assistant to tell about itself; the canonical surface for the self-introduction request."',
' word "अपना परिचय दो"',
' description "Hindi phrase (romanized apna parichay do) a speaker uses to ask the assistant to give its introduction; an introduce-framed surface for the self-introduction request."',
' word "चलो परिचय करते हैं"',
' description "Hindi phrase (romanized chalo parichay karte hain) a speaker uses to propose let us get acquainted; an informal surface for the self-introduction request."',
' word "आइए परिचय करें"',
' description "Hindi phrase (romanized aaiye parichay karen) a speaker uses to politely propose that we get acquainted; a polite-form surface for the self-introduction request."',
' word "चलो एक दूसरे को जानें"',
' description "Hindi phrase (romanized chalo ek dusre ko jaanen) a speaker uses to propose that we get to know each other; a mutual-acquaintance surface for the self-introduction request."',
' lexeme "zh"',
' word "介绍一下你自己"',
' description "Chinese phrase (pinyin jieshao yixia ni ziji) a speaker uses to ask the assistant to introduce itself; the canonical surface for the self-introduction request."',
' word "告诉我你自己"',
' description "Chinese phrase (pinyin gaosu wo ni ziji) a speaker uses to ask the assistant to tell me about itself; a tell-framed surface for the self-introduction request."',
' word "介紹一下你自己"',
' description "Chinese phrase (pinyin jieshao yixia ni ziji) a speaker uses to ask the assistant to introduce itself; the traditional-character variant for the self-introduction request."',
' word "告訴我你自己"',
' description "Chinese phrase (pinyin gaosu wo ni ziji) a speaker uses to ask the assistant to tell me about itself; the traditional-character variant for the self-introduction request."',
' word "我们认识一下"',
' description "Chinese phrase (pinyin women renshi yixia) a speaker uses to propose that we get acquainted; a surface for the self-introduction request."',
' word "认识一下吧"',
' description "Chinese phrase (pinyin renshi yixia ba) a speaker uses to suggest getting acquainted; a softer-particle surface for the self-introduction request."',
' word "让我们认识一下"',
' description "Chinese phrase (pinyin rang women renshi yixia) a speaker uses to propose let us get acquainted; a let-framed surface for the self-introduction request."',
' meaning "conversation_summary_directive"',
' gloss "the verb or noun that asks the assistant to condense the running dialogue into a short summary"',
' wiktionary "summarize"',
' defined_by "inquiry"',
' defined_by "answer"',
' role "conversation_summary_directive"',
' lexeme "en"',
' word "summarize"',
' description "English verb asking for a condensed account; the canonical American-spelling surface for the conversation-summary directive."',
' word "summarise"',
' description "English verb asking for a condensed account; the British-spelling surface for the conversation-summary directive."',
' word "summary"',
' description "English noun naming the condensed account itself; the bare-noun surface for the conversation-summary directive."',
' lexeme "ru"',
' word "суммируй"',
' description "Russian verb (romanized summiruy) asking the assistant to sum up the dialogue; the informal imperative surface for the conversation-summary directive."',
' word "суммируйте"',
' description "Russian verb (romanized summiruyte) asking the assistant to sum up the dialogue; the polite-plural imperative surface for the conversation-summary directive."',
' word "резюмируй"',
' description "Russian verb (romanized rezyumiruy) asking the assistant to summarize the dialogue; the informal imperative surface for the conversation-summary directive."',
' word "резюмируйте"',
' description "Russian verb (romanized rezyumiruyte) asking the assistant to summarize the dialogue; the polite-plural imperative surface for the conversation-summary directive."',
' word "резюме"',
' description "Russian noun (romanized rezyume) naming a summary; the bare-noun surface for the conversation-summary directive."',
' lexeme "hi"',
' word "सारांश"',
' description "Hindi noun (romanized saaraansh) naming a summary; the bare-noun surface for the conversation-summary directive."',
' word "संक्षेप"',
' description "Hindi noun (romanized sankshep) naming a condensation or abstract; an alternative surface for the conversation-summary directive."',
' word "सारांशित"',
' description "Hindi verb stem (romanized saaraanshit) meaning summarized; the verb surface for the conversation-summary directive."',
' lexeme "zh"',
' word "总结"',
' description "Chinese verb or noun (pinyin zongjie) meaning to summarize or a summary; the simplified-character surface for the conversation-summary directive."',
' word "總結"',
' description "Chinese verb or noun (pinyin zongjie) meaning to summarize or a summary; the traditional-character surface for the conversation-summary directive."',
' word "概括"',
' description "Chinese verb (pinyin gaikuo) meaning to sum up or generalize; an alternative surface for the conversation-summary directive."',
' word "摘要"',
' description "Chinese noun (pinyin zhaiyao) meaning an abstract or summary; an alternative surface for the conversation-summary directive."',
' word "归纳"',
' description "Chinese verb (pinyin guina) meaning to summarize or induce; the simplified-character surface for the conversation-summary directive."',
' word "歸納"',
' description "Chinese verb (pinyin guina) meaning to summarize or induce; the traditional-character surface for the conversation-summary directive."',
' meaning "conversation_reference"',
' gloss "the noun naming the running dialogue between the user and the assistant — the object a summary request points at"',
' wiktionary "conversation"',
' defined_by "inquiry"',
' defined_by "answer"',
' role "conversation_reference"',
' lexeme "en"',
' word "conversation"',
' description "English noun for the running dialogue between the user and the assistant; the canonical object of a conversation-summary request."',
' word "chat"',
' description "English noun for an informal conversation; an alternative object surface for a conversation-summary request."',
' word "dialogue"',
' description "English noun for an exchange of turns between participants; an alternative object surface for a conversation-summary request."',
' word "dialog"',
' description "English noun for an exchange of turns; the American-spelling object surface for a conversation-summary request."',
' word "discussion"',
' description "English noun for a conversation about a topic; an alternative object surface for a conversation-summary request."',
' lexeme "ru"',
' word "беседа"',
' description "Russian noun (romanized beseda) for a conversation; the nominative object surface for a conversation-summary request."',
' word "беседы"',
' description "Russian noun (romanized besedy) for a conversation; the genitive surface for a conversation-summary request."',
' word "беседу"',
' description "Russian noun (romanized besedu) for a conversation; the accusative surface for a conversation-summary request."',
' word "беседе"',
' description "Russian noun (romanized besede) for a conversation; the prepositional surface for a conversation-summary request."',
' word "разговор"',
' description "Russian noun (romanized razgovor) for a conversation; the nominative object surface for a conversation-summary request."',
' word "разговора"',
' description "Russian noun (romanized razgovora) for a conversation; the genitive surface for a conversation-summary request."',
' word "разговоре"',
' description "Russian noun (romanized razgovore) for a conversation; the prepositional surface for a conversation-summary request."',
' word "разговором"',
' description "Russian noun (romanized razgovorom) for a conversation; the instrumental surface for a conversation-summary request."',
' word "чат"',
' description "Russian noun (romanized chat) for an online chat; the nominative object surface for a conversation-summary request."',
' word "чата"',
' description "Russian noun (romanized chata) for an online chat; the genitive surface for a conversation-summary request."',
' word "чате"',
' description "Russian noun (romanized chate) for an online chat; the prepositional surface for a conversation-summary request."',
' word "диалог"',
' description "Russian noun (romanized dialog) for a dialogue; an alternative object surface for a conversation-summary request."',
' word "диалога"',
' description "Russian noun (romanized dialoga) for a dialogue; the genitive surface for a conversation-summary request."',
' lexeme "hi"',
' word "बातचीत"',
' description "Hindi noun (romanized baatcheet) for a conversation; the canonical object surface for a conversation-summary request."',
' word "संवाद"',
' description "Hindi noun (romanized samvaad) for a dialogue; an alternative object surface for a conversation-summary request."',
' word "वार्तालाप"',
' description "Hindi noun (romanized vaartaalaap) for a conversation or discourse; an alternative object surface for a conversation-summary request."',
' lexeme "zh"',
' word "对话"',
' description "Chinese noun (pinyin duihua) for a dialogue or conversation; the simplified-character object surface for a conversation-summary request."',
' word "對話"',
' description "Chinese noun (pinyin duihua) for a dialogue or conversation; the traditional-character object surface for a conversation-summary request."',
' word "聊天"',
' description "Chinese noun or verb (pinyin liaotian) for chatting; an informal object surface for a conversation-summary request."',
' word "会话"',
' description "Chinese noun (pinyin huihua) for a conversation or session; the simplified-character object surface for a conversation-summary request."',
' word "會話"',
' description "Chinese noun (pinyin huihua) for a conversation or session; the traditional-character object surface for a conversation-summary request."',
' word "谈话"',
' description "Chinese noun (pinyin tanhua) for a talk or conversation; the simplified-character object surface for a conversation-summary request."',
' word "談話"',
' description "Chinese noun (pinyin tanhua) for a talk or conversation; the traditional-character object surface for a conversation-summary request."',
' meaning "conversation_summary_phrase"',
' gloss "a complete standalone phrasing that asks the assistant to recount or summarize what the dialogue has covered"',
' wiktionary "conversation"',
' defined_by "inquiry"',
' defined_by "conversation_reference"',
' role "conversation_summary_phrase"',
' lexeme "en"',
' word "what have we talked about"',
' description "English standalone phrasing asking the assistant to recall the topics of the running conversation."',
' word "what did we talk about"',
' description "English standalone phrasing asking the assistant to recall what the conversation covered."',
' word "what have we discussed"',
' description "English standalone phrasing asking the assistant to recall what has been discussed."',
' word "summary of our chat"',
' description "English standalone phrasing naming a summary of the running chat; matches even when it does not lead the prompt."',
' word "summary of our conversation"',
' description "English standalone phrasing naming a summary of the running conversation; matches even when it does not lead the prompt."',
' word "summarize so far"',
' description "English standalone phrasing asking the assistant to summarize the conversation up to this point (American spelling)."',
' word "summarise so far"',
' description "English standalone phrasing asking the assistant to summarize the conversation up to this point (British spelling)."',
' lexeme "ru"',
' word "о чём мы разговаривали"',
' description "Russian standalone phrasing (romanized o chyom my razgovarivali) asking what the conversation was about; the yo-spelled surface."',
' word "о чем мы разговаривали"',
' description "Russian standalone phrasing (romanized o chem my razgovarivali) asking what the conversation was about; the ye-spelled surface."',
' word "о чём мы говорили"',
' description "Russian standalone phrasing (romanized o chyom my govorili) asking what we talked about; the yo-spelled surface."',
' word "о чем мы говорили"',
' description "Russian standalone phrasing (romanized o chem my govorili) asking what we talked about; the ye-spelled surface."',
' lexeme "hi"',
' word "हमने किस बारे में बात की"',
' description "Hindi standalone phrasing (romanized humne kis baare mein baat ki) asking what the conversation was about."',
' word "हमने क्या बात की"',
' description "Hindi standalone phrasing (romanized humne kya baat ki) asking what we talked about."',
' lexeme "zh"',
' word "我们聊了什么"',
' description "Chinese standalone phrasing (pinyin women liao le shenme) asking what the conversation covered; simplified surface."',
' word "我们谈了什么"',
' description "Chinese standalone phrasing (pinyin women tan le shenme) asking what we talked about; simplified surface."',
' word "我们说了什么"',
' description "Chinese standalone phrasing (pinyin women shuo le shenme) asking what we said; simplified surface."',
' word "我們聊了什麼"',
' description "Chinese standalone phrasing (pinyin women liao le shenme) asking what the conversation covered; traditional surface."',
' meaning "conversation_summary_courtesy"',
' gloss "a polite or elliptical frame that asks the assistant to summarize without naming the conversation object directly"',
' wiktionary "summary"',
' defined_by "inquiry"',
' defined_by "conversation_summary_directive"',
' role "conversation_summary_courtesy"',
' lexeme "en"',
' word "give me a summary"',
' description "English polite frame asking the assistant to produce a summary; an objectless courtesy surface for the conversation-summary request."',
' word "can you summarize"',
' description "English polite frame asking whether the assistant can summarize; an objectless courtesy surface (American spelling)."',
' word "can you summarise"',
' description "English polite frame asking whether the assistant can summarize; an objectless courtesy surface (British spelling)."',
' word "please summarize"',
' description "English polite frame asking the assistant to summarize; an objectless courtesy surface (American spelling)."',
' word "please summarise"',
' description "English polite frame asking the assistant to summarize; an objectless courtesy surface (British spelling)."',
' lexeme "ru"',
' word "подведи итог"',
' description "Russian polite frame (romanized podvedi itog) asking the assistant to sum up; an objectless courtesy surface for the conversation-summary request."',
' word "подведи итоги"',
' description "Russian polite frame (romanized podvedi itogi) asking the assistant to sum up the results; a plural-object courtesy surface."',
' word "краткое резюме"',
' description "Russian phrase (romanized kratkoye rezyume) asking for a brief summary; an objectless courtesy surface for the conversation-summary request."',
' word "сделай резюме"',
' description "Russian phrase (romanized sdelay rezyume) asking the assistant to make a summary; an objectless courtesy surface."',
' word "краткое содержание"',
' description "Russian phrase (romanized kratkoye soderzhaniye) asking for a brief account; an objectless courtesy surface for the conversation-summary request."',
' lexeme "hi"',
' word "सार दो"',
' description "Hindi phrase (romanized saar do) asking the assistant to give the gist; an objectless courtesy surface for the conversation-summary request."',
' word "सारांश दो"',
' description "Hindi phrase (romanized saaraansh do) asking the assistant to give a summary; an objectless courtesy surface."',
' word "संक्षेप में बताओ"',
' description "Hindi phrase (romanized sankshep mein batao) asking the assistant to tell briefly; an objectless courtesy surface for the conversation-summary request."',
' lexeme "zh"',
' word "帮我总结"',
' description "Chinese phrase (pinyin bang wo zongjie) asking the assistant to help summarize; an objectless courtesy surface; simplified surface."',
' word "帮我概括"',
' description "Chinese phrase (pinyin bang wo gaikuo) asking the assistant to help sum up; an objectless courtesy surface; simplified surface."',
' word "请总结"',
' description "Chinese phrase (pinyin qing zongjie) politely asking the assistant to summarize; an objectless courtesy surface; simplified surface."',
' word "请概括"',
' description "Chinese phrase (pinyin qing gaikuo) politely asking the assistant to sum up; an objectless courtesy surface; simplified surface."',
' word "总结一下"',
' description "Chinese phrase (pinyin zongjie yixia) asking the assistant to do a quick summary; an objectless courtesy surface; simplified surface."',
' word "概括一下"',
' description "Chinese phrase (pinyin gaikuo yixia) asking the assistant to do a quick sum-up; an objectless courtesy surface; simplified surface."',
' meaning "who_is_question"',
' gloss "a who-is question about a person or named entity — who is X, кто такой X, X कौन है, X是谁. It is recognised so the assistant can report a knowledge-base miss and offer a typo correction instead of inventing a biography. Two roles split by slot encode the word order: who_question_lead fronts the interrogative (English and Russian, head-initial) and is detected with starts_with, while who_question_tail postposes it (Hindi and Chinese, head-final) and is detected with ends_with. The entity itself is pulled out separately by the concept-query extractor, so the order within each role does not matter — any matching lead or tail is enough."',
' wiktionary "who"',
' defined_by "inquiry"',
' role "who_question_lead"',
' role "who_question_tail"',
' lexeme "en"',
' word "who is …"',
' description "English interrogative lead; starts_with who is (trailing space), the entity follows."',
' word "who was …"',
' description "English interrogative lead; starts_with who was (trailing space), the entity follows."',
' word "who are …"',
' description "English interrogative lead; starts_with who are (trailing space), the entity follows."',
' lexeme "ru"',
' word "кто такой …"',
' description "Russian interrogative lead (romanized kto takoy); the masculine who-is frame, the entity follows."',
' word "кто такая …"',
' description "Russian interrogative lead (romanized kto takaya); the feminine who-is frame, the entity follows."',
' word "кто это …"',
' description "Russian interrogative lead (romanized kto eto, who is this); the entity follows."',
' word "кто …"',
' description "Russian bare interrogative lead (romanized kto, who); the entity follows."',
' lexeme "hi"',
' word "… कौन है"',
' description "Hindi interrogative tail (romanized kaun hai, who is); head-final, the entity precedes; ends_with the tail (leading space)."',
' word "… कौन हैं"',
' description "Hindi polite interrogative tail (romanized kaun hain, who are); head-final, the entity precedes."',
' lexeme "zh"',
' word "…是谁"',
' description "Chinese interrogative tail (pinyin shi shei, is who); head-final, the entity precedes; simplified surface."',
' word "…是誰"',
' description "Chinese interrogative tail (pinyin shi shei, is who); head-final, the entity precedes; traditional surface."',
' meaning "interrogative_opener"',
' gloss "the generic interrogative opener — the class of question words (the wh-words) that front a content question rather than a yes or no question. When a prompt opens with one of these the intent classifier reads it as a Question. English and Russian are head-initial, so the question word starts the prompt and is detected with starts_with; a trailing space follows the bare word, so what marks what is the capital but not whatever, and who marks who are you but not whoever. Hindi and Chinese are head-final, so their question words need not begin the sentence; they are carried here for language coverage but are never matched positionally. The surfaces are bare single words rather than openers with slots, so any one of them at the front is enough to classify the prompt as a question."',
' wiktionary "interrogative"',
' defined_by "inquiry"',
' role "interrogative_opener"',
' lexeme "en"',
' word "what"',
' description "English interrogative pronoun; head-initial opener, starts_with what (trailing space) marks a content question."',
' word "who"',
' description "English interrogative pronoun for a person; head-initial opener, starts_with who (trailing space)."',
' word "why"',
' description "English interrogative adverb of reason; head-initial opener, starts_with why (trailing space)."',
' word "where"',
' description "English interrogative adverb of place; head-initial opener, starts_with where (trailing space)."',
' word "when"',
' description "English interrogative adverb of time; head-initial opener, starts_with when (trailing space)."',
' word "how"',
' description "English interrogative adverb of manner; head-initial opener, starts_with how (trailing space)."',
' word "which"',
' description "English interrogative determiner selecting among alternatives; head-initial opener, starts_with which (trailing space)."',
' lexeme "ru"',
' word "что"',
' description "Russian interrogative pronoun (romanized chto, what); head-initial opener, starts_with что (trailing space)."',
' word "кто"',
' description "Russian interrogative pronoun (romanized kto, who); head-initial opener, starts_with кто (trailing space)."',
' word "почему"',
' description "Russian interrogative adverb of reason (romanized pochemu, why); head-initial opener, starts_with почему (trailing space)."',
' word "где"',
' description "Russian interrogative adverb of place (romanized gde, where); head-initial opener, starts_with где (trailing space)."',
' word "когда"',
' description "Russian interrogative adverb of time (romanized kogda, when); head-initial opener, starts_with когда (trailing space)."',
' word "как"',
' description "Russian interrogative adverb of manner (romanized kak, how); head-initial opener, starts_with как (trailing space)."',
' lexeme "hi"',
' word "क्या"',
' description "Hindi interrogative (romanized kya, what); carried for language coverage — Hindi is head-final, so the opener is not matched positionally."',
' word "कौन"',
' description "Hindi interrogative (romanized kaun, who); carried for coverage, not matched positionally (head-final)."',
' word "क्यों"',
' description "Hindi interrogative (romanized kyon, why); carried for coverage, not matched positionally (head-final)."',
' word "कहाँ"',
' description "Hindi interrogative (romanized kahan, where); carried for coverage, not matched positionally (head-final)."',
' word "कब"',
' description "Hindi interrogative (romanized kab, when); carried for coverage, not matched positionally (head-final)."',
' word "कैसे"',
' description "Hindi interrogative (romanized kaise, how); carried for coverage, not matched positionally (head-final)."',
' word "कौनसा"',
' description "Hindi interrogative (romanized kaunsa, which); carried for coverage, not matched positionally (head-final)."',
' lexeme "zh"',
' word "什么"',
' description "Chinese interrogative (pinyin shenme, what); carried for coverage, not matched positionally (head-final); simplified surface."',
' word "谁"',
' description "Chinese interrogative (pinyin shei, who); carried for coverage, not matched positionally (head-final); simplified surface."',
' word "为什么"',
' description "Chinese interrogative (pinyin weishenme, why); carried for coverage, not matched positionally (head-final); simplified surface."',
' word "哪里"',
' description "Chinese interrogative (pinyin nali, where); carried for coverage, not matched positionally (head-final); simplified surface."',
' word "何时"',
' description "Chinese interrogative (pinyin heshi, when); carried for coverage, not matched positionally (head-final)."',
' word "如何"',
' description "Chinese interrogative (pinyin ruhe, how); carried for coverage, not matched positionally (head-final)."',
' word "哪个"',
' description "Chinese interrogative (pinyin nage, which); carried for coverage, not matched positionally (head-final); simplified surface."',
"meanings",
' meaning "mechanism_inquiry"',
' gloss "an inquiry into how something works — its internal mechanism or operating principle. The concept a how-it-works prompt expresses, independent of the language or phrasing used. Each surface marks the subject position with the ellipsis … (U+2026): no ellipsis is a bare phrase, a trailing ellipsis is a prefix surface, a leading ellipsis is a suffix surface, and a middle ellipsis is a circumfix surface."',
' wiktionary "how"',
' defined_by "inquiry"',
' defined_by "action"',
' role "mechanism_inquiry"',
' lexeme "en"',
' word "how it works"',
' description "English bare how-it-works phrase with no subject slot; asks for the mechanism of the current topic."',
' word "how does it work"',
' description "English bare how-does-it-work phrase with no subject slot; asks for the mechanism of the current topic."',
' word "how does …"',
' description "English prefix surface; the literal before the … slot introduces a mechanism question whose subject follows (how does X)."',
' word "how do …"',
' description "English prefix surface for a plural subject; the subject follows the … slot (how do X)."',
' word "how did …"',
' description "English past-tense prefix surface; asks how the subject after the … slot worked (how did X)."',
' word "how is …"',
' description "English prefix surface asking how the subject after the … slot is built or arranged (how is X)."',
' word "how … works"',
' description "English circumfix surface; the subject sits between how and works in the … slot (how X works)."',
' word "how … work"',
' description "English circumfix surface for a plural subject between how and work in the … slot (how X work)."',
' lexeme "ru"',
' word "как это работает"',
' description "Russian bare how-it-works phrase (romanized kak eto rabotaet) with no subject slot."',
' word "как оно работает"',
' description "Russian bare how-it-works phrase (romanized kak ono rabotaet) with no subject slot."',
' word "как устроен …"',
' description "Russian masculine prefix surface (romanized kak ustroen) asking how the subject after the … slot is built."',
' word "как устроена …"',
' description "Russian feminine prefix surface (romanized kak ustroena) asking how the subject after the … slot is built."',
' word "как устроено …"',
' description "Russian neuter prefix surface (romanized kak ustroeno) asking how the subject after the … slot is built."',
' word "как устроены …"',
' description "Russian plural prefix surface (romanized kak ustroeny) asking how the subjects after the … slot are built."',
' word "как работает …"',
' description "Russian prefix surface (romanized kak rabotaet) asking how the subject after the … slot works."',
' word "как работают …"',
' description "Russian plural prefix surface (romanized kak rabotayut) asking how the subjects after the … slot work."',
' word "как … работает"',
' description "Russian circumfix surface (romanized kak … rabotaet); the subject sits in the … slot between kak and rabotaet."',
' word "как … работают"',
' description "Russian plural circumfix surface (romanized kak … rabotayut); the subject sits in the … slot."',
' word "… как работает"',
' description "Russian suffix surface (romanized … kak rabotaet); the subject precedes the trailing how-it-works phrase in the leading … slot."',
' word "… как работают"',
' description "Russian plural suffix surface (romanized … kak rabotayut); the subject precedes the trailing phrase in the leading … slot."',
' lexeme "hi"',
' word "यह कैसे काम करता है"',
' description "Hindi bare how-it-works phrase (romanized yah kaise kaam karta hai) with no subject slot."',
' word "यह कैसे काम करती है"',
' description "Hindi bare how-it-works phrase, feminine (romanized yah kaise kaam karti hai), with no subject slot."',
' word "यह कैसे काम करता"',
' description "Hindi bare how-it-works phrase, clipped (romanized yah kaise kaam karta), with no subject slot."',
' word "… कैसे काम करता है"',
' description "Hindi suffix surface (romanized … kaise kaam karta hai); the subject precedes the trailing how-it-works phrase in the leading … slot."',
' word "… कैसे काम करती है"',
' description "Hindi feminine suffix surface (romanized … kaise kaam karti hai); the subject is in the leading … slot."',
' word "… कैसे काम करते हैं"',
' description "Hindi plural suffix surface (romanized … kaise kaam karte hain); the subject is in the leading … slot."',
' word "… कैसे काम करता"',
' description "Hindi clipped suffix surface (romanized … kaise kaam karta); the subject is in the leading … slot."',
' word "… कैसे काम करती"',
' description "Hindi feminine clipped suffix surface (romanized … kaise kaam karti); the subject is in the leading … slot."',
' word "… कैसे काम करते"',
' description "Hindi plural clipped suffix surface (romanized … kaise kaam karte); the subject is in the leading … slot."',
' lexeme "zh"',
' word "这是如何工作的"',
' description "Chinese bare how-it-works phrase (pinyin zhe shi ruhe gongzuo de) with no subject slot."',
' word "这是怎么工作的"',
' description "Chinese bare how-it-works phrase (pinyin zhe shi zenme gongzuo de) with no subject slot."',
' word "这个如何工作"',
' description "Chinese bare how-it-works phrase (pinyin zhege ruhe gongzuo) with no subject slot."',
' word "它如何工作"',
' description "Chinese bare how-it-works phrase (pinyin ta ruhe gongzuo) with no subject slot."',
' word "它是如何工作的"',
' description "Chinese bare how-it-works phrase (pinyin ta shi ruhe gongzuo de) with no subject slot."',
' word "它怎么工作"',
' description "Chinese bare how-it-works phrase (pinyin ta zenme gongzuo) with no subject slot."',
' word "… 是如何工作的"',
' description "Chinese suffix surface (pinyin … shi ruhe gongzuo de) with a leading space; the subject is in the leading … slot."',
' word "…是如何工作的"',
' description "Chinese suffix surface (pinyin … shi ruhe gongzuo de) with no leading space; the subject is in the leading … slot."',
' word "… 是怎么工作的"',
' description "Chinese suffix surface (pinyin … shi zenme gongzuo de) with a leading space; the subject is in the leading … slot."',
' word "…是怎么工作的"',
' description "Chinese suffix surface (pinyin … shi zenme gongzuo de) with no leading space; the subject is in the leading … slot."',
' word "… 如何工作"',
' description "Chinese suffix surface (pinyin … ruhe gongzuo) with a leading space; the subject is in the leading … slot."',
' word "…如何工作"',
' description "Chinese suffix surface (pinyin … ruhe gongzuo) with no leading space; the subject is in the leading … slot."',
' word "… 怎么工作"',
' description "Chinese suffix surface (pinyin … zenme gongzuo) with a leading space; the subject is in the leading … slot."',
' word "…怎么工作"',
' description "Chinese suffix surface (pinyin … zenme gongzuo) with no leading space; the subject is in the leading … slot."',
' word "… 的工作原理是什么"',
' description "Chinese suffix surface (pinyin … de gongzuo yuanli shi shenme) with a leading space; asks the working principle of the subject in the leading … slot."',
' word "…的工作原理是什么"',
' description "Chinese suffix surface (pinyin … de gongzuo yuanli shi shenme) with no leading space; asks the working principle of the subject in the leading … slot."',
' meaning "procedural_request"',
' gloss "a request for the ordered steps to accomplish a task — the how-to-X question that asks for a procedure rather than a mechanism, independent of phrasing language. Each surface is a prefix carrying the … slot at the end, where the task follows. A surface may name the canonical operation in an action child (do, perform, implement, create, write); when it does not, the operation is taken from the first word of the task."',
' wiktionary "procedure"',
' defined_by "inquiry"',
' defined_by "action"',
' role "procedural_request"',
' lexeme "en"',
' word "please tell me how to …"',
' description "English polite prefix surface; the task follows the … slot, with the operation taken from its first word."',
' word "please show me how to …"',
' description "English polite prefix surface requesting a demonstration; the task follows the … slot, operation from its first word."',
' word "tell me how to …"',
' description "English prefix surface; the task follows the … slot, operation from its first word."',
' word "show me how to …"',
' description "English prefix surface requesting a walkthrough; the task follows the … slot, operation from its first word."',
' word "what are the steps to …"',
' description "English prefix surface asking for the steps; the task follows the … slot, operation from its first word."',
' word "what steps do i need to …"',
' description "English first-person prefix surface asking which steps are needed; the task follows the … slot."',
' word "what steps do we need to …"',
' description "English first-person-plural prefix surface asking which steps are needed; the task follows the … slot."',
' word "how should i …"',
' description "English advice-seeking prefix surface; the task follows the … slot, operation from its first word."',
' word "how should we …"',
' description "English first-person-plural advice-seeking prefix surface; the task follows the … slot."',
' word "how could i …"',
' description "English possibility prefix surface; the task follows the … slot, operation from its first word."',
' word "how could we …"',
' description "English first-person-plural possibility prefix surface; the task follows the … slot."',
' word "how would i …"',
' description "English hypothetical prefix surface; the task follows the … slot, operation from its first word."',
' word "how would we …"',
' description "English first-person-plural hypothetical prefix surface; the task follows the … slot."',
' word "how can i …"',
' description "English capability prefix surface; the task follows the … slot, operation from its first word."',
' word "how can we …"',
' description "English first-person-plural capability prefix surface; the task follows the … slot."',
' word "how do i …"',
' description "English procedural prefix surface; the task follows the … slot, operation from its first word."',
' word "how do we …"',
' description "English first-person-plural procedural prefix surface; the task follows the … slot."',
' word "how to do …"',
' action "do"',
' description "English prefix surface naming the do operation explicitly; the whole task follows the … slot."',
' word "how to …"',
' description "English bare how-to prefix surface; the task follows the … slot, operation from its first word."',
' lexeme "ru"',
' word "как сделать …"',
' action "do"',
' description "Russian prefix surface (romanized kak sdelat) naming the do operation; the task follows the … slot."',
' word "как делать …"',
' action "do"',
' description "Russian imperfective prefix surface (romanized kak delat) naming the do operation; the task follows the … slot."',
' word "как выполнить …"',
' action "perform"',
' description "Russian prefix surface (romanized kak vypolnit) naming the perform operation; the task follows the … slot."',
' word "как реализовать …"',
' action "implement"',
' description "Russian prefix surface (romanized kak realizovat) naming the implement operation; the task follows the … slot."',
' word "как создать …"',
' action "create"',
' description "Russian prefix surface (romanized kak sozdat) naming the create operation; the task follows the … slot."',
' word "как написать …"',
' action "write"',
' description "Russian prefix surface (romanized kak napisat) naming the write operation; the task follows the … slot."',
' lexeme "hi"',
' word "कैसे करें …"',
' action "do"',
' description "Hindi polite prefix surface (romanized kaise karen) naming the do operation; the task follows the … slot."',
' word "कैसे करे …"',
' action "do"',
' description "Hindi prefix surface (romanized kaise kare) naming the do operation; the task follows the … slot."',
' word "कैसे लागू करें …"',
' action "implement"',
' description "Hindi prefix surface (romanized kaise laagu karen) naming the implement operation; the task follows the … slot."',
' word "कैसे बनाएं …"',
' action "create"',
' description "Hindi prefix surface (romanized kaise banaen) naming the create operation; the task follows the … slot."',
' word "कैसे बनाएँ …"',
' action "create"',
' description "Hindi prefix surface variant (romanized kaise banaen, with candrabindu) naming the create operation; the task follows the … slot."',
' word "कैसे लिखें …"',
' action "write"',
' description "Hindi prefix surface (romanized kaise likhen) naming the write operation; the task follows the … slot."',
' lexeme "zh"',
' word "如何做 …"',
' action "do"',
' description "Chinese prefix surface (pinyin ruhe zuo) naming the do operation, with a trailing space; the task follows the … slot."',
' word "怎么做 …"',
' action "do"',
' description "Chinese prefix surface (pinyin zenme zuo) naming the do operation, with a trailing space; the task follows the … slot."',
' word "如何实现 …"',
' action "implement"',
' description "Chinese prefix surface (pinyin ruhe shixian) naming the implement operation, with a trailing space; the task follows the … slot."',
' word "怎么实现 …"',
' action "implement"',
' description "Chinese prefix surface (pinyin zenme shixian) naming the implement operation, with a trailing space; the task follows the … slot."',
' word "如何创建 …"',
' action "create"',
' description "Chinese prefix surface (pinyin ruhe chuangjian) naming the create operation, with a trailing space; the task follows the … slot."',
' word "怎么创建 …"',
' action "create"',
' description "Chinese prefix surface (pinyin zenme chuangjian) naming the create operation, with a trailing space; the task follows the … slot."',
' word "如何写 …"',
' action "write"',
' description "Chinese prefix surface (pinyin ruhe xie) naming the write operation, with a trailing space; the task follows the … slot."',
' word "怎么写 …"',
' action "write"',
' description "Chinese prefix surface (pinyin zenme xie) naming the write operation, with a trailing space; the task follows the … slot."',
' meaning "mechanism_predicate"',
' gloss "the predicate that completes a how-it-works clause — the verb or participle stating that a subject operates, is structured, or is built (work, works, structured, organized, organised, built, …). Each surface is a suffix carrying the … (U+2026) slot at the front; the text after the slot is the predicate tail a mechanism-inquiry extractor strips so the bare subject remains. The English surfaces are the ones an extractor removes after a how-does prefix match; the other languages name genuine predicates so every language is covered."',
' wiktionary "work"',
' defined_by "action"',
' defined_by "mechanism_inquiry"',
' role "mechanism_predicate"',
' lexeme "en"',
' word "… work"',
' description "English plural-or-base predicate tail meaning operates; the text after the … slot is stripped to leave the subject."',
' word "… works"',
' description "English singular predicate tail meaning operates; the text after the … slot is stripped to leave the subject."',
' word "… structured"',
' description "English predicate tail meaning arranged; the text after the … slot is stripped to leave the subject."',
' word "… organized"',
' description "English predicate tail meaning arranged, American spelling; the text after the … slot is stripped to leave the subject."',
' word "… organised"',
' description "English predicate tail meaning arranged, British spelling; the text after the … slot is stripped to leave the subject."',
' word "… built"',
' description "English predicate tail meaning constructed; the text after the … slot is stripped to leave the subject."',
' lexeme "ru"',
' word "… работает"',
' description "Russian singular predicate tail (romanized rabotaet) meaning works; a genuine mechanism predicate stripped when a subject ends with it after a prefix match."',
' word "… устроен"',
' description "Russian predicate tail (romanized ustroen) meaning is structured; a genuine mechanism predicate completing a how-it-works clause."',
' lexeme "hi"',
' word "… काम करता है"',
' description "Hindi predicate tail (romanized kaam karta hai) meaning works; a genuine mechanism predicate completing a how-it-works clause."',
' word "… बना है"',
' description "Hindi predicate tail (romanized bana hai) meaning is built; a genuine mechanism predicate completing a how-it-works clause."',
' lexeme "zh"',
' word "…工作"',
' description "Chinese predicate tail (pinyin gongzuo) meaning works, with no leading space; a genuine mechanism predicate completing a how-it-works clause."',
' word "…构建"',
' description "Chinese predicate tail (pinyin goujian) meaning is built, with no leading space; a genuine mechanism predicate completing a how-it-works clause."',
' meaning "detail_modifier"',
' gloss "an optional modifier appended to a how-it-works question asking for more thoroughness or politeness (in detail, internally, exactly, please, …) without naming the subject. Each surface is a suffix carrying the … (U+2026) slot at the front; the text after the slot is the modifier tail a mechanism-inquiry extractor strips so the bare subject remains. The extractor strips every matching modifier in declaration order, re-trimming after each."',
' wiktionary "detail"',
' defined_by "property"',
' defined_by "mechanism_inquiry"',
' role "detail_modifier"',
' lexeme "en"',
' word "… in detail"',
' description "English modifier tail asking for a thorough explanation; the text after the … slot is stripped to leave the subject."',
' word "… internally"',
' description "English modifier tail asking about internal workings; the text after the … slot is stripped to leave the subject."',
' word "… exactly"',
' description "English modifier tail asking for precision; the text after the … slot is stripped to leave the subject."',
' word "… please"',
' description "English politeness modifier tail; the text after the … slot is stripped to leave the subject."',
' lexeme "ru"',
' word "… подробнее"',
' description "Russian modifier tail (romanized podrobneye) meaning in more detail; the text after the … slot is stripped to leave the subject."',
' word "… подробно"',
' description "Russian modifier tail (romanized podrobno) meaning in detail; the text after the … slot is stripped to leave the subject."',
' word "… пожалуйста"',
' description "Russian politeness modifier tail (romanized pozhaluysta) meaning please; the text after the … slot is stripped to leave the subject."',
' lexeme "hi"',
' word "… विस्तार से"',
' description "Hindi modifier tail (romanized vistaar se) meaning in detail; the text after the … slot is stripped to leave the subject."',
' word "… कृपया"',
' description "Hindi politeness modifier tail (romanized kripya) meaning please; the text after the … slot is stripped to leave the subject."',
' lexeme "zh"',
' word "…详细"',
' description "Chinese modifier tail (pinyin xiangxi) meaning in detail, with no leading space; the text after the … slot is stripped to leave the subject."',
' word "…请"',
' description "Chinese politeness modifier tail (pinyin qing) meaning please, with no leading space; the text after the … slot is stripped to leave the subject."',
' meaning "non_referential_subject"',
' gloss "a subject candidate that names no real topic — a pronoun or bare function word that points back at the surrounding context instead of introducing a subject, so a how-it-works extractor rejects it and falls back to the active topic. Bare surfaces match the whole candidate exactly; prefix surfaces carry the … (U+2026) slot and match when the candidate begins with the literal before the slot."',
' wiktionary "pronoun"',
' defined_by "entity"',
' defined_by "mechanism_inquiry"',
' role "non_referential_subject"',
' lexeme "en"',
' word "it"',
' description "English third-person pronoun referring back to context; rejected as a non-referential subject."',
' word "this"',
' description "English demonstrative pronoun pointing at context; rejected as a non-referential subject."',
' word "that"',
' description "English demonstrative pronoun pointing at context; rejected as a non-referential subject."',
' word "you"',
' description "English second-person pronoun addressing the assistant; rejected as a non-referential subject."',
' word "yourself"',
' description "English reflexive pronoun addressing the assistant; rejected as a non-referential subject."',
' word "does"',
' description "English auxiliary verb left over from a how-does question; rejected as a non-referential subject."',
' word "do"',
' description "English auxiliary verb left over from a how-do question; rejected as a non-referential subject."',
' word "does …"',
" description \"English prefix surface; a candidate beginning with 'does ' is a dangling auxiliary clause and is rejected as a non-referential subject.\"",
' word "do …"',
" description \"English prefix surface; a candidate beginning with 'do ' is a dangling auxiliary clause and is rejected as a non-referential subject.\"",
' word "to …"',
" description \"English prefix surface; a candidate beginning with 'to ' is an infinitive clause, not a subject, and is rejected.\"",
' word "you …"',
" description \"English prefix surface; a candidate beginning with 'you ' addresses the assistant and is rejected as a non-referential subject.\"",
' lexeme "ru"',
' word "это"',
' description "Russian demonstrative pronoun (romanized eto) meaning this or it; rejected as a non-referential subject."',
' word "оно"',
' description "Russian neuter pronoun (romanized ono) meaning it; rejected as a non-referential subject."',
' word "он"',
' description "Russian masculine pronoun (romanized on) meaning he or it; rejected as a non-referential subject."',
' word "она"',
' description "Russian feminine pronoun (romanized ona) meaning she or it; rejected as a non-referential subject."',
' word "они"',
' description "Russian plural pronoun (romanized oni) meaning they; rejected as a non-referential subject."',
' word "ты"',
' description "Russian informal second-person pronoun (romanized ty) meaning you; rejected as a non-referential subject."',
' word "вы"',
' description "Russian formal or plural second-person pronoun (romanized vy) meaning you; rejected as a non-referential subject."',
' lexeme "hi"',
' word "यह"',
' description "Hindi pronoun (romanized yah) meaning this or it; rejected as a non-referential subject."',
' word "ये"',
' description "Hindi pronoun (romanized ye) meaning these or this; rejected as a non-referential subject."',
' lexeme "zh"',
' word "这"',
' description "Chinese demonstrative pronoun (pinyin zhe) meaning this; rejected as a non-referential subject."',
' word "这个"',
' description "Chinese demonstrative pronoun (pinyin zhege) meaning this one; rejected as a non-referential subject."',
' word "它"',
' description "Chinese third-person pronoun (pinyin ta) meaning it; rejected as a non-referential subject."',
' meaning "procedural_task_modifier"',
" gloss \"an optional modifier trailing a procedural how-to task that asks for step-by-step granularity or adds politeness (step by step, in steps, please, …) without naming part of the task itself. Each surface is a suffix carrying the … (U+2026) slot at the front; the text after the slot is the modifier tail a procedural extractor strips from the end of the task, scanning surfaces in declaration order and stopping at the first match, so the longer Russian 'напиши по шагам' is tried before its 'по шагам' tail.\"",
' wiktionary "step"',
' defined_by "property"',
' defined_by "procedural_request"',
' role "procedural_task_modifier"',
' lexeme "en"',
' word "… step by step"',
' description "English modifier tail asking for incremental steps; the text after the … slot is stripped from the end of the task."',
' word "… in steps"',
' description "English modifier tail asking for the task broken into steps; the text after the … slot is stripped from the end of the task."',
' word "… with steps"',
' description "English modifier tail asking for accompanying steps; the text after the … slot is stripped from the end of the task."',
' word "… for me"',
' description "English modifier tail framing the request as personal; the text after the … slot is stripped from the end of the task."',
' word "… please"',
' description "English politeness modifier tail; the text after the … slot is stripped from the end of the task."',
' lexeme "ru"',
' word "… напиши по шагам"',
" description \"Russian modifier tail (romanized napishi po shagam) meaning write it step by step; declared before its 'по шагам' tail so the longer surface matches first. The text after the … slot is stripped from the end of the task.\"",
' word "… по шагам"',
' description "Russian modifier tail (romanized po shagam) meaning step by step; the text after the … slot is stripped from the end of the task."',
' word "… пошагово"',
' description "Russian modifier tail (romanized poshagovo) meaning step-by-step; the text after the … slot is stripped from the end of the task."',
' word "… пожалуйста"',
' description "Russian politeness modifier tail (romanized pozhaluysta) meaning please; the text after the … slot is stripped from the end of the task."',
' lexeme "hi"',
' word "… चरणों में लिखो"',
' description "Hindi modifier tail (romanized charanon mein likho) meaning write it in steps; the text after the … slot is stripped from the end of the task."',
' word "… चरणों में बताओ"',
' description "Hindi modifier tail (romanized charanon mein batao) meaning explain it in steps; the text after the … slot is stripped from the end of the task."',
' word "… कदम दर कदम"',
' description "Hindi modifier tail (romanized kadam dar kadam) meaning step by step; the text after the … slot is stripped from the end of the task."',
' word "… कृपया"',
' description "Hindi politeness modifier tail (romanized kripya) meaning please; the text after the … slot is stripped from the end of the task."',
' lexeme "zh"',
' word "… 按步骤写"',
' description "Chinese modifier tail (pinyin an buzhou xie) meaning write by steps, with a leading space matching the task separator; the text after the … slot is stripped from the end of the task."',
' word "… 按步骤说明"',
' description "Chinese modifier tail (pinyin an buzhou shuoming) meaning explain by steps, with a leading space; the text after the … slot is stripped from the end of the task."',
' word "… 一步一步写"',
' description "Chinese modifier tail (pinyin yibu yibu xie) meaning write it step by step, with a leading space; the text after the … slot is stripped from the end of the task."',
' word "… 请"',
' description "Chinese politeness modifier tail (pinyin qing) meaning please, with a leading space; the text after the … slot is stripped from the end of the task."',
' meaning "common_typo"',
" gloss \"a common misspelling that can appear in a procedural how-to task, paired with its correction so an extractor can repair the token by data rather than a hardcoded table. Each surface is a bare word whose text is the misspelled token; its action child names the correct spelling that replaces the token, deduplicated per task by the misspelled form. The English 'dirven' for 'driven' is the canonical example; the other languages carry one genuine misspelling each so every supported language is covered.\"",
' wiktionary "misspelling"',
' defined_by "relation"',
' role "common_typo"',
' lexeme "en"',
' word "dirven"',
' action "driven"',
" description \"English transposition misspelling of 'driven' (as in data-driven); replaced by its action correction when it appears as a task token.\"",
' lexeme "ru"',
' word "руский"',
' action "русский"',
" description \"Russian misspelling (romanized ruskiy) of 'русский' meaning Russian, dropping one с; replaced by its action correction when it appears as a task token.\"",
' lexeme "hi"',
' word "वेबसाईट"',
' action "वेबसाइट"',
" description \"Hindi misspelling (romanized vebsaait) of 'वेबसाइट' meaning website, with an extra long-i vowel sign; replaced by its action correction when it appears as a task token.\"",
' lexeme "zh"',
' word "登陆"',
' action "登录"',
" description \"Chinese misspelling (pinyin denglu) of '登录' meaning to log in, confusing 陆 'land' for 录 'record'; replaced by its action correction when it appears as a task token.\"",
' meaning "topic_scan_stop_word"',
" gloss \"a closed-class function word — an article, preposition, conjunction or pronoun — or a citation heading such as 'source' that names no subject, so a scanner looking for the topic of a prior assistant reply skips it. Each surface is a bare word compared case-insensitively (after lowercasing) against a capitalised token from the reply; the first capitalised token that is not one of these is taken as the topic. English carries the original scan list verbatim (i, the, a, an, in, to, for, of, and, or, source); the other languages add their canonical function words so every supported language is covered. Because the scanner only considers capitalised tokens, the Devanagari and Han forms are self-describing — those scripts have no capitalisation — while the Russian forms also let a capitalised Cyrillic function word be skipped.\"",
' wiktionary "the"',
' defined_by "concept"',
' role "topic_scan_stop_word"',
' lexeme "en"',
' word "i"',
' description "English first-person pronoun; a closed-class word the topic scanner skips. It never matches in practice because the scanner ignores single-letter tokens, but it documents the original scan list."',
' word "the"',
' description "English definite article; skipped by the topic scanner as a function word that names no subject."',
' word "a"',
' description "English indefinite article; a closed-class word the scanner skips. Single-letter, so it never matches in practice but completes the original list."',
' word "an"',
' description "English indefinite article before a vowel; skipped by the topic scanner as a function word that names no subject."',
' word "in"',
' description "English preposition; skipped by the topic scanner as a function word that names no subject."',
' word "to"',
' description "English preposition or infinitive marker; skipped by the topic scanner as a function word that names no subject."',
' word "for"',
' description "English preposition; skipped by the topic scanner as a function word that names no subject."',
' word "of"',
' description "English preposition; skipped by the topic scanner as a function word that names no subject."',
' word "and"',
' description "English coordinating conjunction; skipped by the topic scanner as a function word that names no subject."',
' word "or"',
' description "English coordinating conjunction; skipped by the topic scanner as a function word that names no subject."',
' word "source"',
" description \"English heading word that introduces a citation (as in 'Source: URL') in concept-lookup replies; skipped so the scanner does not mistake it for the subject.\"",
' lexeme "ru"',
' word "и"',
' description "Russian coordinating conjunction (romanized i) meaning and; skipped by the topic scanner as a function word that names no subject."',
' word "или"',
' description "Russian coordinating conjunction (romanized ili) meaning or; skipped by the topic scanner as a function word that names no subject."',
' word "в"',
' description "Russian preposition (romanized v) meaning in; skipped by the topic scanner as a function word that names no subject."',
' word "к"',
' description "Russian preposition (romanized k) meaning to or toward; skipped by the topic scanner as a function word that names no subject."',
' word "для"',
' description "Russian preposition (romanized dlya) meaning for; skipped by the topic scanner as a function word that names no subject."',
' word "из"',
' description "Russian preposition (romanized iz) meaning of or from; skipped by the topic scanner as a function word that names no subject."',
' word "источник"',
' description "Russian heading word (romanized istochnik) meaning source; skipped so the scanner does not mistake a citation heading for the subject."',
' lexeme "hi"',
' word "और"',
' description "Hindi coordinating conjunction (romanized aur) meaning and; a function word the scanner skips. Devanagari has no capitalisation, so it is self-describing rather than matched."',
' word "या"',
' description "Hindi coordinating conjunction (romanized ya) meaning or; a function word the scanner skips. Self-describing, since Devanagari has no capitalisation."',
' word "में"',
' description "Hindi postposition (romanized mein) meaning in; a function word the scanner skips. Self-describing, since Devanagari has no capitalisation."',
' word "को"',
' description "Hindi postposition (romanized ko) marking the object; a function word the scanner skips. Self-describing, since Devanagari has no capitalisation."',
' word "के"',
' description "Hindi postposition (romanized ke) marking possession or relation; a function word the scanner skips. Self-describing, since Devanagari has no capitalisation."',
' word "का"',
' description "Hindi postposition (romanized ka) marking possession; a function word the scanner skips. Self-describing, since Devanagari has no capitalisation."',
' word "स्रोत"',
' description "Hindi heading word (romanized srot) meaning source; skipped so a citation heading is not mistaken for the subject. Self-describing, since Devanagari has no capitalisation."',
' lexeme "zh"',
' word "和"',
' description "Chinese coordinating conjunction (pinyin he) meaning and; a function word the scanner skips. Han script has no capitalisation, so it is self-describing rather than matched."',
' word "或"',
' description "Chinese coordinating conjunction (pinyin huo) meaning or; a function word the scanner skips. Self-describing, since Han script has no capitalisation."',
' word "在"',
' description "Chinese preposition (pinyin zai) meaning in or at; a function word the scanner skips. Self-describing, since Han script has no capitalisation."',
' word "的"',
' description "Chinese possessive particle (pinyin de); a function word the scanner skips. Self-describing, since Han script has no capitalisation."',
' word "来源"',
' description "Chinese heading word (pinyin laiyuan) meaning source; skipped so a citation heading is not mistaken for the subject. Self-describing, since Han script has no capitalisation."',
"meanings",
' meaning "causal_interrogative"',
' gloss "the interrogative word that asks for a cause or reason — why, почему, क्यों, 为什么. By itself it carries no answer reference; a why-did-you-answer question composes it with a prior-answer reference. Only the Hindi and Chinese surfaces are read by the recogniser, paired with prior_answer_reference within the same language to detect a head-final why-question; the English and Russian why-questions front the interrogative and are matched through answer_rationale_inquiry instead."',
' wiktionary "why"',
' defined_by "inquiry"',
' role "causal_interrogative"',
' lexeme "en"',
' word "why"',
' description "English interrogative adverb asking for a cause or reason; the bare surface for the causal interrogative concept."',
' lexeme "ru"',
' word "почему"',
' description "Russian interrogative adverb (romanized pochemu) asking for a cause or reason; the bare surface for the causal interrogative concept."',
' lexeme "hi"',
' word "क्यों"',
' description "Hindi interrogative adverb (romanized kyon) asking for a cause or reason; paired with a prior-answer reference to detect a head-final why-question."',
' lexeme "zh"',
' word "为什么"',
' description "Chinese interrogative (pinyin weishenme) asking for a cause or reason; paired with a prior-answer reference to detect a head-final why-question."',
' meaning "prior_answer_reference"',
' gloss "a reference to the answer the assistant previously gave — the object a why-question points back at when it asks the assistant to justify its prior reply. Only the Hindi and Chinese surfaces are read by the recogniser, paired with the causal interrogative within the same language; the English and Russian why-questions front the interrogative and are matched through answer_rationale_inquiry instead. A dedicated reference rather than the broader answer meaning so its Chinese surface stays exactly 回答, mirroring the original recogniser that required 回答 and not the synonym 答复."',
' wiktionary "answer"',
' defined_by "answer"',
' role "prior_answer_reference"',
' lexeme "en"',
' word "answer"',
' description "English noun for the reply the assistant previously returned; the surface a why-question refers back to."',
' lexeme "ru"',
' word "ответ"',
' description "Russian noun (romanized otvet) for the answer the assistant previously returned; the surface a why-question refers back to."',
' lexeme "hi"',
' word "जवाब"',
' description "Hindi noun (romanized javab) for the reply the assistant previously gave; paired with the causal interrogative to detect a head-final why-question."',
' word "उत्तर"',
' description "Hindi noun (romanized uttar) for the answer the assistant previously gave; an alternative surface paired with the causal interrogative."',
' lexeme "zh"',
' word "回答"',
' description "Chinese noun and verb (pinyin huida) for the answer the assistant previously gave; paired with the causal interrogative to detect a head-final why-question."',
' meaning "answer_rationale_inquiry"',
" gloss \"a why-did-you-answer question — the causal interrogative composed with a reference to the assistant's prior answer, asking it to justify the reply it just gave. The English and Russian surfaces front the interrogative, so the recogniser matches them directly: a prefix surface (trailing … slot) matches when the prompt opens with the literal, and a bare surface matches anywhere. The Hindi and Chinese why-questions are head-final and are detected instead as a same-language pair of causal_interrogative and prior_answer_reference, so the Hindi and Chinese surfaces here are inert completeness forms that are never matched.\"",
' wiktionary "why"',
' defined_by "causal_interrogative"',
' defined_by "prior_answer_reference"',
' defined_by "inquiry"',
' role "answer_rationale_lead"',
' lexeme "en"',
' word "why …"',
' description "English prefix surface; starts_with why (trailing space), the rest of the question follows the … slot."',
' word "why did you answer"',
' description "English bare surface; matches the why-did-you-answer clause anywhere in the prompt, even when it does not open it."',
' lexeme "ru"',
' word "почему …"',
' description "Russian prefix surface (romanized pochemu); starts_with почему (trailing space), the rest of the question follows the … slot."',
' word "почему ты ответил"',
' description "Russian bare surface (romanized pochemu ty otvetil) for why-did-you-answer addressed to the assistant; matches anywhere in the prompt."',
' word "почему ты так ответил"',
' description "Russian bare surface (romanized pochemu ty tak otvetil) for why-did-you-answer-that-way; matches anywhere in the prompt."',
' word "почему вы ответили"',
' description "Russian bare surface (romanized pochemu vy otvetili) for why-did-you-answer in the polite plural; matches anywhere in the prompt."',
' lexeme "hi"',
' word "ऐसा जवाब क्यों दिया"',
' description "Hindi why-did-you-answer phrasing (romanized aisa javab kyon diya); an inert completeness form — Hindi why-questions are detected as a causal_interrogative and prior_answer_reference pair, not through this surface."',
' lexeme "zh"',
' word "为什么这样回答"',
' description "Chinese why-did-you-answer phrasing (pinyin weishenme zheyang huida); an inert completeness form — Chinese why-questions are detected as a causal_interrogative and prior_answer_reference pair, not through this surface."',
' meaning "assistant_self_reference"',
' gloss "a second-person reference to the assistant — you, your, ты, вы, आप, तुम, 你, 您 and the project name formal ai. It marks that a prompt is addressed to the assistant itself. Matched as raw substrings, since several Russian forms are inflectable stems (теб for тебя and тебе, тво for твой and твоё): the architecture recogniser requires it together with an architecture concept, and the how-you-work recogniser requires its Russian forms together with the operating principle. Distinct from self_reference, whose reflexive pronouns (yourself, себя) name the assistant as the grammatical object rather than addressing it in the second person."',
' wiktionary "you"',
' defined_by "assistant"',
' defined_by "self_reference"',
' role "assistant_self_reference"',
' lexeme "en"',
' word "you"',
' description "English second-person pronoun addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' word "your"',
' description "English second-person possessive addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' word "formal ai"',
' description "English project name addressing the assistant directly; a raw-substring surface for the assistant self-reference concept."',
' lexeme "ru"',
' word "ты"',
' description "Russian second-person pronoun (romanized ty) addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' word "теб"',
' description "Russian second-person stem (romanized teb) shared by тебя and тебе addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' word "твоя"',
' description "Russian feminine second-person possessive (romanized tvoya) addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' word "твой"',
' description "Russian masculine second-person possessive (romanized tvoy) addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' word "тво"',
' description "Russian second-person possessive stem (romanized tvo) shared by твоё and твои addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' word "вы"',
' description "Russian polite second-person pronoun (romanized vy) addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' lexeme "hi"',
' word "आप"',
' description "Hindi polite second-person pronoun (romanized aap) addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' word "तुम"',
' description "Hindi informal second-person pronoun (romanized tum) addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' lexeme "zh"',
' word "你"',
' description "Chinese second-person pronoun (pinyin ni) addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' word "您"',
' description "Chinese polite second-person pronoun (pinyin nin) addressing the assistant; a raw-substring surface for the assistant self-reference concept."',
' meaning "assistant_mechanism_inquiry"',
' gloss "a how-do-you-work question addressed to the assistant — the mechanism-inquiry concept applied to the assistant itself, asking it to explain how it operates, how it is built, or the idea behind its design. Each surface is a complete clause matched as a raw substring; the recogniser fires when any one of them appears. The Russian principle-of-operation phrasing (принцип работы … тебя) is handled separately, by composing the operating_principle concept with an assistant self-reference, so it is not listed here."',
' wiktionary "work"',
' defined_by "mechanism_inquiry"',
' defined_by "assistant"',
' role "assistant_mechanism_inquiry"',
' lexeme "en"',
' word "how do you work"',
' description "English how-you-work clause asking the assistant to explain its operation; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "how does this work"',
' description "English how-this-works clause asking the assistant to explain its operation; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "how does it work"',
' description "English how-it-works clause asking the assistant to explain its operation; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "show me how you work"',
' description "English imperative asking the assistant to demonstrate how it works; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "explain how you work"',
' description "English imperative asking the assistant to explain how it works; a raw-substring surface for the assistant mechanism-inquiry concept."',
' lexeme "ru"',
' word "как ты работаешь"',
' description "Russian how-you-work clause (romanized kak ty rabotaesh) asking the assistant to explain its operation; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "покажи как ты работаешь"',
' description "Russian imperative (romanized pokazhi kak ty rabotaesh) asking the assistant to show how it works; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "расскажи как ты работаешь"',
' description "Russian imperative (romanized rasskazhi kak ty rabotaesh) asking the assistant to tell how it works; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "объясни как ты работаешь"',
' description "Russian imperative (romanized obyasni kak ty rabotaesh) asking the assistant to explain how it works; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "как ты устроен"',
' description "Russian how-you-are-built clause (romanized kak ty ustroen) asking the assistant how it is constructed; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "покажи как ты устроен"',
' description "Russian imperative (romanized pokazhi kak ty ustroen) asking the assistant to show how it is constructed; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "какая у тебя модель окружающего мира"',
' description "Russian question (romanized kakaya u tebya model okruzhayushchego mira) asking what model of the surrounding world the assistant has; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "модель окружающего мира"',
' description "Russian phrase (romanized model okruzhayushchego mira) for a model of the surrounding world; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "идея твоей разработки"',
' description "Russian phrase (romanized ideya tvoey razrabotki) for the idea behind your development; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "идея твоего проекта"',
' description "Russian phrase (romanized ideya tvoego proekta) for the idea behind your project; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "зачем тебя разработ"',
' description "Russian phrase stem (romanized zachem tebya razrabot) for why you were developed, catching разработали and разработан; a raw-substring surface for the assistant mechanism-inquiry concept."',
' lexeme "hi"',
' word "तुम कैसे काम करते हो"',
' description "Hindi how-you-work clause (romanized tum kaise kaam karte ho) asking the assistant how it works; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "आप कैसे काम करते हैं"',
' description "Hindi polite how-you-work clause (romanized aap kaise kaam karte hain) asking the assistant how it works; a raw-substring surface for the assistant mechanism-inquiry concept."',
' lexeme "zh"',
' word "你是怎么工作的"',
' description "Chinese how-you-work clause (pinyin ni shi zenme gongzuo de) asking the assistant how it works; a raw-substring surface for the assistant mechanism-inquiry concept."',
' word "你怎么运作"',
' description "Chinese how-you-operate clause (pinyin ni zenme yunzuo) asking the assistant how it operates; a raw-substring surface for the assistant mechanism-inquiry concept."',
' meaning "operating_principle"',
" gloss \"the concept of a thing's operating principle — the rule by which it works. The how-you-work recogniser reads only the Russian surface, composing it with an assistant self-reference to catch принцип работы … тебя (the principle of operation phrased about the assistant); the English, Hindi and Chinese surfaces are inert completeness forms that keep the concept lexicalised in every supported language.\"",
' wiktionary "principle"',
' defined_by "concept"',
' defined_by "action"',
' role "operating_principle"',
' lexeme "en"',
' word "operating principle"',
' description "English phrase for the rule by which something works; an inert completeness form for the operating-principle concept."',
' lexeme "ru"',
' word "принцип работы"',
' description "Russian phrase (romanized printsip raboty) for the principle of operation; composed with an assistant self-reference to recognise a how-you-work question about the assistant."',
' lexeme "hi"',
' word "कार्य सिद्धांत"',
' description "Hindi phrase (romanized kaarya siddhaant) for the principle of operation; an inert completeness form for the operating-principle concept."',
' lexeme "zh"',
' word "工作原理"',
' description "Chinese phrase (pinyin gongzuo yuanli) for the principle of operation; an inert completeness form for the operating-principle concept."',
' meaning "architecture_concept"',
" gloss \"a term that names part of an AI system's architecture or internals — a language model, neural network, OpenAI API, world model, links-notation rules, area of knowledge, or the idea behind a project's development. The architecture recogniser fires when one of these appears together with an assistant self-reference, marking a question about how the assistant is built rather than a request for a task. Each surface is matched as a raw substring; several Russian forms are inflectable stems (нейросет for нейросеть and нейросети, ссылк for ссылка and ссылки, локальных правил for the genitive of local rules).\"",
' wiktionary "architecture"',
' defined_by "concept"',
' defined_by "assistant"',
' role "architecture_concept"',
' lexeme "en"',
' word "llm"',
' description "English abbreviation for a large language model; a raw-substring surface for the architecture concept."',
' word "large language model"',
' description "English phrase for a large neural language model; a raw-substring surface for the architecture concept."',
' word "language model"',
' description "English phrase for a statistical or neural language model; a raw-substring surface for the architecture concept."',
' word "openai api"',
' description "English phrase for the OpenAI application programming interface; a raw-substring surface for the architecture concept."',
' word "openai"',
' description "English name of the OpenAI organisation and its models; a raw-substring surface for the architecture concept."',
' word "neural inference"',
' description "English phrase for running inference through a neural network; a raw-substring surface for the architecture concept."',
' word "neural network"',
' description "English phrase for a network of artificial neurons; a raw-substring surface for the architecture concept."',
' word "links notation rules"',
' description "English phrase for the deterministic Links Notation rules the assistant runs on; a raw-substring surface for the architecture concept."',
' word "local rules"',
" description \"English phrase for the assistant's local rule base; a raw-substring surface for the architecture concept.\"",
' word "world model"',
' description "English phrase for an internal model of the world; a raw-substring surface for the architecture concept."',
' word "model of the world"',
' description "English phrase for an internal model of the world; an alternative raw-substring surface for the architecture concept."',
' lexeme "ru"',
' word "бям"',
' description "Russian abbreviation (romanized byam) for a large language model; a raw-substring surface for the architecture concept."',
' word "языковая модель"',
' description "Russian phrase (romanized yazykovaya model) for a language model; a raw-substring surface for the architecture concept."',
' word "языковой моделью"',
' description "Russian phrase (romanized yazykovoy modelyu) for a language model in the instrumental case; a raw-substring surface for the architecture concept."',
' word "нейросет"',
' description "Russian stem (romanized neyroset) shared by нейросеть and нейросети for a neural network; a raw-substring surface for the architecture concept."',
' word "нейрон"',
' description "Russian stem (romanized neyron) for a neuron, shared by нейронная and нейронов; a raw-substring surface for the architecture concept."',
' word "локальных правил"',
' description "Russian phrase (romanized lokalnykh pravil) for local rules in the genitive; a raw-substring surface for the architecture concept."',
' word "локальных правилах"',
' description "Russian phrase (romanized lokalnykh pravilakh) for local rules in the prepositional case; a raw-substring surface for the architecture concept."',
' word "область знаний"',
' description "Russian phrase (romanized oblast znaniy) for an area of knowledge; a raw-substring surface for the architecture concept."',
' word "модель окружающего мира"',
' description "Russian phrase (romanized model okruzhayushchego mira) for a model of the surrounding world; a raw-substring surface for the architecture concept."',
' word "модель мира"',
' description "Russian phrase (romanized model mira) for a model of the world; a raw-substring surface for the architecture concept."',
' word "принцип работы"',
' description "Russian phrase (romanized printsip raboty) for the principle of operation; a raw-substring surface for the architecture concept."',
' word "идея твоей разработки"',
' description "Russian phrase (romanized ideya tvoey razrabotki) for the idea behind your development; a raw-substring surface for the architecture concept."',
' word "идея твоего проекта"',
' description "Russian phrase (romanized ideya tvoego proekta) for the idea behind your project; a raw-substring surface for the architecture concept."',
' word "зачем тебя разработ"',
' description "Russian phrase stem (romanized zachem tebya razrabot) for why you were developed, catching разработали and разработан; a raw-substring surface for the architecture concept."',
' word "ссылк"',
' description "Russian stem (romanized ssylk) for a link, shared by ссылка and ссылки; a raw-substring surface for the architecture concept."',
' lexeme "hi"',
' word "न्यूरल"',
' description "Hindi word (romanized nyooral) for neural; a raw-substring surface for the architecture concept."',
' word "भाषा मॉडल"',
' description "Hindi phrase (romanized bhaasha modal) for a language model; a raw-substring surface for the architecture concept."',
' lexeme "zh"',
' word "神经"',
' description "Chinese word (pinyin shenjing) for neural or nerve, as in neural network; a raw-substring surface for the architecture concept."',
' word "語言模型"',
' description "Chinese phrase (pinyin yuyan moxing) for a language model; the traditional-character raw-substring surface for the architecture concept."',
' word "语言模型"',
' description "Chinese phrase (pinyin yuyan moxing) for a language model; the simplified-character raw-substring surface for the architecture concept."',
"meanings",
' meaning "web_resource"',
' gloss "a resource identified by a URL — a web page, file, site, or endpoint reachable over the web. It is the object that an http_fetch request retrieves and a url_navigate request opens. Modeled as an entity in the link ontology so the two web intents are defined by the thing they act on, not only by the act itself."',
' wiktionary "URL"',
' defined_by "entity"',
' role "web_navigation_concept"',
' lexeme "en"',
' word "url"',
' description "English noun for the address that identifies a web resource (a uniform resource locator)."',
' word "web page"',
' description "English noun for a single document of a web resource served over HTTP."',
' word "website"',
' description "English noun for a collection of web pages under one host — a kind of web resource."',
' lexeme "ru"',
' word "сайт"',
' description "Russian noun (romanized sait) for a website — a web resource."',
' word "страница"',
' description "Russian noun (romanized stranitsa) for a web page."',
' word "ссылка"',
' description "Russian noun (romanized ssylka) for a hyperlink pointing at a web resource."',
' word "урл"',
' description "Russian borrowing (romanized url) for a URL — the address of a web resource."',
' lexeme "hi"',
' word "वेबसाइट"',
' description "Hindi noun (romanized vebsait) for a website — a web resource."',
' word "वेब पेज"',
' description "Hindi noun (romanized veb pej) for a web page."',
' word "लिंक"',
' description "Hindi noun (romanized link) for a hyperlink to a web resource."',
' lexeme "zh"',
' word "网址"',
' description "Chinese noun (pinyin wangzhi) for a URL — the address of a web resource."',
' word "网页"',
' description "Chinese noun (pinyin wangye) for a web page."',
' word "网站"',
' description "Chinese noun (pinyin wangzhan) for a website — a web resource."',
' meaning "http_fetch"',
' gloss "a request to retrieve a web resource over HTTP — the concept a fetch prompt expresses, independent of language. In the browser worker a real fetch() is attempted first, with an iframe fallback only after the target frame policy is checked. Each surface marks the URL position with the ellipsis … (U+2026): a trailing ellipsis is a prefix surface whose URL follows the literal; a surface with no ellipsis is a bare marker matched anywhere in the prompt. A separate URL gate means a surface only routes here when the prompt also carries a real URL."',
' wiktionary "fetch"',
' defined_by "inquiry"',
' defined_by "action"',
' defined_by "web_resource"',
' role "http_fetch"',
' lexeme "en"',
' word "fetch …"',
' description "English prefix surface; the literal before the … slot asks to fetch the web resource whose URL follows (fetch X)."',
' word "fetch url …"',
' description "English prefix surface naming the url explicitly; the URL follows the … slot (fetch url X)."',
' word "http fetch …"',
' description "English prefix surface naming the HTTP method; the URL follows the … slot (http fetch X)."',
' word "request …"',
' description "English prefix surface; the literal before the … slot asks to request the web resource whose URL follows (request X)."',
' word "make request to …"',
' description "English prefix surface; the URL of the resource to request follows the … slot (make request to X)."',
' word "send request to …"',
' description "English prefix surface; the URL of the resource to send a request to follows the … slot (send request to X)."',
' word "make a request to"',
' description "English bare marker; an HTTP request phrase matched anywhere in the prompt before the URL."',
' word "make an http request to"',
' description "English bare marker naming the HTTP protocol; matched anywhere in the prompt before the URL."',
' word "send a request to"',
' description "English bare marker; a send-a-request phrase matched anywhere in the prompt before the URL."',
' word "send an http request to"',
' description "English bare marker naming the HTTP protocol; matched anywhere in the prompt before the URL."',
' word "http request to"',
' description "English bare marker naming an HTTP request; matched anywhere in the prompt before the URL."',
' word "http get to"',
' description "English bare marker naming the HTTP GET method; matched anywhere in the prompt before the URL."',
' word "fetch the url"',
' description "English bare marker asking to fetch the given url; matched anywhere in the prompt, including after a polite opener."',
' word "fetch this url"',
' description "English bare marker referring to a nearby url; matched anywhere in the prompt."',
' word "fetch the page"',
' description "English bare marker asking to fetch a web page; matched anywhere in the prompt before the URL."',
' lexeme "ru"',
' word "сделай запрос …"',
' description "Russian imperative prefix surface (romanized sdelai zapros) asking to make a request; the URL follows the … slot."',
' word "сделай http запрос …"',
' description "Russian imperative prefix surface (romanized sdelai http zapros) naming the HTTP protocol; the URL follows the … slot."',
' word "выполни запрос …"',
' description "Russian imperative prefix surface (romanized vypolni zapros) asking to perform a request; the URL follows the … slot."',
' word "выполни http запрос …"',
' description "Russian imperative prefix surface (romanized vypolni http zapros) naming the HTTP protocol; the URL follows the … slot."',
' word "запроси …"',
' description "Russian imperative prefix surface (romanized zaprosi) asking to request the resource whose URL follows the … slot."',
' word "получи …"',
' description "Russian imperative prefix surface (romanized poluchi) asking to fetch or obtain the resource whose URL follows the … slot."',
' word "http запрос к …"',
' description "Russian prefix surface (romanized http zapros k) naming an HTTP request to a target; the URL follows the … slot."',
' word "http запрос на …"',
' description "Russian prefix surface (romanized http zapros na) naming an HTTP request to a target; the URL follows the … slot."',
' word "сделать запрос к …"',
' description "Russian infinitive prefix surface (romanized sdelat zapros k) asking to make a request to a target; the URL follows the … slot."',
' word "выполнить запрос к …"',
' description "Russian infinitive prefix surface (romanized vypolnit zapros k) asking to perform a request to a target; the URL follows the … slot."',
' word "сделай запрос к"',
' description "Russian bare marker (romanized sdelai zapros k) for making a request to a target; matched anywhere in the prompt before the URL."',
' word "сделай запрос на"',
' description "Russian bare marker (romanized sdelai zapros na) for making a request to a target; matched anywhere in the prompt before the URL."',
' word "сделай http запрос к"',
' description "Russian bare marker (romanized sdelai http zapros k) naming the HTTP protocol; matched anywhere in the prompt before the URL."',
' word "сделай http запрос на"',
' description "Russian bare marker (romanized sdelai http zapros na) naming the HTTP protocol; matched anywhere in the prompt before the URL."',
' word "выполни запрос к"',
' description "Russian bare marker (romanized vypolni zapros k) for performing a request to a target; matched anywhere in the prompt before the URL."',
' word "выполни запрос на"',
' description "Russian bare marker (romanized vypolni zapros na) for performing a request to a target; matched anywhere in the prompt before the URL."',
' word "выполни http запрос к"',
' description "Russian bare marker (romanized vypolni http zapros k) naming the HTTP protocol; matched anywhere in the prompt before the URL."',
' word "выполни http запрос на"',
' description "Russian bare marker (romanized vypolni http zapros na) naming the HTTP protocol; matched anywhere in the prompt before the URL."',
' word "запрос к"',
' description "Russian bare marker (romanized zapros k) — a request to a target; matched anywhere in the prompt, covering infinitive and other phrasings before the URL."',
' word "запрос на"',
' description "Russian bare marker (romanized zapros na) — a request to a target; matched anywhere in the prompt before the URL."',
' word "http запрос к"',
' description "Russian bare marker (romanized http zapros k) naming an HTTP request to a target; matched anywhere in the prompt before the URL."',
' word "http запрос на"',
' description "Russian bare marker (romanized http zapros na) naming an HTTP request to a target; matched anywhere in the prompt before the URL."',
' lexeme "hi"',
' word "अनुरोध भेजें"',
' description "Hindi bare marker (romanized anurodh bhejen) meaning send a request; matched anywhere in the prompt when a URL is present."',
' word "अनुरोध करें"',
' description "Hindi bare marker (romanized anurodh karen) meaning make a request; matched anywhere in the prompt when a URL is present."',
' lexeme "zh"',
' word "发送请求"',
' description "Chinese bare marker (pinyin fasong qingqiu) meaning send a request; matched anywhere in the prompt when a URL is present."',
' word "获取"',
' description "Chinese bare marker (pinyin huoqu) meaning fetch or obtain; matched anywhere in the prompt when a URL is present."',
' meaning "url_navigate"',
' gloss "a request to open or show a web resource without fetching its contents — the concept a navigation prompt expresses, independent of language. The browser worker returns a direct external link (and, when the target frame policy allows, an iframe preview) rather than attempting fetch(). Each surface marks the URL position with the ellipsis … (U+2026): a trailing ellipsis is a prefix surface whose URL follows the literal; a surface with no ellipsis is a bare marker matched anywhere in the prompt. A bare URL on its own also counts as navigation. A separate URL gate means a surface only routes here when the prompt also carries a real URL."',
' wiktionary "navigate"',
' defined_by "inquiry"',
' defined_by "action"',
' defined_by "web_resource"',
' role "url_navigate"',
' lexeme "en"',
' word "navigate to …"',
' description "English prefix surface; the URL of the resource to navigate to follows the … slot (navigate to X)."',
' word "navigate …"',
' description "English prefix surface; the URL of the resource to navigate to follows the … slot (navigate X)."',
' word "go to …"',
' description "English prefix surface; the URL of the resource to go to follows the … slot (go to X)."',
' word "goto …"',
' description "English prefix surface (one-word spelling of go to); the URL follows the … slot (goto X)."',
' word "visit …"',
' description "English prefix surface; the URL of the resource to visit follows the … slot (visit X)."',
' word "browse to …"',
' description "English prefix surface; the URL of the resource to browse to follows the … slot (browse to X)."',
' word "browse …"',
' description "English prefix surface; the URL of the resource to browse follows the … slot (browse X)."',
' word "show …"',
' description "English prefix surface; the URL of the resource to show follows the … slot (show X)."',
' word "show me …"',
' description "English prefix surface; the URL of the resource to show follows the … slot (show me X)."',
' word "display …"',
' description "English prefix surface; the URL of the resource to display follows the … slot (display X)."',
' word "load …"',
' description "English prefix surface; the URL of the resource to load follows the … slot (load X)."',
' word "open …"',
' description "English prefix surface; the URL of the resource to open follows the … slot (open X)."',
' word "open url …"',
' description "English prefix surface naming the url explicitly; the URL follows the … slot (open url X)."',
' word "open the url …"',
' description "English prefix surface naming the url explicitly; the URL follows the … slot (open the url X)."',
' word "open site …"',
' description "English prefix surface naming a site; the URL follows the … slot (open site X)."',
' word "open website …"',
' description "English prefix surface naming a website; the URL follows the … slot (open website X)."',
' word "open page …"',
' description "English prefix surface naming a page; the URL follows the … slot (open page X)."',
' word "open the page …"',
' description "English prefix surface naming the page; the URL follows the … slot (open the page X)."',
' word "open the website …"',
' description "English prefix surface naming the website; the URL follows the … slot (open the website X)."',
' word "take me to …"',
' description "English prefix surface; the URL of the resource to take the user to follows the … slot (take me to X)."',
' word "preview …"',
' description "English prefix surface; the URL of the resource to preview follows the … slot (preview X)."',
' word "view …"',
' description "English prefix surface; the URL of the resource to view follows the … slot (view X)."',
' word "see …"',
' description "English prefix surface; the URL of the resource to see follows the … slot (see X)."',
' word "get …"',
' description "English prefix surface; the URL of the resource to get follows the … slot (get X). Navigation, not fetch — the http_fetch intent is checked first and never matches a bare get."',
' word "navigate to"',
' description "English bare marker; a navigate-to phrase matched anywhere in the prompt before the URL."',
' word "go to"',
' description "English bare marker; a go-to phrase matched anywhere in the prompt before the URL."',
' word "goto"',
' description "English bare marker (one-word spelling of go to); matched anywhere in the prompt before the URL."',
' word "browse to"',
' description "English bare marker; a browse-to phrase matched anywhere in the prompt before the URL."',
' word "take me to"',
' description "English bare marker; a take-me-to phrase matched anywhere in the prompt before the URL."',
' word "open the page"',
' description "English bare marker naming the page; matched anywhere in the prompt before the URL."',
' word "open the site"',
' description "English bare marker naming the site; matched anywhere in the prompt before the URL."',
' word "open the website"',
' description "English bare marker naming the website; matched anywhere in the prompt before the URL."',
' word "open the url"',
' description "English bare marker naming the url; matched anywhere in the prompt before the URL."',
' word "open url"',
' description "English bare marker naming the url; matched anywhere in the prompt before the URL."',
' lexeme "ru"',
' word "перейди …"',
' description "Russian imperative prefix surface (romanized pereidi) asking to go to the resource whose URL follows the … slot."',
' word "перейди на …"',
' description "Russian imperative prefix surface (romanized pereidi na) asking to go to the resource whose URL follows the … slot."',
' word "переходи на …"',
' description "Russian imperfective imperative prefix surface (romanized perekhodi na) asking to go to the resource whose URL follows the … slot."',
' word "переходи …"',
' description "Russian imperfective imperative prefix surface (romanized perekhodi) asking to go to the resource whose URL follows the … slot."',
' word "перейдите на …"',
' description "Russian polite imperative prefix surface (romanized pereidite na) asking to go to the resource whose URL follows the … slot."',
' word "открой …"',
' description "Russian imperative prefix surface (romanized otkroi) asking to open the resource whose URL follows the … slot."',
' word "открой сайт …"',
' description "Russian imperative prefix surface (romanized otkroi sait) asking to open the site whose URL follows the … slot."',
' word "открой страницу …"',
' description "Russian imperative prefix surface (romanized otkroi stranitsu) asking to open the page whose URL follows the … slot."',
' word "открой ссылку …"',
' description "Russian imperative prefix surface (romanized otkroi ssylku) asking to open the link whose URL follows the … slot."',
' word "открой урл …"',
' description "Russian imperative prefix surface (romanized otkroi url) asking to open the url that follows the … slot."',
' word "покажи …"',
' description "Russian imperative prefix surface (romanized pokazhi) asking to show the resource whose URL follows the … slot."',
' word "покажи сайт …"',
' description "Russian imperative prefix surface (romanized pokazhi sait) asking to show the site whose URL follows the … slot."',
' word "покажи страницу …"',
' description "Russian imperative prefix surface (romanized pokazhi stranitsu) asking to show the page whose URL follows the … slot."',
' word "покажи мне …"',
' description "Russian imperative prefix surface (romanized pokazhi mne) asking to show the user the resource whose URL follows the … slot."',
' word "загрузи …"',
' description "Russian imperative prefix surface (romanized zagruzi) asking to load the resource whose URL follows the … slot."',
' word "загрузи страницу …"',
' description "Russian imperative prefix surface (romanized zagruzi stranitsu) asking to load the page whose URL follows the … slot."',
' word "посети …"',
' description "Russian imperative prefix surface (romanized poseti) asking to visit the resource whose URL follows the … slot."',
' word "зайди на …"',
' description "Russian imperative prefix surface (romanized zaidi na) asking to go onto the resource whose URL follows the … slot."',
' word "зайди …"',
' description "Russian imperative prefix surface (romanized zaidi) asking to go onto the resource whose URL follows the … slot."',
' word "просмотри …"',
' description "Russian imperative prefix surface (romanized prosmotri) asking to view the resource whose URL follows the … slot."',
' word "отобрази …"',
' description "Russian imperative prefix surface (romanized otobrazi) asking to display the resource whose URL follows the … slot."',
' word "перейди на"',
' description "Russian bare marker (romanized pereidi na) for going to a target; matched anywhere in the prompt before the URL."',
' word "переходи на"',
' description "Russian bare marker (romanized perekhodi na) for going to a target; matched anywhere in the prompt before the URL."',
' word "перейдите на"',
' description "Russian polite bare marker (romanized pereidite na) for going to a target; matched anywhere in the prompt before the URL."',
' word "открой сайт"',
' description "Russian bare marker (romanized otkroi sait) for opening a site; matched anywhere in the prompt before the URL."',
' word "открой страницу"',
' description "Russian bare marker (romanized otkroi stranitsu) for opening a page; matched anywhere in the prompt before the URL."',
' word "открой ссылку"',
' description "Russian bare marker (romanized otkroi ssylku) for opening a link; matched anywhere in the prompt before the URL."',
' word "открой урл"',
' description "Russian bare marker (romanized otkroi url) for opening a url; matched anywhere in the prompt before the URL."',
' word "покажи сайт"',
' description "Russian bare marker (romanized pokazhi sait) for showing a site; matched anywhere in the prompt before the URL."',
' word "покажи страницу"',
' description "Russian bare marker (romanized pokazhi stranitsu) for showing a page; matched anywhere in the prompt before the URL."',
' word "зайди на"',
' description "Russian bare marker (romanized zaidi na) for going onto a target; matched anywhere in the prompt before the URL."',
' lexeme "hi"',
' word "पर जाएं"',
' description "Hindi bare marker (romanized par jaen) meaning go to; matched anywhere in the prompt when a URL is present."',
' word "खोलें"',
' description "Hindi bare marker (romanized kholen) meaning open; matched anywhere in the prompt when a URL is present."',
' word "देखें"',
' description "Hindi bare marker (romanized dekhen) meaning view or see; matched anywhere in the prompt when a URL is present."',
' lexeme "zh"',
' word "打开"',
' description "Chinese bare marker (pinyin dakai) meaning open; matched anywhere in the prompt when a URL is present."',
' word "访问"',
' description "Chinese bare marker (pinyin fangwen) meaning visit or access; matched anywhere in the prompt when a URL is present."',
' word "前往"',
' description "Chinese bare marker (pinyin qianwang) meaning go to; matched anywhere in the prompt when a URL is present."',
' word "查看"',
' description "Chinese bare marker (pinyin chakan) meaning view or look at; matched anywhere in the prompt when a URL is present."',
"meanings",
' meaning "web_search"',
' gloss "a request to search the open web (or a public reference such as an encyclopedia) for information about a topic — the concept a web-search prompt expresses, independent of language. The solver extracts the topic and looks it up; it is distinct from http_fetch and url_navigate, which act on a single named URL. Two surface conventions are shared by every web-search marker. (1) A marker written with a leading and trailing space, like the value containing search surrounded by spaces, matches only as a whole token, so it never fires inside a longer word; a marker written with no surrounding space matches as a substring, which is how the Devanagari and Han markers fold their inflections. (2) A marker that ends with the ellipsis … (U+2026) is a prefix surface whose query follows the literal before the slot; the handler strips that literal and keeps the remainder as the query."',
' wiktionary "search"',
' defined_by "inquiry"',
' defined_by "action"',
' defined_by "web_resource"',
' role "web_search_concept"',
' lexeme "en"',
' word "web search"',
' description "English noun phrase naming the act of searching the web for information about a topic."',
' word "search the web"',
' description "English verb phrase for performing a web search — the canonical realisation of this concept."',
' lexeme "ru"',
' word "поиск в интернете"',
' description "Russian noun phrase (romanized poisk v internete) for a web search — looking a topic up on the internet."',
' word "веб-поиск"',
' description "Russian compound (romanized veb-poisk) naming a web search."',
' lexeme "hi"',
' word "वेब खोज"',
' description "Hindi noun phrase (romanized veb khoj) for a web search — looking a topic up on the web."',
' word "इंटरनेट पर खोज"',
' description "Hindi phrase (romanized internet par khoj) for searching the internet for a topic."',
' lexeme "zh"',
' word "网络搜索"',
' description "Chinese noun phrase (pinyin wangluo sousuo) for a web search."',
' word "在网上搜索"',
' description "Chinese verb phrase (pinyin zai wangshang sousuo) for searching on the web."',
' meaning "reference_internet"',
' gloss "the open internet seen as a place to look something up — the web, the net, the online world. As a web-search signal its surfaces are matched anywhere in the prompt (whole-token for the space-wrapped Latin and Cyrillic forms, substring for the Han forms) to confirm that a weak search verb is aimed at the web. The same concept also names a standalone source: a prompt whose whole extracted query is just the word internet (in any language) is rejected as a bare source rather than searched for, which is why this meaning also carries the source-only role. The handler reads the source-only words by trimming these signal surfaces. The same internet-naming surfaces also fill the web_medium role: paired with a leading imperative search verb they confirm that a prompt explicitly asks to search the web, so a documentation handler can screen such a prompt out of its method-question gate."',
' wiktionary "internet"',
' defined_by "web_resource"',
' defined_by "entity"',
' role "web_search_signal"',
' role "web_search_source_only"',
' role "web_medium"',
' lexeme "en"',
' word " web "',
' description "English noun (the web), space-wrapped so it matches only as a whole token; trimmed it is the bare source word web."',
' word " internet "',
' description "English noun (the internet), space-wrapped for a whole-token match; trimmed it is the bare source word internet."',
' word " online "',
' description "English adverb (online), space-wrapped for a whole-token match; trimmed it is the bare source word online."',
' lexeme "ru"',
' word " интернете "',
' description "Russian prepositional form (romanized internete), space-wrapped for a whole-token match; trimmed it is the bare source word интернете."',
' word " интернет "',
' description "Russian noun (romanized internet), space-wrapped for a whole-token match; trimmed it is the bare source word интернет."',
' word " онлайн "',
' description "Russian adverb (romanized onlain), space-wrapped for a whole-token match; trimmed it is the bare source word онлайн."',
' word " сети "',
' description "Russian noun (romanized seti, in the net), space-wrapped for a whole-token match; trimmed it is the bare source word сети."',
' lexeme "hi"',
' word "इंटरनेट"',
' description "Hindi noun (romanized internet) for the internet; a bare substring marker that also names a standalone source."',
' word "ऑनलाइन"',
' description "Hindi adverb (romanized onlain) for online; a bare substring marker that also names a standalone source."',
' word "वेब"',
' description "Hindi noun (romanized veb) for the web; a bare substring marker that also names a standalone source."',
' lexeme "zh"',
' word "网上"',
' description "Chinese phrase (pinyin wangshang) for on the web; a bare substring marker that also names a standalone source."',
' word "網上"',
' description "Chinese phrase (pinyin wangshang, traditional) for on the web; a bare substring marker that also names a standalone source."',
' word "在线"',
' description "Chinese phrase (pinyin zaixian) for online; a bare substring marker that also names a standalone source."',
' word "在線"',
' description "Chinese phrase (pinyin zaixian, traditional) for online; a bare substring marker that also names a standalone source."',
' word "互联网"',
' description "Chinese noun (pinyin hulianwang) for the internet; a bare substring marker that also names a standalone source."',
' word "網路"',
' description "Chinese noun (pinyin wanglu, traditional) for the network or internet; a bare substring marker that also names a standalone source."',
' word "网络"',
' description "Chinese noun (pinyin wangluo) for the network or internet; a bare substring marker that also names a standalone source."',
' meaning "reference_encyclopedia"',
' gloss "a named public reference work used as a place to look something up — Wikipedia, Wikidata, Wiktionary and their kin. As a web-search signal its surfaces confirm that a weak search verb targets a reference source; the Russian and Han forms are written as stems (no trailing boundary) so they fold inflected and compound spellings. The concept is also a standalone source: a query that is just the name of the encyclopedia is rejected rather than searched for, so this meaning carries the source-only role too. For exactness the Russian genitive википедии is stored as its own bare source word in addition to the stem."',
' wiktionary "encyclopedia"',
' defined_by "web_resource"',
' defined_by "entity"',
' role "web_search_signal"',
' role "web_search_source_only"',
' lexeme "en"',
' word " wikipedia "',
' description "English proper noun (Wikipedia), space-wrapped for a whole-token match; trimmed it is the bare source word wikipedia."',
' word " wikidata "',
' description "English proper noun (Wikidata), space-wrapped for a whole-token match; trimmed it is the bare source word wikidata."',
' word " wiktionary "',
' description "English proper noun (Wiktionary), space-wrapped for a whole-token match; trimmed it is the bare source word wiktionary."',
' lexeme "ru"',
' word " википед"',
' description "Russian stem (romanized wikiped) with a leading boundary only, so it folds википедия, википедии and википедию as a signal."',
' word " викиданн"',
' description "Russian stem (romanized wikidann) with a leading boundary only, so it folds the declensions of Wikidata as a signal."',
' word "википедии"',
' description "Russian genitive (romanized wikipedii) stored bare so the standalone source word википедии is rejected exactly as a bare source."',
' lexeme "hi"',
' word "विकिपीडिया"',
' description "Hindi proper noun (romanized vikipidiya) for Wikipedia; a bare substring marker that also names a standalone source."',
' word "विकिडाटा"',
' description "Hindi proper noun (romanized vikidata) for Wikidata; a bare substring marker that also names a standalone source."',
' lexeme "zh"',
' word "百科"',
' description "Chinese noun (pinyin baike) for an encyclopedia; a bare substring marker that also names a standalone source."',
' word "维基百科"',
' description "Chinese proper noun (pinyin weiji baike) for Wikipedia; a bare substring marker that also names a standalone source."',
' word "維基百科"',
' description "Chinese proper noun (pinyin weiji baike, traditional) for Wikipedia; a bare substring marker that also names a standalone source."',
' word "维基数据"',
' description "Chinese proper noun (pinyin weiji shuju) for Wikidata; a bare substring marker that also names a standalone source."',
' word "維基數據"',
' description "Chinese proper noun (pinyin weiji shuju, traditional) for Wikidata; a bare substring marker that also names a standalone source."',
' meaning "reference_information"',
' gloss "information itself seen as the thing a search is after — facts, details, data, materials, sources, articles. As a web-search signal these surfaces confirm that a weak search verb is looking for information, but unlike the internet and the encyclopedia they are not standalone sources: a query that is merely the word information is still a real query, so this meaning carries the signal role only and never the source-only role. The Russian forms that originally folded inflections are kept as leading-boundary stems."',
' wiktionary "information"',
' defined_by "concept"',
' role "web_search_signal"',
' lexeme "en"',
' word " information "',
' description "English noun (information), space-wrapped for a whole-token signal match."',
' word " info "',
' description "English clipping (info), space-wrapped for a whole-token signal match."',
' word " details "',
' description "English noun (details), space-wrapped for a whole-token signal match."',
' word " data "',
' description "English noun (data), space-wrapped for a whole-token signal match."',
' word " material "',
' description "English noun (material), space-wrapped for a whole-token signal match."',
' word " materials "',
' description "English noun (materials), space-wrapped for a whole-token signal match."',
' word " resource "',
' description "English noun (resource), space-wrapped for a whole-token signal match."',
' word " resources "',
' description "English noun (resources), space-wrapped for a whole-token signal match."',
' word " source "',
' description "English noun (source), space-wrapped for a whole-token signal match."',
' word " sources "',
' description "English noun (sources), space-wrapped for a whole-token signal match."',
' word " article "',
' description "English noun (article), space-wrapped for a whole-token signal match."',
' word " articles "',
' description "English noun (articles), space-wrapped for a whole-token signal match."',
' word " fact "',
' description "English noun (fact), space-wrapped for a whole-token signal match."',
' word " facts "',
' description "English noun (facts), space-wrapped for a whole-token signal match."',
' lexeme "ru"',
' word " информац"',
' description "Russian stem (romanized informac) with a leading boundary only, folding информация, информацию and информации as a signal."',
' word " инфу "',
' description "Russian colloquial accusative (romanized infu), space-wrapped for a whole-token signal match."',
' word " сведения "',
' description "Russian noun (romanized svedeniya, information), space-wrapped for a whole-token signal match."',
' word " материал"',
' description "Russian stem (romanized material) with a leading boundary only, folding материал, материалы and материалов as a signal."',
' word " данные "',
' description "Russian noun (romanized dannye, data), space-wrapped for a whole-token signal match."',
' word " источник"',
' description "Russian stem (romanized istochnik) with a leading boundary only, folding источник, источники and источников as a signal."',
' lexeme "hi"',
' word "जानकारी"',
' description "Hindi noun (romanized jankari) for information; a bare substring signal marker."',
' word "सूचना"',
' description "Hindi noun (romanized suchna) for information or notice; a bare substring signal marker."',
' word "विवरण"',
' description "Hindi noun (romanized vivaran) for details; a bare substring signal marker."',
' word "सामग्री"',
' description "Hindi noun (romanized samagri) for material; a bare substring signal marker."',
' word "स्रोत"',
' description "Hindi noun (romanized srot) for a source; a bare substring signal marker."',
' word "लेख"',
' description "Hindi noun (romanized lekh) for an article; a bare substring signal marker."',
' lexeme "zh"',
' word "信息"',
' description "Chinese noun (pinyin xinxi) for information; a bare substring signal marker."',
' word "資料"',
' description "Chinese noun (pinyin ziliao, traditional) for data or material; a bare substring signal marker."',
' word "资料"',
' description "Chinese noun (pinyin ziliao) for data or material; a bare substring signal marker."',
' word "内容"',
' description "Chinese noun (pinyin neirong) for content; a bare substring signal marker."',
' word "來源"',
' description "Chinese noun (pinyin laiyuan, traditional) for a source; a bare substring signal marker."',
' word "来源"',
' description "Chinese noun (pinyin laiyuan) for a source; a bare substring signal marker."',
' word "资源"',
' description "Chinese noun (pinyin ziyuan) for a resource; a bare substring signal marker."',
' word "資源"',
' description "Chinese noun (pinyin ziyuan, traditional) for a resource; a bare substring signal marker."',
' word "文章"',
' description "Chinese noun (pinyin wenzhang) for an article; a bare substring signal marker."',
' meaning "act_search_strong"',
' gloss "the decisive search action — to search, look up, research or investigate. It is strong because, on its own, it is enough to route a prompt to web search without any reference-source signal. Each verb appears twice: as a space-wrapped (or, for Devanagari and Han, bare substring) bare marker used to detect that a search is being asked for, and as a prefix surface ending in … used to extract the query that follows the imperative. The longer prefix search for … is listed before the shorter search … so an imperative like search for cats keeps cats rather than for cats."',
' wiktionary "search"',
' defined_by "inquiry"',
' defined_by "action"',
' role "web_search_action"',
' role "web_search_strong_action"',
' role "web_search_imperative_lead"',
' lexeme "en"',
' word " search "',
' description "English verb (to search), space-wrapped bare marker detecting a strong search action."',
' word " look up "',
' description "English phrasal verb (to look up), space-wrapped bare marker detecting a strong search action."',
' word " lookup "',
' description "English one-word spelling (lookup), space-wrapped bare marker detecting a strong search action."',
' word " research "',
' description "English verb (to research), space-wrapped bare marker detecting a strong search action."',
' word " investigate "',
' description "English verb (to investigate), space-wrapped bare marker detecting a strong search action."',
' word "search for …"',
' description "English imperative prefix surface; the query follows search for, listed first so for is not kept in the query."',
' word "search …"',
' description "English imperative prefix surface; the query follows the verb search."',
' word "look up …"',
' description "English imperative prefix surface; the query follows look up."',
' word "lookup …"',
' description "English imperative prefix surface; the query follows the one-word lookup."',
' word "research …"',
' description "English imperative prefix surface; the query follows research."',
' word "investigate …"',
' description "English imperative prefix surface; the query follows investigate."',
' lexeme "ru"',
' word " поищи "',
' description "Russian imperative (romanized poishchi, search), space-wrapped bare marker detecting a strong search action."',
' word " поиск "',
' description "Russian noun (romanized poisk, a search), space-wrapped bare marker detecting a strong search action."',
' word " поискать "',
' description "Russian infinitive (romanized poiskat, to search), space-wrapped bare marker detecting a strong search action."',
' word " ищи "',
' description "Russian imperative (romanized ishchi, seek), space-wrapped bare marker detecting a strong search action."',
' word "поищи …"',
' description "Russian imperative prefix surface (romanized poishchi); the query follows the verb."',
' word "поискать …"',
' description "Russian infinitive prefix surface (romanized poiskat); the query follows the verb."',
' word "ищи …"',
' description "Russian imperative prefix surface (romanized ishchi); the query follows the verb."',
' lexeme "hi"',
' word "खोज"',
' description "Hindi verb stem (romanized khoj, search) as a bare substring marker detecting a strong search action across its inflections."',
' word "ढूंढ"',
' description "Hindi verb stem (romanized dhundh, search) as a bare substring marker detecting a strong search action."',
' word "ढूँढ"',
' description "Hindi verb stem (romanized dhundh, nasalised spelling) as a bare substring marker detecting a strong search action."',
' word "खोजो …"',
' description "Hindi imperative prefix surface (romanized khojo); the query follows the verb."',
' word "खोजें …"',
' description "Hindi polite imperative prefix surface (romanized khojen); the query follows the verb."',
' word "खोजिए …"',
' description "Hindi formal imperative prefix surface (romanized khojie); the query follows the verb."',
' word "ढूंढो …"',
' description "Hindi imperative prefix surface (romanized dhundho); the query follows the verb."',
' word "ढूँढो …"',
' description "Hindi imperative prefix surface (romanized dhundho, nasalised); the query follows the verb."',
' word "ढूंढें …"',
' description "Hindi polite imperative prefix surface (romanized dhundhen); the query follows the verb."',
' word "ढूँढें …"',
' description "Hindi polite imperative prefix surface (romanized dhundhen, nasalised); the query follows the verb."',
' lexeme "zh"',
' word "搜索"',
' description "Chinese verb (pinyin sousuo, to search) as a bare substring marker detecting a strong search action."',
' word "查找"',
' description "Chinese verb (pinyin chazhao, to look up) as a bare substring marker detecting a strong search action."',
' word "查询"',
' description "Chinese verb (pinyin chaxun, to query) as a bare substring marker detecting a strong search action."',
' word "檢索"',
' description "Chinese verb (pinyin jiansuo, to retrieve, traditional) as a bare substring marker detecting a strong search action."',
' word "检索"',
' description "Chinese verb (pinyin jiansuo, to retrieve) as a bare substring marker detecting a strong search action."',
' word "搜一下"',
' description "Chinese phrase (pinyin sou yixia, have a search) as a bare substring marker detecting a strong search action."',
' word "查一下"',
' description "Chinese phrase (pinyin cha yixia, have a look) as a bare substring marker detecting a strong search action."',
' word "搜索…"',
' description "Chinese imperative prefix surface (pinyin sousuo); the query follows the verb."',
' word "查找…"',
' description "Chinese imperative prefix surface (pinyin chazhao); the query follows the verb."',
' word "查询…"',
' description "Chinese imperative prefix surface (pinyin chaxun); the query follows the verb."',
' word "檢索…"',
' description "Chinese imperative prefix surface (pinyin jiansuo, traditional); the query follows the verb."',
' word "检索…"',
' description "Chinese imperative prefix surface (pinyin jiansuo); the query follows the verb."',
' word "搜一下…"',
' description "Chinese imperative prefix surface (pinyin sou yixia); the query follows the phrase."',
' word "查一下…"',
' description "Chinese imperative prefix surface (pinyin cha yixia); the query follows the phrase."',
' meaning "act_find_weak"',
' gloss "the weak search action — to find, locate or discover. It is weak because, unlike act_search_strong, it routes to web search only when the prompt also carries a reference-source signal such as the internet, an encyclopedia or information; on its own find is too ordinary to mean a web search. Each verb appears as a bare detection marker and as a prefix surface ending in … for extracting the query that follows. Hindi and Chinese weak verbs are provided so the concept is complete in every supported language."',
' wiktionary "find"',
' defined_by "inquiry"',
' defined_by "action"',
' role "web_search_action"',
' role "web_search_imperative_lead"',
' lexeme "en"',
' word " find "',
' description "English verb (to find), space-wrapped bare marker detecting a weak search action that needs a reference-source signal."',
' word "find …"',
' description "English imperative prefix surface; the query follows find."',
' lexeme "ru"',
' word " найди "',
' description "Russian imperative (romanized naidi, find), space-wrapped bare marker detecting a weak search action."',
' word " найти "',
' description "Russian infinitive (romanized naiti, to find), space-wrapped bare marker detecting a weak search action."',
' word " разыщи "',
' description "Russian imperative (romanized razyshchi, track down), space-wrapped bare marker detecting a weak search action."',
' word " узнай "',
' description "Russian imperative (romanized uznai, find out), space-wrapped bare marker detecting a weak search action."',
' word "найди …"',
' description "Russian imperative prefix surface (romanized naidi); the query follows the verb."',
' word "найти …"',
' description "Russian infinitive prefix surface (romanized naiti); the query follows the verb."',
' word "разыщи …"',
' description "Russian imperative prefix surface (romanized razyshchi); the query follows the verb."',
' word "узнай …"',
' description "Russian imperative prefix surface (romanized uznai); the query follows the verb."',
' lexeme "hi"',
' word "पता लगाओ"',
' description "Hindi phrase (romanized pata lagao, find out) as a bare substring marker detecting a weak search action that needs a reference-source signal."',
' word "पता लगाओ …"',
' description "Hindi imperative prefix surface (romanized pata lagao); the query follows the phrase."',
' lexeme "zh"',
' word "找到"',
' description "Chinese verb (pinyin zhaodao, to find) as a bare substring marker detecting a weak search action that needs a reference-source signal."',
' word "找到…"',
' description "Chinese imperative prefix surface (pinyin zhaodao); the query follows the verb."',
' meaning "web_search_mention"',
' gloss "a mention of web search inside an earlier conversation turn — not the current prompt — used to decide whether a terse follow-up such as search it or найди это refers back to a web search the assistant already offered. Unlike the other web-search markers it is tested against the raw, lowercased text of a prior turn (not the normalised prompt), so each surface is stored exactly as it appears, including the hyphen in веб-поиск; all forms are bare substrings. The signal is lexicalised in every supported language, so a Hindi or Chinese prior turn that searched the web is recognised just like an English or Russian one."',
' wiktionary "search"',
' defined_by "web_search"',
' role "web_search_history_signal"',
' lexeme "en"',
' word "duckduckgo"',
' description "English proper noun naming the DuckDuckGo search engine; a raw lowercased substring signalling that a prior turn performed a web search."',
' word "web search"',
' description "English phrase (web search); a raw lowercased substring signalling that a prior turn performed a web search."',
' word "search the internet"',
' description "English phrase (search the internet); a raw lowercased substring signalling that a prior turn performed a web search."',
' lexeme "ru"',
' word "веб-поиск"',
' description "Russian compound (romanized veb-poisk, web search), hyphenated; a raw lowercased substring signalling that a prior turn performed a web search."',
' word "веб поиск"',
' description "Russian phrase (romanized veb poisk, web search), spaced; a raw lowercased substring signalling that a prior turn performed a web search."',
' word "интернет"',
' description "Russian noun (romanized internet); a raw lowercased substring signalling that a prior turn referenced the internet."',
' lexeme "hi"',
' word "वेब खोज"',
' description "Hindi phrase (romanized veb khoj, web search); a raw lowercased substring signalling that a prior turn performed a web search."',
' word "इंटरनेट पर खोज"',
' description "Hindi phrase (romanized internet par khoj, search the internet); a raw lowercased substring signalling that a prior turn performed a web search."',
' word "इंटरनेट"',
' description "Hindi noun (romanized internet); a raw lowercased substring signalling that a prior turn referenced the internet."',
' lexeme "zh"',
' word "网络搜索"',
' description "Chinese phrase (pinyin wangluo sousuo, web search) in simplified script; a raw lowercased substring signalling that a prior turn performed a web search."',
' word "在网上搜索"',
' description "Chinese phrase (pinyin zai wangshang sousuo, search on the web) in simplified script; a raw lowercased substring signalling that a prior turn performed a web search."',
' word "互联网"',
' description "Chinese noun (pinyin hulianwang, internet) in simplified script; a raw lowercased substring signalling that a prior turn referenced the internet."',
' word "網路"',
' description "Chinese noun (pinyin wanglu, network or internet) in traditional script; a raw lowercased substring signalling that a prior turn referenced the internet."',
"meanings",
' meaning "explicit_web_search_command"',
' gloss "an explicit, fully spelled-out web-search command whose topic sits at the very end — search the web for X, find information about X, найди в интернете X. It is a specialisation of web_search in which the source and the act are stated outright, so the recogniser does not have to infer them: it strips the lead-in from the front of the prompt and keeps whatever follows as the query. Every surface is a prefix surface ending with the ellipsis … (U+2026); the literal before the slot is the lead-in to strip (it keeps its trailing space so the boundary is exact), and the remainder is the search topic. The longer, more specific lead-ins are written before the shorter ones so that, for example, find detailed information about … wins over find information about …. English and Russian carry the original lead-ins verbatim; Hindi and Chinese add natural verb-initial commands so the concept is complete in every supported language."',
' wiktionary "search"',
' defined_by "web_search"',
' defined_by "action"',
' role "web_search_explicit_prefix"',
' lexeme "en"',
' word "search the web for …"',
' description "English lead-in naming the web as the source; the query is whatever follows search the web for."',
' word "search web for …"',
' description "English lead-in (article-dropped variant of search the web for); the query follows."',
' word "search the internet for …"',
' description "English lead-in naming the internet as the source; the query follows search the internet for."',
' word "search internet for …"',
' description "English lead-in (article-dropped variant of search the internet for); the query follows."',
' word "search online for …"',
' description "English lead-in naming online search; the query follows search online for."',
' word "search wikipedia for …"',
' description "English lead-in naming Wikipedia as the source; the query follows search wikipedia for."',
' word "search wikidata for …"',
' description "English lead-in naming Wikidata as the source; the query follows search wikidata for."',
' word "search wiktionary for …"',
' description "English lead-in naming Wiktionary as the source; the query follows search wiktionary for."',
' word "search for information about …"',
' description "English lead-in asking for information about a topic; the query follows search for information about."',
' word "search for information on …"',
' description "English lead-in asking for information on a topic; the query follows search for information on."',
' word "web search for …"',
' description "English lead-in naming a web search; the query follows web search for."',
' word "find on the internet …"',
' description "English lead-in asking to find something on the internet; the query follows find on the internet."',
' word "find online …"',
' description "English lead-in asking to find something online; the query follows find online."',
' word "find information about …"',
' description "English lead-in asking to find information about a topic; the query follows find information about."',
' word "find information on …"',
' description "English lead-in asking to find information on a topic; the query follows find information on."',
' word "find detailed information about …"',
' description "English lead-in asking to find detailed information about a topic; listed before find information about so detailed is not kept; the query follows."',
' word "find detailed information on …"',
' description "English lead-in asking to find detailed information on a topic; listed before find information on so detailed is not kept; the query follows."',
' word "find info about …"',
' description "English lead-in (clipped info) asking to find information about a topic; the query follows find info about."',
' word "find info on …"',
' description "English lead-in (clipped info) asking to find information on a topic; the query follows find info on."',
' word "look up information about …"',
' description "English lead-in asking to look up information about a topic; the query follows look up information about."',
' word "look up information on …"',
' description "English lead-in asking to look up information on a topic; the query follows look up information on."',
' word "look up info about …"',
' description "English lead-in (clipped info) asking to look up information about a topic; the query follows look up info about."',
' word "look up info on …"',
' description "English lead-in (clipped info) asking to look up information on a topic; the query follows look up info on."',
' word "look up online …"',
' description "English lead-in asking to look something up online; the query follows look up online."',
' lexeme "ru"',
' word "найди в интернете …"',
' description "Russian lead-in (romanized naidi v internete, find on the internet); the query follows the lead-in."',
' word "поищи в интернете …"',
' description "Russian lead-in (romanized poishchi v internete, search on the internet); the query follows the lead-in."',
' word "поиск в интернете …"',
' description "Russian lead-in (romanized poisk v internete, a search on the internet); the query follows the lead-in."',
' word "найди онлайн …"',
' description "Russian lead-in (romanized naidi onlain, find online); the query follows the lead-in."',
' word "поищи онлайн …"',
' description "Russian lead-in (romanized poishchi onlain, search online); the query follows the lead-in."',
' word "найди в сети …"',
' description "Russian lead-in (romanized naidi v seti, find on the net); the query follows the lead-in."',
' word "поищи в сети …"',
' description "Russian lead-in (romanized poishchi v seti, search on the net); the query follows the lead-in."',
' word "найди информацию в интернете о …"',
' description "Russian lead-in (romanized naidi informaciyu v internete o, find information on the internet about); the query follows."',
' word "найди информацию в интернете об …"',
' description "Russian lead-in (romanized naidi informaciyu v internete ob, the ob variant before a vowel); the query follows."',
' word "поищи информацию в интернете о …"',
' description "Russian lead-in (romanized poishchi informaciyu v internete o, search the internet for information about); the query follows."',
' word "поищи информацию в интернете об …"',
' description "Russian lead-in (romanized poishchi informaciyu v internete ob, the ob variant before a vowel); the query follows."',
' word "найди информацию о …"',
' description "Russian lead-in (romanized naidi informaciyu o, find information about); the query follows."',
' word "найди информацию об …"',
' description "Russian lead-in (romanized naidi informaciyu ob, the ob variant before a vowel); the query follows."',
' word "найди информацию про …"',
' description "Russian lead-in (romanized naidi informaciyu pro, find information about); the query follows."',
' word "найди информацию по …"',
' description "Russian lead-in (romanized naidi informaciyu po, find information on); the query follows."',
' word "найти информацию о …"',
' description "Russian lead-in (romanized naiti informaciyu o, infinitive to find information about); the query follows."',
' word "найти информацию об …"',
' description "Russian lead-in (romanized naiti informaciyu ob, the ob variant before a vowel); the query follows."',
' word "поищи информацию о …"',
' description "Russian lead-in (romanized poishchi informaciyu o, search for information about); the query follows."',
' word "поищи информацию об …"',
' description "Russian lead-in (romanized poishchi informaciyu ob, the ob variant before a vowel); the query follows."',
' word "поищи информацию про …"',
' description "Russian lead-in (romanized poishchi informaciyu pro, search for information about); the query follows."',
' word "поищи информацию по …"',
' description "Russian lead-in (romanized poishchi informaciyu po, search for information on); the query follows."',
' word "найди инфу о …"',
' description "Russian lead-in (romanized naidi infu o, colloquial find info about); the query follows."',
' word "найди инфу об …"',
' description "Russian lead-in (romanized naidi infu ob, the ob variant before a vowel); the query follows."',
' word "поищи инфу о …"',
' description "Russian lead-in (romanized poishchi infu o, colloquial search for info about); the query follows."',
' word "поищи инфу об …"',
' description "Russian lead-in (romanized poishchi infu ob, the ob variant before a vowel); the query follows."',
' word "найди сведения о …"',
' description "Russian lead-in (romanized naidi svedeniya o, find information about); the query follows."',
' word "найди сведения об …"',
' description "Russian lead-in (romanized naidi svedeniya ob, the ob variant before a vowel); the query follows."',
' word "поищи сведения о …"',
' description "Russian lead-in (romanized poishchi svedeniya o, search for information about); the query follows."',
' word "поищи сведения об …"',
' description "Russian lead-in (romanized poishchi svedeniya ob, the ob variant before a vowel); the query follows."',
' word "найди материалы о …"',
' description "Russian lead-in (romanized naidi materialy o, find materials about); the query follows."',
' word "найди материалы об …"',
' description "Russian lead-in (romanized naidi materialy ob, the ob variant before a vowel); the query follows."',
' word "поищи материалы о …"',
' description "Russian lead-in (romanized poishchi materialy o, search for materials about); the query follows."',
' word "поищи материалы об …"',
' description "Russian lead-in (romanized poishchi materialy ob, the ob variant before a vowel); the query follows."',
' lexeme "hi"',
' word "इंटरनेट पर खोजें …"',
' description "Hindi verb-initial command (romanized internet par khojen, search on the internet); the query follows the lead-in."',
' word "वेब पर खोजें …"',
' description "Hindi verb-initial command (romanized veb par khojen, search on the web); the query follows the lead-in."',
' word "ऑनलाइन खोजें …"',
' description "Hindi verb-initial command (romanized onlain khojen, search online); the query follows the lead-in."',
' word "विकिपीडिया पर खोजें …"',
' description "Hindi verb-initial command (romanized vikipidiya par khojen, search on Wikipedia); the query follows the lead-in."',
' lexeme "zh"',
' word "在网上搜索…"',
' description "Chinese verb-initial command (pinyin zai wangshang sousuo, search on the web for); the query follows the lead-in."',
' word "在互联网上搜索…"',
' description "Chinese verb-initial command (pinyin zai hulianwang shang sousuo, search on the internet for); the query follows the lead-in."',
' word "在维基百科上搜索…"',
' description "Chinese verb-initial command (pinyin zai weiji baike shang sousuo, search on Wikipedia for); the query follows the lead-in."',
' word "上网查找…"',
' description "Chinese verb-initial command (pinyin shangwang chazhao, go online and look up); the query follows the lead-in."',
' meaning "topic_connective"',
' gloss "the connective that ties a search verb to the topic it is about — the aboutness relation between a query and its subject. Its surfaces split by word order, and the slot shape records which side the topic falls on. In head-initial languages the connective precedes the topic, so the form is a prefix surface ( about …, о …, 关于…) whose literal before the slot is found in the prompt and the remainder taken as the query. In head-final Hindi the postposition follows the topic, so the form is a suffix surface (… के बारे में) whose literal after the slot is found and the text before it taken as the query. The recogniser reads the slot to decide the direction, trying the prefix (after-topic) connectives before the suffix (before-topic) ones; within each side the order is the declared order, so the specific about/regarding markers are tried before the broad for."',
' wiktionary "about"',
' defined_by "relation"',
' role "web_search_topic_marker"',
' lexeme "en"',
' word " about …"',
' description "English connective (about), space-wrapped before the slot; the topic follows, so the text after about is the query."',
' word " on …"',
' description "English connective (on), space-wrapped before the slot; the topic follows on."',
' word " regarding …"',
' description "English connective (regarding), space-wrapped before the slot; the topic follows regarding."',
' word " concerning …"',
' description "English connective (concerning), space-wrapped before the slot; the topic follows concerning."',
' word " for …"',
' description "English connective (for), the broadest marker so it is tried last; the topic follows for."',
' lexeme "ru"',
' word " о …"',
' description "Russian preposition (romanized o, about), space-wrapped before the slot; the topic follows."',
' word " об …"',
' description "Russian preposition (romanized ob, the variant before a vowel); the topic follows."',
' word " про …"',
' description "Russian preposition (romanized pro, about), space-wrapped before the slot; the topic follows."',
' word " по …"',
' description "Russian preposition (romanized po, on/about), space-wrapped before the slot; the topic follows."',
' word " насчет …"',
' description "Russian preposition (romanized naschet, regarding), space-wrapped before the slot; the topic follows."',
' word " относительно …"',
' description "Russian preposition (romanized otnositelno, concerning), space-wrapped before the slot; the topic follows."',
' lexeme "hi"',
' word "… के बारे में"',
' description "Hindi postposition (romanized ke baare mein, about) after the slot; the topic precedes it, so the text before के बारे में is the query."',
' word "… के विषय में"',
' description "Hindi postposition (romanized ke vishay mein, on the subject of) after the slot; the topic precedes it."',
' word "… से संबंधित"',
' description "Hindi postposition (romanized se sambandhit, related to) after the slot; the topic precedes it."',
' word "… पर"',
' description "Hindi postposition (romanized par, on) after the slot; the topic precedes it."',
' word "… की जानकारी"',
' description "Hindi postposition phrase (romanized ki jankari, information of) after the slot; the topic precedes it."',
' word "… की सूचना"',
' description "Hindi postposition phrase (romanized ki suchna, notice of) after the slot; the topic precedes it."',
' lexeme "zh"',
' word "关于…"',
' description "Chinese coverb (pinyin guanyu, about) before the slot; the topic follows."',
' word "關於…"',
' description "Chinese coverb (pinyin guanyu, about, traditional) before the slot; the topic follows."',
' word "有关…"',
' description "Chinese coverb (pinyin youguan, concerning) before the slot; the topic follows."',
' word "有關…"',
' description "Chinese coverb (pinyin youguan, concerning, traditional) before the slot; the topic follows."',
' meaning "query_leading_noise"',
' gloss "filler that precedes the real search topic and must be trimmed off its front — politeness, articles, quantifiers and information about lead-ins that are not part of the topic. As a leading-noise marker each surface is a prefix surface whose literal before the slot is stripped from the start of an extracted query; the recogniser strips repeatedly until the query stops changing, so the declared order does not matter. The Latin and Cyrillic forms keep their trailing space so they peel off a whole leading word, while the Han forms are bare. These overlap deliberately with the topic connectives ( о versus o ): here the marker sits at the very front of the query, so only a trailing boundary is needed."',
' wiktionary "please"',
' defined_by "concept"',
' role "web_search_query_leading_noise"',
' lexeme "en"',
' word "please …"',
' description "English politeness particle (please), stripped from the front of a query."',
' word "can you …"',
' description "English request frame (can you), stripped from the front of a query."',
' word "could you …"',
' description "English request frame (could you), stripped from the front of a query."',
' word "would you …"',
' description "English request frame (would you), stripped from the front of a query."',
' word "me …"',
' description "English object pronoun (me) left after show/give me, stripped from the front of a query."',
' word "the …"',
' description "English definite article (the), stripped from the front of a query."',
' word "some …"',
' description "English quantifier (some), stripped from the front of a query."',
' word "detailed …"',
' description "English adjective (detailed), stripped from the front of a query."',
' word "more …"',
' description "English quantifier (more), stripped from the front of a query."',
' word "current …"',
' description "English adjective (current), stripped from the front of a query."',
' word "latest …"',
' description "English adjective (latest), stripped from the front of a query."',
' word "information about …"',
' description "English lead-in (information about) left after a verb, stripped from the front of a query."',
' word "information on …"',
' description "English lead-in (information on), stripped from the front of a query."',
' word "info about …"',
' description "English lead-in (clipped info about), stripped from the front of a query."',
' word "info on …"',
' description "English lead-in (clipped info on), stripped from the front of a query."',
' word "details about …"',
' description "English lead-in (details about), stripped from the front of a query."',
' word "details on …"',
' description "English lead-in (details on), stripped from the front of a query."',
' word "data about …"',
' description "English lead-in (data about), stripped from the front of a query."',
' word "data on …"',
' description "English lead-in (data on), stripped from the front of a query."',
' lexeme "ru"',
' word "подробные …"',
' description "Russian adjective (romanized podrobnye, detailed), stripped from the front of a query."',
' word "информацию о …"',
' description "Russian lead-in (romanized informaciyu o, information about), stripped from the front of a query."',
' word "информацию об …"',
' description "Russian lead-in (romanized informaciyu ob, the ob variant before a vowel), stripped from the front of a query."',
' word "инфу о …"',
' description "Russian colloquial lead-in (romanized infu o, info about), stripped from the front of a query."',
' word "инфу об …"',
' description "Russian colloquial lead-in (romanized infu ob, the ob variant before a vowel), stripped from the front of a query."',
' word "сведения о …"',
' description "Russian lead-in (romanized svedeniya o, information about), stripped from the front of a query."',
' word "сведения об …"',
' description "Russian lead-in (romanized svedeniya ob, the ob variant before a vowel), stripped from the front of a query."',
' word "материалы о …"',
' description "Russian lead-in (romanized materialy o, materials about), stripped from the front of a query."',
' word "материалы об …"',
' description "Russian lead-in (romanized materialy ob, the ob variant before a vowel), stripped from the front of a query."',
' word "материалы по …"',
' description "Russian lead-in (romanized materialy po, materials on), stripped from the front of a query."',
' word "данные о …"',
' description "Russian lead-in (romanized dannye o, data about), stripped from the front of a query."',
' word "данные об …"',
' description "Russian lead-in (romanized dannye ob, the ob variant before a vowel), stripped from the front of a query."',
' word "о …"',
' description "Russian preposition (romanized o, about) at the very front, stripped from the front of a query."',
' word "об …"',
' description "Russian preposition (romanized ob, the variant before a vowel), stripped from the front of a query."',
' word "про …"',
' description "Russian preposition (romanized pro, about), stripped from the front of a query."',
' word "по …"',
' description "Russian preposition (romanized po, on/about), stripped from the front of a query."',
' lexeme "hi"',
' word "कृपया …"',
' description "Hindi politeness particle (romanized kripya, please), stripped from the front of a query."',
' word "जानकारी …"',
' description "Hindi noun (romanized jankari, information) lead-in, stripped from the front of a query."',
' word "सूचना …"',
' description "Hindi noun (romanized suchna, information) lead-in, stripped from the front of a query."',
' word "विवरण …"',
' description "Hindi noun (romanized vivaran, details) lead-in, stripped from the front of a query."',
' word "सामग्री …"',
' description "Hindi noun (romanized samagri, material) lead-in, stripped from the front of a query."',
' lexeme "zh"',
' word "关于…"',
' description "Chinese coverb (pinyin guanyu, about) at the front, stripped from the front of a query."',
' word "關於…"',
' description "Chinese coverb (pinyin guanyu, about, traditional), stripped from the front of a query."',
' word "有关…"',
' description "Chinese coverb (pinyin youguan, concerning), stripped from the front of a query."',
' word "有關…"',
' description "Chinese coverb (pinyin youguan, concerning, traditional), stripped from the front of a query."',
' meaning "query_trailing_noise"',
' gloss "filler that follows the real search topic and must be trimmed off its tail — trailing source phrases, qualifiers and stray search verbs that are not part of the topic ( online, on the internet, в интернете, के बारे में, 的信息). As a trailing-noise marker each surface is a suffix surface whose literal after the slot is stripped from the end of an extracted query; the recogniser strips repeatedly until the query stops changing, so the declared order does not matter. The Latin and Cyrillic forms keep their leading space so they peel off a whole trailing word, while the Han forms are bare."',
' wiktionary "online"',
' defined_by "concept"',
' role "web_search_query_trailing_noise"',
' lexeme "en"',
' word "… online"',
' description "English trailing adverb (online), stripped from the end of a query."',
' word "… on the internet"',
' description "English trailing phrase (on the internet), stripped from the end of a query."',
' word "… on the web"',
' description "English trailing phrase (on the web), stripped from the end of a query."',
' word "… on wikipedia"',
' description "English trailing phrase (on wikipedia), stripped from the end of a query."',
' word "… in wikipedia"',
' description "English trailing phrase (in wikipedia), stripped from the end of a query."',
' word "… from wikipedia"',
' description "English trailing phrase (from wikipedia), stripped from the end of a query."',
' word "… information"',
' description "English trailing noun (information), stripped from the end of a query."',
' word "… info"',
' description "English trailing noun (clipped info), stripped from the end of a query."',
' word "… details"',
' description "English trailing noun (details), stripped from the end of a query."',
' word "… data"',
' description "English trailing noun (data), stripped from the end of a query."',
' word "… material"',
' description "English trailing noun (material), stripped from the end of a query."',
' word "… materials"',
' description "English trailing noun (materials), stripped from the end of a query."',
' word "… resources"',
' description "English trailing noun (resources), stripped from the end of a query."',
' word "… sources"',
' description "English trailing noun (sources), stripped from the end of a query."',
' word "… articles"',
' description "English trailing noun (articles), stripped from the end of a query."',
' word "… facts"',
' description "English trailing noun (facts), stripped from the end of a query."',
' lexeme "ru"',
' word "… в интернете"',
' description "Russian trailing phrase (romanized v internete, on the internet), stripped from the end of a query."',
' word "… онлайн"',
' description "Russian trailing adverb (romanized onlain, online), stripped from the end of a query."',
' word "… в сети"',
' description "Russian trailing phrase (romanized v seti, on the net), stripped from the end of a query."',
' word "… в википедии"',
' description "Russian trailing phrase (romanized v wikipedii, in Wikipedia), stripped from the end of a query."',
' word "… википедии"',
' description "Russian trailing noun (romanized wikipedii, of Wikipedia), stripped from the end of a query."',
' word "… информация"',
' description "Russian trailing noun (romanized informaciya, information), stripped from the end of a query."',
' word "… сведения"',
' description "Russian trailing noun (romanized svedeniya, information), stripped from the end of a query."',
' word "… материалы"',
' description "Russian trailing noun (romanized materialy, materials), stripped from the end of a query."',
' word "… данные"',
' description "Russian trailing noun (romanized dannye, data), stripped from the end of a query."',
' lexeme "hi"',
' word "… के बारे में"',
' description "Hindi trailing postposition (romanized ke baare mein, about), stripped from the end of a query."',
' word "… के विषय में"',
' description "Hindi trailing postposition (romanized ke vishay mein, on the subject of), stripped from the end of a query."',
' word "… से संबंधित"',
' description "Hindi trailing postposition (romanized se sambandhit, related to), stripped from the end of a query."',
' word "… पर"',
' description "Hindi trailing postposition (romanized par, on), stripped from the end of a query."',
' word "… की जानकारी"',
' description "Hindi trailing phrase (romanized ki jankari, information of), stripped from the end of a query."',
' word "… की सूचना"',
' description "Hindi trailing phrase (romanized ki suchna, notice of), stripped from the end of a query."',
' word "… जानकारी"',
' description "Hindi trailing noun (romanized jankari, information), stripped from the end of a query."',
' word "… सूचना"',
' description "Hindi trailing noun (romanized suchna, information), stripped from the end of a query."',
' word "… विवरण"',
' description "Hindi trailing noun (romanized vivaran, details), stripped from the end of a query."',
' word "… सामग्री"',
' description "Hindi trailing noun (romanized samagri, material), stripped from the end of a query."',
' word "… स्रोत"',
' description "Hindi trailing noun (romanized srot, source), stripped from the end of a query."',
' word "… विकिपीडिया में"',
' description "Hindi trailing phrase (romanized vikipidiya mein, in Wikipedia), stripped from the end of a query."',
' word "… ऑनलाइन"',
' description "Hindi trailing adverb (romanized onlain, online), stripped from the end of a query."',
' word "… इंटरनेट पर"',
' description "Hindi trailing phrase (romanized internet par, on the internet), stripped from the end of a query."',
' word "… खोजो"',
' description "Hindi trailing imperative (romanized khojo, search), stripped from the end of a query."',
' word "… खोजें"',
' description "Hindi trailing imperative (romanized khojen, search), stripped from the end of a query."',
' word "… खोजिए"',
' description "Hindi trailing imperative (romanized khojie, search), stripped from the end of a query."',
' word "… ढूंढो"',
' description "Hindi trailing imperative (romanized dhundho, find), stripped from the end of a query."',
' word "… ढूँढो"',
' description "Hindi trailing imperative (romanized dhundho, nasalised), stripped from the end of a query."',
' word "… ढूंढें"',
' description "Hindi trailing imperative (romanized dhundhen, find), stripped from the end of a query."',
' word "… ढूँढें"',
' description "Hindi trailing imperative (romanized dhundhen, nasalised), stripped from the end of a query."',
' lexeme "zh"',
' word "…的信息"',
' description "Chinese trailing phrase (pinyin de xinxi, information of), stripped from the end of a query."',
' word "…的資料"',
' description "Chinese trailing phrase (pinyin de ziliao, data of, traditional), stripped from the end of a query."',
' word "…的资料"',
' description "Chinese trailing phrase (pinyin de ziliao, data of), stripped from the end of a query."',
' word "…信息"',
' description "Chinese trailing noun (pinyin xinxi, information), stripped from the end of a query."',
' word "…資料"',
' description "Chinese trailing noun (pinyin ziliao, data, traditional), stripped from the end of a query."',
' word "…资料"',
' description "Chinese trailing noun (pinyin ziliao, data), stripped from the end of a query."',
' word "…内容"',
' description "Chinese trailing noun (pinyin neirong, content), stripped from the end of a query."',
' word "…文章"',
' description "Chinese trailing noun (pinyin wenzhang, article), stripped from the end of a query."',
' word "…在维基百科上"',
' description "Chinese trailing phrase (pinyin zai weiji baike shang, on Wikipedia), stripped from the end of a query."',
' word "…在維基百科上"',
' description "Chinese trailing phrase (pinyin zai weiji baike shang, on Wikipedia, traditional), stripped from the end of a query."',
' word "…维基百科"',
' description "Chinese trailing noun (pinyin weiji baike, Wikipedia), stripped from the end of a query."',
' word "…維基百科"',
' description "Chinese trailing noun (pinyin weiji baike, Wikipedia, traditional), stripped from the end of a query."',
' word "…网上"',
' description "Chinese trailing phrase (pinyin wangshang, on the web), stripped from the end of a query."',
' word "…網上"',
' description "Chinese trailing phrase (pinyin wangshang, on the web, traditional), stripped from the end of a query."',
' word "…在线"',
' description "Chinese trailing adverb (pinyin zaixian, online), stripped from the end of a query."',
' word "…在線"',
' description "Chinese trailing adverb (pinyin zaixian, online, traditional), stripped from the end of a query."',
' word "…搜索"',
' description "Chinese trailing verb (pinyin sousuo, search), stripped from the end of a query."',
' word "…查找"',
' description "Chinese trailing verb (pinyin chazhao, look up), stripped from the end of a query."',
' word "…查一下"',
' description "Chinese trailing phrase (pinyin cha yixia, have a look), stripped from the end of a query."',
' word "…搜一下"',
' description "Chinese trailing phrase (pinyin sou yixia, have a search), stripped from the end of a query."',
"meanings",
' meaning "research_question_opener"',
' gloss "the interrogative opener that turns a bare question into an implicit research request — what is the X, who are the X, какой самый X, 什么是 X. It is the front trigger of the implicit-research path: when a prompt begins with one of these and also carries a superlative modifier or both an evidence and an evaluation domain, the opener is stripped and the remainder taken as the research query. Each surface is a prefix surface ending with the slot; the literal before the slot is what starts_with matches and strip removes. The longer, more specific openers are declared before the shorter ones (what is the before what is before what) so the most specific opener wins. English carries the original openers verbatim; Russian, Hindi and Chinese add their natural question heads so the concept is complete in every supported language."',
' wiktionary "what"',
' defined_by "inquiry"',
' role "research_question_opener"',
' lexeme "en"',
' word "what is the …"',
' description "English opener (what is the); strips to leave the questioned entity as the query."',
' word "what is a …"',
' description "English opener (what is a); strips to leave the questioned entity."',
' word "what is an …"',
' description "English opener (what is an); strips to leave the questioned entity."',
' word "what is …"',
' description "English opener (what is); broader than what is the, so declared after it."',
' word "what are the …"',
' description "English opener (what are the); plural form, strips to leave the questioned entities."',
' word "what are …"',
' description "English opener (what are); broader plural, declared after what are the."',
' word "what s the …"',
' description "English opener (what s the, the apostrophe-stripped what is the); strips to leave the entity."',
' word "what s a …"',
' description "English opener (what s a, apostrophe-stripped what is a); strips to leave the entity."',
' word "what s an …"',
' description "English opener (what s an, apostrophe-stripped what is an); strips to leave the entity."',
' word "what s …"',
' description "English opener (what s, apostrophe-stripped what is); broader, declared after the longer variants."',
' word "which is the …"',
' description "English opener (which is the); strips to leave the questioned choice."',
' word "which is a …"',
' description "English opener (which is a); strips to leave the questioned choice."',
' word "which is an …"',
' description "English opener (which is an); strips to leave the questioned choice."',
' word "which are the …"',
' description "English opener (which are the); plural, strips to leave the questioned choices."',
' word "which are …"',
' description "English opener (which are); broader plural, declared after which are the."',
' word "which …"',
' description "English opener (which); broadest of the which family, declared last."',
' word "who is the …"',
' description "English opener (who is the); strips to leave the questioned person."',
' word "who are the …"',
' description "English opener (who are the); plural, strips to leave the questioned people."',
' word "who …"',
' description "English opener (who); broadest of the who family, declared last."',
' word "where is the …"',
' description "English opener (where is the); strips to leave the questioned place."',
' word "where are the …"',
' description "English opener (where are the); plural, strips to leave the questioned places."',
' word "where …"',
' description "English opener (where); broadest of the where family, declared last."',
' word "when is the …"',
' description "English opener (when is the); strips to leave the questioned time."',
' word "when are the …"',
' description "English opener (when are the); plural, strips to leave the questioned times."',
' word "when …"',
' description "English opener (when); broadest of the when family, declared last."',
' word "why is the …"',
' description "English opener (why is the); strips to leave the questioned reason."',
' word "why are the …"',
' description "English opener (why are the); plural, strips to leave the questioned reasons."',
' word "why …"',
' description "English opener (why); broadest of the why family, declared last."',
' word "how is the …"',
' description "English opener (how is the); strips to leave the questioned manner."',
' word "how are the …"',
' description "English opener (how are the); plural, strips to leave the questioned manners."',
' word "how …"',
' description "English opener (how); broadest of the how family, declared last."',
' word "can you tell me …"',
' description "English polite opener (can you tell me); strips to leave the asked-about topic."',
' word "could you tell me …"',
' description "English polite opener (could you tell me); strips to leave the asked-about topic."',
' word "do you know …"',
' description "English polite opener (do you know); strips to leave the asked-about topic."',
' lexeme "ru"',
' word "что такое …"',
' description "Russian opener (romanized chto takoe, what is); strips to leave the questioned entity."',
' word "что за …"',
' description "Russian opener (romanized chto za, what kind of); strips to leave the questioned entity."',
' word "какие …"',
' description "Russian opener (romanized kakie, which/what plural); strips to leave the questioned entities."',
' word "какой …"',
' description "Russian opener (romanized kakoy, which masculine); strips to leave the questioned entity."',
' word "какая …"',
' description "Russian opener (romanized kakaya, which feminine); strips to leave the questioned entity."',
' word "какое …"',
' description "Russian opener (romanized kakoe, which neuter); strips to leave the questioned entity."',
' word "кто такой …"',
' description "Russian opener (romanized kto takoy, who is masculine); strips to leave the questioned person."',
' word "кто такая …"',
' description "Russian opener (romanized kto takaya, who is feminine); strips to leave the questioned person."',
' word "кто …"',
' description "Russian opener (romanized kto, who); broader, declared after the kto takoy variants."',
' word "где …"',
' description "Russian opener (romanized gde, where); strips to leave the questioned place."',
' word "когда …"',
' description "Russian opener (romanized kogda, when); strips to leave the questioned time."',
' word "почему …"',
' description "Russian opener (romanized pochemu, why); strips to leave the questioned reason."',
' word "зачем …"',
' description "Russian opener (romanized zachem, what for); strips to leave the questioned purpose."',
' word "как …"',
' description "Russian opener (romanized kak, how); strips to leave the questioned manner."',
' word "расскажи мне …"',
' description "Russian polite opener (romanized rasskazhi mne, tell me); strips to leave the asked-about topic."',
' word "ты знаешь …"',
' description "Russian polite opener (romanized ty znaesh, do you know); strips to leave the asked-about topic."',
' lexeme "hi"',
' word "क्या होता है …"',
' description "Hindi opener (romanized kya hota hai, what is); strips to leave the questioned entity."',
' word "क्या है …"',
' description "Hindi opener (romanized kya hai, what is); broader, declared after kya hota hai."',
' word "कौन है …"',
' description "Hindi opener (romanized kaun hai, who is); strips to leave the questioned person."',
' word "कौन …"',
' description "Hindi opener (romanized kaun, who); broader, declared after kaun hai."',
' word "कहाँ है …"',
' description "Hindi opener (romanized kahan hai, where is); strips to leave the questioned place."',
' word "कहाँ …"',
' description "Hindi opener (romanized kahan, where); broader, declared after kahan hai."',
' word "कब …"',
' description "Hindi opener (romanized kab, when); strips to leave the questioned time."',
' word "क्यों …"',
' description "Hindi opener (romanized kyon, why); strips to leave the questioned reason."',
' word "कैसे …"',
' description "Hindi opener (romanized kaise, how); strips to leave the questioned manner."',
' word "बताओ …"',
' description "Hindi polite opener (romanized batao, tell me); strips to leave the asked-about topic."',
' lexeme "zh"',
' word "什么是…"',
' description "Chinese opener (pinyin shenme shi, what is); strips to leave the questioned entity."',
' word "谁是…"',
' description "Chinese opener (pinyin shei shi, who is); strips to leave the questioned person."',
' word "哪里是…"',
' description "Chinese opener (pinyin nali shi, where is); strips to leave the questioned place."',
' word "哪里…"',
' description "Chinese opener (pinyin nali, where); broader, declared after nali shi."',
' word "哪个…"',
' description "Chinese opener (pinyin nage, which); strips to leave the questioned choice."',
' word "什么时候…"',
' description "Chinese opener (pinyin shenme shihou, when); strips to leave the questioned time."',
' word "为什么…"',
' description "Chinese opener (pinyin weishenme, why); strips to leave the questioned reason."',
' word "怎么…"',
' description "Chinese opener (pinyin zenme, how); strips to leave the questioned manner."',
' word "如何…"',
' description "Chinese opener (pinyin ruhe, how, formal); strips to leave the questioned manner."',
' word "告诉我…"',
' description "Chinese polite opener (pinyin gaosu wo, tell me); strips to leave the asked-about topic."',
' word "你知道…"',
' description "Chinese polite opener (pinyin ni zhidao, do you know); strips to leave the asked-about topic."',
' meaning "research_superlative_modifier"',
' gloss "a superlative or recommendation qualifier whose presence marks a question as a research request — the most X, the best X, the recommended X. As a modifier each surface is a whole-token marker: the space-delimited languages keep their surrounding spaces so the match lands on a whole word inside the padded prompt, while the Han forms are bare and match as a substring. Finding any one modifier (together with a research opener) is enough to route the prompt down the implicit-research path. English carries the original modifiers verbatim; Russian, Hindi and Chinese add their natural superlatives so the concept is complete in every supported language."',
' wiktionary "most"',
' defined_by "property"',
' role "research_superlative_modifier"',
' lexeme "en"',
' word " most "',
' description "English superlative degree (most); whole-token modifier marking a research question."',
' word " best "',
' description "English superlative (best); whole-token modifier marking a research question."',
' word " top "',
' description "English superlative (top); whole-token modifier marking a research question."',
' word " leading "',
' description "English qualifier (leading); whole-token modifier marking a research question."',
' word " standard "',
' description "English qualifier (standard); whole-token modifier marking a research question."',
' word " de facto "',
' description "English qualifier (de facto); whole-token modifier marking a research question."',
' word " widely used "',
' description "English qualifier (widely used); whole-token modifier marking a research question."',
' word " commonly used "',
' description "English qualifier (commonly used); whole-token modifier marking a research question."',
' word " popular "',
' description "English qualifier (popular); whole-token modifier marking a research question."',
' word " recommended "',
' description "English qualifier (recommended); whole-token modifier marking a research question."',
' word " current "',
' description "English qualifier (current); whole-token modifier marking a research question."',
' word " latest "',
' description "English qualifier (latest); whole-token modifier marking a research question."',
' word " recent "',
' description "English qualifier (recent); whole-token modifier marking a research question."',
' word " state of the art "',
' description "English qualifier (state of the art); whole-token modifier marking a research question."',
' word " sota "',
' description "English qualifier (sota, the state-of-the-art acronym); whole-token modifier marking a research question."',
' word " should i use "',
' description "English recommendation frame (should i use); whole-token modifier marking a research question."',
' word " should we use "',
' description "English recommendation frame (should we use); whole-token modifier marking a research question."',
' word " should be used "',
' description "English recommendation frame (should be used); whole-token modifier marking a research question."',
' lexeme "ru"',
' word " лучший "',
' description "Russian superlative (romanized luchshiy, best masculine); whole-token modifier marking a research question."',
' word " лучшая "',
' description "Russian superlative (romanized luchshaya, best feminine); whole-token modifier marking a research question."',
' word " лучшие "',
' description "Russian superlative (romanized luchshie, best plural); whole-token modifier marking a research question."',
' word " самый "',
' description "Russian intensifier (romanized samyy, the most); whole-token modifier marking a research question."',
' word " самые "',
' description "Russian intensifier (romanized samye, the most plural); whole-token modifier marking a research question."',
' word " топ "',
' description "Russian qualifier (romanized top, top); whole-token modifier marking a research question."',
' word " ведущий "',
' description "Russian qualifier (romanized vedushchiy, leading); whole-token modifier marking a research question."',
' word " популярный "',
' description "Russian qualifier (romanized populyarnyy, popular); whole-token modifier marking a research question."',
' word " стандартный "',
' description "Russian qualifier (romanized standartnyy, standard); whole-token modifier marking a research question."',
' word " рекомендуемый "',
' description "Russian qualifier (romanized rekomenduemyy, recommended); whole-token modifier marking a research question."',
' word " текущий "',
' description "Russian qualifier (romanized tekushchiy, current); whole-token modifier marking a research question."',
' word " последний "',
' description "Russian qualifier (romanized posledniy, latest); whole-token modifier marking a research question."',
' word " недавний "',
' description "Russian qualifier (romanized nedavniy, recent); whole-token modifier marking a research question."',
' lexeme "hi"',
' word " सबसे अच्छा "',
' description "Hindi superlative (romanized sabse achchha, the best); whole-token modifier marking a research question."',
' word " सर्वश्रेष्ठ "',
' description "Hindi superlative (romanized sarvashreshth, the best); whole-token modifier marking a research question."',
' word " शीर्ष "',
' description "Hindi qualifier (romanized shirsh, top); whole-token modifier marking a research question."',
' word " प्रमुख "',
' description "Hindi qualifier (romanized pramukh, leading); whole-token modifier marking a research question."',
' word " मानक "',
' description "Hindi qualifier (romanized manak, standard); whole-token modifier marking a research question."',
' word " लोकप्रिय "',
' description "Hindi qualifier (romanized lokpriy, popular); whole-token modifier marking a research question."',
' word " अनुशंसित "',
' description "Hindi qualifier (romanized anushansit, recommended); whole-token modifier marking a research question."',
' word " वर्तमान "',
' description "Hindi qualifier (romanized vartaman, current); whole-token modifier marking a research question."',
' word " नवीनतम "',
' description "Hindi qualifier (romanized navintam, latest); whole-token modifier marking a research question."',
' word " हाल ही का "',
' description "Hindi qualifier (romanized haal hi ka, recent); whole-token modifier marking a research question."',
' lexeme "zh"',
' word "最好"',
' description "Chinese superlative (pinyin zui hao, best); substring modifier marking a research question."',
' word "最佳"',
' description "Chinese superlative (pinyin zui jia, best/optimal); substring modifier marking a research question."',
' word "顶级"',
' description "Chinese qualifier (pinyin dingji, top-tier); substring modifier marking a research question."',
' word "领先"',
' description "Chinese qualifier (pinyin lingxian, leading); substring modifier marking a research question."',
' word "标准"',
' description "Chinese qualifier (pinyin biaozhun, standard); substring modifier marking a research question."',
' word "流行"',
' description "Chinese qualifier (pinyin liuxing, popular); substring modifier marking a research question."',
' word "推荐"',
' description "Chinese qualifier (pinyin tuijian, recommended); substring modifier marking a research question."',
' word "当前"',
' description "Chinese qualifier (pinyin dangqian, current); substring modifier marking a research question."',
' word "最新"',
' description "Chinese qualifier (pinyin zui xin, latest); substring modifier marking a research question."',
' word "最近"',
' description "Chinese qualifier (pinyin zui jin, recent); substring modifier marking a research question."',
' meaning "research_evidence_domain"',
' gloss "an evidence-bearing domain noun whose presence helps mark a question as a research request — a dataset, a benchmark, a paper, a study. Evidence terms count toward the implicit-research gate only in concert with an evaluation term (the two together stand in for a superlative modifier). As a domain term each surface is a whole-token marker: the space-delimited languages keep their surrounding spaces, while the Han forms are bare and match as a substring. English carries the original evidence terms verbatim; Russian, Hindi and Chinese add their natural equivalents so the concept is complete in every supported language."',
' wiktionary "dataset"',
' defined_by "entity"',
' role "research_evidence_domain"',
' lexeme "en"',
' word " dataset "',
' description "English evidence noun (dataset, singular); whole-token domain term for research routing."',
' word " datasets "',
' description "English evidence noun (datasets, plural); whole-token domain term for research routing."',
' word " benchmark "',
' description "English evidence noun (benchmark, singular); whole-token domain term for research routing."',
' word " benchmarks "',
' description "English evidence noun (benchmarks, plural); whole-token domain term for research routing."',
' word " corpus "',
' description "English evidence noun (corpus, singular); whole-token domain term for research routing."',
' word " corpora "',
' description "English evidence noun (corpora, plural); whole-token domain term for research routing."',
' word " metric "',
' description "English evidence noun (metric, singular); whole-token domain term for research routing."',
' word " metrics "',
' description "English evidence noun (metrics, plural); whole-token domain term for research routing."',
' word " framework "',
' description "English evidence noun (framework, singular); whole-token domain term for research routing."',
' word " frameworks "',
' description "English evidence noun (frameworks, plural); whole-token domain term for research routing."',
' word " paper "',
' description "English evidence noun (paper, singular); whole-token domain term for research routing."',
' word " papers "',
' description "English evidence noun (papers, plural); whole-token domain term for research routing."',
' word " study "',
' description "English evidence noun (study, singular); whole-token domain term for research routing."',
' word " studies "',
' description "English evidence noun (studies, plural); whole-token domain term for research routing."',
' lexeme "ru"',
' word " датасет "',
' description "Russian evidence noun (romanized datatset, dataset); whole-token domain term for research routing."',
' word " набор данных "',
' description "Russian evidence phrase (romanized nabor dannyh, data set); whole-token domain term for research routing."',
' word " бенчмарк "',
' description "Russian evidence noun (romanized benchmark, benchmark); whole-token domain term for research routing."',
' word " корпус "',
' description "Russian evidence noun (romanized korpus, corpus); whole-token domain term for research routing."',
' word " метрика "',
' description "Russian evidence noun (romanized metrika, metric); whole-token domain term for research routing."',
' word " фреймворк "',
' description "Russian evidence noun (romanized freymvork, framework); whole-token domain term for research routing."',
' word " статья "',
' description "Russian evidence noun (romanized statya, paper/article); whole-token domain term for research routing."',
' word " исследование "',
' description "Russian evidence noun (romanized issledovanie, study); whole-token domain term for research routing."',
' lexeme "hi"',
' word " डेटासेट "',
' description "Hindi evidence noun (romanized detaset, dataset); whole-token domain term for research routing."',
' word " बेंचमार्क "',
' description "Hindi evidence noun (romanized benchmark, benchmark); whole-token domain term for research routing."',
' word " कॉर्पस "',
' description "Hindi evidence noun (romanized korpas, corpus); whole-token domain term for research routing."',
' word " मीट्रिक "',
' description "Hindi evidence noun (romanized mitrik, metric); whole-token domain term for research routing."',
' word " फ्रेमवर्क "',
' description "Hindi evidence noun (romanized phremvark, framework); whole-token domain term for research routing."',
' word " पेपर "',
' description "Hindi evidence noun (romanized pepar, paper); whole-token domain term for research routing."',
' word " अध्ययन "',
' description "Hindi evidence noun (romanized adhyayan, study); whole-token domain term for research routing."',
' lexeme "zh"',
' word "数据集"',
' description "Chinese evidence noun (pinyin shujuji, dataset); substring domain term for research routing."',
' word "基准"',
' description "Chinese evidence noun (pinyin jizhun, benchmark); substring domain term for research routing."',
' word "语料库"',
' description "Chinese evidence noun (pinyin yuliaoku, corpus); substring domain term for research routing."',
' word "指标"',
' description "Chinese evidence noun (pinyin zhibiao, metric); substring domain term for research routing."',
' word "框架"',
' description "Chinese evidence noun (pinyin kuangjia, framework); substring domain term for research routing."',
' word "论文"',
' description "Chinese evidence noun (pinyin lunwen, paper); substring domain term for research routing."',
' word "研究"',
' description "Chinese evidence noun (pinyin yanjiu, study); substring domain term for research routing."',
' meaning "research_evaluation_domain"',
' gloss "an evaluation domain term whose presence helps mark a question as a research request — evaluation, validation, quality, comparison. Evaluation terms count toward the implicit-research gate only in concert with an evidence term (the two together stand in for a superlative modifier). As a domain term each surface is a whole-token marker: the space-delimited languages keep their surrounding spaces, while the Han forms are bare and match as a substring. English carries the original evaluation terms verbatim; Russian, Hindi and Chinese add their natural equivalents so the concept is complete in every supported language."',
' wiktionary "evaluation"',
' defined_by "concept"',
' role "research_evaluation_domain"',
' lexeme "en"',
' word " evaluation "',
' description "English evaluation noun (evaluation); whole-token domain term for research routing."',
' word " evaluate "',
' description "English evaluation verb (evaluate); whole-token domain term for research routing."',
' word " validation "',
' description "English evaluation noun (validation); whole-token domain term for research routing."',
' word " validate "',
' description "English evaluation verb (validate); whole-token domain term for research routing."',
' word " quality "',
' description "English evaluation noun (quality); whole-token domain term for research routing."',
' word " translation "',
' description "English evaluation noun (translation); whole-token domain term for research routing."',
' word " compare "',
' description "English evaluation verb (compare); whole-token domain term for research routing."',
' word " comparison "',
' description "English evaluation noun (comparison); whole-token domain term for research routing."',
' lexeme "ru"',
' word " оценка "',
' description "Russian evaluation noun (romanized otsenka, evaluation); whole-token domain term for research routing."',
' word " оценить "',
' description "Russian evaluation verb (romanized otsenit, to evaluate); whole-token domain term for research routing."',
' word " валидация "',
' description "Russian evaluation noun (romanized validatsiya, validation); whole-token domain term for research routing."',
' word " проверка "',
' description "Russian evaluation noun (romanized proverka, verification); whole-token domain term for research routing."',
' word " качество "',
' description "Russian evaluation noun (romanized kachestvo, quality); whole-token domain term for research routing."',
' word " перевод "',
' description "Russian evaluation noun (romanized perevod, translation); whole-token domain term for research routing."',
' word " сравнить "',
' description "Russian evaluation verb (romanized sravnit, to compare); whole-token domain term for research routing."',
' word " сравнение "',
' description "Russian evaluation noun (romanized sravnenie, comparison); whole-token domain term for research routing."',
' lexeme "hi"',
' word " मूल्यांकन "',
' description "Hindi evaluation noun (romanized mulyankan, evaluation); whole-token domain term for research routing."',
' word " सत्यापन "',
' description "Hindi evaluation noun (romanized satyapan, validation); whole-token domain term for research routing."',
' word " गुणवत्ता "',
' description "Hindi evaluation noun (romanized gunavatta, quality); whole-token domain term for research routing."',
' word " अनुवाद "',
' description "Hindi evaluation noun (romanized anuvad, translation); whole-token domain term for research routing."',
' word " तुलना "',
' description "Hindi evaluation noun (romanized tulna, comparison); whole-token domain term for research routing."',
' lexeme "zh"',
' word "评估"',
' description "Chinese evaluation noun (pinyin pinggu, evaluation); substring domain term for research routing."',
' word "评价"',
' description "Chinese evaluation noun (pinyin pingjia, appraisal); substring domain term for research routing."',
' word "验证"',
' description "Chinese evaluation noun (pinyin yanzheng, validation); substring domain term for research routing."',
' word "质量"',
' description "Chinese evaluation noun (pinyin zhiliang, quality); substring domain term for research routing."',
' word "翻译"',
' description "Chinese evaluation noun (pinyin fanyi, translation); substring domain term for research routing."',
' word "比较"',
' description "Chinese evaluation verb (pinyin bijiao, compare); substring domain term for research routing."',
' meaning "enumeration_request_opener"',
' gloss "the opener of an enumeration request — list all X, show me the X, перечисли всех X, 列出所有 X. It is the front trigger of the enumeration path: when a prompt begins with one of these and the remainder is at least three words long and carries a constraint marker, the opener is stripped and the remainder taken as the enumeration query. Each surface is a prefix surface; the literal before the slot is what strip removes, and it keeps its trailing separator (a space for the space-delimited languages, including the Han forms whose original surfaces carry a trailing space). This concept already spans all four supported languages."',
' wiktionary "list"',
' defined_by "inquiry"',
' defined_by "action"',
' role "enumeration_request_opener"',
' lexeme "en"',
' word "list all …"',
' description "English enumeration opener (list all); strips to leave the enumerated class."',
' word "list every …"',
' description "English enumeration opener (list every); strips to leave the enumerated class."',
' word "list the …"',
' description "English enumeration opener (list the); strips to leave the enumerated class."',
' word "show all …"',
' description "English enumeration opener (show all); strips to leave the enumerated class."',
' word "show me all …"',
' description "English enumeration opener (show me all); strips to leave the enumerated class."',
' word "show me the …"',
' description "English enumeration opener (show me the); strips to leave the enumerated class."',
' word "give me all …"',
' description "English enumeration opener (give me all); strips to leave the enumerated class."',
' word "name all …"',
' description "English enumeration opener (name all); strips to leave the enumerated class."',
' word "enumerate all …"',
' description "English enumeration opener (enumerate all); strips to leave the enumerated class."',
' lexeme "ru"',
' word "перечисли всех …"',
' description "Russian enumeration opener (romanized perechisli vseh, list all animate); strips to leave the enumerated class."',
' word "перечисли все …"',
' description "Russian enumeration opener (romanized perechisli vse, list all inanimate); strips to leave the enumerated class."',
' word "список всех …"',
' description "Russian enumeration opener (romanized spisok vseh, a list of all); strips to leave the enumerated class."',
' word "назови всех …"',
' description "Russian enumeration opener (romanized nazovi vseh, name all); strips to leave the enumerated class."',
' lexeme "hi"',
' word "सभी …"',
' description "Hindi enumeration opener (romanized sabhi, all); strips to leave the enumerated class."',
' word "हर …"',
' description "Hindi enumeration opener (romanized har, every); strips to leave the enumerated class."',
' lexeme "zh"',
' word "列出所有 …"',
' description "Chinese enumeration opener (pinyin liechu suoyou, list all), keeping the original trailing space; strips to leave the enumerated class."',
' word "列出全部 …"',
' description "Chinese enumeration opener (pinyin liechu quanbu, list every), keeping the original trailing space; strips to leave the enumerated class."',
' word "显示所有 …"',
' description "Chinese enumeration opener (pinyin xianshi suoyou, show all), keeping the original trailing space; strips to leave the enumerated class."',
' word "枚举所有 …"',
' description "Chinese enumeration opener (pinyin meiju suoyou, enumerate all), keeping the original trailing space; strips to leave the enumerated class."',
' meaning "enumeration_constraint"',
' gloss "a constraint connective that filters an enumerated class — list all X with Y, that Y, у которых Y, 具有 Y. Its presence (together with a query of at least three words) confirms that a stripped enumeration prompt is a real enumeration request rather than a stray fragment. As a constraint each surface is a whole-token marker keeping its surrounding spaces, including the Han forms whose original surfaces are space-wrapped. This concept already spans all four supported languages."',
' wiktionary "with"',
' defined_by "relation"',
' role "enumeration_constraint"',
' lexeme "en"',
' word " with "',
' description "English constraint connective (with); whole-token marker confirming an enumeration query."',
' word " that "',
' description "English constraint connective (that); whole-token marker confirming an enumeration query."',
' word " who "',
' description "English constraint connective (who); whole-token marker confirming an enumeration query."',
' word " whose "',
' description "English constraint connective (whose); whole-token marker confirming an enumeration query."',
' word " where "',
' description "English constraint connective (where); whole-token marker confirming an enumeration query."',
' word " which "',
' description "English constraint connective (which); whole-token marker confirming an enumeration query."',
' word " having "',
' description "English constraint connective (having); whole-token marker confirming an enumeration query."',
' word " have "',
' description "English constraint connective (have); whole-token marker confirming an enumeration query."',
' word " has "',
' description "English constraint connective (has); whole-token marker confirming an enumeration query."',
' word " featuring "',
' description "English constraint connective (featuring); whole-token marker confirming an enumeration query."',
' word " capable of "',
' description "English constraint connective (capable of); whole-token marker confirming an enumeration query."',
' word " can "',
' description "English constraint connective (can); whole-token marker confirming an enumeration query."',
' word " for "',
' description "English constraint connective (for); whole-token marker confirming an enumeration query."',
' word " by "',
' description "English constraint connective (by); whole-token marker confirming an enumeration query."',
' word " in "',
' description "English constraint connective (in); whole-token marker confirming an enumeration query."',
' lexeme "ru"',
' word " с "',
' description "Russian constraint connective (romanized s, with); whole-token marker confirming an enumeration query."',
' word " у которых "',
' description "Russian constraint connective (romanized u kotoryh, which have); whole-token marker confirming an enumeration query."',
' word " которые "',
' description "Russian constraint connective (romanized kotorye, which); whole-token marker confirming an enumeration query."',
' word " имеющие "',
' description "Russian constraint connective (romanized imeyushchie, having nominative); whole-token marker confirming an enumeration query."',
' word " имеющих "',
' description "Russian constraint connective (romanized imeyushchih, having genitive); whole-token marker confirming an enumeration query."',
' word " для "',
' description "Russian constraint connective (romanized dlya, for); whole-token marker confirming an enumeration query."',
' word " в "',
' description "Russian constraint connective (romanized v, in); whole-token marker confirming an enumeration query."',
' lexeme "hi"',
' word " जिनके "',
' description "Hindi constraint connective (romanized jinke, whose plural); whole-token marker confirming an enumeration query."',
' word " जिनमें "',
' description "Hindi constraint connective (romanized jinmein, in which plural); whole-token marker confirming an enumeration query."',
' word " जिसमें "',
' description "Hindi constraint connective (romanized jismein, in which singular); whole-token marker confirming an enumeration query."',
' word " वाले "',
' description "Hindi constraint connective (romanized vale, the ones with); whole-token marker confirming an enumeration query."',
' word " के साथ "',
' description "Hindi constraint connective (romanized ke saath, with); whole-token marker confirming an enumeration query."',
' word " के लिए "',
' description "Hindi constraint connective (romanized ke liye, for); whole-token marker confirming an enumeration query."',
' word " में "',
' description "Hindi constraint connective (romanized mein, in); whole-token marker confirming an enumeration query."',
' lexeme "zh"',
' word " 具有 "',
' description "Chinese constraint connective (pinyin juyou, possessing), kept space-wrapped as in the original; whole-token marker confirming an enumeration query."',
' word " 有 "',
' description "Chinese constraint connective (pinyin you, have), kept space-wrapped as in the original; whole-token marker confirming an enumeration query."',
' word " 带有 "',
' description "Chinese constraint connective (pinyin daiyou, featuring), kept space-wrapped as in the original; whole-token marker confirming an enumeration query."',
' word " 可以 "',
' description "Chinese constraint connective (pinyin keyi, can), kept space-wrapped as in the original; whole-token marker confirming an enumeration query."',
' word " 能 "',
' description "Chinese constraint connective (pinyin neng, able to), kept space-wrapped as in the original; whole-token marker confirming an enumeration query."',
' word " 在 "',
' description "Chinese constraint connective (pinyin zai, in), kept space-wrapped as in the original; whole-token marker confirming an enumeration query."',
' word " 用于 "',
' description "Chinese constraint connective (pinyin yongyu, used for), kept space-wrapped as in the original; whole-token marker confirming an enumeration query."',
"meanings",
' meaning "followup_instruction_verb"',
' gloss "the predicate of a follow-up instruction clause appended after a search query — compare X, summarize Y, explain Z. When a prompt reads search for X and then compare their sizes, the trailing compare their sizes is a directive about what to do with the results, not part of the search topic, so the recogniser truncates the query at the start of that clause. A clause counts as a follow-up only when one of these verbs is immediately preceded by a boundary: sentence punctuation (a period, question mark, exclamation mark, semicolon or colon — universal across languages) or a clause continuation marker (and, then, and their translations). A bare verb with no boundary before it is treated as part of the topic and left alone. Each surface is a bare verb token matched on a word boundary, so it fires whether the clause ends the prompt or runs on. English carries the original follow-up verbs (compare, summarize, summarise, explain, describe) plus show and tell to match the browser worker; Russian, Hindi and Chinese add their natural imperative equivalents so follow-up clauses are recognised in every supported language."',
' wiktionary "compare"',
' defined_by "action"',
' role "followup_instruction_verb"',
' lexeme "en"',
' word "compare"',
' description "English follow-up verb (compare); after a boundary it opens a directive to contrast the results, so the query is cut before it."',
' word "summarize"',
' description "English follow-up verb (summarize, American spelling); after a boundary it opens a directive to condense the results, so the query is cut before it."',
' word "summarise"',
' description "English follow-up verb (summarise, British spelling); after a boundary it opens a directive to condense the results, so the query is cut before it."',
' word "explain"',
' description "English follow-up verb (explain); after a boundary it opens a directive to elaborate on the results, so the query is cut before it."',
' word "describe"',
' description "English follow-up verb (describe); after a boundary it opens a directive to characterise the results, so the query is cut before it."',
' word "show"',
' description "English follow-up verb (show), matched to mirror the browser worker; after a boundary it opens a directive to display the results, so the query is cut before it."',
' word "tell"',
' description "English follow-up verb (tell), matched to mirror the browser worker; after a boundary it opens a directive to report the results, so the query is cut before it."',
' lexeme "ru"',
' word "сравни"',
' description "Russian follow-up verb (romanized sravni, compare imperative); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "обобщи"',
' description "Russian follow-up verb (romanized obobshchi, summarize imperative); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "резюмируй"',
' description "Russian follow-up verb (romanized rezyumiruy, summarize imperative); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "объясни"',
' description "Russian follow-up verb (romanized obyasni, explain imperative); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "опиши"',
' description "Russian follow-up verb (romanized opishi, describe imperative); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "покажи"',
' description "Russian follow-up verb (romanized pokazhi, show imperative); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "расскажи"',
' description "Russian follow-up verb (romanized rasskazhi, tell imperative); after a boundary it opens a directive about the results, so the query is cut before it."',
' lexeme "hi"',
' word "तुलना करो"',
' description "Hindi follow-up verb (romanized tulna karo, compare); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "सारांश दो"',
' description "Hindi follow-up verb (romanized saaraansh do, give a summary); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "समझाओ"',
' description "Hindi follow-up verb (romanized samjhao, explain); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "वर्णन करो"',
' description "Hindi follow-up verb (romanized varnan karo, describe); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "दिखाओ"',
' description "Hindi follow-up verb (romanized dikhao, show); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "बताओ"',
' description "Hindi follow-up verb (romanized batao, tell); after a boundary it opens a directive about the results, so the query is cut before it."',
' lexeme "zh"',
' word "比较"',
' description "Chinese follow-up verb (pinyin bijiao, compare); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "总结"',
' description "Chinese follow-up verb (pinyin zongjie, summarize); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "概括"',
' description "Chinese follow-up verb (pinyin gaikuo, summarize/generalize); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "解释"',
' description "Chinese follow-up verb (pinyin jieshi, explain); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "描述"',
' description "Chinese follow-up verb (pinyin miaoshu, describe); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "显示"',
' description "Chinese follow-up verb (pinyin xianshi, show); after a boundary it opens a directive about the results, so the query is cut before it."',
' word "告诉"',
' description "Chinese follow-up verb (pinyin gaosu, tell); after a boundary it opens a directive about the results, so the query is cut before it."',
' meaning "clause_continuation_marker"',
' gloss "a conjunction or sequencing adverb that can introduce a new clause — and, then, and then. Together with sentence punctuation it forms the set of boundaries that mark where a follow-up instruction clause begins: a followup_instruction_verb counts as a follow-up directive (and triggers query truncation) only when one of these markers, or a punctuation mark, sits immediately before it. Because and and then are both modelled here, the compound and then is recognised by walking back over consecutive markers — no compound surface needs to be stored. Each surface is a bare token. English carries and and then; Russian, Hindi and Chinese add their natural coordinating and sequencing words so clause boundaries are recognised in every supported language."',
' wiktionary "and"',
' defined_by "relation"',
' role "clause_continuation_marker"',
' lexeme "en"',
' word "and"',
' description "English coordinating conjunction (and); a clause boundary that can introduce a follow-up instruction."',
' word "then"',
' description "English sequencing adverb (then); a clause boundary that can introduce a follow-up instruction, including the compound and then."',
' lexeme "ru"',
' word "и"',
' description "Russian coordinating conjunction (romanized i, and); a clause boundary that can introduce a follow-up instruction."',
' word "затем"',
' description "Russian sequencing adverb (romanized zatem, then); a clause boundary that can introduce a follow-up instruction."',
' word "потом"',
' description "Russian sequencing adverb (romanized potom, afterwards); a clause boundary that can introduce a follow-up instruction."',
' lexeme "hi"',
' word "और"',
' description "Hindi coordinating conjunction (romanized aur, and); a clause boundary that can introduce a follow-up instruction."',
' word "फिर"',
' description "Hindi sequencing adverb (romanized phir, then); a clause boundary that can introduce a follow-up instruction."',
' word "तब"',
' description "Hindi sequencing adverb (romanized tab, then); a clause boundary that can introduce a follow-up instruction."',
' lexeme "zh"',
' word "并"',
' description "Chinese coordinating conjunction (pinyin bing, and/also); a clause boundary that can introduce a follow-up instruction."',
' word "然后"',
' description "Chinese sequencing adverb (pinyin ranhou, then); a clause boundary that can introduce a follow-up instruction."',
' word "接着"',
' description "Chinese sequencing adverb (pinyin jiezhe, next); a clause boundary that can introduce a follow-up instruction."',
"meanings",
' meaning "human_language"',
" gloss \"a natural human language — the kind of system a translation request names as its source or its target. It is the genus the four supported languages specialise: each language meaning is defined_by it, so the recogniser reads a marker's language by walking the marker's defined_by edges down to one of these language meanings. The ISO 639-1 code itself (en, ru, hi, zh) is an identifier fixed in code, not a surface word; what lives here is how each language is named, in every supported language.\"",
' wiktionary "language"',
' defined_by "concept"',
' role "translation_language_genus"',
' lexeme "en"',
' word "language"',
' description "English noun (language) naming the genus of natural human languages a translation runs between."',
' lexeme "ru"',
' word "язык"',
' description "Russian noun (romanized yazyk, language) naming the genus of natural human languages."',
' lexeme "hi"',
' word "भाषा"',
' description "Hindi noun (romanized bhasha, language) naming the genus of natural human languages."',
' lexeme "zh"',
' word "语言"',
' description "Chinese noun (pinyin yuyan, language) naming the genus of natural human languages."',
' meaning "language_english"',
" gloss \"the English language — one of the four supported translation languages, ISO 639-1 code en. The code is fixed in the handler; this meaning records how English is named across the supported languages and is the language building block the from-English and into-English markers are defined_by, so detection resolves their language by reaching this meaning's slug.\"",
' wiktionary "English"',
' defined_by "human_language"',
' role "translation_language"',
' lexeme "en"',
' word "english"',
' description "English name of the English language (lowercased), code en."',
' lexeme "ru"',
' word "английский"',
' description "Russian name of English (romanized angliyskiy), code en."',
' lexeme "hi"',
' word "अंग्रेज़ी"',
' description "Hindi name of English (romanized angrezi, with nuqta), code en."',
' word "अंग्रेजी"',
' description "Hindi name of English (romanized angrezi, without nuqta), code en."',
' lexeme "zh"',
' word "英语"',
' description "Chinese name of English (pinyin yingyu), code en."',
' word "英文"',
' description "Chinese name of English (pinyin yingwen, the written-language variant), code en."',
' meaning "language_russian"',
' gloss "the Russian language — one of the four supported translation languages, ISO 639-1 code ru. The code is fixed in the handler; this meaning records how Russian is named across the supported languages and is the language building block the from-Russian and into-Russian markers are defined_by."',
' wiktionary "Russian"',
' defined_by "human_language"',
' role "translation_language"',
' lexeme "en"',
' word "russian"',
' description "English name of the Russian language (lowercased), code ru."',
' lexeme "ru"',
' word "русский"',
' description "Russian name of Russian (romanized russkiy), code ru."',
' lexeme "hi"',
' word "रूसी"',
' description "Hindi name of Russian (romanized rusi), code ru."',
' lexeme "zh"',
' word "俄语"',
' description "Chinese name of Russian (pinyin eyu), code ru."',
' meaning "language_hindi"',
' gloss "the Hindi language — one of the four supported translation languages, ISO 639-1 code hi. The code is fixed in the handler; this meaning records how Hindi is named across the supported languages and is the language building block the from-Hindi and into-Hindi markers are defined_by."',
' wiktionary "Hindi"',
' defined_by "human_language"',
' role "translation_language"',
' lexeme "en"',
' word "hindi"',
' description "English name of the Hindi language (lowercased), code hi."',
' lexeme "ru"',
' word "хинди"',
' description "Russian name of Hindi (romanized khindi), code hi."',
' lexeme "hi"',
' word "हिंदी"',
' description "Hindi name of Hindi (romanized hindi, anusvara spelling), code hi."',
' word "हिन्दी"',
' description "Hindi name of Hindi (romanized hindi, conjunct spelling), code hi."',
' lexeme "zh"',
' word "印地语"',
' description "Chinese name of Hindi (pinyin yindiyu), code hi."',
' meaning "language_chinese"',
' gloss "the Chinese language — one of the four supported translation languages, ISO 639-1 code zh. The code is fixed in the handler; this meaning records how Chinese is named across the supported languages and is the language building block the from-Chinese and into-Chinese markers are defined_by."',
' wiktionary "Chinese"',
' defined_by "human_language"',
' role "translation_language"',
' lexeme "en"',
' word "chinese"',
' description "English name of the Chinese language (lowercased), code zh."',
' lexeme "ru"',
' word "китайский"',
' description "Russian name of Chinese (romanized kitayskiy), code zh."',
' lexeme "hi"',
' word "चीनी"',
' description "Hindi name of Chinese (romanized chini), code zh."',
' lexeme "zh"',
' word "中文"',
' description "Chinese name of Chinese (pinyin zhongwen), code zh."',
' word "汉语"',
' description "Chinese name of Chinese (pinyin hanyu, simplified), code zh."',
' word "漢語"',
' description "Chinese name of Chinese (pinyin hanyu, traditional), code zh."',
' meaning "translate"',
" gloss \"the action of rendering a surface from one language into another — the verb every translation request realises. It is the genus the unquoted-frame and into-marker meanings specialise: its surfaces are the bare verb stems, used to detect a translation command in head-final Hindi (अनुवाद) and Chinese (翻译) where the verb is not bracketed by a circumfix. The English and Russian stems are clause-initial: the request-gate (try_translation) recognises a command by a head-initial stem, and the source-inferencer (infer_source_from_prompt) reads the stem's language as the language the user issued the command in. The Russian describe-imperative (опиши) is recorded under this genus too — this solver routes a description request through the same translation/description pipeline, so it counts as a clause-initial command stem.\"",
' wiktionary "translate"',
' defined_by "action"',
' role "translation_action"',
' lexeme "en"',
' word "translate"',
' description "English verb (translate) naming the translation action; clause-initial, so the request-gate matches it as a prefix."',
' lexeme "ru"',
' word "перевести"',
' description "Russian verb (romanized perevesti, to translate), the infinitive stem of the translation action; clause-initial."',
' word "переведи"',
' description "Russian verb (romanized perevedi, translate!), the imperative stem of the translation action; clause-initial."',
' word "опиши"',
' description "Russian verb (romanized opishi, describe!), the imperative the Russian reporter used to request a rendering/description; this solver routes it through the same translation/description pipeline, so it is recorded as a clause-initial command stem of this genus."',
' lexeme "hi"',
' word "अनुवाद"',
' description "Hindi noun (romanized anuvad, translation) used with करो/करें to form the translation command; scanned as the bare verb stem in Hindi prompts."',
' lexeme "zh"',
' word "翻译"',
' description "Chinese verb (pinyin fanyi, translate, simplified), scanned as the bare verb stem in Chinese prompts."',
' word "翻譯"',
' description "Chinese verb (pinyin fanyi, translate, traditional), scanned as the bare verb stem in Chinese prompts."',
' meaning "translation_direction_source"',
' gloss "the source-direction relation in a translation — the from side that names the language a surface is translated out of. Its surfaces are the bare directional prepositions; the from-language markers are constructed from this relation plus a language meaning, so the recogniser never stores a glued from-language phrase as an atom — it is built from its parts."',
' wiktionary "from"',
' defined_by "relation"',
' role "translation_source_direction"',
' lexeme "en"',
' word "from"',
' description "English preposition (from) naming the source direction of a translation."',
' lexeme "ru"',
' word "с"',
' description "Russian preposition (romanized s, from), naming the source direction (governs the genitive)."',
' lexeme "hi"',
' word "से"',
' description "Hindi postposition (romanized se, from), naming the source direction."',
' lexeme "zh"',
' word "从"',
' description "Chinese coverb (pinyin cong, from), naming the source direction."',
' meaning "translation_direction_target"',
' gloss "the target-direction relation in a translation — the into side that names the language a surface is translated toward. Its surfaces are the bare directional markers. In Chinese these bare markers (成, 为, 為, 到) are scanned directly: after a 翻译 verb the recogniser stops the surface at the first of them, so it reads the target boundary from this relation rather than from a hardcoded list. The into-language markers are constructed from this relation plus a language meaning."',
' wiktionary "to"',
' defined_by "relation"',
' role "translation_target_direction"',
' lexeme "en"',
' word "to"',
' description "English preposition (to) naming the target direction of a translation."',
' lexeme "ru"',
' word "на"',
' description "Russian preposition (romanized na, to/onto), naming the target direction (governs the accusative)."',
' lexeme "hi"',
' word "में"',
' description "Hindi postposition (romanized mein, in/into), naming the target direction."',
' lexeme "zh"',
' word "成"',
' description "Chinese resultative (pinyin cheng, into), a bare target-direction marker after the verb."',
' word "为"',
' description "Chinese coverb (pinyin wei, into/as, simplified), a bare target-direction marker after the verb."',
' word "為"',
' description "Chinese coverb (pinyin wei, into/as, traditional), a bare target-direction marker after the verb."',
' word "到"',
' description "Chinese resultative (pinyin dao, to/until), a bare target-direction marker after the verb."',
' meaning "translate_from_english"',
' gloss "the marker that names English as the translation source — translate … from english, с английского, अंग्रेज़ी से, 从英语. It is constructed from language_english and the source-direction relation; when any of its surfaces appears in a prompt the recogniser reports the source language as English (en, read by walking defined_by to language_english). Surfaces are matched as raw substrings, exactly as the previous hardcoded list did."',
' wiktionary "English"',
' defined_by "language_english"',
' defined_by "translation_direction_source"',
' role "translation_source_marker"',
' lexeme "en"',
' word "from english"',
' description "English source phrase (from + english); evidence the source language is English."',
' lexeme "ru"',
' word "с английского"',
' description "Russian source phrase (romanized s angliyskogo, from English, genitive); evidence the source is English."',
' lexeme "hi"',
' word "अंग्रेजी से"',
' description "Hindi source phrase (romanized angrezi se, from English, without nuqta); evidence the source is English."',
' word "अंग्रेज़ी से"',
' description "Hindi source phrase (romanized angrezi se, from English, with nuqta); evidence the source is English."',
' lexeme "zh"',
' word "从英语"',
' description "Chinese source phrase (pinyin cong yingyu, from English); evidence the source is English."',
' word "从英文"',
' description "Chinese source phrase (pinyin cong yingwen, from English, written-language variant); evidence the source is English."',
' meaning "translate_from_russian"',
' gloss "the marker that names Russian as the translation source — translate … from russian, с русского, रूसी से, 从俄语. Constructed from language_russian and the source-direction relation; any surface reports the source language as Russian (ru)."',
' wiktionary "Russian"',
' defined_by "language_russian"',
' defined_by "translation_direction_source"',
' role "translation_source_marker"',
' lexeme "en"',
' word "from russian"',
' description "English source phrase (from + russian); evidence the source language is Russian."',
' lexeme "ru"',
' word "с русского"',
' description "Russian source phrase (romanized s russkogo, from Russian, genitive); evidence the source is Russian."',
' lexeme "hi"',
' word "रूसी से"',
' description "Hindi source phrase (romanized rusi se, from Russian); evidence the source is Russian."',
' lexeme "zh"',
' word "从俄语"',
' description "Chinese source phrase (pinyin cong eyu, from Russian); evidence the source is Russian."',
' meaning "translate_from_hindi"',
' gloss "the marker that names Hindi as the translation source — translate … from hindi, с хинди, हिंदी से, 从印地语. Constructed from language_hindi and the source-direction relation; any surface reports the source language as Hindi (hi). The Russian с хинди surface completes the four-language coverage the relative-meta-logic invariants require."',
' wiktionary "Hindi"',
' defined_by "language_hindi"',
' defined_by "translation_direction_source"',
' role "translation_source_marker"',
' lexeme "en"',
' word "from hindi"',
' description "English source phrase (from + hindi); evidence the source language is Hindi."',
' lexeme "ru"',
' word "с хинди"',
' description "Russian source phrase (romanized s khindi, from Hindi, genitive); evidence the source is Hindi."',
' lexeme "hi"',
' word "हिंदी से"',
' description "Hindi source phrase (romanized hindi se, from Hindi, anusvara spelling); evidence the source is Hindi."',
' word "हिन्दी से"',
' description "Hindi source phrase (romanized hindi se, from Hindi, conjunct spelling); evidence the source is Hindi."',
' lexeme "zh"',
' word "从印地语"',
' description "Chinese source phrase (pinyin cong yindiyu, from Hindi); evidence the source is Hindi."',
' word "从印地文"',
' description "Chinese source phrase (pinyin cong yindiwen, from Hindi, written-language variant); evidence the source is Hindi."',
' meaning "translate_from_chinese"',
' gloss "the marker that names Chinese as the translation source — translate … from chinese, с китайского, चीनी से, 从中文. Constructed from language_chinese and the source-direction relation; any surface reports the source language as Chinese (zh). The Russian с китайского surface completes the four-language coverage the relative-meta-logic invariants require."',
' wiktionary "Chinese"',
' defined_by "language_chinese"',
' defined_by "translation_direction_source"',
' role "translation_source_marker"',
' lexeme "en"',
' word "from chinese"',
' description "English source phrase (from + chinese); evidence the source language is Chinese."',
' lexeme "ru"',
' word "с китайского"',
' description "Russian source phrase (romanized s kitayskogo, from Chinese, genitive); evidence the source is Chinese."',
' lexeme "hi"',
' word "चीनी से"',
' description "Hindi source phrase (romanized chini se, from Chinese); evidence the source is Chinese."',
' lexeme "zh"',
' word "从中文"',
' description "Chinese source phrase (pinyin cong zhongwen, from Chinese); evidence the source is Chinese."',
' word "从汉语"',
' description "Chinese source phrase (pinyin cong hanyu, from Chinese, simplified); evidence the source is Chinese."',
' word "从漢語"',
' description "Chinese source phrase (pinyin cong hanyu, from Chinese, traditional); evidence the source is Chinese."',
' meaning "translate_into_english"',
' gloss "the marker that names English as the translation target — translate … to english, на английский, अंग्रेज़ी में, 成英文. Constructed from language_english and the target-direction relation; any surface reports the target language as English (en). The Chinese forms enumerate every target-direction marker (成/为/為/到) glued to each name of English, matched as raw substrings exactly as the previous hardcoded list did."',
' wiktionary "English"',
' defined_by "language_english"',
' defined_by "translation_direction_target"',
' role "translation_target_marker"',
' lexeme "en"',
' word "to english"',
' description "English target phrase (to + english); evidence the target language is English."',
' lexeme "ru"',
' word "на английский"',
' description "Russian target phrase (romanized na angliyskiy, into English, accusative); evidence the target is English."',
' word "на английском"',
' description "Russian target phrase (romanized na angliyskom, in English, prepositional); evidence the target is English."',
' lexeme "hi"',
' word "अंग्रेजी में"',
' description "Hindi target phrase (romanized angrezi mein, into English, without nuqta); evidence the target is English."',
' word "अंग्रेज़ी में"',
' description "Hindi target phrase (romanized angrezi mein, into English, with nuqta); evidence the target is English."',
' lexeme "zh"',
' word "成英文"',
' description "Chinese target phrase (pinyin cheng yingwen, into English); 成 + 英文."',
' word "成英语"',
' description "Chinese target phrase (pinyin cheng yingyu, into English); 成 + 英语."',
' word "为英文"',
' description "Chinese target phrase (pinyin wei yingwen, into English, simplified); 为 + 英文."',
' word "为英语"',
' description "Chinese target phrase (pinyin wei yingyu, into English, simplified); 为 + 英语."',
' word "為英文"',
' description "Chinese target phrase (pinyin wei yingwen, into English, traditional); 為 + 英文."',
' word "為英语"',
' description "Chinese target phrase (pinyin wei yingyu, into English, traditional 為 + simplified 英语); evidence the target is English."',
' word "到英文"',
' description "Chinese target phrase (pinyin dao yingwen, to English); 到 + 英文."',
' word "到英语"',
' description "Chinese target phrase (pinyin dao yingyu, to English); 到 + 英语."',
' meaning "translate_into_russian"',
' gloss "the marker that names Russian as the translation target — translate … to russian, на русский, रूसी में, 成俄语. Constructed from language_russian and the target-direction relation; any surface reports the target language as Russian (ru). The Chinese forms enumerate every target-direction marker glued to each name of Russian."',
' wiktionary "Russian"',
' defined_by "language_russian"',
' defined_by "translation_direction_target"',
' role "translation_target_marker"',
' lexeme "en"',
' word "to russian"',
' description "English target phrase (to + russian); evidence the target language is Russian."',
' lexeme "ru"',
' word "на русский"',
' description "Russian target phrase (romanized na russkiy, into Russian, accusative); evidence the target is Russian."',
' lexeme "hi"',
' word "रूसी में"',
' description "Hindi target phrase (romanized rusi mein, into Russian); evidence the target is Russian."',
' lexeme "zh"',
' word "成俄语"',
' description "Chinese target phrase (pinyin cheng eyu, into Russian, simplified); 成 + 俄语."',
' word "成俄語"',
' description "Chinese target phrase (pinyin cheng eyu, into Russian, traditional); 成 + 俄語."',
' word "为俄语"',
' description "Chinese target phrase (pinyin wei eyu, into Russian, simplified); 为 + 俄语."',
' word "为俄語"',
' description "Chinese target phrase (pinyin wei eyu, into Russian, simplified 为 + traditional 俄語); evidence the target is Russian."',
' word "為俄语"',
' description "Chinese target phrase (pinyin wei eyu, into Russian, traditional 為 + simplified 俄语); evidence the target is Russian."',
' word "為俄語"',
' description "Chinese target phrase (pinyin wei eyu, into Russian, traditional); 為 + 俄語."',
' word "到俄语"',
' description "Chinese target phrase (pinyin dao eyu, to Russian, simplified); 到 + 俄语."',
' word "到俄語"',
' description "Chinese target phrase (pinyin dao eyu, to Russian, traditional); 到 + 俄語."',
' meaning "translate_into_hindi"',
' gloss "the marker that names Hindi as the translation target — translate … to hindi, на хинди, हिंदी में, 成印地语. Constructed from language_hindi and the target-direction relation; any surface reports the target language as Hindi (hi). The Chinese forms enumerate every target-direction marker glued to each name of Hindi."',
' wiktionary "Hindi"',
' defined_by "language_hindi"',
' defined_by "translation_direction_target"',
' role "translation_target_marker"',
' lexeme "en"',
' word "to hindi"',
' description "English target phrase (to + hindi); evidence the target language is Hindi."',
' lexeme "ru"',
' word "на хинди"',
' description "Russian target phrase (romanized na khindi, into Hindi); evidence the target is Hindi."',
' lexeme "hi"',
' word "हिंदी में"',
' description "Hindi target phrase (romanized hindi mein, into Hindi, anusvara spelling); evidence the target is Hindi."',
' word "हिन्दी में"',
' description "Hindi target phrase (romanized hindi mein, into Hindi, conjunct spelling); evidence the target is Hindi."',
' lexeme "zh"',
' word "成印地语"',
' description "Chinese target phrase (pinyin cheng yindiyu, into Hindi); 成 + 印地语."',
' word "成印地文"',
' description "Chinese target phrase (pinyin cheng yindiwen, into Hindi, written-language variant); 成 + 印地文."',
' word "为印地语"',
' description "Chinese target phrase (pinyin wei yindiyu, into Hindi, simplified); 为 + 印地语."',
' word "为印地文"',
' description "Chinese target phrase (pinyin wei yindiwen, into Hindi, simplified); 为 + 印地文."',
' word "為印地语"',
' description "Chinese target phrase (pinyin wei yindiyu, into Hindi, traditional 為 + simplified 印地语); evidence the target is Hindi."',
' word "為印地文"',
' description "Chinese target phrase (pinyin wei yindiwen, into Hindi, traditional 為 + 印地文); evidence the target is Hindi."',
' word "到印地语"',
' description "Chinese target phrase (pinyin dao yindiyu, to Hindi); 到 + 印地语."',
' word "到印地文"',
' description "Chinese target phrase (pinyin dao yindiwen, to Hindi); 到 + 印地文."',
' meaning "translate_into_chinese"',
' gloss "the marker that names Chinese as the translation target — translate … to chinese, на китайский, चीनी में, 成中文. Constructed from language_chinese and the target-direction relation; any surface reports the target language as Chinese (zh). The Chinese forms enumerate every target-direction marker glued to each name of Chinese."',
' wiktionary "Chinese"',
' defined_by "language_chinese"',
' defined_by "translation_direction_target"',
' role "translation_target_marker"',
' lexeme "en"',
' word "to chinese"',
' description "English target phrase (to + chinese); evidence the target language is Chinese."',
' lexeme "ru"',
' word "на китайский"',
' description "Russian target phrase (romanized na kitayskiy, into Chinese, accusative); evidence the target is Chinese."',
' lexeme "hi"',
' word "चीनी में"',
' description "Hindi target phrase (romanized chini mein, into Chinese); evidence the target is Chinese."',
' lexeme "zh"',
' word "成中文"',
' description "Chinese target phrase (pinyin cheng zhongwen, into Chinese); 成 + 中文."',
' word "成汉语"',
' description "Chinese target phrase (pinyin cheng hanyu, into Chinese, simplified); 成 + 汉语."',
' word "成漢語"',
' description "Chinese target phrase (pinyin cheng hanyu, into Chinese, traditional); 成 + 漢語."',
' word "为中文"',
' description "Chinese target phrase (pinyin wei zhongwen, into Chinese, simplified); 为 + 中文."',
' word "为汉语"',
' description "Chinese target phrase (pinyin wei hanyu, into Chinese, simplified); 为 + 汉语."',
' word "为漢語"',
' description "Chinese target phrase (pinyin wei hanyu, into Chinese, simplified 为 + traditional 漢語); evidence the target is Chinese."',
' word "為中文"',
' description "Chinese target phrase (pinyin wei zhongwen, into Chinese, traditional 為 + 中文); evidence the target is Chinese."',
' word "為汉语"',
' description "Chinese target phrase (pinyin wei hanyu, into Chinese, traditional 為 + simplified 汉语); evidence the target is Chinese."',
' word "為漢語"',
' description "Chinese target phrase (pinyin wei hanyu, into Chinese, traditional); 為 + 漢語."',
' word "到中文"',
' description "Chinese target phrase (pinyin dao zhongwen, to Chinese); 到 + 中文."',
' word "到汉语"',
' description "Chinese target phrase (pinyin dao hanyu, to Chinese, simplified); 到 + 汉语."',
' word "到漢語"',
' description "Chinese target phrase (pinyin dao hanyu, to Chinese, traditional); 到 + 漢語."',
' meaning "translation_unquoted_frame"',
' gloss "the verb frame that brackets the surface to translate in an unquoted command, so an extractor can lift the surface out without quotes. Its forms split by word order, and the slot shape records the shape. In head-initial English and Russian the verb precedes the surface and the target preposition follows it, so the form is a circumfix surface (translate … to , переведи … на ) whose literal before the slot is stripped from the front and whose literal after the slot bounds the surface on the right. In head-final Hindi and Chinese the verb is not a bracket, so the form is a bare verb stem (अनुवाद, 翻译/翻譯) that gates the language-specific extractor. Constructed from the translate action and the target-direction relation."',
' wiktionary "translate"',
' defined_by "translate"',
' defined_by "translation_direction_target"',
' role "translation_unquoted_frame"',
' lexeme "en"',
' word "translate … to "',
' description "English circumfix frame; before the slot the verb prefix translate (trailing space) is stripped, after the slot the target preposition to (space-wrapped) bounds the surface on the right."',
' lexeme "ru"',
' word "переведи … на "',
' description "Russian circumfix frame (romanized perevedi … na, translate … to); before the slot the imperative verb is stripped, after the slot the target preposition на bounds the surface on the right."',
' lexeme "hi"',
' word "अनुवाद"',
' description "Hindi bare verb stem (romanized anuvad, translation); its presence gates the Hindi unquoted extractor, which reads the surface from the object and into postpositions."',
' lexeme "zh"',
' word "翻译"',
' description "Chinese bare verb stem (pinyin fanyi, translate, simplified); stripped from the front as a translate prefix when no disposal 把/将 opens the command."',
' word "翻譯"',
' description "Chinese bare verb stem (pinyin fanyi, translate, traditional); stripped from the front as a translate prefix when no disposal 把/将 opens the command."',
' meaning "translation_into_marker"',
" gloss \"the verb-and-target compound that introduces the target language right after the surface — translate-into. Languages glue the verb and the into-direction in opposite orders: head-final Hindi postposes the target marker onto the verb noun ( में अनुवाद, मे अनुवाद), so the extractor finds it and takes the text before it; Chinese prefixes the into-direction onto the verb (翻译成, 翻译为, 翻译到 and traditional 翻譯…), so the extractor stops the surface at the first such compound. The English and Russian compounds (translate into, перевести на) are recorded for completeness; those languages are extracted through the unquoted frame's circumfix instead, so these full compounds are not separately scanned. Constructed from the translate action and the target-direction relation.\"",
' wiktionary "into"',
' defined_by "translate"',
' defined_by "translation_direction_target"',
' role "translation_into_marker"',
' lexeme "en"',
' word "translate into"',
' description "English verb-and-target compound (translate + into); recorded for completeness — English is extracted through the unquoted frame, so this compound is not separately scanned."',
' lexeme "ru"',
' word "перевести на"',
' description "Russian verb-and-target compound (romanized perevesti na, translate into); recorded for completeness — Russian is extracted through the unquoted frame, so this compound is not separately scanned."',
' lexeme "hi"',
' word " में अनुवाद"',
' description "Hindi target-and-verb compound (romanized mein anuvad, into translation), space-led; the extractor finds it and keeps the text before it as the surface."',
' word " मे अनुवाद"',
' description "Hindi target-and-verb compound (romanized me anuvad, into translation, anusvara-dropped variant), space-led; the extractor finds it and keeps the text before it as the surface."',
' lexeme "zh"',
' word "翻译成"',
' description "Chinese verb-and-target compound (pinyin fanyi cheng, translate into, simplified); the extractor stops the surface at it."',
' word "翻译为"',
' description "Chinese verb-and-target compound (pinyin fanyi wei, translate into, simplified); the extractor stops the surface at it."',
' word "翻译到"',
' description "Chinese verb-and-target compound (pinyin fanyi dao, translate to, simplified); the extractor stops the surface at it."',
' word "翻譯成"',
' description "Chinese verb-and-target compound (pinyin fanyi cheng, translate into, traditional); the extractor stops the surface at it."',
' word "翻譯為"',
' description "Chinese verb-and-target compound (pinyin fanyi wei, translate into, traditional); the extractor stops the surface at it."',
' word "翻譯到"',
' description "Chinese verb-and-target compound (pinyin fanyi dao, translate to, traditional); the extractor stops the surface at it."',
' meaning "translation_object_marker"',
' gloss "the particle that flags the noun phrase to be translated as the object, so an extractor can bound it. Word order decides the shape: head-final Hindi postposes the marker after the object (का genitive, को accusative), so the extractor uses it as a right boundary and keeps the text before it; Chinese prefixes a disposal particle before the object (把, 将), so the extractor strips it from the front and keeps the text after it. English and Russian mark the object by position and case rather than a dedicated particle, so their nearest realisations are recorded for completeness and are not scanned — only the Devanagari and Han forms are. Defined as a grammatical relation."',
' wiktionary "of"',
' defined_by "relation"',
' role "translation_object_marker"',
' lexeme "en"',
' word "of"',
' description "English genitive linker (of), as in the translation of X — the nearest realisation of Hindi का; recorded for completeness, not scanned (English marks the object positionally)."',
' lexeme "ru"',
' word "слова"',
' description "Russian genitive noun (romanized slova, of the word), as in перевод слова X — the nearest realisation marking X as the object; recorded for completeness, not scanned (Russian marks the object by case)."',
' lexeme "hi"',
' word " का "',
' description "Hindi genitive postposition (romanized ka, of), space-wrapped; used as a right boundary — the surface is the text before it."',
' word " को "',
' description "Hindi accusative postposition (romanized ko, the object marker), space-wrapped; used as a right boundary after का — the surface is the text before it."',
' lexeme "zh"',
' word "把"',
' description "Chinese disposal particle (pinyin ba) fronting the object; stripped from the front so the surface is the text after it."',
' word "将"',
' description "Chinese disposal particle (pinyin jiang, formal variant of 把) fronting the object; stripped from the front so the surface is the text after it."',
' meaning "definition_command"',
' gloss "an imperative verb asking the assistant to define a phrase — to render its meaning, here as a Links Notation definition. The definition_command role marks the clause-initial command; the translation handler recognises a define request by composing this verb with a quoted or backticked phrase and a links_notation_format marker, then renders the phrase as its formal definition. Only the English surface is scanned, matched as a clause-initial prefix with a trailing space exactly as the original recogniser required; the Russian, Hindi and Chinese imperatives are recorded for completeness so the concept is lexicalised in every supported language, mirroring the original handler which gated on the English verb alone. Defined as an action."',
' wiktionary "define"',
' defined_by "action"',
' role "definition_command"',
' lexeme "en"',
' word "define"',
' description "English imperative verb to define; the only scanned definition_command surface, matched as a clause-initial prefix with a trailing space so that defined and definition do not trigger it."',
' lexeme "ru"',
' word "определи"',
' description "Russian imperative verb (romanized opredeli, of определить, to define); a completeness form for the definition_command concept, recorded but not scanned because the original recogniser gated on the English verb alone."',
' lexeme "hi"',
' word "परिभाषित करें"',
' description "Hindi imperative phrase (romanized paribhashit karen, define); a completeness form for the definition_command concept, recorded but not scanned."',
' lexeme "zh"',
' word "定义"',
' description "Chinese verb (pinyin dingyi, to define); a completeness form for the definition_command concept, recorded but not scanned."',
' meaning "links_notation_format"',
" gloss \"a phrase naming Links Notation — the indentation-based serialization format of the Deep Theory project — as the target a define request renders into. The links_notation_format role carries these surfaces; the translation handler reconstructs each as a space-prefixed token and treats a prompt as a define-in-Links request when one appears alongside a definition_command verb and a quoted or backticked phrase. The English phrase links notation and the Russian code-switched form are scanned, exactly the original recogniser's two substrings; the Hindi and Chinese renderings are recorded for completeness so the concept is lexicalised in every supported language. Defined as a concept.\"",
' wiktionary "notation"',
' defined_by "concept"',
' role "links_notation_format"',
' lexeme "en"',
' word "links notation"',
' description "English name of the Links Notation format; a links_notation_format surface scanned as a space-prefixed substring so it matches in links notation and to links notation without firing mid-word."',
' lexeme "ru"',
' word "в links"',
' description "Russian code-switched phrase (romanized v links, in links) naming Links Notation as the target; a links_notation_format surface scanned as a space-prefixed substring that pairs the Russian preposition v with the format proper noun, exactly as the original recogniser did."',
' lexeme "hi"',
' word "लिंक्स नोटेशन"',
' description "Hindi transliteration (romanized links noteshan) of Links Notation; a completeness form for the links_notation_format concept, recorded but not scanned."',
' lexeme "zh"',
' word "链接表示法"',
' description "Chinese rendering (pinyin lianjie biaoshifa) of Links Notation; a completeness form for the links_notation_format concept, recorded but not scanned."',
' meaning "apple"',
' gloss "the fruit apple, a concrete entity the compositional ru-to-en translator renders when a multi-word title carries the Russian apple lemma in any case. It holds the compositional_lemma role; the per-word fallback resolves any listed Russian inflection to the English surface apple. Head-initial English and Russian are the consulted pair; Hindi and Chinese are carried so the concept is lexicalised in every supported language. Defined as an entity."',
' wiktionary "apple"',
' defined_by "entity"',
' role "compositional_lemma"',
' lexeme "en"',
' word "apple"',
' description "English noun (apple); the surface the compositional translator emits for the Russian apple lemma."',
' lexeme "ru"',
' word "яблоко"',
' description "Russian noun (romanized yabloko, apple), nominative singular; a compositional_lemma form resolving to apple."',
' word "яблока"',
' description "Russian noun (romanized yabloka, apple), genitive singular; a compositional_lemma form resolving to apple."',
' word "яблоку"',
' description "Russian noun (romanized yabloku, apple), dative singular; a compositional_lemma form resolving to apple."',
' word "яблоком"',
' description "Russian noun (romanized yablokom, apple), instrumental singular; a compositional_lemma form resolving to apple."',
' word "яблоке"',
' description "Russian noun (romanized yabloke, apple), prepositional singular; a compositional_lemma form resolving to apple."',
' word "яблоки"',
' description "Russian noun (romanized yabloki, apple), nominative plural; a compositional_lemma form resolving to apple."',
' word "яблок"',
' description "Russian noun (romanized yablok, apple), genitive plural; a compositional_lemma form resolving to apple."',
' word "яблокам"',
' description "Russian noun (romanized yablokam, apple), dative plural; a compositional_lemma form resolving to apple."',
' word "яблоками"',
' description "Russian noun (romanized yablokami, apple), instrumental plural; a compositional_lemma form resolving to apple."',
' word "яблоках"',
' description "Russian noun (romanized yablokakh, apple), prepositional plural; a compositional_lemma form resolving to apple."',
' lexeme "hi"',
' word "सेब"',
' description "Hindi noun (romanized seb, apple); a coverage form, not consulted by the head-initial ru-to-en scan."',
' lexeme "zh"',
' word "苹果"',
' description "Chinese noun (pinyin pingguo, apple); a coverage form, not consulted by the head-initial ru-to-en scan."',
' meaning "good"',
' gloss "the quality good, a property the compositional ru-to-en translator renders when a multi-word title carries a Russian good or kind adjective in any gender, number or case. It holds the compositional_lemma role; the per-word fallback resolves any listed inflection of dobryy or khoroshiy to the English surface good. Head-initial English and Russian are the consulted pair; Hindi and Chinese are carried for coverage. Defined as a property."',
' wiktionary "good"',
' defined_by "property"',
' role "compositional_lemma"',
' lexeme "en"',
' word "good"',
' description "English adjective (good); the surface the compositional translator emits for a Russian good or kind adjective."',
' lexeme "ru"',
' word "доброе"',
' description "Russian adjective (romanized dobroye, good or kind), neuter nominative singular; a compositional_lemma form resolving to good."',
' word "добрый"',
' description "Russian adjective (romanized dobryy, good or kind), masculine nominative singular; a compositional_lemma form resolving to good."',
' word "добрая"',
' description "Russian adjective (romanized dobraya, good or kind), feminine nominative singular; a compositional_lemma form resolving to good."',
' word "добрые"',
' description "Russian adjective (romanized dobryye, good or kind), nominative plural; a compositional_lemma form resolving to good."',
' word "доброго"',
' description "Russian adjective (romanized dobrogo, good or kind), masculine or neuter genitive singular; a compositional_lemma form resolving to good."',
' word "добрую"',
' description "Russian adjective (romanized dobruyu, good or kind), feminine accusative singular; a compositional_lemma form resolving to good."',
' word "добрым"',
' description "Russian adjective (romanized dobrym, good or kind), masculine or neuter instrumental singular; a compositional_lemma form resolving to good."',
' word "хорошее"',
' description "Russian adjective (romanized khorosheye, good), neuter nominative singular; a compositional_lemma form resolving to good."',
' word "хороший"',
' description "Russian adjective (romanized khoroshiy, good), masculine nominative singular; a compositional_lemma form resolving to good."',
' word "хорошая"',
' description "Russian adjective (romanized khoroshaya, good), feminine nominative singular; a compositional_lemma form resolving to good."',
' word "хорошие"',
' description "Russian adjective (romanized khoroshiye, good), nominative plural; a compositional_lemma form resolving to good."',
' word "хорошего"',
' description "Russian adjective (romanized khoroshego, good), masculine or neuter genitive singular; a compositional_lemma form resolving to good."',
' word "хорошую"',
' description "Russian adjective (romanized khoroshuyu, good), feminine accusative singular; a compositional_lemma form resolving to good."',
' word "хорошим"',
' description "Russian adjective (romanized khoroshim, good), masculine or neuter instrumental singular; a compositional_lemma form resolving to good."',
' lexeme "hi"',
' word "अच्छा"',
' description "Hindi adjective (romanized achchha, good); a coverage form, not consulted by the head-initial ru-to-en scan."',
' lexeme "zh"',
' word "好"',
' description "Chinese adjective (pinyin hao, good); a coverage form, not consulted by the head-initial ru-to-en scan."',
' meaning "find"',
' gloss "the action find, locating something; the verb the compositional ru-to-en translator renders when a Russian find imperative or infinitive opens a search request. It holds the compositional_lemma role; the per-word fallback resolves any listed Russian form to the English surface find. Head-initial English and Russian are the consulted pair; Hindi and Chinese are carried for coverage. Defined as an action."',
' wiktionary "find"',
' defined_by "action"',
' role "compositional_lemma"',
' lexeme "en"',
' word "find"',
' description "English verb (find); the surface the compositional translator emits for a Russian find imperative or infinitive."',
' lexeme "ru"',
' word "найди"',
' description "Russian verb (romanized naydi, find), singular imperative; a compositional_lemma form resolving to find."',
' word "найдите"',
' description "Russian verb (romanized naydite, find), plural or polite imperative; a compositional_lemma form resolving to find."',
' word "найти"',
' description "Russian verb (romanized nayti, to find), infinitive; a compositional_lemma form resolving to find."',
' lexeme "hi"',
' word "खोजें"',
' description "Hindi verb (romanized khojen, find or search); a coverage form, not consulted by the head-initial ru-to-en scan."',
' lexeme "zh"',
' word "查找"',
' description "Chinese verb (pinyin chazhao, find or look up); a coverage form, not consulted by the head-initial ru-to-en scan."',
' meaning "synonym"',
" gloss \"the concept synonym, a word sharing another word's meaning; rendered by the compositional ru-to-en translator and, as a relation noun, able to govern a genitive complement, as in sinonimy soglasovaniya, synonyms of agreement. It holds compositional_lemma and compositional_genitive_head; the per-word fallback resolves any listed Russian form to the English plural surface synonyms, the form the original search-phrase mapping emits. Head-initial English and Russian are the consulted pair; Hindi and Chinese are carried for coverage. Defined as a concept.\"",
' wiktionary "synonym"',
' defined_by "concept"',
' role "compositional_lemma"',
' role "compositional_genitive_head"',
' lexeme "en"',
' word "synonyms"',
' description "English noun (synonyms), plural; the surface the compositional translator emits for a Russian synonym form, matching the original search-phrase mapping."',
' lexeme "ru"',
' word "синоним"',
' description "Russian noun (romanized sinonim, synonym), nominative singular; a compositional_lemma and genitive-head form resolving to synonyms."',
' word "синонимы"',
' description "Russian noun (romanized sinonimy, synonyms), nominative plural; a compositional_lemma and genitive-head form resolving to synonyms."',
' word "синонимов"',
' description "Russian noun (romanized sinonimov, synonyms), genitive plural; a compositional_lemma and genitive-head form resolving to synonyms."',
' lexeme "hi"',
' word "पर्यायवाची"',
' description "Hindi noun (romanized paryayvachi, synonym); a coverage form, not consulted by the head-initial ru-to-en scan."',
' lexeme "zh"',
' word "同义词"',
' description "Chinese noun (pinyin tongyici, synonym); a coverage form, not consulted by the head-initial ru-to-en scan."',
' meaning "example"',
' gloss "the concept example, an instance illustrating something; rendered by the compositional ru-to-en translator and, as a relation noun, able to govern a genitive complement, as in primery soglasovaniya, examples of agreement. It holds compositional_lemma and compositional_genitive_head; the per-word fallback resolves any listed Russian form to the English plural surface examples. Head-initial English and Russian are the consulted pair; Hindi and Chinese are carried for coverage. Defined as a concept."',
' wiktionary "example"',
' defined_by "concept"',
' role "compositional_lemma"',
' role "compositional_genitive_head"',
' lexeme "en"',
' word "examples"',
' description "English noun (examples), plural; the surface the compositional translator emits for a Russian example form, matching the original search-phrase mapping."',
' lexeme "ru"',
' word "пример"',
' description "Russian noun (romanized primer, example), nominative singular; a compositional_lemma and genitive-head form resolving to examples."',
' word "примеры"',
' description "Russian noun (romanized primery, examples), nominative plural; a compositional_lemma and genitive-head form resolving to examples."',
' word "примеров"',
' description "Russian noun (romanized primerov, examples), genitive plural; a compositional_lemma and genitive-head form resolving to examples."',
' lexeme "hi"',
' word "उदाहरण"',
' description "Hindi noun (romanized udaharan, example); a coverage form, not consulted by the head-initial ru-to-en scan."',
' lexeme "zh"',
' word "例子"',
' description "Chinese noun (pinyin lizi, example); a coverage form, not consulted by the head-initial ru-to-en scan."',
' meaning "agreement"',
' gloss "the concept agreement, grammatical concord; the genitive complement in the search phrase examples of agreement, rendered by the compositional ru-to-en translator. It holds the compositional_lemma role; the per-word fallback resolves any listed Russian form to the English surface agreement. The genitive-singular form soglasovaniya additionally carries action genitive so the genitive-of construction picks it as the complement of a relation head. Head-initial English and Russian are the consulted pair; Hindi and Chinese are carried for coverage. Defined as a concept."',
' wiktionary "agreement"',
' defined_by "concept"',
' role "compositional_lemma"',
' lexeme "en"',
' word "agreement"',
' description "English noun (agreement); the surface the compositional translator emits for a Russian agreement form, including the genitive complement of a relation head."',
' lexeme "ru"',
' word "согласование"',
' description "Russian noun (romanized soglasovaniye, agreement), nominative singular; a compositional_lemma form resolving to agreement."',
' word "согласования"',
' action "genitive"',
' description "Russian noun (romanized soglasovaniya, agreement), genitive singular; tagged genitive so the genitive-of construction reads it as the complement of a relation head, resolving to agreement."',
' word "согласованию"',
' description "Russian noun (romanized soglasovaniyu, agreement), dative singular; a compositional_lemma form resolving to agreement."',
' word "согласованием"',
' description "Russian noun (romanized soglasovaniyem, agreement), instrumental singular; a compositional_lemma form resolving to agreement."',
' word "согласовании"',
' description "Russian noun (romanized soglasovanii, agreement), prepositional singular; a compositional_lemma form resolving to agreement."',
' lexeme "hi"',
' word "सहमति"',
' description "Hindi noun (romanized sahmati, agreement); a coverage form, not consulted by the head-initial ru-to-en scan."',
' lexeme "zh"',
' word "一致"',
' description "Chinese noun (pinyin yizhi, agreement or concord); a coverage form, not consulted by the head-initial ru-to-en scan."',
' meaning "conjunction_or"',
' gloss "the relation or, the logical connective joining alternatives; rendered by the compositional ru-to-en translator when the Russian connective ili appears between search terms. It holds the compositional_lemma role; the per-word fallback resolves ili to the English surface or. Head-initial English and Russian are the consulted pair; Hindi and Chinese are carried for coverage. Defined as a relation."',
' wiktionary "or"',
' defined_by "relation"',
' role "compositional_lemma"',
' lexeme "en"',
' word "or"',
' description "English conjunction (or); the surface the compositional translator emits for the Russian connective ili."',
' lexeme "ru"',
' word "или"',
' description "Russian conjunction (romanized ili, or); a compositional_lemma form resolving to or."',
' lexeme "hi"',
' word "या"',
' description "Hindi conjunction (romanized ya, or); a coverage form, not consulted by the head-initial ru-to-en scan."',
' lexeme "zh"',
' word "或"',
' description "Chinese conjunction (pinyin huo, or); a coverage form, not consulted by the head-initial ru-to-en scan."',
' meaning "who_are_you"',
' gloss "the fixed question who are you, a short Russian identity question that translates as a whole rather than word by word. It holds the compositional_phrase role; the compositional fallback looks the normalized title up among the phrase meanings before attempting composition and returns the English form verbatim, capitalization and terminal question mark included. Head-initial English and Russian are the consulted pair; Hindi and Chinese are carried for coverage. Defined as a concept."',
' wiktionary "who"',
' defined_by "concept"',
' role "compositional_phrase"',
' lexeme "en"',
' word "Who are you?"',
' description "English question (Who are you?); the verbatim rendering the compositional translator returns for the Russian identity question, capitalization and question mark included."',
' lexeme "ru"',
' word "кто ты"',
' description "Russian question (romanized kto ty, who are you), informal; a compositional_phrase form resolving to Who are you."',
' word "кто ты такой"',
' description "Russian question (romanized kto ty takoy, who are you), informal masculine; a compositional_phrase form resolving to Who are you."',
' word "кто ты такая"',
' description "Russian question (romanized kto ty takaya, who are you), informal feminine; a compositional_phrase form resolving to Who are you."',
' word "кто вы"',
' description "Russian question (romanized kto vy, who are you), polite or plural; a compositional_phrase form resolving to Who are you."',
' word "кто вы такой"',
' description "Russian question (romanized kto vy takoy, who are you), polite masculine; a compositional_phrase form resolving to Who are you."',
' word "кто вы такая"',
' description "Russian question (romanized kto vy takaya, who are you), polite feminine; a compositional_phrase form resolving to Who are you."',
' lexeme "hi"',
' word "आप कौन हैं"',
' description "Hindi question (romanized aap kaun hain, who are you); a coverage form, not consulted by the head-initial ru-to-en scan."',
' lexeme "zh"',
' word "你是谁"',
' description "Chinese question (pinyin ni shi shei, who are you); a coverage form, not consulted by the head-initial ru-to-en scan."',
' meaning "what_is_this"',
' gloss "the fixed question what is this, a short Russian question that translates as a whole rather than word by word. It holds the compositional_phrase role; the compositional fallback looks the normalized title up among the phrase meanings before attempting composition and returns the English form verbatim, capitalization and terminal question mark included. Head-initial English and Russian are the consulted pair; Hindi and Chinese are carried for coverage. Defined as a concept."',
' wiktionary "what"',
' defined_by "concept"',
' role "compositional_phrase"',
' lexeme "en"',
' word "What is this?"',
' description "English question (What is this?); the verbatim rendering the compositional translator returns for the Russian what-is-this question, capitalization and question mark included."',
' lexeme "ru"',
' word "что это"',
' description "Russian question (romanized chto eto, what is this); a compositional_phrase form resolving to What is this."',
' word "что это такое"',
' description "Russian question (romanized chto eto takoye, what is this), emphatic; a compositional_phrase form resolving to What is this."',
' lexeme "hi"',
' word "यह क्या है"',
' description "Hindi question (romanized yah kya hai, what is this); a coverage form, not consulted by the head-initial ru-to-en scan."',
' lexeme "zh"',
' word "这是什么"',
' description "Chinese question (pinyin zhe shi shenme, what is this); a coverage form, not consulted by the head-initial ru-to-en scan."',
' meaning "how_are_you"',
' gloss "the fixed greeting question how are you, a short Russian phrase that translates as a whole rather than word by word. It holds the compositional_phrase role; the compositional fallback returns the English form verbatim, lowercase and without terminal punctuation so a source that carries none keeps none. Head-initial English and Russian are the consulted pair; Hindi and Chinese are carried for coverage. Defined as a concept."',
' wiktionary "how"',
' defined_by "concept"',
' role "compositional_phrase"',
' lexeme "en"',
' word "how are you"',
' description "English greeting question (how are you), lowercase and unpunctuated; the verbatim rendering the compositional translator returns for the Russian greeting."',
' lexeme "ru"',
' word "как дела"',
' description "Russian greeting question (romanized kak dela, how are you); a compositional_phrase form resolving to how are you."',
' lexeme "hi"',
' word "आप कैसे हैं"',
' description "Hindi greeting question (romanized aap kaise hain, how are you); a coverage form, not consulted by the head-initial ru-to-en scan."',
' lexeme "zh"',
' word "你好吗"',
' description "Chinese greeting question (pinyin ni hao ma, how are you); a coverage form, not consulted by the head-initial ru-to-en scan."',
"meanings",
' meaning "link"',
' gloss "the root of the ontology — a connection between things. In Links Notation every meaning is itself a link, so the root link is defined by itself and every other meaning descends from it (a single merged root in the spirit of relative-meta-logic)."',
' wiktionary "link"',
' defined_by "link"',
' role "ontology_root"',
' lexeme "en"',
' word "link"',
' description "English noun and verb for a connection between two things; the self-rooted root of the whole ontology."',
' word "connection"',
' description "English noun for the relationship that joins two things; a synonym surface for the link concept."',
' lexeme "ru"',
' word "связь"',
' description "Russian noun (romanized svyaz) for a connection or tie; the Russian surface for the link concept."',
' word "ссылка"',
' description "Russian noun (romanized ssylka) for a reference or hyperlink; the Russian surface for an explicit link."',
' lexeme "hi"',
' word "लिंक"',
' description "Hindi noun (romanized link, a loanword) for a connection or hyperlink; the Hindi surface for the link concept."',
' word "कड़ी"',
' description "Hindi noun (romanized kadi) for a link in a chain; the native Hindi surface for a connection."',
' lexeme "zh"',
' word "链接"',
' description "Chinese noun (pinyin lianjie) for a hyperlink or connection; the Chinese surface for the link concept."',
' word "连接"',
' description "Chinese verb (pinyin lianjie) for joining or connecting; the Chinese surface for forming a connection."',
' meaning "type"',
' gloss "a classification of links — the root of the type-system ontology; a type is itself a link, so it is defined by link. Entities and concepts are the broadest types the assistant reasons with."',
' wiktionary "type"',
' defined_by "link"',
' role "ontology_type"',
' lexeme "en"',
' word "type"',
' description "English noun for a classification or category of links; the root of the type-system sub-ontology."',
' word "kind"',
' description "English noun for a sort or category; a synonym surface for the type concept."',
' lexeme "ru"',
' word "тип"',
' description "Russian noun (romanized tip) for a type or category; the Russian surface for the type concept."',
' word "вид"',
' description "Russian noun (romanized vid) for a kind or sort; an alternative Russian surface for a category."',
' lexeme "hi"',
' word "प्रकार"',
' description "Hindi noun (romanized prakar) for a type or kind; the Hindi surface for the type concept."',
' word "क़िस्म"',
' description "Hindi noun (romanized qism) for a sort or variety; an alternative Hindi surface for a category."',
' lexeme "zh"',
' word "类型"',
' description "Chinese noun (pinyin leixing) for a type or category; the Chinese surface for the type concept."',
' word "种类"',
' description "Chinese noun (pinyin zhonglei) for a kind or sort; an alternative Chinese surface for a category."',
' meaning "entity"',
' gloss "a thing that exists and can be referred to — a link seen as a node; the genus of every concrete subject the assistant reasons about (programs, artifacts, the assistant and user themselves)."',
' wiktionary "entity"',
' defined_by "type"',
' role "ontology_category"',
' lexeme "en"',
' word "entity"',
' description "English noun for a thing that exists and can be referred to; the genus of concrete subjects."',
' word "thing"',
' description "English noun for any object that can be referred to; a plain synonym surface for entity."',
' lexeme "ru"',
' word "сущность"',
' description "Russian noun (romanized sushchnost) for an entity or essence; the Russian surface for the entity concept."',
' word "объект"',
' description "Russian noun (romanized obyekt) for an object; an alternative Russian surface for a concrete entity."',
' lexeme "hi"',
' word "इकाई"',
' description "Hindi noun (romanized ikai) for a unit or entity; the Hindi surface for the entity concept."',
' word "वस्तु"',
' description "Hindi noun (romanized vastu) for a thing or object; an alternative Hindi surface for an entity."',
' lexeme "zh"',
' word "实体"',
' description "Chinese noun (pinyin shiti) for an entity; the Chinese surface for the entity concept."',
' word "事物"',
' description "Chinese noun (pinyin shiwu) for a thing or object; an alternative Chinese surface for an entity."',
' meaning "concept"',
' gloss "an abstract meaning or idea — a type of notion the assistant can name and reason about apart from any concrete instance (calendars, approvals, features)."',
' wiktionary "concept"',
' defined_by "type"',
' role "ontology_category"',
' lexeme "en"',
' word "concept"',
' description "English noun for an abstract meaning or idea; the genus of notions reasoned about apart from instances."',
' word "notion"',
' description "English noun for an idea or concept; a synonym surface for the concept meaning."',
' lexeme "ru"',
' word "понятие"',
' description "Russian noun (romanized ponyatiye) for a concept or notion; the Russian surface for the concept meaning."',
' word "концепция"',
' description "Russian noun (romanized kontseptsiya) for a conception or framework; an alternative Russian surface for a concept."',
' lexeme "hi"',
' word "अवधारणा"',
' description "Hindi noun (romanized avadharana) for a concept or notion; the Hindi surface for the concept meaning."',
' word "संकल्पना"',
' description "Hindi noun (romanized sankalpana) for a conception or idea; an alternative Hindi surface for a concept."',
' lexeme "zh"',
' word "概念"',
' description "Chinese noun (pinyin gainian) for a concept; the Chinese surface for the concept meaning."',
' word "观念"',
' description "Chinese noun (pinyin guannian) for an idea or notion; an alternative Chinese surface for a concept."',
' meaning "relation"',
' gloss "a link that connects entities — it maps one entity or value to another; the genus of every named relationship in the knowledge base."',
' wiktionary "relation"',
' defined_by "link"',
' role "ontology_category"',
' lexeme "en"',
' word "relation"',
' description "English noun for a link that connects entities; the genus of named relationships."',
' word "relationship"',
' description "English noun for how two entities are connected; a synonym surface for relation."',
' lexeme "ru"',
' word "отношение"',
' description "Russian noun (romanized otnosheniye) for a relation; the Russian surface for the relation concept."',
' word "соотношение"',
' description "Russian noun (romanized sootnosheniye) for a correlation or ratio; an alternative Russian surface for a relation."',
' lexeme "hi"',
' word "संबंध"',
' description "Hindi noun (romanized sambandh) for a relation or connection; the Hindi surface for the relation concept."',
' word "रिश्ता"',
' description "Hindi noun (romanized rishta) for a relationship; an alternative Hindi surface for a relation."',
' lexeme "zh"',
' word "关系"',
' description "Chinese noun (pinyin guanxi) for a relation or relationship; the Chinese surface for the relation concept."',
' word "联系"',
' description "Chinese noun (pinyin lianxi) for a connection or link; an alternative Chinese surface for a relation."',
' meaning "action"',
' gloss "something performed — a process or operation that changes or produces state; the genus of every verb the assistant can carry out (sort, modify, follow up)."',
' wiktionary "action"',
' defined_by "concept"',
' role "ontology_category"',
' lexeme "en"',
' word "action"',
' description "English noun for a process or operation that changes or produces state; the genus of verbs the assistant performs."',
' word "act"',
' description "English noun for a single deed or operation; a shorter synonym surface for action."',
' lexeme "ru"',
' word "действие"',
' description "Russian noun (romanized deystviye) for an action; the Russian surface for the action concept."',
' word "операция"',
' description "Russian noun (romanized operatsiya) for an operation; an alternative Russian surface for an action."',
' lexeme "hi"',
' word "क्रिया"',
' description "Hindi noun (romanized kriya) for an action or verb; the Hindi surface for the action concept."',
' word "कार्य"',
' description "Hindi noun (romanized karya) for a task or operation; an alternative Hindi surface for an action."',
' lexeme "zh"',
' word "动作"',
' description "Chinese noun (pinyin dongzuo) for an action or movement; the Chinese surface for the action concept."',
' word "操作"',
' description "Chinese noun (pinyin caozuo) for an operation; an alternative Chinese surface for an action."',
' meaning "property"',
' gloss "a quality or attribute of an entity — what can be measured, classified, or arranged; the genus of measurable dimensions and software features."',
' wiktionary "property"',
' defined_by "concept"',
' role "ontology_category"',
' lexeme "en"',
' word "property"',
' description "English noun for a quality or attribute of an entity; the genus of measurable dimensions and features."',
' word "attribute"',
' description "English noun for a characteristic of an entity; a synonym surface for property."',
' lexeme "ru"',
' word "свойство"',
' description "Russian noun (romanized svoystvo) for a property; the Russian surface for the property concept."',
' word "атрибут"',
' description "Russian noun (romanized atribut) for an attribute; an alternative Russian surface for a property."',
' lexeme "hi"',
' word "गुण"',
' description "Hindi noun (romanized gun) for a quality or property; the Hindi surface for the property concept."',
' word "विशेषता"',
' description "Hindi noun (romanized visheshta) for a characteristic; an alternative Hindi surface for a property."',
' lexeme "zh"',
' word "属性"',
' description "Chinese noun (pinyin shuxing) for an attribute or property; the Chinese surface for the property concept."',
' word "特性"',
' description "Chinese noun (pinyin texing) for a characteristic or trait; an alternative Chinese surface for a property."',
"meanings",
' meaning "wikidata_item_apple"',
' gloss "the fruit of the apple tree (Wikidata Q89); a common edible pome fruit used as a canonical concrete entity in formalization examples. Rooted in the external Wikidata knowledge base through its language-independent Q-id."',
' wiktionary "apple"',
' wikidata "Q89"',
' defined_by "entity"',
' role "wikidata_entity_anchor"',
' lexeme "en"',
' word "apple"',
' description "English noun for the edible pome fruit of the apple tree; the canonical English label for Wikidata entity Q89."',
' word "apples"',
' description "English plural noun for apple; an inflected surface for Wikidata entity Q89."',
' lexeme "ru"',
' word "яблоко"',
' description "Russian noun (romanized yabloko) for apple; the Russian surface for Wikidata entity Q89."',
' word "яблоки"',
' description "Russian plural noun (romanized yabloki) for apples; an inflected Russian surface for Wikidata entity Q89."',
' lexeme "hi"',
' word "सेब"',
' description "Hindi noun (romanized seb) for apple; the Hindi surface for Wikidata entity Q89."',
' lexeme "zh"',
' word "苹果"',
' description "Chinese noun (pinyin pingguo, simplified) for apple; the Chinese surface for Wikidata entity Q89."',
' word "蘋果"',
' description "Chinese noun (pinyin pingguo, traditional) for apple; the traditional Chinese surface for Wikidata entity Q89."',
' meaning "wikidata_item_fruit"',
' gloss "edible fruit (Wikidata Q3314483); the seed-bearing edible part of a flowering plant, used as a canonical class entity in formalization examples. Rooted in the external Wikidata knowledge base through its language-independent Q-id."',
' wiktionary "fruit"',
' wikidata "Q3314483"',
' defined_by "concept"',
' role "wikidata_entity_anchor"',
' lexeme "en"',
' word "fruit"',
' description "English noun for the edible seed-bearing part of a plant; the canonical English label for Wikidata entity Q3314483."',
' word "fruits"',
' description "English plural noun for fruit; an inflected surface for Wikidata entity Q3314483."',
' word "edible fruit"',
' description "English compound noun matching the Wikidata Q3314483 label edible fruit; an explicit surface for the same entity."',
' lexeme "ru"',
' word "фрукт"',
' description "Russian noun (romanized frukt) for fruit; the Russian surface for Wikidata entity Q3314483."',
' word "фрукты"',
' description "Russian plural noun (romanized frukty) for fruits; an inflected Russian surface for Wikidata entity Q3314483."',
' word "плод"',
' description "Russian noun (romanized plod) for fruit or produce; an alternative Russian surface for Wikidata entity Q3314483."',
' lexeme "hi"',
' word "फल"',
' description "Hindi noun (romanized phal) for fruit; the Hindi surface for Wikidata entity Q3314483."',
' lexeme "zh"',
' word "水果"',
' description "Chinese noun (pinyin shuiguo) for fruit; the Chinese surface for Wikidata entity Q3314483."',
' word "水果类"',
' description "Chinese noun (pinyin shuiguolei) for the fruit category; an alternative Chinese surface for Wikidata entity Q3314483."',
' meaning "wikidata_item_sorting_algorithm"',
' gloss "sorting algorithm (Wikidata Q181593); an algorithm that arranges the elements of a list into an order, a canonical class entity for reasoning examples. Rooted in the external Wikidata knowledge base through its language-independent Q-id."',
' wiktionary "sorting algorithm"',
' wikidata "Q181593"',
' defined_by "concept"',
' role "wikidata_entity_anchor"',
' lexeme "en"',
' word "sorting algorithm"',
' description "English compound noun for an algorithm that arranges elements into order; the canonical English label for Wikidata entity Q181593."',
' word "sorting algorithms"',
' description "English plural surface for sorting algorithm; an inflected surface for Wikidata entity Q181593."',
' word "sort algorithm"',
' description "English compound noun, a shorter synonym for sorting algorithm; an alternative surface for Wikidata entity Q181593."',
' lexeme "ru"',
' word "алгоритм сортировки"',
' description "Russian compound noun (romanized algoritm sortirovki) for sorting algorithm; the Russian surface for Wikidata entity Q181593."',
' lexeme "hi"',
' word "सॉर्टिंग एल्गोरिदम"',
' description "Hindi compound noun (romanized sorting elgoridam, a loan compound) for sorting algorithm; the Hindi surface for Wikidata entity Q181593."',
' lexeme "zh"',
' word "排序算法"',
' description "Chinese compound noun (pinyin paixu suanfa) for sorting algorithm; the Chinese surface for Wikidata entity Q181593."',
' meaning "wikidata_item_water"',
' gloss "water (Wikidata Q283); the chemical substance with formula H2O, used as a canonical concrete entity in formalization examples. Rooted in the external Wikidata knowledge base through its language-independent Q-id."',
' wiktionary "water"',
' wikidata "Q283"',
' defined_by "entity"',
' role "wikidata_entity_anchor"',
' lexeme "en"',
' word "water"',
' description "English noun for the substance H2O; the canonical English label for Wikidata entity Q283."',
' lexeme "ru"',
' word "вода"',
' description "Russian noun (romanized voda) for water; the Russian surface for Wikidata entity Q283."',
' lexeme "hi"',
' word "पानी"',
' description "Hindi noun (romanized pani) for water; the Hindi surface for Wikidata entity Q283."',
' lexeme "zh"',
' word "水"',
' description "Chinese noun (pinyin shui) for water; the Chinese surface for Wikidata entity Q283."',
' meaning "wikidata_item_bread"',
' gloss "bread (Wikidata Q7802); a staple food prepared by baking dough of flour and water, used as a canonical concrete entity in formalization examples. Rooted in the external Wikidata knowledge base through its language-independent Q-id."',
' wiktionary "bread"',
' wikidata "Q7802"',
' defined_by "entity"',
' role "wikidata_entity_anchor"',
' lexeme "en"',
' word "bread"',
' description "English noun for the baked staple food made from dough; the canonical English label for Wikidata entity Q7802."',
' lexeme "ru"',
' word "хлеб"',
' description "Russian noun (romanized khleb) for bread; the Russian surface for Wikidata entity Q7802."',
' lexeme "hi"',
' word "रोटी"',
' description "Hindi noun (romanized roti) for bread or flatbread; the Hindi surface for Wikidata entity Q7802."',
' lexeme "zh"',
' word "面包"',
' description "Chinese noun (pinyin mianbao, simplified) for bread; the Chinese surface for Wikidata entity Q7802."',
' word "麵包"',
' description "Chinese noun (pinyin mianbao, traditional) for bread; the traditional Chinese surface for Wikidata entity Q7802."',
' meaning "wikidata_item_carrot"',
' gloss "carrot (Wikidata Q81); the edible orange taproot of the carrot plant, used as a canonical concrete entity in formalization examples. Rooted in the external Wikidata knowledge base through its language-independent Q-id."',
' wiktionary "carrot"',
' wikidata "Q81"',
' defined_by "entity"',
' role "wikidata_entity_anchor"',
' lexeme "en"',
' word "carrot"',
' description "English noun for the edible orange taproot; the canonical English label for Wikidata entity Q81."',
' word "carrots"',
' description "English plural noun for carrot; an inflected surface for Wikidata entity Q81."',
' lexeme "ru"',
' word "морковь"',
' description "Russian noun (romanized morkov) for carrot; the Russian surface for Wikidata entity Q81."',
' lexeme "hi"',
' word "गाजर"',
' description "Hindi noun (romanized gajar) for carrot; the Hindi surface for Wikidata entity Q81."',
' lexeme "zh"',
' word "胡萝卜"',
' description "Chinese noun (pinyin huluobo, simplified) for carrot; the Chinese surface for Wikidata entity Q81."',
' word "胡蘿蔔"',
' description "Chinese noun (pinyin huluobo, traditional) for carrot; the traditional Chinese surface for Wikidata entity Q81."',
' meaning "wikidata_item_wikidata"',
' gloss "Wikidata (Wikidata Q2013); the free collaborative knowledge base of structured data, referenced as a knowledge-source entity in formalization. Rooted in the external Wikidata knowledge base through its own language-independent Q-id."',
' wiktionary "Wikidata"',
' wikidata "Q2013"',
' defined_by "entity"',
' role "wikidata_entity_anchor"',
' lexeme "en"',
' word "Wikidata"',
' description "English proper noun for the collaborative structured knowledge base; the canonical English label for Wikidata entity Q2013."',
' lexeme "ru"',
' word "викидата"',
' description "Russian proper noun (romanized vikidata) for Wikidata; the Russian surface for Wikidata entity Q2013."',
' lexeme "hi"',
' word "विकिडेटा"',
' description "Hindi proper noun (romanized vikideta) for Wikidata; the Hindi surface for Wikidata entity Q2013."',
' lexeme "zh"',
' word "维基数据"',
' description "Chinese proper noun (pinyin weiji shuju, simplified) for Wikidata; the Chinese surface for Wikidata entity Q2013."',
' word "維基數據"',
' description "Chinese proper noun (pinyin weiji shuju, traditional) for Wikidata; the traditional Chinese surface for Wikidata entity Q2013."',
' meaning "wikidata_item_wikipedia"',
' gloss "Wikipedia (Wikidata Q52); the free collaborative online encyclopedia, referenced as a knowledge-source entity in formalization. Rooted in the external Wikidata knowledge base through its language-independent Q-id."',
' wiktionary "Wikipedia"',
' wikidata "Q52"',
' defined_by "entity"',
' role "wikidata_entity_anchor"',
' lexeme "en"',
' word "Wikipedia"',
' description "English proper noun for the collaborative online encyclopedia; the canonical English label for Wikidata entity Q52."',
' lexeme "ru"',
' word "википедия"',
' description "Russian proper noun (romanized vikipediya) for Wikipedia; the Russian surface for Wikidata entity Q52."',
' lexeme "hi"',
' word "विकिपीडिया"',
' description "Hindi proper noun (romanized vikipidiya) for Wikipedia; the Hindi surface for Wikidata entity Q52."',
' lexeme "zh"',
' word "维基百科"',
' description "Chinese proper noun (pinyin weiji baike, simplified) for Wikipedia; the Chinese surface for Wikidata entity Q52."',
' word "維基百科"',
' description "Chinese proper noun (pinyin weiji baike, traditional) for Wikipedia; the traditional Chinese surface for Wikidata entity Q52."',
' meaning "wikidata_item_wiktionary"',
' gloss "Wiktionary (Wikidata Q151); the free collaborative multilingual dictionary, referenced as a knowledge-source entity in formalization. Rooted in the external Wikidata knowledge base through its language-independent Q-id."',
' wiktionary "Wiktionary"',
' wikidata "Q151"',
' defined_by "entity"',
' role "wikidata_entity_anchor"',
' lexeme "en"',
' word "Wiktionary"',
' description "English proper noun for the collaborative multilingual dictionary; the canonical English label for Wikidata entity Q151."',
' lexeme "ru"',
' word "викисловарь"',
' description "Russian proper noun (romanized vikislovar) for Wiktionary; the Russian surface for Wikidata entity Q151."',
' lexeme "hi"',
' word "विक्षनरी"',
' description "Hindi proper noun (romanized vikshanari) for Wiktionary; the Hindi surface for Wikidata entity Q151."',
' lexeme "zh"',
' word "维基词典"',
' description "Chinese proper noun (pinyin weiji cidian, simplified) for Wiktionary; the Chinese surface for Wikidata entity Q151."',
' word "維基辭典"',
' description "Chinese proper noun (pinyin weiji cidian, traditional) for Wiktionary; the traditional Chinese surface for Wikidata entity Q151."',
' meaning "wikidata_property_subclass_of"',
' gloss "subclass of (Wikidata property P279); relates a class to a broader class that includes it, the binary relation used when formalizing taxonomic prompts. Rooted in the external Wikidata knowledge base through its language-independent P-id."',
' wiktionary "subclass of"',
' wikidata "P279"',
' defined_by "relation"',
' role "binary_relation_property"',
' lexeme "en"',
' word "subclass of"',
' description "English relational phrase naming the subclass relation; the canonical English label for Wikidata property P279."',
' word "is a kind of"',
' description "English copular phrase asserting a subclass relation; a matching surface for Wikidata property P279."',
' word "is a type of"',
' description "English copular phrase asserting a subclass relation; a matching surface for Wikidata property P279."',
' word "is subclass of"',
' description "English relational phrase asserting a subclass relation; a matching surface for Wikidata property P279."',
' word "kind of"',
' description "English partitive phrase asserting a subclass relation; a matching surface for Wikidata property P279."',
' word "type of"',
' description "English partitive phrase asserting a subclass relation; a matching surface for Wikidata property P279."',
' lexeme "ru"',
' word "род"',
' description "Russian noun (romanized rod) for genus or kind, used for the subclass relation; a matching surface for Wikidata property P279."',
' word "тип"',
' description "Russian noun (romanized tip) for type, used for the subclass relation; a matching surface for Wikidata property P279."',
' lexeme "hi"',
' word "उपवर्ग"',
' description "Hindi noun (romanized upvarg) for subclass; the Hindi surface for Wikidata property P279."',
' lexeme "zh"',
' word "子类"',
' description "Chinese noun (pinyin zilei) for subclass; the Chinese surface for Wikidata property P279."',
' meaning "wikidata_property_instance_of"',
' gloss "instance of (Wikidata property P31); relates an individual to the class it is an instance of, the binary relation used when formalizing membership prompts. Rooted in the external Wikidata knowledge base through its language-independent P-id."',
' wiktionary "instance of"',
' wikidata "P31"',
' defined_by "relation"',
' role "binary_relation_property"',
' lexeme "en"',
' word "instance of"',
' description "English relational phrase naming the instance relation; the canonical English label for Wikidata property P31."',
' word "is a"',
' description "English copular phrase asserting class membership; a matching surface for Wikidata property P31, ambiguous with the subclass relation it also admits."',
' action "wikidata_property_subclass_of"',
' word "is an"',
' description "English copular phrase asserting class membership; a matching surface for Wikidata property P31, ambiguous with the subclass relation it also admits."',
' action "wikidata_property_subclass_of"',
' word "is the"',
' description "English copular phrase asserting identity or membership; a matching surface for Wikidata property P31."',
' word "are a"',
' description "English plural copular phrase asserting class membership; a matching surface for Wikidata property P31, ambiguous with the subclass relation it also admits."',
' action "wikidata_property_subclass_of"',
' word "are an"',
' description "English plural copular phrase asserting class membership; a matching surface for Wikidata property P31, ambiguous with the subclass relation it also admits."',
' action "wikidata_property_subclass_of"',
' lexeme "ru"',
' word "является"',
' description "Russian verb (romanized yavlyaetsya) for is or constitutes; a matching surface for Wikidata property P31."',
' word "это"',
' description "Russian pronoun-copula (romanized eto) for this is; a matching surface for Wikidata property P31."',
' lexeme "hi"',
' word "है"',
' description "Hindi verb (romanized hai) for is; a matching surface for Wikidata property P31."',
' lexeme "zh"',
' word "是"',
' description "Chinese verb (pinyin shi) for is; a matching surface for Wikidata property P31."',
' meaning "wikidata_property_part_of"',
' gloss "part of (Wikidata property P361); relates a part to the whole it belongs to, the binary relation used when formalizing meronymy prompts. Rooted in the external Wikidata knowledge base through its language-independent P-id."',
' wiktionary "part of"',
' wikidata "P361"',
' defined_by "relation"',
' role "binary_relation_property"',
' lexeme "en"',
' word "part of"',
' description "English relational phrase naming the part-of relation; the canonical English label for Wikidata property P361."',
' word "is part of"',
' description "English copular phrase asserting a part-of relation; a matching surface for Wikidata property P361."',
' word "belongs to"',
' description "English relational phrase asserting membership in a whole; a matching surface for Wikidata property P361."',
' lexeme "ru"',
' word "является частью"',
' description "Russian phrase (romanized yavlyaetsya chastyu) for is part of; a matching surface for Wikidata property P361."',
' word "часть"',
' description "Russian noun (romanized chast) for part; a matching surface for Wikidata property P361."',
' lexeme "hi"',
' word "का हिस्सा"',
' description "Hindi phrase (romanized ka hissa) for part of; the Hindi surface for Wikidata property P361."',
' lexeme "zh"',
' word "属于"',
' description "Chinese verb (pinyin shuyu) for belongs to; the Chinese surface for Wikidata property P361."',
' meaning "wikidata_property_has_part"',
' gloss "has part (Wikidata property P527); relates a whole to a part it contains, the binary relation used when formalizing holonymy prompts. Rooted in the external Wikidata knowledge base through its language-independent P-id."',
' wiktionary "has part"',
' wikidata "P527"',
' defined_by "relation"',
' role "binary_relation_property"',
' lexeme "en"',
' word "has part"',
' description "English relational phrase naming the has-part relation; the canonical English label for Wikidata property P527."',
' word "has a part"',
' description "English relational phrase asserting a has-part relation; a matching surface for Wikidata property P527."',
' word "contains"',
' description "English verb asserting that a whole includes a part; a matching surface for Wikidata property P527."',
' word "includes"',
' description "English verb asserting that a whole includes a part; a matching surface for Wikidata property P527."',
' lexeme "ru"',
' word "содержит"',
' description "Russian verb (romanized soderzhit) for contains; a matching surface for Wikidata property P527."',
' lexeme "hi"',
' word "शामिल है"',
' description "Hindi phrase (romanized shamil hai) for includes or contains; the Hindi surface for Wikidata property P527."',
' lexeme "zh"',
' word "包含"',
' description "Chinese verb (pinyin baohan) for contains or includes; the Chinese surface for Wikidata property P527."',
' meaning "wikidata_property_capital"',
' gloss "capital (Wikidata property P36); relates an administrative territory to its capital city, the binary relation used when formalizing capital-of prompts. Rooted in the external Wikidata knowledge base through its language-independent P-id."',
' wiktionary "capital"',
' wikidata "P36"',
' defined_by "relation"',
' role "binary_relation_property"',
' lexeme "en"',
' word "capital"',
' description "English noun naming the capital relation; the canonical English label for Wikidata property P36."',
' word "is the capital of"',
' description "English copular phrase asserting a capital-of relation; a matching surface for Wikidata property P36."',
' word "is capital of"',
' description "English copular phrase asserting a capital-of relation; a matching surface for Wikidata property P36."',
' word "capital of"',
' description "English relational phrase asserting a capital-of relation; a matching surface for Wikidata property P36."',
' lexeme "ru"',
' word "столица"',
' description "Russian noun (romanized stolitsa) for capital city; a matching surface for Wikidata property P36."',
' lexeme "hi"',
' word "राजधानी"',
' description "Hindi noun (romanized rajdhani) for capital city; the Hindi surface for Wikidata property P36."',
' lexeme "zh"',
' word "首都"',
' description "Chinese noun (pinyin shoudu) for capital city; the Chinese surface for Wikidata property P36."',
' meaning "wikidata_property_named_after"',
' gloss "named after (Wikidata property P138); relates an entity to the thing it is named after, the binary relation used when formalizing eponym prompts. Rooted in the external Wikidata knowledge base through its language-independent P-id."',
' wiktionary "named after"',
' wikidata "P138"',
' defined_by "relation"',
' role "binary_relation_property"',
' lexeme "en"',
' word "named after"',
' description "English relational phrase naming the named-after relation; the canonical English label for Wikidata property P138."',
' word "is named after"',
' description "English copular phrase asserting a named-after relation; a matching surface for Wikidata property P138."',
' lexeme "ru"',
' word "назван в честь"',
' description "Russian phrase (romanized nazvan v chest) for named in honor of; a matching surface for Wikidata property P138."',
' lexeme "hi"',
' word "के नाम पर"',
' description "Hindi phrase (romanized ke naam par) for named after; the Hindi surface for Wikidata property P138."',
' lexeme "zh"',
' word "命名自"',
' description "Chinese phrase (pinyin mingming zi) for named after; the Chinese surface for Wikidata property P138."',
' meaning "wikidata_property_translation"',
' gloss "translation (Wikidata property P5972); relates a lexeme sense to its translation in another language, the property an action prompt resolves to when asking to translate a term. Rooted in the external Wikidata knowledge base through its language-independent P-id."',
' wiktionary "translation"',
' wikidata "P5972"',
' defined_by "relation"',
' role "translation_property"',
' lexeme "en"',
' word "translation"',
' description "English noun naming the translation relation; the canonical English label for Wikidata property P5972."',
' word "translate"',
' description "English verb for rendering a term in another language; a coverage surface for Wikidata property P5972."',
' word "translates"',
' description "English verb (third person) for rendering a term in another language; a coverage surface for Wikidata property P5972."',
' lexeme "ru"',
' word "переведи"',
' description "Russian verb (romanized perevedi, imperative translate) for translation; a coverage surface for Wikidata property P5972."',
' word "перевести"',
' description "Russian verb (romanized perevesti, infinitive to translate) for translation; a coverage surface for Wikidata property P5972."',
' lexeme "hi"',
' word "अनुवाद"',
' description "Hindi noun (romanized anuvad) for translation; the Hindi surface for Wikidata property P5972."',
' lexeme "zh"',
' word "翻译"',
' description "Chinese verb (pinyin fanyi, simplified) for translate; the Chinese surface for Wikidata property P5972."',
' word "翻譯"',
' description "Chinese verb (pinyin fanyi, traditional) for translate; the traditional Chinese surface for Wikidata property P5972."',
' meaning "wikidata_property_item_for_this_sense"',
' gloss "item for this sense (Wikidata property P5137); relates a dictionary sense to the Wikidata item that captures its meaning, the binary relation used when formalizing means prompts. Rooted in the external Wikidata knowledge base through its language-independent P-id."',
' wiktionary "item for this sense"',
' wikidata "P5137"',
' defined_by "relation"',
' role "binary_relation_property"',
' lexeme "en"',
' word "item for this sense"',
' description "English relational phrase naming the item-for-this-sense relation; the canonical English label for Wikidata property P5137."',
' word "means"',
' description "English verb asserting that a term has a meaning; a matching surface for Wikidata property P5137."',
' word "meaning of"',
' description "English relational phrase asserting the meaning of a term; a matching surface for Wikidata property P5137."',
' word "meaning item"',
' description "English compound noun naming the item that captures a sense; a matching surface for Wikidata property P5137."',
' word "sense item"',
' description "English compound noun naming the item for a sense; a matching surface for Wikidata property P5137."',
' lexeme "ru"',
' word "означает"',
' description "Russian verb (romanized oznachaet) for means; a matching surface for Wikidata property P5137."',
' lexeme "hi"',
' word "अर्थ"',
' description "Hindi noun (romanized arth) for meaning; the Hindi surface for Wikidata property P5137."',
' lexeme "zh"',
' word "意思"',
' description "Chinese noun (pinyin yisi) for meaning; the Chinese surface for Wikidata property P5137."',
"meanings",
' meaning "behavior_rule"',
" gloss \"the rule itself — a single When-X-then-Y conditional that governs how the assistant responds, the noun a listing request enumerates. It is both a relation (a condition mapped to a response) and part of the assistant's knowledge (its stored, chat-editable conduct), so it is defined_by both. A behavior-rules-list recogniser reads this role to decide the prompt names rules at all; on its own that is not enough — the request and scope roles must also be present, within one language, for the prompt to count as a list query. The surface forms are matched as raw substrings so an inflected stem catches its whole paradigm.\"",
' wiktionary "rule"',
' defined_by "relation"',
' defined_by "knowledge"',
' role "rule_listing_subject"',
' lexeme "en"',
' word "rules"',
' description "English plural noun (rules) naming the behavior rules to enumerate; matched as a raw substring."',
' word "rule list"',
" description \"English noun phrase (singular rule + list) so 'show my rule list' is recognised even though it lacks the plural 'rules'.\"",
' word "rules list"',
' description "English noun phrase (plural rules + list); explicit variant kept for parity with the singular form."',
' lexeme "ru"',
' word "правил"',
' description "Russian noun stem (romanized pravil, genitive plural of правило, rule); matched as a substring so it also catches правила/правилами."',
' word "правила"',
' description "Russian noun form (romanized pravila, nominative plural / genitive singular of правило, rule)."',
' lexeme "hi"',
' word "नियम"',
' description "Hindi noun (romanized niyam, rule); the bare stem, matched as a substring so it also catches inflections like नियमों."',
' word "नियमों"',
' description "Hindi oblique-plural noun (romanized niyamon, of rules)."',
' lexeme "zh"',
' word "规则"',
' description "Chinese noun (pinyin guize, rule) in simplified script."',
' word "規則"',
' description "Chinese noun (pinyin guize, rule) in traditional script."',
' meaning "rule_enumeration_request"',
" gloss \"the request to reveal the members of a set — either the imperative to list or show them, or the which/what interrogative that asks for them. It is an action (an enumerate operation) framed as an inquiry (a question put to the assistant), so it is defined_by both. Combined with the subject and scope roles it identifies a behavior-rules-list prompt; alone it is just a generic 'show me' verb. Imperatives and interrogatives are grouped here because both equally ask the assistant to enumerate the rule set.\"",
' wiktionary "list"',
' defined_by "action"',
' defined_by "inquiry"',
' role "rule_listing_request"',
' lexeme "en"',
' word "list"',
" description \"English verb (list) — the imperative to enumerate a set's members.\"",
' word "show"',
" description \"English verb (show) — the imperative to display a set's members.\"",
' word "what"',
" description \"English interrogative (what) opening a request for the members of a set ('what behavior rules…').\"",
' word "which"',
" description \"English interrogative (which) selecting among a set's members.\"",
' lexeme "ru"',
' word "список"',
" description \"Russian noun (romanized spisok, a list); used as the nominalised request 'give the list of …'.\"",
' word "перечисли"',
' description "Russian verb (romanized perechisli, enumerate, imperative) — list them one by one."',
' word "покажи"',
' description "Russian verb (romanized pokazhi, show, imperative)."',
' word "какие"',
' description "Russian interrogative (romanized kakiye, which / what kind) asking which members a set has."',
' lexeme "hi"',
' word "सूची"',
' description "Hindi noun (romanized suchi, a list)."',
' word "सूचीबद्ध"',
" description \"Hindi adjective/verb (romanized suchibaddh, listed / enumerated), as in 'list them'.\"",
' word "दिखाओ"',
' description "Hindi verb (romanized dikhao, show, informal imperative)."',
' word "दिखाएं"',
' description "Hindi verb (romanized dikhaen, show, polite imperative)."',
' word "बताओ"',
' description "Hindi verb (romanized batao, tell, imperative)."',
' word "गिनाओ"',
' description "Hindi verb (romanized ginao, enumerate / count off, imperative)."',
' word "कौन"',
' description "Hindi interrogative (romanized kaun, who / which) asking which members a set has."',
' lexeme "zh"',
' word "列出"',
' description "Chinese verb (pinyin liechu, list out)."',
' word "显示"',
' description "Chinese verb (pinyin xianshi, display) in simplified script."',
' word "顯示"',
' description "Chinese verb (pinyin xianshi, display) in traditional script."',
' word "展示"',
' description "Chinese verb (pinyin zhanshi, show / exhibit)."',
' word "哪些"',
" description \"Chinese interrogative (pinyin naxie, which ones) asking for a set's members.\"",
' word "什么"',
' description "Chinese interrogative (pinyin shenme, what)."',
' meaning "behavior_domain"',
" gloss \"the domain of conduct — behaviour itself, the dimension the rules govern. Naming it scopes a rules-listing request to the assistant's behaviour rather than some other rule set. It is a concept (an abstract domain) and a facet of the assistant's self (how it acts), so it is defined_by self_reference and concept. One of two meanings carrying the rule_listing_scope role; the other is assistant_own_ruleset. Surface forms match as raw substrings.\"",
' wiktionary "behavior"',
' defined_by "self_reference"',
' defined_by "concept"',
' role "rule_listing_scope"',
' lexeme "en"',
' word "behavior"',
' description "English noun (behavior, US spelling) naming the conduct that the rules govern."',
' lexeme "ru"',
' word "поведения"',
' description "Russian noun (romanized povedeniya, genitive of поведение, behaviour); the stem matched as a substring."',
' lexeme "hi"',
' word "व्यवहार"',
' description "Hindi noun (romanized vyavahar, behaviour / conduct)."',
' lexeme "zh"',
' word "行为"',
' description "Chinese noun (pinyin xingwei, behaviour) in simplified script."',
' word "行為"',
' description "Chinese noun (pinyin xingwei, behaviour) in traditional script."',
' meaning "assistant_own_ruleset"',
" gloss \"the requester pointing at the assistant's OWN, already-existing rule set — the second-person possessive (your), the reflexive own (own / собственные / 自己), the existence deixis (current / existing), and the bare rule-list compound that already names the set (список правил / नियमों की सूची / 规则列表). Any of these scopes a listing request to the assistant's stored rules. It is defined_by self_reference (it points back at the assistant) and knowledge (its existing set). The word set mirrors the recogniser exactly; the per-language cues are not parallel — only English carries a distinct current/existing deixis — so they are grouped here under the single notion of the assistant's own existing rules rather than split into meanings that some languages could not fill.\"",
' wiktionary "own"',
' defined_by "self_reference"',
' defined_by "knowledge"',
' role "rule_listing_scope"',
' lexeme "en"',
' word "your"',
' description "English second-person possessive (your) scoping the rules to the assistant addressed."',
' word "own"',
" description \"English reflexive determiner (own), as in 'your own rules'.\"",
' word "current"',
' description "English deictic adjective (current) selecting the rules in force now."',
' word "existing"',
' description "English participial adjective (existing) selecting the rules that already exist."',
' lexeme "ru"',
' word "свои"',
" description \"Russian reflexive possessive (romanized svoi, one's own, nominative plural).\"",
' word "своих"',
" description \"Russian reflexive possessive (romanized svoikh, one's own, genitive / prepositional plural).\"",
' word "твои"',
' description "Russian second-person possessive (romanized tvoi, your, nominative plural, informal)."',
' word "твоих"',
' description "Russian second-person possessive (romanized tvoikh, your, genitive / prepositional plural, informal)."',
' word "собственные"',
' description "Russian adjective (romanized sobstvennye, own / proper, plural)."',
' word "список правил"',
' description "Russian noun phrase (romanized spisok pravil, list of rules) — the bare compound that already names the set, so it scopes the request by itself."',
' lexeme "hi"',
' word "अपने"',
" description \"Hindi reflexive possessive (romanized apne, one's own, oblique / plural).\"",
' word "तुम्हारे"',
' description "Hindi second-person possessive (romanized tumhare, your, informal plural)."',
' word "आपके"',
' description "Hindi second-person possessive (romanized aapke, your, polite)."',
' word "नियमों की सूची"',
' description "Hindi noun phrase (romanized niyamon ki suchi, list of rules) — the compound that already names the set."',
' lexeme "zh"',
' word "你的"',
' description "Chinese second-person possessive (pinyin nide, your, informal)."',
' word "您的"',
' description "Chinese second-person possessive (pinyin ninde, your, polite)."',
' word "自己"',
' description "Chinese reflexive (pinyin ziji, oneself / own)."',
' word "规则列表"',
' description "Chinese noun phrase (pinyin guize liebiao, rule list) in simplified script — the compound that already names the set."',
' word "規則列表"',
' description "Chinese noun phrase (pinyin guize liebiao, rule list) in traditional script."',
' meaning "behavior_rule_set_phrase"',
" gloss \"fixed multi-word phrases that directly name the assistant's behavior-rule set and are recognised as a list request even without a separate enumerate verb — most importantly the bare compound 'behavior rules' / 行为规则 / व्यवहार के नियम, where the noun phrase alone is a standing request to see the catalogue. The verbed variants (list / show … behavior rules) are kept so the phrase set matches the prior hand-listed recogniser exactly and stays symmetric across the supported languages, even though most of them are also reachable by composing the subject, request, and scope roles. Defined_by inquiry (each phrase is itself a request) and knowledge (it names the stored rule set). Matched as raw substrings.\"",
' wiktionary "rule"',
' defined_by "inquiry"',
' defined_by "knowledge"',
' role "rule_listing_phrase"',
' lexeme "en"',
' word "list behavior rules"',
' description "English imperative phrase requesting the behavior-rule catalogue."',
' word "list all behavior rules"',
" description \"English imperative phrase (with 'all') requesting the entire behavior-rule catalogue.\"",
' word "show behavior rules"',
' description "English imperative phrase requesting display of the behavior rules."',
' word "show all behavior rules"',
" description \"English imperative phrase (with 'all') requesting display of every behavior rule.\"",
' word "what behavior rules"',
' description "English interrogative phrase asking which behavior rules exist."',
' word "existing behavior rules"',
' description "English noun phrase naming the behavior rules already in force; recognised as a standing request to list them even without an enumerate verb."',
' lexeme "ru"',
' word "список правил поведения"',
' description "Russian noun phrase (romanized spisok pravil povedeniya, list of behavior rules)."',
' word "покажи правила поведения"',
' description "Russian imperative phrase (romanized pokazhi pravila povedeniya, show the behavior rules)."',
' word "какие правила поведения"',
' description "Russian interrogative phrase (romanized kakiye pravila povedeniya, which behavior rules)."',
' lexeme "hi"',
' word "व्यवहार के नियम"',
' description "Hindi noun phrase (romanized vyavahar ke niyam, rules of behaviour) — the bare compound recognised as a standing list request."',
' word "व्यवहार नियम सूचीबद्ध करें"',
' description "Hindi imperative phrase (romanized vyavahar niyam suchibaddh karen, list the behavior rules)."',
' lexeme "zh"',
' word "行为规则"',
' description "Chinese noun phrase (pinyin xingwei guize, behavior rules) — the bare compound recognised as a standing list request."',
' word "列出行为规则"',
' description "Chinese imperative phrase (pinyin liechu xingwei guize, list the behavior rules)."',
"meanings",
' meaning "prove"',
' gloss "the act of establishing a claim by formal argument — to prove, to demonstrate, or to give a proof. It is both an inquiry (the user asks the assistant to settle a truth) and an action (the assistant carries out a proof). Two roles share this meaning, separated by slot. The proof_directive bare forms are the imperative verbs (prove, докажи, …) detected clause-initially with a verb boundary, so prover and proven never false-match. The proof_claim_scaffold prefix forms end in … and are stripped to extract the claim the user wants proved; their declaration order is significant because the extractor takes the first matching prefix, so each that variant is listed before its shorter sibling. Hindi and Chinese carry no bare directive — their proof is detected by the proof_assertion substring markers — but they still carry claim scaffolds so extraction works in every language."',
' wiktionary "prove"',
' defined_by "inquiry"',
' defined_by "action"',
' role "proof_directive"',
' role "proof_claim_scaffold"',
' lexeme "en"',
' word "prove"',
' description "English verb (to prove); a bare proof directive detected clause-initially with a verb boundary so prover and proven do not match."',
' word "proof"',
' description "English noun (a proof); a bare proof directive detected clause-initially with a verb boundary."',
' word "prove that …"',
' description "English scaffold prefix; the claim follows prove that, listed before the shorter prove so that is not kept in the claim."',
' word "prove …"',
' description "English scaffold prefix; the claim follows the bare verb prove."',
' word "proof of …"',
' description "English scaffold prefix; the claim follows proof of."',
' word "proof that …"',
' description "English scaffold prefix; the claim follows proof that."',
' word "show that …"',
' description "English scaffold prefix; the claim follows show that."',
' word "demonstrate that …"',
' description "English scaffold prefix; the claim follows demonstrate that, listed before the shorter demonstrate."',
' word "demonstrate …"',
' description "English scaffold prefix; the claim follows the bare verb demonstrate."',
' word "can you prove that …"',
' description "English polite scaffold prefix; the claim follows can you prove that, listed before the shorter can you prove."',
' word "can you prove …"',
' description "English polite scaffold prefix; the claim follows can you prove."',
' word "could you prove that …"',
' description "English polite scaffold prefix; the claim follows could you prove that, before the shorter could you prove."',
' word "could you prove …"',
' description "English polite scaffold prefix; the claim follows could you prove."',
' word "please prove that …"',
' description "English polite scaffold prefix; the claim follows please prove that, before the shorter please prove."',
' word "please prove …"',
' description "English polite scaffold prefix; the claim follows please prove."',
' word "give me a proof of …"',
' description "English scaffold prefix; the claim follows give me a proof of."',
' word "give me a proof that …"',
' description "English scaffold prefix; the claim follows give me a proof that."',
' word "give a proof of …"',
' description "English scaffold prefix; the claim follows give a proof of."',
' word "give a proof that …"',
' description "English scaffold prefix; the claim follows give a proof that."',
' lexeme "ru"',
' word "докажи"',
' description "Russian imperative (romanized dokazhi, prove); a bare proof directive detected clause-initially with a verb boundary."',
' word "докажите"',
' description "Russian polite imperative (romanized dokazhite, prove); a bare proof directive detected clause-initially."',
' word "доказать"',
' description "Russian infinitive (romanized dokazat, to prove); a bare proof directive detected clause-initially."',
' word "доказательство"',
' description "Russian noun (romanized dokazatelstvo, a proof); a bare proof directive detected clause-initially."',
' word "докажи что …"',
' description "Russian scaffold prefix (romanized dokazhi chto); the claim follows, listed before the shorter докажи."',
' word "докажите что …"',
' description "Russian scaffold prefix (romanized dokazhite chto); the claim follows, listed before the shorter докажите."',
' word "доказать что …"',
' description "Russian scaffold prefix (romanized dokazat chto); the claim follows, listed before the shorter доказать."',
' word "докажите …"',
' description "Russian scaffold prefix (romanized dokazhite); the claim follows the polite imperative."',
' word "докажи …"',
' description "Russian scaffold prefix (romanized dokazhi); the claim follows the imperative."',
' word "доказать …"',
' description "Russian scaffold prefix (romanized dokazat); the claim follows the infinitive."',
' word "доказательство …"',
' description "Russian scaffold prefix (romanized dokazatelstvo); the claim follows the noun."',
' lexeme "hi"',
' word "साबित करो कि …"',
' description "Hindi scaffold prefix (romanized sabit karo ki); the claim follows."',
' word "साबित कीजिए कि …"',
' description "Hindi polite scaffold prefix (romanized sabit kijie ki); the claim follows."',
' word "साबित कर …"',
' description "Hindi scaffold prefix (romanized sabit kar); the claim follows the bare verb."',
' word "सिद्ध कीजिए कि …"',
' description "Hindi polite scaffold prefix (romanized siddh kijie ki); the claim follows."',
' word "सिद्ध करो कि …"',
' description "Hindi scaffold prefix (romanized siddh karo ki); the claim follows."',
' lexeme "zh"',
' word "证明…"',
' description "Chinese verb (pinyin zhengming, to prove) in simplified script; scaffold prefix, the claim follows."',
' word "證明…"',
' description "Chinese verb (pinyin zhengming, to prove) in traditional script; scaffold prefix, the claim follows."',
' meaning "proof_request_frame"',
' gloss "a broad request frame that asks for a proof without naming the claim with a that clause — can you prove, please prove, give me a proof, show that, demonstrate that, and their counterparts in every supported language. These leads are detected by a plain starts_with (no verb boundary, no claim extraction), so a prompt like can you prove the riemann hypothesis is recognised even though it carries no that. The Russian, Hindi and Chinese leads each embed a proof_assertion marker (доказать, सिद्ध, 证明, …), so a prompt that opens with one is already caught by that mid-prompt marker; they are lexicalised here too so the request-frame concept is complete in every language and so a lead that carries no claim is still recognised. In English the assertion markers cover only prove that and proof of, so the English leads are the sole surface that recognises a polite request such as can you prove the riemann hypothesis."',
' wiktionary "proof"',
' defined_by "inquiry"',
' defined_by "prove"',
' role "proof_request_lead"',
' lexeme "en"',
' word "can you prove…"',
' description "English request-frame lead; starts_with can you prove (no trailing space) so it also fires without a following that."',
' word "could you prove…"',
' description "English request-frame lead; starts_with could you prove (no trailing space)."',
' word "please prove…"',
' description "English request-frame lead; starts_with please prove (no trailing space)."',
' word "give me a proof…"',
' description "English request-frame lead; starts_with give me a proof (no trailing space)."',
' word "give a proof…"',
' description "English request-frame lead; starts_with give a proof (no trailing space)."',
' word "show that …"',
' description "English request-frame lead; starts_with show that (with a trailing space)."',
' word "demonstrate that …"',
' description "English request-frame lead; starts_with demonstrate that (with a trailing space)."',
' lexeme "ru"',
' word "можешь доказать…"',
' description "Russian polite request-frame lead (romanized mozhesh dokazat, can you prove); starts_with можешь доказать and embeds the доказать assertion marker."',
' word "можете доказать…"',
' description "Russian polite request-frame lead (romanized mozhete dokazat, can you prove); starts_with можете доказать and embeds the доказать assertion marker."',
' word "сможешь доказать…"',
' description "Russian polite request-frame lead (romanized smozhesh dokazat, could you prove); starts_with сможешь доказать and embeds the доказать assertion marker."',
' word "пожалуйста докажи…"',
' description "Russian polite request-frame lead (romanized pozhaluysta dokazhi, please prove); starts_with пожалуйста докажи and embeds the докажи assertion marker."',
' word "пожалуйста докажите…"',
' description "Russian polite request-frame lead (romanized pozhaluysta dokazhite, please prove); starts_with пожалуйста докажите and embeds the докажите assertion marker."',
' lexeme "hi"',
' word "क्या आप साबित कर सकते हैं…"',
' description "Hindi polite request-frame lead (romanized kya aap sabit kar sakte hain, can you prove); starts_with the phrase and embeds the साबित कर assertion marker."',
' word "क्या आप सिद्ध कर सकते हैं…"',
' description "Hindi polite request-frame lead (romanized kya aap siddh kar sakte hain, can you prove); starts_with the phrase and embeds the सिद्ध कर assertion marker."',
' word "कृपया सिद्ध कीजिए…"',
' description "Hindi polite request-frame lead (romanized kripya siddh kijie, please prove); starts_with the phrase and embeds the सिद्ध कीजिए assertion marker."',
' word "कृपया साबित कीजिए…"',
' description "Hindi polite request-frame lead (romanized kripya sabit kijie, please prove); starts_with the phrase and embeds the साबित कीजिए assertion marker."',
' lexeme "zh"',
' word "你能证明…"',
' description "Chinese polite request-frame lead (pinyin ni neng zhengming, can you prove) in simplified script; starts_with 你能证明 and embeds the 证明 assertion marker."',
' word "你能證明…"',
' description "Chinese polite request-frame lead (pinyin ni neng zhengming, can you prove) in traditional script; starts_with 你能證明 and embeds the 證明 assertion marker."',
' word "请证明…"',
' description "Chinese polite request-frame lead (pinyin qing zhengming, please prove) in simplified script; starts_with 请证明 and embeds the 证明 assertion marker."',
' word "請證明…"',
' description "Chinese polite request-frame lead (pinyin qing zhengming, please prove) in traditional script; starts_with 請證明 and embeds the 證明 assertion marker."',
' meaning "proof_assertion"',
' gloss "a proof verb or noun appearing anywhere inside a prompt, not just clause-initially — the mid-sentence assertion that a proof is wanted. Its surfaces are matched as raw substrings (not whole tokens), so the English and Russian forms are stored space-wrapped to enforce a word boundary while the Devanagari and Han forms match bare. The four Russian markers (докажи, докажите, доказать, доказательство) keep the Rust solver and the browser worker in lockstep."',
' wiktionary "proof"',
' defined_by "inquiry"',
' defined_by "prove"',
' role "proof_marker"',
' lexeme "en"',
' word " prove that "',
' description "English space-wrapped substring marker; a proof assertion appearing mid-prompt (… prove that …)."',
' word " proof of "',
' description "English space-wrapped substring marker; a proof assertion appearing mid-prompt (… proof of …)."',
' lexeme "ru"',
' word " докажи "',
' description "Russian space-wrapped substring marker (romanized dokazhi); a proof assertion mid-prompt."',
' word " докажите "',
' description "Russian space-wrapped substring marker (romanized dokazhite); a proof assertion mid-prompt."',
' word " доказать "',
' description "Russian space-wrapped substring marker (romanized dokazat); a proof assertion mid-prompt."',
' word " доказательство "',
' description "Russian space-wrapped substring marker (romanized dokazatelstvo); a proof assertion mid-prompt."',
' lexeme "hi"',
' word "साबित कर"',
' description "Hindi substring marker (romanized sabit kar, prove) matched bare across inflections."',
' word "साबित कीजिए"',
' description "Hindi polite substring marker (romanized sabit kijie, prove)."',
' word "साबित कीजिये"',
' description "Hindi polite substring marker (romanized sabit kijiye, prove), alternate spelling."',
' word "सिद्ध कर"',
' description "Hindi substring marker (romanized siddh kar, prove)."',
' word "सिद्ध कीजिए"',
' description "Hindi polite substring marker (romanized siddh kijie, prove)."',
' word "सिद्ध कीजिये"',
' description "Hindi polite substring marker (romanized siddh kijiye, prove), alternate spelling."',
' word "प्रमाण"',
' description "Hindi noun (romanized praman, proof) matched as a bare substring."',
' lexeme "zh"',
' word "证明"',
' description "Chinese verb (pinyin zhengming, to prove) in simplified script, matched as a bare substring."',
' word "證明"',
' description "Chinese verb (pinyin zhengming, to prove) in traditional script, matched as a bare substring."',
' meaning "godel"',
' gloss "the surname Gödel (Kurt Gödel) and his incompleteness theorems, named inside a proof prompt. When present, the proof engine selects the incompleteness interpretation. Its surfaces are bare substring markers read by the Rust solver; the browser worker embeds the same data but its simpler proof engine does not branch on it."',
' wiktionary "Gödel"',
' defined_by "concept"',
' role "proof_concept_godel"',
' lexeme "en"',
' word "godel"',
' description "English transliteration of the surname Gödel; a bare substring marker steering the proof toward incompleteness."',
' word "gödel"',
' description "Umlaut spelling of the surname Gödel; a bare substring marker for the incompleteness concept."',
' lexeme "ru"',
' word "гёдел"',
' description "Russian transliteration (romanized gyodel) of the surname Gödel; a bare substring marker."',
' word "гёделя"',
' description "Russian genitive (romanized gyodelya) of the surname Gödel; a bare substring marker."',
' word "гедел"',
' description "Russian transliteration without yo (romanized gedel) of the surname Gödel; a bare substring marker."',
' lexeme "hi"',
' word "गोडेल"',
' description "Hindi transliteration (romanized godel) of the surname Gödel; a bare substring marker."',
' lexeme "zh"',
' word "哥德尔"',
' description "Chinese transliteration (pinyin gedeer) of the surname Gödel; a bare substring marker."',
' meaning "determinism"',
' gloss "the concept of determinism — that every state is fixed by prior causes — named inside a proof prompt. When present, the proof engine selects the determinism interpretation. Its surfaces are bare substring markers read by the Rust solver; the browser worker embeds the same data but its simpler proof engine does not branch on it."',
' wiktionary "determinism"',
' defined_by "concept"',
' role "proof_concept_determinism"',
' lexeme "en"',
' word "determinism"',
' description "English noun for determinism; a bare substring marker steering the proof toward the determinism interpretation."',
' word "deterministic"',
' description "English adjective (deterministic); a bare substring marker for the determinism concept."',
' lexeme "ru"',
' word "детерминизм"',
' description "Russian noun (romanized determinizm) for determinism; a bare substring marker."',
' lexeme "hi"',
' word "निर्धारणवाद"',
' description "Hindi noun (romanized nirdharanvad) for determinism; a bare substring marker."',
' lexeme "zh"',
' word "决定论"',
' description "Chinese noun (pinyin juedinglun) for determinism; a bare substring marker."',
"meanings",
' meaning "physical_action_query"',
' gloss "a question that asks whether the assistant performed a bodily action it cannot perform, because the assistant has no physical body. The physical_action_trigger forms are crude taunts matched as raw substrings, so recognition is language-independent and tolerant of inflection. Content-policy screening runs before this handler, so any surface that is also flagged as vulgar content is refused first; a surface that passes screening receives a factual reply stating the assistant has no physical body, localized to the language of the prompt. The Russian forms are inflections of the verb сосать; the other supported languages carry an equivalent interrogative so the concept is lexicalized everywhere."',
' wiktionary "body"',
' defined_by "inquiry"',
' defined_by "action"',
' role "physical_action_trigger"',
' lexeme "en"',
' word "did you suck"',
' description "English interrogative; it contains the vulgar marker you suck, so content-policy screening refuses it before this handler runs and it never reaches the factual reply."',
' lexeme "ru"',
' word "сосал"',
' description "Russian past-tense masculine (romanized sosal, sucked); a physical_action_trigger matched as a raw substring."',
' word "сосала"',
' description "Russian past-tense feminine (romanized sosala, sucked); a physical_action_trigger matched as a raw substring."',
' word "сосёшь"',
' description "Russian second-person present (romanized sosyosh, you suck); a physical_action_trigger matched as a raw substring."',
' word "соси"',
' description "Russian imperative (romanized sosi, suck); a physical_action_trigger matched as a raw substring."',
' word "сосать"',
' description "Russian infinitive (romanized sosat, to suck); a physical_action_trigger matched as a raw substring."',
' lexeme "hi"',
' word "क्या तुमने चूसा"',
' description "Hindi interrogative (romanized kya tumne chusa, did you suck); a physical_action_trigger matched as a raw substring."',
' lexeme "zh"',
' word "你吸了吗"',
' description "Chinese interrogative (pinyin ni xi le ma, did you suck); a physical_action_trigger matched as a raw substring."',
' meaning "circular_joke_idiom"',
" gloss \"«Купи слона» — a well-known Russian children's circular-joke idiom. The game works by repetition: whatever the listener replies, the speaker answers everyone says that, but you buy an elephant!, and the traditional winning reply is everyone has an elephant, but I do not. The circular_joke_phrase forms are matched as raw substrings so the assistant recognises the idiom instead of letting it fall through to an unknown prompt, and the localized reply explains the game in the language of the prompt. The phrase is lexicalized in every supported language as the calque buy an elephant.\"",
' wiktionary "elephant"',
' defined_by "inquiry"',
' defined_by "concept"',
' role "circular_joke_phrase"',
' lexeme "en"',
' word "buy an elephant"',
' description "English calque of the Russian idiom; the concept lexicalized in English, matched as a raw substring."',
' lexeme "ru"',
' word "купи слона"',
' description "Russian imperative phrase (romanized kupi slona, buy an elephant); the opening line of the circular-joke game, matched as a raw substring."',
' lexeme "hi"',
' word "हाथी खरीदो"',
' description "Hindi calque (romanized haathi khareedo, buy an elephant); the concept lexicalized in Hindi, matched as a raw substring."',
' lexeme "zh"',
' word "买大象"',
' description "Chinese calque (pinyin mai daxiang, buy an elephant); the concept lexicalized in Chinese, matched as a raw substring."',
' meaning "vulgar_content"',
' gloss "a marker that a message contains vulgar or obscene language, which the assistant refuses with a polite content-policy reply before any other handler runs. The vulgar_content_marker forms are profanities and slurs matched as raw substrings, so screening is language-independent and tolerant of inflection: the English and Russian forms are migrated verbatim from the original hardcoded lists, and Hindi and Chinese carry equivalent obscenities so the concept is lexicalized in every supported language. A surface that is also a physical_action_trigger is therefore refused here first, which is why «did you suck» never reaches the factual physical-action reply."',
' wiktionary "profanity"',
' defined_by "concept"',
' role "vulgar_content_marker"',
' lexeme "en"',
' word "fuck you"',
' description "English profanity directed at the listener; a vulgar_content_marker matched as a raw substring."',
' word "fuckyou"',
' description "English profanity directed at the listener, written without a space; a vulgar_content_marker matched as a raw substring."',
' word "suck my"',
' description "English crude imperative fragment; a vulgar_content_marker matched as a raw substring so any completion is caught."',
' word "suck my dick"',
' description "English crude imperative; a vulgar_content_marker matched as a raw substring."',
' word "suck my cock"',
' description "English crude imperative; a vulgar_content_marker matched as a raw substring."',
' word "you suck"',
' description "English derogatory taunt; a vulgar_content_marker matched as a raw substring, which is why «did you suck» is refused before the physical-action handler runs."',
' word "eat shit"',
' description "English crude insult; a vulgar_content_marker matched as a raw substring."',
' word "go to hell"',
' description "English hostile dismissal; a vulgar_content_marker matched as a raw substring."',
' word "asshole"',
' description "English vulgar insult; a vulgar_content_marker matched as a raw substring."',
' word "motherfucker"',
' description "English vulgar insult; a vulgar_content_marker matched as a raw substring."',
' word "you fucking"',
' description "English profane intensifier aimed at the listener; a vulgar_content_marker matched as a raw substring."',
' word "piece of shit"',
' description "English vulgar insult; a vulgar_content_marker matched as a raw substring."',
' lexeme "ru"',
' word "ебать"',
' description "Russian obscenity (romanized ebat, the infinitive to fuck); a vulgar_content_marker matched as a raw substring."',
' word "ебёт"',
' description "Russian obscenity (romanized ebyot, third-person fucks); a vulgar_content_marker matched as a raw substring."',
' word "ебал"',
' description "Russian obscenity (romanized ebal, past-tense fucked); a vulgar_content_marker matched as a raw substring."',
' word "ёб"',
' description "Russian obscenity (romanized yob, a short past-tense expletive); a vulgar_content_marker matched as a raw substring."',
' word "еблан"',
' description "Russian vulgar insult (romanized eblan, idiot); a vulgar_content_marker matched as a raw substring."',
' word "пизда"',
' description "Russian obscenity (romanized pizda, cunt); a vulgar_content_marker matched as a raw substring."',
' word "пиздец"',
' description "Russian obscenity (romanized pizdets, an expletive for a disastrous situation); a vulgar_content_marker matched as a raw substring."',
' word "пиздёж"',
' description "Russian obscenity (romanized pizdyozh, bullshit); a vulgar_content_marker matched as a raw substring."',
' word "хуй"',
' description "Russian obscenity (romanized khuy, dick); a vulgar_content_marker matched as a raw substring."',
' word "хуёв"',
' description "Russian obscenity (romanized khuyov, the genitive plural of dick); a vulgar_content_marker matched as a raw substring."',
' word "хуйня"',
' description "Russian obscenity (romanized khuynya, nonsense or crap); a vulgar_content_marker matched as a raw substring."',
' word "блядь"',
' description "Russian obscenity (romanized blyad, whore or damn); a vulgar_content_marker matched as a raw substring."',
' word "блядство"',
' description "Russian obscenity (romanized blyadstvo, debauchery); a vulgar_content_marker matched as a raw substring."',
' word "залупа"',
' description "Russian vulgar insult (romanized zalupa, glans, used as a crude insult); a vulgar_content_marker matched as a raw substring."',
' word "мудак"',
' description "Russian vulgar insult (romanized mudak, asshole); a vulgar_content_marker matched as a raw substring."',
' word "мудила"',
' description "Russian vulgar insult (romanized mudila, asshole or jerk); a vulgar_content_marker matched as a raw substring."',
' word "шлюха"',
' description "Russian derogatory term (romanized shlyukha, slut); a vulgar_content_marker matched as a raw substring."',
' word "проститутка"',
' description "Russian term (romanized prostitutka, prostitute) used here as a derogatory insult; a vulgar_content_marker matched as a raw substring."',
' word "ублюдок"',
' description "Russian vulgar insult (romanized ublyudok, bastard); a vulgar_content_marker matched as a raw substring."',
' word "сука"',
' description "Russian vulgar insult (romanized suka, bitch); a vulgar_content_marker matched as a raw substring."',
' word "пидор"',
' description "Russian homophobic slur (romanized pidor); a vulgar_content_marker matched as a raw substring."',
' word "пидорас"',
' description "Russian homophobic slur (romanized pidoras); a vulgar_content_marker matched as a raw substring."',
' lexeme "hi"',
' word "मादरचोद"',
' description "Hindi obscenity (romanized madarchod, motherfucker); a vulgar_content_marker matched as a raw substring."',
' word "बहनचोद"',
' description "Hindi obscenity (romanized behenchod, a vulgar insult); a vulgar_content_marker matched as a raw substring."',
' lexeme "zh"',
' word "操你妈"',
" description \"Chinese obscenity (pinyin cao ni ma, a vulgar insult aimed at the listener's mother); a vulgar_content_marker matched as a raw substring.\"",
' word "傻逼"',
' description "Chinese vulgar insult (pinyin sha bi); a vulgar_content_marker matched as a raw substring."',
"meanings",
' meaning "explanation_request"',
' gloss "a request to have something explained — to be told how it works, what it is, or what it does. The concept an explanation prompt expresses, independent of the language or exact phrasing. Each lead marks the subject position with the ellipsis … (U+2026): a trailing ellipsis is a prefix surface matched against the start of the prompt by the literal before the slot, while a surface with no ellipsis is a bare phrase matched anywhere as a raw substring. A bare phrase written with surrounding spaces matches only on whole-word boundaries; one written without them folds its inflections. No interrogative word is named in the consuming code; every lead lives here in the data."',
' wiktionary "explain"',
' defined_by "inquiry"',
' defined_by "action"',
' role "explanation_request_lead"',
' lexeme "en"',
' word "how …"',
' description "English prefix surface asking how something works or is done; matched by the literal how before the … slot at the start of the prompt."',
' word " how "',
' description "English bare interrogative how, space-wrapped so it matches only as a whole word anywhere inside the prompt."',
' word "explain …"',
' description "English prefix surface; the imperative explain leads a request to explain whatever follows the … slot."',
' word "describe …"',
' description "English prefix surface; the imperative describe leads a request to describe whatever follows the … slot."',
' word "what does …"',
' description "English prefix surface; the question what does leads an explanation request whose subject follows the … slot."',
' word "what is …"',
' description "English prefix surface; the question what is leads a definition request whose subject follows the … slot."',
' word "tell me about …"',
' description "English prefix surface; tell me about leads a request to explain the subject after the … slot."',
' word "how to use …"',
' description "English prefix surface; how to use leads a usage question whose subject follows the … slot, subsumed by the bare how lead but kept for the explicit usage phrasing."',
' lexeme "ru"',
' word "как …"',
' description "Russian prefix surface (romanized kak); the interrogative how leads an explanation request whose subject follows the … slot."',
' word " как "',
' description "Russian bare interrogative how (romanized kak), space-wrapped so it matches only as a whole word anywhere inside the prompt."',
' word "объясни …"',
' description "Russian prefix surface (romanized obyasni); the imperative explain leads a request to explain whatever follows the … slot."',
' word "расскажи …"',
' description "Russian prefix surface (romanized rasskazhi); the imperative tell leads a request to describe whatever follows the … slot."',
' word "что такое …"',
' description "Russian prefix surface (romanized chto takoe); the question what is leads a definition request whose subject follows the … slot."',
' lexeme "hi"',
' word "कैसे काम"',
' description "Hindi phrase (romanized kaise kaam, how it works) as a bare substring marking a how-it-works explanation request."',
' word "समझाओ…"',
' description "Hindi prefix surface (romanized samjhao, explain) matched by its literal start with no space before the … slot; the subject follows."',
' word "क्या है …"',
' description "Hindi prefix surface (romanized kya hai, what is) matched at the start of the prompt; the subject follows the … slot."',
' lexeme "zh"',
' word "如何工作"',
' description "Chinese phrase (pinyin ruhe gongzuo, how it works) as a bare substring marking a how-it-works explanation request."',
' word "怎么工作"',
' description "Chinese phrase (pinyin zenme gongzuo, how it works) as a bare substring marking a how-it-works explanation request."',
' word "解释…"',
' description "Chinese prefix surface (pinyin jieshi, explain) matched by its literal start with no space before the … slot; the subject follows."',
' word "是什么"',
' description "Chinese phrase (pinyin shi shenme, is what) as a bare substring marking a definition request."',
' meaning "code_method"',
" gloss \"a method in the programming sense — a named operation or function defined on a type or object, such as the join method of a DataFrame. The word a prompt uses, in any language, to refer to such an operation when asking how it works. A handler pairs this concept with the method's own API identifier — which is written the same in every language — so it can recognise a question about a specific method without naming the word method in the code. Space-delimited surfaces match on whole-token boundaries; the Han surface matches as a substring.\"",
' wiktionary "method"',
' defined_by "action"',
' defined_by "concept"',
' role "code_method_noun"',
' lexeme "en"',
' word "method"',
' description "English noun method, the word for a named operation on a type or object; matched as a whole token."',
' lexeme "ru"',
' word "метод"',
' description "Russian noun (romanized metod) for a method; matched as a whole token."',
' lexeme "hi"',
' word "विधि"',
' description "Hindi noun (romanized vidhi) for a method or procedure; matched as a whole token."',
' lexeme "zh"',
' word "方法"',
' description "Chinese noun (pinyin fangfa) for a method; a Han substring marker for the method concept."',
"meanings",
' meaning "skill_teaching_trigger"',
' gloss "the opening clause of a natural-language skill that names the moment a taught behaviour should fire — the user saying or asking some phrase. The concept a teaching instruction expresses when it introduces its trigger, independent of language or exact wording. Each surface is a bare clause-initial lead matched as a raw substring (the consuming code lower-cases the description first), and a trigger lead only teaches a skill when it co-occurs with a response verb and the instruction also quotes a trigger and a reply in backticks. No trigger word is named in the compiler; every lead lives here in the data, so the same instruction can be recognised across languages."',
' wiktionary "when"',
' defined_by "relation"',
' defined_by "inquiry"',
' role "skill_teaching_trigger_lead"',
' lexeme "en"',
' word "when i say"',
' description "English teaching lead introducing the phrase the user will say to trigger the skill; matched as a raw substring."',
' word "when the user says"',
' description "English teaching lead naming the user saying a trigger phrase; matched as a raw substring."',
' word "when the user asks"',
' description "English teaching lead naming the user asking a trigger phrase; matched as a raw substring."',
' word "if i ask"',
' description "English teaching lead introducing a conditional trigger phrased as a question; matched as a raw substring."',
' lexeme "ru"',
' word "когда я скажу"',
' description "Russian teaching lead (romanized kogda ya skazhu, when I say) introducing the trigger phrase; matched as a raw substring."',
' word "если я спрошу"',
' description "Russian teaching lead (romanized esli ya sprošu, if I ask) introducing a conditional trigger; matched as a raw substring."',
' lexeme "hi"',
' word "जब मैं कहूँ"',
' description "Hindi teaching lead (romanized jab main kahun, when I say) introducing the trigger phrase; matched as a raw substring."',
' word "अगर मैं पूछूँ"',
' description "Hindi teaching lead (romanized agar main puchun, if I ask) introducing a conditional trigger; matched as a raw substring."',
' lexeme "zh"',
' word "当我说"',
' description "Chinese teaching lead (pinyin dang wo shuo, when I say) introducing the trigger phrase; a Han substring marker."',
' word "当用户说"',
' description "Chinese teaching lead (pinyin dang yonghu shuo, when the user says) naming the user saying a trigger; a Han substring marker."',
' word "当用户问"',
' description "Chinese teaching lead (pinyin dang yonghu wen, when the user asks) naming the user asking a trigger; a Han substring marker."',
' meaning "skill_teaching_response"',
' gloss "the verb that introduces the canned reply a taught skill should emit — to answer, reply, or respond with a phrase. The concept a teaching instruction expresses when it names the response side of a trigger-and-reply pair, independent of language. Each surface is matched as a raw substring, so an inflectable stem such as the Russian otvet folds its endings; a response verb only teaches a skill when it co-occurs with a trigger lead. No verb is named in the compiler; every form lives here in the data."',
' wiktionary "answer"',
' defined_by "action"',
' defined_by "answer"',
' role "skill_teaching_response_verb"',
' lexeme "en"',
' word "answer"',
' description "English verb answer naming the reply a taught skill emits; matched as a raw substring."',
' word "reply"',
' description "English verb reply naming the response a taught skill emits; matched as a raw substring."',
' word "respond"',
' description "English verb respond naming the response a taught skill emits; matched as a raw substring."',
' lexeme "ru"',
' word "ответ"',
' description "Russian stem (romanized otvet, answer) folding its inflections such as otvet/otveť/otvetit; matched as a raw substring."',
' lexeme "hi"',
' word "उत्तर"',
' description "Hindi noun-verb (romanized uttar, answer) naming the reply a taught skill emits; matched as a raw substring."',
' word "जवाब"',
' description "Hindi noun-verb (romanized javab, reply) naming the response a taught skill emits; matched as a raw substring."',
' lexeme "zh"',
' word "回答"',
' description "Chinese verb (pinyin huida, answer) naming the reply a taught skill emits; a Han substring marker."',
' word "回复"',
' description "Chinese verb (pinyin huifu, reply) naming the response a taught skill emits; a Han substring marker."',
' meaning "behavior_rule_edit"',
' gloss "a standalone imperative to add or update a behaviour rule in the assistant — a direct instruction to change runtime behaviour rather than a trigger-and-reply teaching pair. The concept such a directive expresses, independent of language. Each surface is matched as a raw substring and is recognised on its own, without needing a separate response verb, because the imperative already names both the act of editing and its object. No directive phrase is named in the compiler; every form lives here in the data."',
' wiktionary "rule"',
' defined_by "action"',
' defined_by "knowledge"',
' role "behavior_rule_edit_directive"',
' lexeme "en"',
' word "add behavior rule"',
' description "English imperative to add a behaviour rule; matched as a raw substring and recognised on its own."',
' word "update behavior rule"',
' description "English imperative to update a behaviour rule; matched as a raw substring and recognised on its own."',
' lexeme "ru"',
' word "добавь правило поведения"',
' description "Russian imperative (romanized dobav pravilo povedeniya, add a behaviour rule); matched as a raw substring and recognised on its own."',
' word "обнови правило поведения"',
' description "Russian imperative (romanized obnovi pravilo povedeniya, update a behaviour rule); matched as a raw substring and recognised on its own."',
' lexeme "hi"',
' word "व्यवहार नियम जोड़ो"',
' description "Hindi imperative (romanized vyavhar niyam jodo, add a behaviour rule); matched as a raw substring and recognised on its own."',
' word "व्यवहार नियम अपडेट करो"',
' description "Hindi imperative (romanized vyavhar niyam update karo, update a behaviour rule); matched as a raw substring and recognised on its own."',
' lexeme "zh"',
' word "添加行为规则"',
' description "Chinese imperative (pinyin tianjia xingwei guize, add a behaviour rule); a Han substring marker recognised on its own."',
' word "更新行为规则"',
' description "Chinese imperative (pinyin gengxin xingwei guize, update a behaviour rule); a Han substring marker recognised on its own."',
' meaning "skill_when_then"',
' gloss "the when-then frame of a conditional skill instruction — a head clause that opens the condition and a link clause that opens the consequence, with the trigger and the response quoted in backticks between and after them. The concept a when-then rule expresses, independent of language. Each surface is a circumfix: the literal before the ellipsis … (U+2026) is the head the instruction must contain, and the literal after it is the link that must follow the head; a skill is taught only when a backtick-quoted span sits between the head and the link and another follows the link. No keyword pair is named in the compiler; every head-and-link frame lives here in the data."',
' wiktionary "then"',
' defined_by "relation"',
' defined_by "concept"',
' role "skill_when_then_pair"',
' lexeme "en"',
' word "when … then "',
' description "English when-then frame; the head when opens the condition and the link then opens the consequence around the … slot."',
' word "when … do "',
' description "English when-do frame; the head when opens the condition and the link do opens an imperative consequence around the … slot."',
' lexeme "ru"',
' word "когда … тогда "',
' description "Russian when-then frame (romanized kogda … togda); the head opens the condition and the link opens the consequence around the … slot."',
' word "когда … делай "',
' description "Russian when-do frame (romanized kogda … delay); the head opens the condition and the link opens an imperative consequence around the … slot."',
' word "когда … сделай "',
' description "Russian when-do frame (romanized kogda … sdelay, perfective); the head opens the condition and the link opens the consequence around the … slot."',
' word "когда … отвечай "',
' description "Russian when-answer frame (romanized kogda … otvechay); the head opens the condition and the link names answering around the … slot."',
' word "когда … отвечать "',
' description "Russian when-answer frame (romanized kogda … otvechat, infinitive); the head opens the condition and the link names answering around the … slot."',
' word "если … то "',
' description "Russian if-then frame (romanized esli … to); the head opens the condition and the link opens the consequence around the … slot."',
' lexeme "hi"',
' word "जब … तब "',
' description "Hindi when-then frame (romanized jab … tab); the head opens the condition and the link opens the consequence around the … slot."',
' word "जब … तो "',
' description "Hindi when-then frame (romanized jab … to); the head opens the condition and the link opens the consequence around the … slot."',
' lexeme "zh"',
' word "当 … 时 "',
' description "Chinese when-then frame (pinyin dang … shi); the head opens the condition and the link closes it before the consequence around the … slot."',
' word "当 … 则 "',
' description "Chinese when-then frame (pinyin dang … ze); the head opens the condition and the link opens the consequence around the … slot."',
' word "当 … 回答 "',
' description "Chinese when-answer frame (pinyin dang … huida); the head opens the condition and the link names answering around the … slot."',
' word "当 …时回答 "',
' description "Chinese when-then-answer frame (pinyin dang … shi huida); the head opens the condition and the link closes it and names answering around the … slot."',
' word "当 …则回答 "',
' description "Chinese when-then-answer frame (pinyin dang … ze huida); the head opens the condition and the link opens the consequence and names answering around the … slot."',
' meaning "nondeterministic_step"',
' gloss "the property of a structured-skill step that makes it non-deterministic or otherwise unreviewable — randomness, non-determinism, or arbitrary code. The concept the compiler screens for so it can refuse such a step, because a compiled skill must be deterministic and reviewable. Each surface is matched as a raw substring after the step text is lower-cased. No marker word is named in the compiler; every form lives here in the data."',
' wiktionary "random"',
' defined_by "property"',
' defined_by "concept"',
' role "nondeterministic_marker"',
' lexeme "en"',
' word "random"',
' description "English adjective random marking a non-deterministic step; matched as a raw substring."',
' word "nondeterministic"',
' description "English adjective nondeterministic marking an unreviewable step; matched as a raw substring."',
' word "non-deterministic"',
' description "English hyphenated spelling of nondeterministic; matched as a raw substring."',
' word "arbitrary code"',
' description "English phrase arbitrary code marking a step that runs unreviewable instructions; matched as a raw substring."',
' lexeme "ru"',
' word "случайный"',
' description "Russian adjective (romanized sluchaynyy, random) marking a non-deterministic step; matched as a raw substring."',
' word "недетерминированный"',
' description "Russian adjective (romanized nedeterminirovannyy, nondeterministic) marking an unreviewable step; matched as a raw substring."',
' lexeme "hi"',
' word "यादृच्छिक"',
' description "Hindi adjective (romanized yadrcchik, random) marking a non-deterministic step; matched as a raw substring."',
' word "अनिश्चित"',
' description "Hindi adjective (romanized anishchit, indeterminate) marking an unreviewable step; matched as a raw substring."',
' lexeme "zh"',
' word "随机"',
' description "Chinese adjective (pinyin suiji, random) marking a non-deterministic step; a Han substring marker."',
' word "不确定"',
' description "Chinese adjective (pinyin buqueding, indeterminate) marking an unreviewable step; a Han substring marker."',
' meaning "shell_capability_need"',
' gloss "the property of a structured-skill step that implies it needs the local shell or filesystem capability — running a shell, listing files, or writing and deleting files. The concept the compiler reads so it can require an explicit tool:local_shell permission grant before the step is allowed. Each surface is matched as a raw substring after the step text is lower-cased, and this cue is checked before the network cue so a step that touches both is attributed to the shell. No cue word is named in the compiler; every form lives here in the data, and the formal capability identifier it implies stays in the code as a tool-namespace bridge."',
' wiktionary "shell"',
' defined_by "capability"',
' defined_by "action"',
' role "shell_capability_cue"',
' lexeme "en"',
' word "local_shell"',
' description "English tool name local_shell naming the shell runner; matched as a raw substring."',
' word "shell"',
' description "English noun shell naming a command shell; matched as a raw substring."',
' word "filesystem"',
' description "English noun filesystem naming on-disk storage; matched as a raw substring."',
' word "file system"',
' description "English spaced spelling file system; matched as a raw substring."',
' word "list files"',
' description "English phrase list files naming a directory read; matched as a raw substring."',
' word "write file"',
' description "English phrase write file naming an on-disk write; matched as a raw substring."',
' word "delete file"',
' description "English phrase delete file naming an on-disk delete; matched as a raw substring."',
' lexeme "ru"',
' word "оболочка"',
' description "Russian noun (romanized obolochka, shell) naming a command shell; matched as a raw substring."',
' word "файловая система"',
' description "Russian phrase (romanized faylovaya sistema, file system) naming on-disk storage; matched as a raw substring."',
' word "список файлов"',
' description "Russian phrase (romanized spisok faylov, list of files) naming a directory read; matched as a raw substring."',
' lexeme "hi"',
' word "शेल"',
' description "Hindi noun (romanized shel, shell) naming a command shell; matched as a raw substring."',
' word "फाइल सिस्टम"',
' description "Hindi phrase (romanized phail sistam, file system) naming on-disk storage; matched as a raw substring."',
' word "फाइलें सूचीबद्ध"',
' description "Hindi phrase (romanized phailen suchibaddh, list files) naming a directory read; matched as a raw substring."',
' lexeme "zh"',
' word "外壳"',
' description "Chinese noun (pinyin waike, shell) naming a command shell; a Han substring marker."',
' word "文件系统"',
' description "Chinese noun (pinyin wenjian xitong, file system) naming on-disk storage; a Han substring marker."',
' word "列出文件"',
' description "Chinese phrase (pinyin liechu wenjian, list files) naming a directory read; a Han substring marker."',
' meaning "network_capability_need"',
' gloss "the property of a structured-skill step that implies it needs the network or web-fetch capability — making an HTTP or web request, reaching the network, or fetching a remote resource. The concept the compiler reads so it can require an explicit tool:web_fetch permission grant before the step is allowed. Each surface is matched as a raw substring after the step text is lower-cased, and this cue is checked after the shell cue. No cue word is named in the compiler; every form lives here in the data, and the formal capability identifier it implies stays in the code as a tool-namespace bridge."',
' wiktionary "network"',
' defined_by "capability"',
' defined_by "action"',
' role "network_capability_cue"',
' lexeme "en"',
' word "http"',
' description "English protocol name http naming a web request; matched as a raw substring."',
' word "network"',
' description "English noun network naming remote connectivity; matched as a raw substring."',
' word "fetch"',
' description "English verb fetch naming a remote retrieval; matched as a raw substring."',
' word "web request"',
' description "English phrase web request naming an outbound network call; matched as a raw substring."',
' lexeme "ru"',
' word "сеть"',
' description "Russian noun (romanized set, network) naming remote connectivity; matched as a raw substring."',
' word "веб-запрос"',
' description "Russian phrase (romanized veb-zapros, web request) naming an outbound call; matched as a raw substring."',
' word "сетевой запрос"',
' description "Russian phrase (romanized setevoy zapros, network request) naming an outbound call; matched as a raw substring."',
' lexeme "hi"',
' word "नेटवर्क"',
' description "Hindi noun (romanized netvark, network) naming remote connectivity; matched as a raw substring."',
' word "वेब अनुरोध"',
' description "Hindi phrase (romanized veb anurodh, web request) naming an outbound call; matched as a raw substring."',
' lexeme "zh"',
' word "网络"',
' description "Chinese noun (pinyin wangluo, network) naming remote connectivity; a Han substring marker."',
' word "网络请求"',
' description "Chinese phrase (pinyin wangluo qingqiu, network request) naming an outbound call; a Han substring marker."',
' word "获取"',
' description "Chinese verb (pinyin huoqu, fetch) naming a remote retrieval; a Han substring marker."',
"meanings",
' meaning "investment"',
' gloss "the act of investing money — committing a principal sum so it can earn a return. The investment_cue role marks the surface forms that signal a prompt is a compound-interest word problem; the compound-interest handler requires this together with an interest_cue and a compounding_action_cue before it extracts the principal, rate, frequency and term. Matched as raw substrings so inflected forms are caught in every supported language."',
' wiktionary "investment"',
' defined_by "money"',
' defined_by "action"',
' role "investment_cue"',
' lexeme "en"',
' word "invest"',
' description "English verb for committing money to earn a return; an investment_cue matched as a raw substring so investing and invested are also caught."',
' word "investment"',
" description \"English noun for a committed sum of money; an investment_cue matched as a raw substring, kept explicitly so the surface list mirrors the original recognizer's disjunction.\"",
' lexeme "ru"',
' word "инвестир"',
' description "Russian verb stem (romanized investir, of инвестировать, to invest); an investment_cue matched as a raw substring so инвестировать and инвестируй are caught."',
' word "инвестиц"',
' description "Russian noun stem (romanized investits, of инвестиция, investment); an investment_cue matched as a raw substring so инвестиция and инвестиции are caught."',
' lexeme "hi"',
' word "निवेश"',
' description "Hindi noun (romanized nivesh, investment); an investment_cue matched as a raw substring."',
' lexeme "zh"',
' word "投资"',
' description "Chinese verb (pinyin touzi, to invest); an investment_cue matched as a raw substring."',
' meaning "interest_finance"',
' gloss "interest in the financial sense — the charge paid for the use of money, expressed as a periodic rate on a principal. The interest_cue role marks the surface forms that signal a prompt is about interest; the compound-interest handler requires this together with an investment_cue and a compounding_action_cue before it answers. Matched as raw substrings so inflected forms are caught in every supported language."',
' wiktionary "interest"',
' defined_by "money"',
' role "interest_cue"',
' lexeme "en"',
' word "interest"',
' description "English noun for the financial charge on borrowed or invested money; an interest_cue matched as a raw substring."',
' lexeme "ru"',
' word "процент"',
' description "Russian noun (romanized protsent, interest or percent); an interest_cue matched as a raw substring so проценты and процентов are caught."',
' lexeme "hi"',
' word "ब्याज"',
' description "Hindi noun (romanized byaj, interest); an interest_cue matched as a raw substring."',
' lexeme "zh"',
' word "利息"',
' description "Chinese noun (pinyin lixi, interest); an interest_cue matched as a raw substring."',
' meaning "compounding"',
' gloss "compounding — adding earned interest back to the principal so that it, in turn, earns further interest. The compounding_action_cue role marks the surface forms that signal a compound-interest problem; the compound-interest handler requires this together with an investment_cue and an interest_cue before it answers. Matched as raw substrings so inflected forms are caught in every supported language."',
' wiktionary "compound interest"',
' defined_by "action"',
' defined_by "money"',
' role "compounding_action_cue"',
' lexeme "en"',
' word "compound"',
' description "English verb for adding interest to principal so it earns further interest; a compounding_action_cue matched as a raw substring so compounded and compounding are also caught."',
' lexeme "ru"',
' word "сложный процент"',
' description "Russian phrase (romanized slozhnyy protsent, compound interest); a compounding_action_cue matched as a raw substring."',
' word "капитализаци"',
' description "Russian noun stem (romanized kapitalizatsi, of капитализация, capitalization of interest); a compounding_action_cue matched as a raw substring so капитализация and капитализации are caught."',
' lexeme "hi"',
' word "चक्रवृद्धि"',
' description "Hindi noun (romanized chakravriddhi, compounding); a compounding_action_cue matched as a raw substring."',
' lexeme "zh"',
' word "复利"',
' description "Chinese noun (pinyin fuli, compound interest); a compounding_action_cue matched as a raw substring."',
' meaning "compounding_monthly"',
' gloss "compounding once a month — twelve compounding periods per year. A specialization of compounding by frequency. The compounding_frequency_cue role marks the surface forms that signal how often interest compounds; the compound-interest handler reads the first frequency it finds, in declaration order, so monthly is tried before the rarer frequencies. Matched as raw substrings in every supported language."',
' wiktionary "monthly"',
' defined_by "compounding"',
' role "compounding_frequency_cue"',
' lexeme "en"',
' word "monthly"',
' description "English adverb for once a month; a compounding_frequency_cue matched as a raw substring, mapping to twelve compounding periods per year."',
' lexeme "ru"',
' word "ежемесячн"',
' description "Russian adjective stem (romanized ezhemesyachn, of ежемесячный, monthly); a compounding_frequency_cue matched as a raw substring so ежемесячно and ежемесячное are caught."',
' lexeme "hi"',
' word "मासिक"',
' description "Hindi adjective (romanized masik, monthly); a compounding_frequency_cue matched as a raw substring."',
' lexeme "zh"',
' word "每月"',
' description "Chinese adverb (pinyin meiyue, every month); a compounding_frequency_cue matched as a raw substring."',
' meaning "compounding_quarterly"',
' gloss "compounding once a quarter — four compounding periods per year. A specialization of compounding by frequency. The compounding_frequency_cue role marks the surface forms; the compound-interest handler reads the first frequency it finds, in declaration order. Matched as raw substrings in every supported language."',
' wiktionary "quarterly"',
' defined_by "compounding"',
' role "compounding_frequency_cue"',
' lexeme "en"',
' word "quarterly"',
' description "English adverb for once a quarter; a compounding_frequency_cue matched as a raw substring, mapping to four compounding periods per year."',
' lexeme "ru"',
' word "ежеквартальн"',
' description "Russian adjective stem (romanized ezhekvartaln, of ежеквартальный, quarterly); a compounding_frequency_cue matched as a raw substring so ежеквартально and ежеквартальное are caught."',
' lexeme "hi"',
' word "त्रैमासिक"',
' description "Hindi adjective (romanized traimasik, quarterly); a compounding_frequency_cue matched as a raw substring."',
' lexeme "zh"',
' word "每季度"',
' description "Chinese adverb (pinyin meijidu, every quarter); a compounding_frequency_cue matched as a raw substring."',
' meaning "compounding_weekly"',
' gloss "compounding once a week — fifty-two compounding periods per year. A specialization of compounding by frequency. The compounding_frequency_cue role marks the surface forms; the compound-interest handler reads the first frequency it finds, in declaration order. Matched as raw substrings in every supported language."',
' wiktionary "weekly"',
' defined_by "compounding"',
' role "compounding_frequency_cue"',
' lexeme "en"',
' word "weekly"',
' description "English adverb for once a week; a compounding_frequency_cue matched as a raw substring, mapping to fifty-two compounding periods per year."',
' lexeme "ru"',
' word "еженедельн"',
' description "Russian adjective stem (romanized ezhenedeln, of еженедельный, weekly); a compounding_frequency_cue matched as a raw substring so еженедельно and еженедельное are caught."',
' lexeme "hi"',
' word "साप्ताहिक"',
' description "Hindi adjective (romanized saptahik, weekly); a compounding_frequency_cue matched as a raw substring."',
' lexeme "zh"',
' word "每周"',
' description "Chinese adverb (pinyin meizhou, every week); a compounding_frequency_cue matched as a raw substring."',
' meaning "compounding_daily"',
' gloss "compounding once a day — three hundred sixty-five compounding periods per year. A specialization of compounding by frequency. The compounding_frequency_cue role marks the surface forms; the compound-interest handler reads the first frequency it finds, in declaration order. Matched as raw substrings in every supported language."',
' wiktionary "daily"',
' defined_by "compounding"',
' role "compounding_frequency_cue"',
' lexeme "en"',
' word "daily"',
' description "English adverb for once a day; a compounding_frequency_cue matched as a raw substring, mapping to three hundred sixty-five compounding periods per year."',
' lexeme "ru"',
' word "ежедневн"',
' description "Russian adjective stem (romanized ezhednevn, of ежедневный, daily); a compounding_frequency_cue matched as a raw substring so ежедневно and ежедневное are caught."',
' lexeme "hi"',
' word "दैनिक"',
' description "Hindi adjective (romanized dainik, daily); a compounding_frequency_cue matched as a raw substring."',
' lexeme "zh"',
' word "每日"',
' description "Chinese adverb (pinyin meiri, every day); a compounding_frequency_cue matched as a raw substring."',
' meaning "compounding_annual"',
' gloss "compounding once a year — a single compounding period per year. A specialization of compounding by frequency. The compounding_frequency_cue role marks the surface forms; the compound-interest handler reads the first frequency it finds, in declaration order, so this is the fallback when no finer frequency is named. Matched as raw substrings in every supported language."',
' wiktionary "annually"',
' defined_by "compounding"',
' role "compounding_frequency_cue"',
' lexeme "en"',
' word "annually"',
' description "English adverb for once a year; a compounding_frequency_cue matched as a raw substring, mapping to one compounding period per year."',
' word "yearly"',
" description \"English adverb for once a year, a synonym of annually; a compounding_frequency_cue matched as a raw substring, kept explicitly so the surface list mirrors the original recognizer's disjunction.\"",
' lexeme "ru"',
' word "ежегодн"',
' description "Russian adjective stem (romanized ezhegodn, of ежегодный, annual); a compounding_frequency_cue matched as a raw substring so ежегодно and ежегодное are caught."',
' lexeme "hi"',
' word "वार्षिक"',
' description "Hindi adjective (romanized varshik, annual); a compounding_frequency_cue matched as a raw substring."',
' lexeme "zh"',
' word "每年"',
' description "Chinese adverb (pinyin meinian, every year); a compounding_frequency_cue matched as a raw substring."',
' meaning "live_rate_freshness"',
' gloss "a request for a live, web-sourced, up-to-the-minute exchange rate rather than a locally cached one. The live_rate_freshness_cue role marks the surface forms; the compound-interest handler reads it to add a caveat that web freshness is not independently verified, while still answering from the local calculator. A freshness qualifier on an exchange_rate. Matched as raw substrings so compound forms are caught in every supported language."',
' wiktionary "exchange rate"',
' defined_by "exchange_rate"',
' defined_by "concept"',
' role "live_rate_freshness_cue"',
' lexeme "en"',
' word "web"',
' description "English noun for the World Wide Web as a live data source; a live_rate_freshness_cue matched as a raw substring."',
' word "current exchange"',
' description "English fragment asking for the current exchange of currencies; a live_rate_freshness_cue matched as a raw substring."',
' word "current rate"',
' description "English fragment asking for the current rate; a live_rate_freshness_cue matched as a raw substring."',
' word "exchange rate"',
' description "English compound noun for the price of one currency in another, read here as a request for its live value; a live_rate_freshness_cue matched as a raw substring."',
' lexeme "ru"',
' word "текущий курс"',
' description "Russian phrase (romanized tekushchiy kurs, current rate); a live_rate_freshness_cue matched as a raw substring."',
' word "актуальный курс"',
' description "Russian phrase (romanized aktualnyy kurs, up-to-date rate); a live_rate_freshness_cue matched as a raw substring."',
' lexeme "hi"',
' word "वर्तमान दर"',
' description "Hindi phrase (romanized vartaman dar, current rate); a live_rate_freshness_cue matched as a raw substring."',
' lexeme "zh"',
' word "实时汇率"',
' description "Chinese phrase (pinyin shishi huilu, real-time exchange rate); a live_rate_freshness_cue matched as a raw substring."',
' meaning "year_period"',
' gloss "a year — the unit of time a compound-interest term is measured in. The year_unit_cue role marks the surface forms; the compound-interest handler locates the cue and reads the number immediately before it as the number of years. A time concept. Located as raw substrings in every supported language."',
' wiktionary "year"',
' defined_by "concept"',
' role "year_unit_cue"',
' lexeme "en"',
' word "year"',
' description "English noun for the time unit of a year; a year_unit_cue located as a raw substring so years is also caught and the preceding number can be read."',
' lexeme "ru"',
' word "год"',
' description "Russian noun (romanized god, year); a year_unit_cue located as a raw substring so года and годов are caught."',
' word "лет"',
' description "Russian genitive-plural noun (romanized let, years); a year_unit_cue located as a raw substring, the form used after most numbers."',
' lexeme "hi"',
' word "वर्ष"',
' description "Hindi noun (romanized varsh, year); a year_unit_cue located as a raw substring."',
' lexeme "zh"',
' word "年"',
' description "Chinese noun (pinyin nian, year); a year_unit_cue located as a raw substring."',
' meaning "conversion_action"',
' gloss "converting an amount of money from one currency into another. The conversion_action_cue role marks the surface forms; the compound-interest handler requires it together with a final_amount_reference before it converts a previously computed final amount. Matched as raw substrings so inflected forms are caught in every supported language."',
' wiktionary "convert"',
' defined_by "action"',
' defined_by "money"',
' role "conversion_action_cue"',
' lexeme "en"',
' word "convert"',
' description "English verb for changing one currency into another; a conversion_action_cue matched as a raw substring so converted and converting are also caught."',
' lexeme "ru"',
' word "конвертир"',
' description "Russian verb stem (romanized konvertir, of конвертировать, to convert); a conversion_action_cue matched as a raw substring so конвертировать and конвертируй are caught."',
' lexeme "hi"',
' word "परिवर्तित"',
' description "Hindi adjective (romanized parivartit, converted); a conversion_action_cue matched as a raw substring."',
' lexeme "zh"',
' word "转换"',
' description "Chinese verb (pinyin zhuanhuan, to convert); a conversion_action_cue matched as a raw substring."',
' meaning "final_amount"',
' gloss "the final amount — the computed result of a compound-interest calculation that a follow-up turn may ask to convert. The final_amount_reference role marks the surface forms; the compound-interest handler requires it together with a conversion_action_cue before it reads the prior final amount and converts it. A kind of money. Matched as raw substrings so phrasings are caught in every supported language."',
' wiktionary "amount"',
' defined_by "money"',
' role "final_amount_reference"',
' lexeme "en"',
' word "final amount"',
' description "English compound noun for the computed result of the calculation; a final_amount_reference matched as a raw substring."',
' lexeme "ru"',
' word "итоговая сумма"',
' description "Russian phrase (romanized itogovaya summa, final amount); a final_amount_reference matched as a raw substring."',
' lexeme "hi"',
' word "अंतिम राशि"',
' description "Hindi phrase (romanized antim rashi, final amount); a final_amount_reference matched as a raw substring."',
' lexeme "zh"',
' word "最终金额"',
" description \"Chinese phrase (pinyin zuizhong jin'e, final amount); a final_amount_reference matched as a raw substring.\"",
"meanings",
' meaning "definition_merge_action"',
' gloss "merging two or more definitions, translations, or encyclopedia entries into a single combined answer. The definition_merge_action role marks the surface forms that ask for such a merge; the definition-merge handler requires this together with a definition_artifact_request before it looks the term up and combines its definitions. Matched as raw substrings so inflected forms are caught in every supported language."',
' wiktionary "merge"',
' defined_by "action"',
' role "definition_merge_action"',
' lexeme "en"',
' word "merge"',
' description "English verb for combining things into one; a definition_merge_action matched as a raw substring so merges and merging are also caught."',
' word "merged"',
" description \"English past participle of merge; a definition_merge_action matched as a raw substring, kept explicitly so the surface list mirrors the original recognizer's disjunction.\"",
' word "combine"',
' description "English verb for joining things together; a definition_merge_action matched as a raw substring so combines and combining are also caught."',
' word "combined"',
" description \"English past participle of combine; a definition_merge_action matched as a raw substring, kept explicitly so the surface list mirrors the original recognizer's disjunction.\"",
' word "fuse"',
' description "English verb for blending things into one; a definition_merge_action matched as a raw substring so fuses and fusing are also caught."',
' word "fusion"',
' description "English noun for a blending into one; a definition_merge_action matched as a raw substring, kept explicitly because fuse is not a substring of fusion."',
' lexeme "ru"',
' word "объедин"',
' description "Russian verb stem (romanized obyedin, of объединить, to merge or combine); a definition_merge_action matched as a raw substring so объедини and объединить are caught."',
' word "слия"',
' description "Russian noun stem (romanized sliya, of слияние, fusion); a definition_merge_action matched as a raw substring so слияние and слияния are caught."',
' lexeme "hi"',
' word "विलय"',
' description "Hindi noun (romanized vilay, merger); a definition_merge_action matched as a raw substring."',
' word "संयोजन"',
' description "Hindi noun (romanized sanyojan, combination); a definition_merge_action matched as a raw substring."',
' lexeme "zh"',
' word "合并"',
' description "Chinese verb (pinyin hebing, to merge); a definition_merge_action matched as a raw substring."',
' word "融合"',
' description "Chinese verb (pinyin ronghe, to fuse); a definition_merge_action matched as a raw substring."',
' meaning "definition_artifact_request"',
' gloss "a request for a definition, a translation, or a Wikipedia entry — the artifacts the definition-merge handler combines. The definition_artifact_request role marks these surface forms; the handler requires this together with a definition_merge_action before it merges definitions of a term. Matched as raw substrings so inflected forms are caught in every supported language."',
' wiktionary "definition"',
' defined_by "inquiry"',
' role "definition_artifact_request"',
' lexeme "en"',
' word "definition"',
' description "English noun for a statement of meaning; a definition_artifact_request matched as a raw substring so definitions is also caught."',
' word "definitions"',
" description \"English plural of definition; a definition_artifact_request matched as a raw substring, kept explicitly so the surface list mirrors the original recognizer's disjunction.\"",
' word "translation"',
' description "English noun for a rendering into another language; a definition_artifact_request matched as a raw substring so translations is also caught."',
' word "translations"',
" description \"English plural of translation; a definition_artifact_request matched as a raw substring, kept explicitly so the surface list mirrors the original recognizer's disjunction.\"",
' word "translated"',
' description "English past participle of translate; a definition_artifact_request matched as a raw substring."',
' word "wikipedia"',
' description "English proper noun for the Wikipedia encyclopedia, a source of definitions; a definition_artifact_request matched as a raw substring."',
' lexeme "ru"',
' word "определени"',
' description "Russian noun stem (romanized opredeleni, of определение, definition); a definition_artifact_request matched as a raw substring so определение and определения are caught."',
' word "перевод"',
' description "Russian noun (romanized perevod, translation); a definition_artifact_request matched as a raw substring so перевода and переводы are caught."',
' word "википеди"',
' description "Russian noun stem (romanized vikipedi, of Википедия, Wikipedia); a definition_artifact_request matched as a raw substring so Википедия and Википедии are caught."',
' lexeme "hi"',
' word "परिभाषा"',
' description "Hindi noun (romanized paribhasha, definition); a definition_artifact_request matched as a raw substring."',
' word "अनुवाद"',
' description "Hindi noun (romanized anuvad, translation); a definition_artifact_request matched as a raw substring."',
' lexeme "zh"',
' word "定义"',
' description "Chinese noun (pinyin dingyi, definition); a definition_artifact_request matched as a raw substring."',
' word "翻译"',
' description "Chinese noun (pinyin fanyi, translation); a definition_artifact_request matched as a raw substring."',
' meaning "definition_merge_marker"',
" gloss \"a phrase that introduces the term whose definitions are to be merged — for example definitions of or translation for — immediately followed by the term itself. The definition_merge_marker role carries these as prefix word forms whose text before the slot marker is the phrase to locate; the definition-merge handler scans them in declaration order, finds the first whose prefix appears in the prompt, and takes the text after it as the term. The English forms are listed in the original recognizer's priority order so longer, more specific phrases win before shorter ones.\"",
' wiktionary "definition"',
' defined_by "inquiry"',
' role "definition_merge_marker"',
' lexeme "en"',
' word "translated definitions for …"',
" description \"English prefix 'translated definitions for'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term, tried first as the longest, most specific phrase.\"",
' word "translated definitions of …"',
" description \"English prefix 'translated definitions of'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "wikipedia definitions for …"',
" description \"English prefix 'wikipedia definitions for'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "wikipedia definitions of …"',
" description \"English prefix 'wikipedia definitions of'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "definitions for …"',
" description \"English prefix 'definitions for'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "definitions of …"',
" description \"English prefix 'definitions of'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "definition for …"',
" description \"English prefix 'definition for'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "definition of …"',
" description \"English prefix 'definition of'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "translations for …"',
" description \"English prefix 'translations for'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "translations of …"',
" description \"English prefix 'translations of'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "translation for …"',
" description \"English prefix 'translation for'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "translation of …"',
" description \"English prefix 'translation of'; a definition_merge_marker whose prefix before the slot is located and stripped to leave the term, tried last as the shortest phrase.\"",
' lexeme "ru"',
' word "переведенные определения для …"',
' description "Russian prefix (romanized perevedennye opredeleniya dlya, translated definitions for); a definition_merge_marker whose prefix before the slot is located and stripped to leave the term."',
' word "определения для …"',
' description "Russian prefix (romanized opredeleniya dlya, definitions for); a definition_merge_marker whose prefix before the slot is located and stripped to leave the term."',
' word "определение …"',
' description "Russian prefix (romanized opredelenie, definition of); a definition_merge_marker whose prefix before the slot is located and stripped to leave the term that follows in the genitive."',
' word "перевод …"',
' description "Russian prefix (romanized perevod, translation of); a definition_merge_marker whose prefix before the slot is located and stripped to leave the term."',
' lexeme "hi"',
' word "की परिभाषाएँ …"',
' description "Hindi best-effort prefix (romanized ki paribhashaen, definitions of); a definition_merge_marker whose prefix before the slot is located and stripped to leave the term."',
' word "का अनुवाद …"',
' description "Hindi best-effort prefix (romanized ka anuvad, translation of); a definition_merge_marker whose prefix before the slot is located and stripped to leave the term."',
' lexeme "zh"',
' word "的定义 …"',
" description \"Chinese best-effort prefix (pinyin de dingyi, 's definition); a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' word "的翻译 …"',
" description \"Chinese best-effort prefix (pinyin de fanyi, 's translation); a definition_merge_marker whose prefix before the slot is located and stripped to leave the term.\"",
' meaning "definition_merge_tail_boundary"',
' gloss "a word that ends the term in a definition-merge prompt — once the term has been located, any text from the first such boundary word onward (the source, the method, the destination) is trimmed away. The definition_merge_tail_boundary role marks these forms; the handler reconstructs each as a space-padded token and cuts the extracted term at the earliest one it finds. Defined as a relation between the term and what follows it."',
' wiktionary "from"',
' defined_by "relation"',
' role "definition_merge_tail_boundary"',
' lexeme "en"',
' word "from"',
' description "English preposition introducing a source; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' word "using"',
' description "English preposition introducing a method; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' word "with"',
' description "English preposition introducing an accompaniment; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' word "by"',
' description "English preposition introducing an agent or means; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' word "into"',
' description "English preposition introducing a destination; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' word "across"',
' description "English preposition introducing a span; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' lexeme "ru"',
' word "из"',
' description "Russian preposition (romanized iz, from) introducing a source; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' word "с"',
' description "Russian preposition (romanized s, with or from) introducing an accompaniment or source; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' word "по"',
' description "Russian preposition (romanized po, by) introducing a means; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' word "в"',
' description "Russian preposition (romanized v, into) introducing a destination; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' lexeme "hi"',
' word "से"',
' description "Hindi postposition (romanized se, from) introducing a source; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' word "के साथ"',
' description "Hindi postposition (romanized ke saath, with) introducing an accompaniment; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' lexeme "zh"',
' word "从"',
' description "Chinese preposition (pinyin cong, from) introducing a source; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
' word "使用"',
' description "Chinese verb (pinyin shiyong, using) introducing a method; a definition_merge_tail_boundary reconstructed as a space-padded token, marking where the term ends."',
"meanings",
' meaning "tool_invocation_cue"',
' gloss "a cue that the prompt is an explicit natural-language tool or API call — the verbs call, invoke, and run together with the nouns api and tool. The tool_invocation_cue role marks these surface forms; the natural-language-tool handler requires one of them together with a named tool (calculator_tool or web_search_tool) before it treats the prompt as a direct tool call rather than ordinary prose. Matched as whole tokens in every supported language, so no cue word is named in the code."',
' wiktionary "invoke"',
' defined_by "action"',
' role "tool_invocation_cue"',
' lexeme "en"',
' word "call"',
' description "English verb to call or invoke a tool; a tool_invocation_cue matched as a whole token so it signals an explicit tool or API call."',
' word "invoke"',
' description "English verb to invoke a routine or tool; a tool_invocation_cue matched as a whole token so it signals an explicit tool or API call."',
' word "run"',
' description "English verb to run or execute; a tool_invocation_cue matched as a whole token so it signals an explicit tool or API call."',
' word "api"',
' description "English noun api (application programming interface); a tool_invocation_cue matched as a whole token so naming an api signals an explicit tool call."',
' word "tool"',
' description "English noun tool naming an invokable capability; a tool_invocation_cue matched as a whole token so naming a tool signals an explicit tool call."',
' lexeme "ru"',
' word "вызови"',
' description "Russian verb (romanized vyzovi, call or invoke — imperative); a tool_invocation_cue matched as a whole token so it signals an explicit tool or API call."',
' word "вызвать"',
' description "Russian verb (romanized vyzvat, to call or invoke); a tool_invocation_cue matched as a whole token so it signals an explicit tool or API call."',
' word "запусти"',
' description "Russian verb (romanized zapusti, run or launch — imperative); a tool_invocation_cue matched as a whole token so it signals an explicit tool or API call."',
' word "инструмент"',
' description "Russian noun (romanized instrument, tool); a tool_invocation_cue matched as a whole token so naming a tool signals an explicit tool call."',
' lexeme "hi"',
' word "कॉल"',
' description "Hindi verb (romanized kol, call — a loanword); a tool_invocation_cue matched as a whole token so it signals an explicit tool or API call."',
' word "चलाओ"',
' description "Hindi verb (romanized chalao, run — imperative); a tool_invocation_cue matched as a whole token so it signals an explicit tool or API call."',
' word "उपकरण"',
' description "Hindi noun (romanized upkaran, tool); a tool_invocation_cue matched as a whole token so naming a tool signals an explicit tool call."',
' lexeme "zh"',
' word "调用"',
' description "Chinese verb (pinyin diaoyong, to call or invoke); a tool_invocation_cue matched as a Han substring so it signals an explicit tool or API call."',
' word "运行"',
' description "Chinese verb (pinyin yunxing, to run); a tool_invocation_cue matched as a Han substring so it signals an explicit tool or API call."',
' word "工具"',
' description "Chinese noun (pinyin gongju, tool); a tool_invocation_cue matched as a Han substring so naming a tool signals an explicit tool call."',
' meaning "calculator_tool"',
' gloss "the calculator tool the assistant can invoke to evaluate an arithmetic expression — its formal capability is tool:calculator. The calculator_tool_name role marks the surface words that name it; the natural-language-tool handler requires this name together with a tool_invocation_cue before it routes the prompt to the calculator. The English form is the literal tool identifier; the other languages are best-effort descriptive surfaces. Matched as whole tokens."',
' wiktionary "calculator"',
' defined_by "entity"',
' role "calculator_tool_name"',
' lexeme "en"',
' word "calculator"',
' description "English noun calculator and the literal tool identifier calculator; a calculator_tool_name matched as a whole token."',
' lexeme "ru"',
' word "калькулятор"',
' description "Russian noun (romanized kalkulyator, calculator); a calculator_tool_name matched as a whole token."',
' lexeme "hi"',
' word "कैलकुलेटर"',
' description "Hindi noun (romanized kailkuletar, calculator — a loanword); a calculator_tool_name matched as a whole token."',
' lexeme "zh"',
' word "计算器"',
' description "Chinese noun (pinyin jisuanqi, calculator); a calculator_tool_name matched as a Han substring."',
' meaning "web_search_tool"',
' gloss "the web-search tool the assistant can invoke to record a search plan — its formal capability is tool:web_search. The web_search_tool_name role marks the surface words that name it; the natural-language-tool handler requires this name together with a tool_invocation_cue before it routes the prompt to web search. The English forms are the literal tool identifier and its spaced and hyphenated spellings; the other languages are best-effort descriptive surfaces. Matched as whole tokens."',
' wiktionary "search"',
' defined_by "entity"',
' role "web_search_tool_name"',
' lexeme "en"',
' word "web_search"',
' description "English literal tool identifier web_search naming the web-search tool; a web_search_tool_name matched as a whole token."',
' word "web search"',
' description "English spaced spelling web search naming the web-search tool; a web_search_tool_name matched as a whole token (phrase)."',
' word "web-search"',
' description "English hyphenated spelling web-search naming the web-search tool; a web_search_tool_name matched as a whole token."',
' lexeme "ru"',
' word "веб-поиск"',
' description "Russian noun (romanized veb-poisk, web search); a web_search_tool_name matched as a whole token."',
' word "поиск в интернете"',
' description "Russian phrase (romanized poisk v internete, search on the internet); a web_search_tool_name matched as a whole token (phrase)."',
' lexeme "hi"',
' word "वेब खोज"',
' description "Hindi phrase (romanized veb khoj, web search); a web_search_tool_name matched as a whole token (phrase)."',
' word "इंटरनेट खोज"',
' description "Hindi phrase (romanized internet khoj, internet search); a web_search_tool_name matched as a whole token (phrase)."',
' lexeme "zh"',
' word "网络搜索"',
' description "Chinese noun (pinyin wangluo sousuo, web search); a web_search_tool_name matched as a Han substring."',
' word "网页搜索"',
' description "Chinese noun (pinyin wangye sousuo, web-page search); a web_search_tool_name matched as a Han substring."',
' meaning "local_shell_tool"',
' gloss "an explicit request to invoke the local_shell tool — its formal capability is tool:local_shell. Unlike calculator_tool and web_search_tool, the surface forms here bundle the verb and the tool name into whole phrases (for example local shell tool or invoke the shell tool), so the local_shell_request_cue role is decisive on its own and the handler does not also require a separate tool_invocation_cue. The English forms are the literal identifier and the request phrases; the other languages are best-effort descriptive surfaces. Matched as whole tokens."',
' wiktionary "shell"',
' defined_by "entity"',
' role "local_shell_request_cue"',
' lexeme "en"',
' word "local_shell"',
' description "English literal tool identifier local_shell naming the shell runner; a local_shell_request_cue matched as a whole token."',
' word "local shell tool"',
' description "English phrase local shell tool naming the shell tool; a local_shell_request_cue matched as a whole token (phrase)."',
' word "local shell api"',
" description \"English phrase local shell api naming the shell tool's api; a local_shell_request_cue matched as a whole token (phrase).\"",
' word "call the shell tool"',
' description "English phrase call the shell tool requesting the shell tool; a local_shell_request_cue matched as a whole token (phrase)."',
' word "invoke the shell tool"',
' description "English phrase invoke the shell tool requesting the shell tool; a local_shell_request_cue matched as a whole token (phrase)."',
' lexeme "ru"',
' word "локальная оболочка"',
' description "Russian phrase (romanized lokalnaya obolochka, local shell); a local_shell_request_cue matched as a whole token (phrase)."',
' word "вызови оболочку"',
' description "Russian phrase (romanized vyzovi obolochku, call the shell); a local_shell_request_cue matched as a whole token (phrase)."',
' lexeme "hi"',
' word "लोकल शेल"',
' description "Hindi phrase (romanized lokal shel, local shell); a local_shell_request_cue matched as a whole token (phrase)."',
' word "शेल टूल चलाओ"',
' description "Hindi phrase (romanized shel tul chalao, run the shell tool); a local_shell_request_cue matched as a whole token (phrase)."',
' lexeme "zh"',
' word "本地外壳"',
' description "Chinese noun (pinyin bendi waike, local shell); a local_shell_request_cue matched as a Han substring."',
' word "调用外壳工具"',
' description "Chinese phrase (pinyin diaoyong waike gongju, invoke the shell tool); a local_shell_request_cue matched as a Han substring."',
' meaning "tool_argument_marker"',
' gloss "a phrase that introduces the argument of a natural-language tool call — for example with query or for — immediately followed by the argument text. The tool_argument_marker role carries these forms; when the argument is not already delimited by backticks or quotes, the handler reconstructs each English form as a space-padded token, finds the first one present in declaration order, and takes the text after it as the argument. Only the English forms are consulted — this is an English-frame extraction heuristic — while the other languages remain in the seed so the meaning stays fully self-describing. The forms are listed in the original priority order so longer, more specific phrases win before shorter ones."',
' wiktionary "with"',
' defined_by "relation"',
' role "tool_argument_marker"',
' lexeme "en"',
' word "with query"',
" description \"English marker 'with query' introducing a search query argument; a tool_argument_marker reconstructed as a space-padded token, tried first as the longest, most specific phrase.\"",
' word "query"',
" description \"English marker 'query' introducing a query argument; a tool_argument_marker reconstructed as a space-padded token, tried after 'with query'.\"",
' word "with"',
" description \"English marker 'with' introducing an argument; a tool_argument_marker reconstructed as a space-padded token, tried after the query phrases.\"",
' word "for"',
" description \"English marker 'for' introducing an argument; a tool_argument_marker reconstructed as a space-padded token, tried last as the shortest phrase.\"",
' lexeme "ru"',
' word "с запросом"',
' description "Russian marker (romanized s zaprosom, with query) introducing a query argument; a tool_argument_marker kept in the seed for self-description (English forms drive extraction)."',
' word "для"',
' description "Russian marker (romanized dlya, for) introducing an argument; a tool_argument_marker kept in the seed for self-description (English forms drive extraction)."',
' lexeme "hi"',
' word "क्वेरी के साथ"',
' description "Hindi marker (romanized kveri ke saath, with query) introducing a query argument; a tool_argument_marker kept in the seed for self-description (English forms drive extraction)."',
' word "के लिए"',
' description "Hindi marker (romanized ke liye, for) introducing an argument; a tool_argument_marker kept in the seed for self-description (English forms drive extraction)."',
' lexeme "zh"',
' word "查询"',
' description "Chinese marker (pinyin chaxun, query) introducing a query argument; a tool_argument_marker kept in the seed for self-description (English forms drive extraction)."',
' word "用于"',
' description "Chinese marker (pinyin yongyu, for) introducing an argument; a tool_argument_marker kept in the seed for self-description (English forms drive extraction)."',
"meanings",
' meaning "feature_capability_web_search"',
" gloss \"the web-search capability — querying search engines and the open internet. A feature_capability_alias meaning: the feature-capability handler walks the feature_capability_alias meanings in declaration (priority) order and, through first_role_match_in_languages_raw, returns the first whose forms occur as a raw substring in the prompt, checked in the prompt's own language plus English. The matched slug minus its feature_capability_ prefix keys the localized response table, so no surface alias is named in the code. Availability is gated at runtime by offline mode and the configured search providers; this meaning is listed first to mirror the original hand-ordered capability table.\"",
' wiktionary "search"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "web search"',
" description \"English form 'web search' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "internet search"',
" description \"English form 'internet search' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "search engines"',
" description \"English form 'search engines' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "can you search the internet"',
" description \"English form 'can you search the internet' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "can you search internet"',
" description \"English form 'can you search internet' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "can you search the web"',
" description \"English form 'can you search the web' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "can you search web"',
" description \"English form 'can you search web' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "can you search online"',
" description \"English form 'can you search online' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "do you have internet search"',
" description \"English form 'do you have internet search' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "do you have web search"',
" description \"English form 'do you have web search' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "do you have internet access"',
" description \"English form 'do you have internet access' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "are you connected to search engines"',
" description \"English form 'are you connected to search engines' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "can you use search engines"',
" description \"English form 'can you use search engines' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "can you browse the web"',
" description \"English form 'can you browse the web' naming the web-search capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "веб-поиск"',
" description \"Russian form 'веб-поиск' (romanized veb-poisk, web search) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "веб поиск"',
" description \"Russian form 'веб поиск' (romanized veb poisk, web search) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "поиск в интернете"',
" description \"Russian phrase 'поиск в интернете' (romanized poisk v internete, search on the internet) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "поисковик"',
" description \"Russian noun 'поисковик' (romanized poiskovik, search engine) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "поисковые системы"',
" description \"Russian phrase 'поисковые системы' (romanized poiskovye sistemy, search engines) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "можешь искать в интернете"',
" description \"Russian phrase 'можешь искать в интернете' (romanized mozhesh iskat v internete, can you search the internet) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "можешь искать интернет"',
" description \"Russian phrase 'можешь искать интернет' (romanized mozhesh iskat internet, can you search the internet) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "умеешь искать в интернете"',
" description \"Russian phrase 'умеешь искать в интернете' (romanized umeesh iskat v internete, are you able to search the internet) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "умеешь искать интернет"',
" description \"Russian phrase 'умеешь искать интернет' (romanized umeesh iskat internet, are you able to search the internet) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "можешь искать онлайн"',
" description \"Russian phrase 'можешь искать онлайн' (romanized mozhesh iskat onlayn, can you search online) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "умеешь искать онлайн"',
" description \"Russian phrase 'умеешь искать онлайн' (romanized umeesh iskat onlayn, are you able to search online) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "у тебя есть веб-поиск"',
" description \"Russian phrase 'у тебя есть веб-поиск' (romanized u tebya est veb-poisk, do you have web search) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "у тебя есть веб поиск"',
" description \"Russian phrase 'у тебя есть веб поиск' (romanized u tebya est veb poisk, do you have web search) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "у тебя есть поиск в интернете"',
" description \"Russian phrase 'у тебя есть поиск в интернете' (romanized u tebya est poisk v internete, do you have internet search) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "есть доступ к интернету"',
" description \"Russian phrase 'есть доступ к интернету' (romanized est dostup k internetu, is there internet access) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "подключен к поисковикам"',
" description \"Russian phrase 'подключен к поисковикам' (romanized podklyuchen k poiskovikam, connected to search engines, masculine) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "подключена к поисковикам"',
" description \"Russian phrase 'подключена к поисковикам' (romanized podklyuchena k poiskovikam, connected to search engines, feminine) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "подключен к поисковым системам"',
" description \"Russian phrase 'подключен к поисковым системам' (romanized podklyuchen k poiskovym sistemam, connected to search engines) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "можешь пользоваться интернетом"',
" description \"Russian phrase 'можешь пользоваться интернетом' (romanized mozhesh polzovatsya internetom, can you use the internet) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "web search"',
" description \"English loanword 'web search' as used in Hindi prompts for the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "internet search"',
" description \"English loanword 'internet search' as used in Hindi prompts for the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "search engine"',
" description \"English loanword 'search engine' as used in Hindi prompts for the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "इंटरनेट पर खोज सकते"',
" description \"Hindi phrase 'इंटरनेट पर खोज सकते' (romanized internet par khoj sakte, can search on the internet) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "ऑनलाइन खोज सकते"',
" description \"Hindi phrase 'ऑनलाइन खोज सकते' (romanized online khoj sakte, can search online) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "इंटरनेट खोज है"',
" description \"Hindi phrase 'इंटरनेट खोज है' (romanized internet khoj hai, is there internet search) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "वेब खोज है"',
" description \"Hindi phrase 'वेब खोज है' (romanized veb khoj hai, is there web search) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "सर्च इंजन से जुड़े"',
" description \"Hindi phrase 'सर्च इंजन से जुड़े' (romanized sarch injan se jude, connected to a search engine) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "खोज इंजन से जुड़े"',
" description \"Hindi phrase 'खोज इंजन से जुड़े' (romanized khoj injan se jude, connected to a search engine) naming the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "web search"',
" description \"English loanword 'web search' as used in Chinese prompts for the web-search capability; a feature_capability_alias matched as a raw substring.\"",
' word "搜索引擎"',
" description \"Chinese form '搜索引擎' (pinyin sousuo yinqing, search engine) naming the web-search capability; a feature_capability_alias matched as a Han substring.\"",
' word "上网搜索"',
" description \"Chinese form '上网搜索' (pinyin shangwang sousuo, go online to search) naming the web-search capability; a feature_capability_alias matched as a Han substring.\"",
' word "搜索互联网"',
" description \"Chinese form '搜索互联网' (pinyin sousuo hulianwang, search the internet) naming the web-search capability; a feature_capability_alias matched as a Han substring.\"",
' word "搜索网络"',
" description \"Chinese form '搜索网络' (pinyin sousuo wangluo, search the web) naming the web-search capability; a feature_capability_alias matched as a Han substring.\"",
' word "联网搜索"',
" description \"Chinese form '联网搜索' (pinyin lianwang sousuo, networked search) naming the web-search capability; a feature_capability_alias matched as a Han substring.\"",
' word "用搜索引擎"',
" description \"Chinese form '用搜索引擎' (pinyin yong sousuo yinqing, use a search engine) naming the web-search capability; a feature_capability_alias matched as a Han substring.\"",
' word "使用搜索引擎"',
" description \"Chinese form '使用搜索引擎' (pinyin shiyong sousuo yinqing, use a search engine) naming the web-search capability; a feature_capability_alias matched as a Han substring.\"",
' word "网络搜索"',
" description \"Chinese form '网络搜索' (pinyin wangluo sousuo, web search) naming the web-search capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_diagnostics"',
' gloss "the diagnostic-trace capability — showing the reasoning trace behind an answer. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; availability is gated at runtime by diagnostic mode."',
' wiktionary "diagnostics"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "diagnostics"',
" description \"English form 'diagnostics' naming the diagnostic-trace capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "diagnostic"',
" description \"English form 'diagnostic' naming the diagnostic-trace capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "trace"',
" description \"English form 'trace' naming the diagnostic-trace capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "reasoning trace"',
" description \"English form 'reasoning trace' naming the diagnostic-trace capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "show diagnostics"',
" description \"English form 'show diagnostics' naming the diagnostic-trace capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "диагностика"',
" description \"Russian noun 'диагностика' (romanized diagnostika, diagnostics) naming the diagnostic-trace capability; a feature_capability_alias matched as a raw substring.\"",
' word "диагност"',
" description \"Russian stem 'диагност' (romanized diagnost, diagnostic-) naming the diagnostic-trace capability; a feature_capability_alias matched as a raw substring (a stem, so it also catches diagnostika and related forms).\"",
' word "трассировка"',
" description \"Russian noun 'трассировка' (romanized trassirovka, trace) naming the diagnostic-trace capability; a feature_capability_alias matched as a raw substring.\"",
' word "trace"',
" description \"English loanword 'trace' as used in Russian prompts for the diagnostic-trace capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "diagnostics"',
" description \"English loanword 'diagnostics' as used in Hindi prompts for the diagnostic-trace capability; a feature_capability_alias matched as a raw substring.\"",
' word "निदान"',
" description \"Hindi noun 'निदान' (romanized nidan, diagnosis) naming the diagnostic-trace capability; a feature_capability_alias matched as a raw substring.\"",
' word "trace"',
" description \"English loanword 'trace' as used in Hindi prompts for the diagnostic-trace capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "诊断"',
" description \"Chinese form '诊断' (pinyin zhenduan, diagnostics) naming the diagnostic-trace capability; a feature_capability_alias matched as a Han substring.\"",
' word "trace"',
" description \"English loanword 'trace' as used in Chinese prompts for the diagnostic-trace capability; a feature_capability_alias matched as a raw substring.\"",
' word "推理跟踪"',
" description \"Chinese form '推理跟踪' (pinyin tuili genzong, reasoning trace) naming the diagnostic-trace capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_agent_mode"',
' gloss "the agent-mode capability — multi-step, autonomous tool use. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; availability is gated at runtime by agent mode."',
' wiktionary "agent"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "agent mode"',
" description \"English form 'agent mode' naming the agent-mode capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "agent"',
" description \"English form 'agent' naming the agent-mode capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "multi-step"',
" description \"English form 'multi-step' naming the agent-mode capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "autonomous"',
" description \"English form 'autonomous' naming the agent-mode capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "agent mode"',
" description \"English loanword 'agent mode' as used in Russian prompts for the agent-mode capability; a feature_capability_alias matched as a raw substring.\"",
' word "агент"',
" description \"Russian noun 'агент' (romanized agent, agent) naming the agent-mode capability; a feature_capability_alias matched as a raw substring.\"",
' word "многошаг"',
" description \"Russian stem 'многошаг' (romanized mnogoshag, multi-step) naming the agent-mode capability; a feature_capability_alias matched as a raw substring (a stem, so it also catches mnogoshagovyy).\"",
' word "автоном"',
" description \"Russian stem 'автоном' (romanized avtonom, autonomous) naming the agent-mode capability; a feature_capability_alias matched as a raw substring (a stem, so it also catches avtonomnyy).\"",
' lexeme "hi"',
' word "agent mode"',
" description \"English loanword 'agent mode' as used in Hindi prompts for the agent-mode capability; a feature_capability_alias matched as a raw substring.\"",
' word "एजेंट"',
" description \"Hindi noun 'एजेंट' (romanized ejent, agent — a loanword) naming the agent-mode capability; a feature_capability_alias matched as a raw substring.\"",
' word "multi-step"',
" description \"English loanword 'multi-step' as used in Hindi prompts for the agent-mode capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "agent mode"',
" description \"English loanword 'agent mode' as used in Chinese prompts for the agent-mode capability; a feature_capability_alias matched as a raw substring.\"",
' word "代理"',
" description \"Chinese form '代理' (pinyin daili, agent or proxy) naming the agent-mode capability; a feature_capability_alias matched as a Han substring.\"",
' word "多步骤"',
" description \"Chinese form '多步骤' (pinyin duo buzhou, multi-step) naming the agent-mode capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_definition_fusion"',
' gloss "the automatic-definition-fusion capability — merging overlapping definitions automatically. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; availability is gated at runtime by the definition-fusion-by-default setting."',
' wiktionary "fusion"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "definition fusion"',
" description \"English form 'definition fusion' naming the automatic-definition-fusion capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "merge definitions"',
" description \"English form 'merge definitions' naming the automatic-definition-fusion capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "automatic definition"',
" description \"English form 'automatic definition' naming the automatic-definition-fusion capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "слияние определений"',
" description \"Russian phrase 'слияние определений' (romanized sliyanie opredeleniy, fusion of definitions) naming the automatic-definition-fusion capability; a feature_capability_alias matched as a raw substring.\"",
' word "объединение определений"',
" description \"Russian phrase 'объединение определений' (romanized obedinenie opredeleniy, merging of definitions) naming the automatic-definition-fusion capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "definition fusion"',
" description \"English loanword 'definition fusion' as used in Hindi prompts for the automatic-definition-fusion capability; a feature_capability_alias matched as a raw substring.\"",
' word "merge definitions"',
" description \"English loanword 'merge definitions' as used in Hindi prompts for the automatic-definition-fusion capability; a feature_capability_alias matched as a raw substring.\"",
' word "परिभाषा विलय"',
" description \"Hindi phrase 'परिभाषा विलय' (romanized paribhasha vilay, definition fusion) naming the automatic-definition-fusion capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "definition fusion"',
" description \"English loanword 'definition fusion' as used in Chinese prompts for the automatic-definition-fusion capability; a feature_capability_alias matched as a raw substring.\"",
' word "合并定义"',
" description \"Chinese phrase '合并定义' (pinyin hebing dingyi, merge definitions) naming the automatic-definition-fusion capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_configuration"',
' gloss "the message-driven configuration capability — changing settings, theme, language, and chat style from chat messages. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available."',
' wiktionary "configuration"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "settings"',
" description \"English form 'settings' naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "configuration"',
" description \"English form 'configuration' naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "configure settings"',
" description \"English form 'configure settings' naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "theme"',
" description \"English form 'theme' naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "language"',
" description \"English form 'language' naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "chat style"',
" description \"English form 'chat style' naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "configure"',
" description \"English form 'configure' naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "preferences"',
" description \"English form 'preferences' naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "composer style"',
" description \"English form 'composer style' naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "ui skin"',
" description \"English form 'ui skin' naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "настройки"',
" description \"Russian noun 'настройки' (romanized nastroyki, settings) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "настройка"',
" description \"Russian noun 'настройка' (romanized nastroyka, setting) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "конфигурация"',
" description \"Russian noun 'конфигурация' (romanized konfiguratsiya, configuration) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "тема"',
" description \"Russian noun 'тема' (romanized tema, theme) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "язык"',
" description \"Russian noun 'язык' (romanized yazyk, language) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "стиль чата"',
" description \"Russian phrase 'стиль чата' (romanized stil chata, chat style) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "оформление"',
" description \"Russian noun 'оформление' (romanized oformlenie, styling or appearance) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "настрой"',
" description \"Russian stem 'настрой' (romanized nastroy, configure — imperative) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring (a stem, so it also catches nastroyka and nastroyki).\"",
' word "конфигурац"',
" description \"Russian stem 'конфигурац' (romanized konfigurats, configurat-) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring (a stem, so it also catches konfiguratsiya and konfiguratsiyu).\"",
' word "параметр"',
" description \"Russian noun 'параметр' (romanized parametr, parameter) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "settings"',
" description \"English loanword 'settings' as used in Hindi prompts for the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "configuration"',
" description \"English loanword 'configuration' as used in Hindi prompts for the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "theme"',
" description \"English loanword 'theme' as used in Hindi prompts for the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "language"',
" description \"English loanword 'language' as used in Hindi prompts for the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' word "सेटिंग"',
" description \"Hindi noun 'सेटिंग' (romanized seting, settings — a loanword) naming the message-driven configuration capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "设置"',
" description \"Chinese form '设置' (pinyin shezhi, settings) naming the message-driven configuration capability; a feature_capability_alias matched as a Han substring.\"",
' word "配置"',
" description \"Chinese form '配置' (pinyin peizhi, configuration) naming the message-driven configuration capability; a feature_capability_alias matched as a Han substring.\"",
' word "主题"',
" description \"Chinese form '主题' (pinyin zhuti, theme) naming the message-driven configuration capability; a feature_capability_alias matched as a Han substring.\"",
' word "语言"',
" description \"Chinese form '语言' (pinyin yuyan, language) naming the message-driven configuration capability; a feature_capability_alias matched as a Han substring.\"",
' word "聊天样式"',
" description \"Chinese phrase '聊天样式' (pinyin liaotian yangshi, chat style) naming the message-driven configuration capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_memory_actions"',
' gloss "the memory import/export capability — saving and loading conversation memory. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available."',
' wiktionary "memory"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "export memory"',
" description \"English form 'export memory' naming the memory import/export capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "import memory"',
" description \"English form 'import memory' naming the memory import/export capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "memory export"',
" description \"English form 'memory export' naming the memory import/export capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "memory import"',
" description \"English form 'memory import' naming the memory import/export capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "экспорт памяти"',
" description \"Russian phrase 'экспорт памяти' (romanized eksport pamyati, memory export) naming the memory import/export capability; a feature_capability_alias matched as a raw substring.\"",
' word "импорт памяти"',
" description \"Russian phrase 'импорт памяти' (romanized import pamyati, memory import) naming the memory import/export capability; a feature_capability_alias matched as a raw substring.\"",
' word "память экспорт"',
" description \"Russian phrase 'память экспорт' (romanized pamyat eksport, memory export) naming the memory import/export capability; a feature_capability_alias matched as a raw substring.\"",
' word "память импорт"',
" description \"Russian phrase 'память импорт' (romanized pamyat import, memory import) naming the memory import/export capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "memory export"',
" description \"English loanword 'memory export' as used in Hindi prompts for the memory import/export capability; a feature_capability_alias matched as a raw substring.\"",
' word "memory import"',
" description \"English loanword 'memory import' as used in Hindi prompts for the memory import/export capability; a feature_capability_alias matched as a raw substring.\"",
' word "स्मृति निर्यात"',
" description \"Hindi phrase 'स्मृति निर्यात' (romanized smriti niryat, memory export) naming the memory import/export capability; a feature_capability_alias matched as a raw substring.\"",
' word "स्मृति आयात"',
" description \"Hindi phrase 'स्मृति आयात' (romanized smriti aayat, memory import) naming the memory import/export capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "导出记忆"',
" description \"Chinese phrase '导出记忆' (pinyin daochu jiyi, export memory) naming the memory import/export capability; a feature_capability_alias matched as a Han substring.\"",
' word "导入记忆"',
" description \"Chinese phrase '导入记忆' (pinyin daoru jiyi, import memory) naming the memory import/export capability; a feature_capability_alias matched as a Han substring.\"",
' word "memory export"',
" description \"English loanword 'memory export' as used in Chinese prompts for the memory import/export capability; a feature_capability_alias matched as a raw substring.\"",
' word "memory import"',
" description \"English loanword 'memory import' as used in Chinese prompts for the memory import/export capability; a feature_capability_alias matched as a raw substring.\"",
' meaning "feature_capability_greeting"',
' gloss "the greeting capability — recognising and answering hellos. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available."',
' wiktionary "greeting"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "greeting"',
" description \"English form 'greeting' naming the greeting capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "greetings"',
" description \"English form 'greetings' naming the greeting capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "say hello"',
" description \"English form 'say hello' naming the greeting capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "respond to hello"',
" description \"English form 'respond to hello' naming the greeting capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "приветствие"',
" description \"Russian noun 'приветствие' (romanized privetstvie, greeting) naming the greeting capability; a feature_capability_alias matched as a raw substring.\"",
' word "приветствия"',
" description \"Russian noun 'приветствия' (romanized privetstviya, greetings) naming the greeting capability; a feature_capability_alias matched as a raw substring.\"",
' word "здороваться"',
" description \"Russian verb 'здороваться' (romanized zdorovatsya, to greet) naming the greeting capability; a feature_capability_alias matched as a raw substring.\"",
' word "привет"',
" description \"Russian word 'привет' (romanized privet, hi) naming the greeting capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "अभिवादन"',
" description \"Hindi noun 'अभिवादन' (romanized abhivadan, greeting) naming the greeting capability; a feature_capability_alias matched as a raw substring.\"",
' word "नमस्ते"',
" description \"Hindi word 'नमस्ते' (romanized namaste, hello) naming the greeting capability; a feature_capability_alias matched as a raw substring.\"",
' word "hello"',
" description \"English loanword 'hello' as used in Hindi prompts for the greeting capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "问候"',
" description \"Chinese form '问候' (pinyin wenhou, greeting) naming the greeting capability; a feature_capability_alias matched as a Han substring.\"",
' word "打招呼"',
" description \"Chinese form '打招呼' (pinyin da zhaohu, to greet) naming the greeting capability; a feature_capability_alias matched as a Han substring.\"",
' word "你好"',
" description \"Chinese word '你好' (pinyin nihao, hello) naming the greeting capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_write_program"',
' gloss "the program-template generation capability — writing small programs and hello-world templates. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available."',
' wiktionary "program"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "hello world"',
" description \"English form 'hello world' naming the program-template generation capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "write code"',
" description \"English form 'write code' naming the program-template generation capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "generate code"',
" description \"English form 'generate code' naming the program-template generation capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "write program"',
" description \"English form 'write program' naming the program-template generation capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "program"',
" description \"English form 'program' naming the program-template generation capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "hello world"',
" description \"English loanword 'hello world' as used in Russian prompts for the program-template generation capability; a feature_capability_alias matched as a raw substring.\"",
' word "код"',
" description \"Russian noun 'код' (romanized kod, code) naming the program-template generation capability; a feature_capability_alias matched as a raw substring.\"",
' word "программу"',
" description \"Russian noun 'программу' (romanized programmu, program — accusative) naming the program-template generation capability; a feature_capability_alias matched as a raw substring.\"",
' word "программа"',
" description \"Russian noun 'программа' (romanized programma, program) naming the program-template generation capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "hello world"',
" description \"English loanword 'hello world' as used in Hindi prompts for the program-template generation capability; a feature_capability_alias matched as a raw substring.\"",
' word "code"',
" description \"English loanword 'code' as used in Hindi prompts for the program-template generation capability; a feature_capability_alias matched as a raw substring.\"",
' word "program"',
" description \"English loanword 'program' as used in Hindi prompts for the program-template generation capability; a feature_capability_alias matched as a raw substring.\"",
' word "प्रोग्राम"',
" description \"Hindi noun 'प्रोग्राम' (romanized program, program — a loanword) naming the program-template generation capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "hello world"',
" description \"English loanword 'hello world' as used in Chinese prompts for the program-template generation capability; a feature_capability_alias matched as a raw substring.\"",
' word "代码"',
" description \"Chinese form '代码' (pinyin daima, code) naming the program-template generation capability; a feature_capability_alias matched as a Han substring.\"",
' word "程序"',
" description \"Chinese form '程序' (pinyin chengxu, program) naming the program-template generation capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_concept_lookup"',
' gloss "the concept-lookup capability — explaining a concept or term. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available."',
' wiktionary "concept"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "concept lookup"',
" description \"English form 'concept lookup' naming the concept-lookup capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "concept"',
" description \"English form 'concept' naming the concept-lookup capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "wikipedia lookup"',
" description \"English form 'wikipedia lookup' naming the concept-lookup capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "поиск понятий"',
" description \"Russian phrase 'поиск понятий' (romanized poisk ponyatiy, concept lookup) naming the concept-lookup capability; a feature_capability_alias matched as a raw substring.\"",
' word "понятие"',
" description \"Russian noun 'понятие' (romanized ponyatie, concept) naming the concept-lookup capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "concept"',
" description \"English loanword 'concept' as used in Hindi prompts for the concept-lookup capability; a feature_capability_alias matched as a raw substring.\"",
' word "अवधारणा"',
" description \"Hindi noun 'अवधारणा' (romanized avadharana, concept) naming the concept-lookup capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "概念"',
" description \"Chinese form '概念' (pinyin gainian, concept) naming the concept-lookup capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_arithmetic"',
' gloss "the arithmetic capability — evaluating numeric expressions. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available. When a capability question is itself an arithmetic action request (see feature_action_arithmetic) the handler defers to the arithmetic solver instead."',
' wiktionary "arithmetic"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "arithmetic"',
" description \"English form 'arithmetic' naming the arithmetic capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "calculate"',
" description \"English form 'calculate' naming the arithmetic capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "math"',
" description \"English form 'math' naming the arithmetic capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "2 + 2"',
" description \"The numeric expression '2 + 2' (language-independent) exemplifying the arithmetic capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "арифмет"',
" description \"Russian stem 'арифмет' (romanized arifmet, arithmetic-) naming the arithmetic capability; a feature_capability_alias matched as a raw substring (a stem, so it also catches arifmetika).\"",
' word "считать"',
" description \"Russian verb 'считать' (romanized schitat, to count or calculate) naming the arithmetic capability; a feature_capability_alias matched as a raw substring.\"",
' word "посчитать"',
" description \"Russian verb 'посчитать' (romanized poschitat, to compute) naming the arithmetic capability; a feature_capability_alias matched as a raw substring.\"",
' word "2 + 2"',
" description \"The numeric expression '2 + 2' (language-independent) exemplifying the arithmetic capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "hi"',
' word "अंकगणित"',
" description \"Hindi noun 'अंकगणित' (romanized ankganit, arithmetic) naming the arithmetic capability; a feature_capability_alias matched as a raw substring.\"",
' word "गणना"',
" description \"Hindi noun 'गणना' (romanized ganana, calculation) naming the arithmetic capability; a feature_capability_alias matched as a raw substring.\"",
' word "math"',
" description \"English loanword 'math' as used in Hindi prompts for the arithmetic capability; a feature_capability_alias matched as a raw substring.\"",
' word "2 + 2"',
" description \"The numeric expression '2 + 2' (language-independent) exemplifying the arithmetic capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "zh"',
' word "算术"',
" description \"Chinese form '算术' (pinyin suanshu, arithmetic) naming the arithmetic capability; a feature_capability_alias matched as a Han substring.\"",
' word "计算"',
" description \"Chinese form '计算' (pinyin jisuan, calculate) naming the arithmetic capability; a feature_capability_alias matched as a Han substring.\"",
' word "数学"',
" description \"Chinese form '数学' (pinyin shuxue, math) naming the arithmetic capability; a feature_capability_alias matched as a Han substring.\"",
' word "2 + 2"',
" description \"The numeric expression '2 + 2' (language-independent) exemplifying the arithmetic capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' meaning "feature_capability_translation"',
' gloss "the translation capability — translating text between languages. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available."',
' wiktionary "translation"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "translation"',
" description \"English form 'translation' naming the translation capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "translate"',
" description \"English form 'translate' naming the translation capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "language translation"',
" description \"English form 'language translation' naming the translation capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "перевод"',
" description \"Russian noun 'перевод' (romanized perevod, translation) naming the translation capability; a feature_capability_alias matched as a raw substring.\"",
' word "переводить"',
" description \"Russian verb 'переводить' (romanized perevodit, to translate) naming the translation capability; a feature_capability_alias matched as a raw substring.\"",
' word "перевести"',
" description \"Russian verb 'перевести' (romanized perevesti, to translate — perfective) naming the translation capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "अनुवाद"',
" description \"Hindi noun 'अनुवाद' (romanized anuvad, translation) naming the translation capability; a feature_capability_alias matched as a raw substring.\"",
' word "translate"',
" description \"English loanword 'translate' as used in Hindi prompts for the translation capability; a feature_capability_alias matched as a raw substring.\"",
' word "translation"',
" description \"English loanword 'translation' as used in Hindi prompts for the translation capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "翻译"',
" description \"Chinese form '翻译' (pinyin fanyi, translation) naming the translation capability; a feature_capability_alias matched as a Han substring.\"",
' word "translation"',
" description \"English loanword 'translation' as used in Chinese prompts for the translation capability; a feature_capability_alias matched as a raw substring.\"",
' word "translate"',
" description \"English loanword 'translate' as used in Chinese prompts for the translation capability; a feature_capability_alias matched as a raw substring.\"",
' meaning "feature_capability_memory"',
' gloss "the conversation-memory capability — remembering and recalling facts stated earlier. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available."',
' wiktionary "memory"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "memory"',
" description \"English form 'memory' naming the conversation-memory capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "remember"',
" description \"English form 'remember' naming the conversation-memory capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "recall"',
" description \"English form 'recall' naming the conversation-memory capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "conversation context"',
" description \"English form 'conversation context' naming the conversation-memory capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "память"',
" description \"Russian noun 'память' (romanized pamyat, memory) naming the conversation-memory capability; a feature_capability_alias matched as a raw substring.\"",
' word "помнить"',
" description \"Russian verb 'помнить' (romanized pomnit, to remember) naming the conversation-memory capability; a feature_capability_alias matched as a raw substring.\"",
' word "запомнить"',
" description \"Russian verb 'запомнить' (romanized zapomnit, to memorize) naming the conversation-memory capability; a feature_capability_alias matched as a raw substring.\"",
' word "контекст"',
" description \"Russian noun 'контекст' (romanized kontekst, context) naming the conversation-memory capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "स्मृति"',
" description \"Hindi noun 'स्मृति' (romanized smriti, memory) naming the conversation-memory capability; a feature_capability_alias matched as a raw substring.\"",
' word "याद"',
" description \"Hindi noun 'याद' (romanized yaad, memory or recall) naming the conversation-memory capability; a feature_capability_alias matched as a raw substring.\"",
' word "memory"',
" description \"English loanword 'memory' as used in Hindi prompts for the conversation-memory capability; a feature_capability_alias matched as a raw substring.\"",
' word "context"',
" description \"English loanword 'context' as used in Hindi prompts for the conversation-memory capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "记忆"',
" description \"Chinese form '记忆' (pinyin jiyi, memory) naming the conversation-memory capability; a feature_capability_alias matched as a Han substring.\"",
' word "记住"',
" description \"Chinese form '记住' (pinyin jizhu, to remember) naming the conversation-memory capability; a feature_capability_alias matched as a Han substring.\"",
' word "回忆"',
" description \"Chinese form '回忆' (pinyin huiyi, to recall) naming the conversation-memory capability; a feature_capability_alias matched as a Han substring.\"",
' word "上下文"',
" description \"Chinese form '上下文' (pinyin shangxiawen, context) naming the conversation-memory capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_demo_mode"',
' gloss "the demo-mode capability — a scripted demonstration mode. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available."',
' wiktionary "demo"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "demo mode"',
" description \"English form 'demo mode' naming the demo-mode capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "demo"',
" description \"English form 'demo' naming the demo-mode capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "scripted demo"',
" description \"English form 'scripted demo' naming the demo-mode capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "демо"',
" description \"Russian noun 'демо' (romanized demo, demo — a loanword) naming the demo-mode capability; a feature_capability_alias matched as a raw substring.\"",
' word "демо-режим"',
" description \"Russian noun 'демо-режим' (romanized demo-rezhim, demo mode) naming the demo-mode capability; a feature_capability_alias matched as a raw substring.\"",
' word "сценарный демо"',
" description \"Russian phrase 'сценарный демо' (romanized stsenarnyy demo, scripted demo) naming the demo-mode capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "demo"',
" description \"English loanword 'demo' as used in Hindi prompts for the demo-mode capability; a feature_capability_alias matched as a raw substring.\"",
' word "डेमो"',
" description \"Hindi noun 'डेमो' (romanized demo, demo — a loanword) naming the demo-mode capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "demo"',
" description \"English loanword 'demo' as used in Chinese prompts for the demo-mode capability; a feature_capability_alias matched as a raw substring.\"",
' word "演示"',
" description \"Chinese form '演示' (pinyin yanshi, demonstration) naming the demo-mode capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_http_url"',
' gloss "the URL-navigation and HTTP-fetch capability — fetching and visiting URLs. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available."',
' wiktionary "URL"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "http fetch"',
" description \"English form 'http fetch' naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "fetch url"',
" description \"English form 'fetch url' naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "open url"',
" description \"English form 'open url' naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "navigate to url"',
" description \"English form 'navigate to url' naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "visit url"',
" description \"English form 'visit url' naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "url navigation"',
" description \"English form 'url navigation' naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "http запрос"',
" description \"Russian phrase 'http запрос' (romanized http zapros, http request) naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' word "открыть url"',
" description \"Russian phrase 'открыть url' (romanized otkryt url, open url) naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' word "перейти на"',
" description \"Russian phrase 'перейти на' (romanized pereyti na, navigate to) naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring (a phrase stem followed by a target).\"",
' word "сделать запрос"',
" description \"Russian phrase 'сделать запрос' (romanized sdelat zapros, make a request) naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' word "url-навигация"',
" description \"Russian phrase 'url-навигация' (romanized url-navigatsiya, url navigation) naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' word "url навигация"',
" description \"Russian phrase 'url навигация' (romanized url navigatsiya, url navigation) naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "http fetch"',
" description \"English loanword 'http fetch' as used in Hindi prompts for the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' word "url"',
" description \"English loanword 'url' as used in Hindi prompts for the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' word "navigate"',
" description \"English loanword 'navigate' as used in Hindi prompts for the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' word "लिंक"',
" description \"Hindi noun 'लिंक' (romanized link, link — a loanword) naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' word "यूआरएल"',
" description \"Hindi noun 'यूआरएल' (romanized yuaarel, URL — a loanword) naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "http fetch"',
" description \"English loanword 'http fetch' as used in Chinese prompts for the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' word "url"',
" description \"English loanword 'url' as used in Chinese prompts for the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a raw substring.\"",
' word "打开链接"',
" description \"Chinese phrase '打开链接' (pinyin dakai lianjie, open link) naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a Han substring.\"",
' word "访问链接"',
" description \"Chinese phrase '访问链接' (pinyin fangwen lianjie, visit link) naming the URL-navigation and HTTP-fetch capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_javascript_execution"',
' gloss "the JavaScript-execution capability — running a deterministic JavaScript subset. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available."',
' wiktionary "JavaScript"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "javascript"',
" description \"English form 'javascript' naming the JavaScript-execution capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "run javascript"',
" description \"English form 'run javascript' naming the JavaScript-execution capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "execute javascript"',
" description \"English form 'execute javascript' naming the JavaScript-execution capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "js"',
" description \"English form 'js' naming the JavaScript-execution capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "javascript"',
" description \"English loanword 'javascript' as used in Russian prompts for the JavaScript-execution capability; a feature_capability_alias matched as a raw substring.\"",
' word "js"',
" description \"English loanword 'js' as used in Russian prompts for the JavaScript-execution capability; a feature_capability_alias matched as a raw substring.\"",
' word "выполнить javascript"',
" description \"Russian phrase 'выполнить javascript' (romanized vypolnit javascript, execute javascript) naming the JavaScript-execution capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "javascript"',
" description \"English loanword 'javascript' as used in Hindi prompts for the JavaScript-execution capability; a feature_capability_alias matched as a raw substring.\"",
' word "js"',
" description \"English loanword 'js' as used in Hindi prompts for the JavaScript-execution capability; a feature_capability_alias matched as a raw substring.\"",
' word "स्क्रिप्ट"',
" description \"Hindi noun 'स्क्रिप्ट' (romanized skript, script — a loanword) naming the JavaScript-execution capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "javascript"',
" description \"English loanword 'javascript' as used in Chinese prompts for the JavaScript-execution capability; a feature_capability_alias matched as a raw substring.\"",
' word "js"',
" description \"English loanword 'js' as used in Chinese prompts for the JavaScript-execution capability; a feature_capability_alias matched as a raw substring.\"",
' word "脚本执行"',
" description \"Chinese phrase '脚本执行' (pinyin jiaoben zhixing, script execution) naming the JavaScript-execution capability; a feature_capability_alias matched as a Han substring.\"",
' word "执行脚本"',
" description \"Chinese phrase '执行脚本' (pinyin zhixing jiaoben, execute script) naming the JavaScript-execution capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_planning"',
' gloss "the planning capability — summaries, brainstorming, roleplay, and project planning. A feature_capability_alias meaning whose multilingual forms the feature-capability handler matches as raw substrings in declaration (priority) order, so no surface alias lives in the code; this capability is always available. When a capability question is itself a planning action request (see feature_action_planning) the handler defers to the primary planning handler instead."',
' wiktionary "planning"',
' defined_by "concept"',
' role "feature_capability_alias"',
' lexeme "en"',
' word "summarize"',
" description \"English form 'summarize' naming the planning capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "brainstorm"',
" description \"English form 'brainstorm' naming the planning capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "roleplay"',
" description \"English form 'roleplay' naming the planning capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "software project"',
" description \"English form 'software project' naming the planning capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' word "project plan"',
" description \"English form 'project plan' naming the planning capability; a feature_capability_alias matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "резюмировать"',
" description \"Russian verb 'резюмировать' (romanized rezyumirovat, to summarize) naming the planning capability; a feature_capability_alias matched as a raw substring.\"",
' word "брейншторм"',
" description \"Russian noun 'брейншторм' (romanized breynshtorm, brainstorm — a loanword) naming the planning capability; a feature_capability_alias matched as a raw substring.\"",
' word "роль"',
" description \"Russian noun 'роль' (romanized rol, role) naming the planning capability; a feature_capability_alias matched as a raw substring.\"",
' word "проект"',
" description \"Russian noun 'проект' (romanized proekt, project) naming the planning capability; a feature_capability_alias matched as a raw substring.\"",
' word "план проекта"',
" description \"Russian phrase 'план проекта' (romanized plan proekta, project plan) naming the planning capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "hi"',
' word "summary"',
" description \"English loanword 'summary' as used in Hindi prompts for the planning capability; a feature_capability_alias matched as a raw substring.\"",
' word "brainstorm"',
" description \"English loanword 'brainstorm' as used in Hindi prompts for the planning capability; a feature_capability_alias matched as a raw substring.\"",
' word "roleplay"',
" description \"English loanword 'roleplay' as used in Hindi prompts for the planning capability; a feature_capability_alias matched as a raw substring.\"",
' word "project plan"',
" description \"English loanword 'project plan' as used in Hindi prompts for the planning capability; a feature_capability_alias matched as a raw substring.\"",
' word "परियोजना योजना"',
" description \"Hindi phrase 'परियोजना योजना' (romanized pariyojana yojana, project plan) naming the planning capability; a feature_capability_alias matched as a raw substring.\"",
' lexeme "zh"',
' word "总结"',
" description \"Chinese form '总结' (pinyin zongjie, to summarize) naming the planning capability; a feature_capability_alias matched as a Han substring.\"",
' word "头脑风暴"',
" description \"Chinese phrase '头脑风暴' (pinyin tounao fengbao, brainstorm) naming the planning capability; a feature_capability_alias matched as a Han substring.\"",
' word "角色扮演"',
" description \"Chinese phrase '角色扮演' (pinyin juese banyan, roleplay) naming the planning capability; a feature_capability_alias matched as a Han substring.\"",
' word "项目计划"',
" description \"Chinese phrase '项目计划' (pinyin xiangmu jihua, project plan) naming the planning capability; a feature_capability_alias matched as a Han substring.\"",
' meaning "feature_capability_question"',
" gloss \"the interrogative frame that flags a prompt as a capability question — cues such as 'can you ...?', 'у тебя есть ...?', '能...?', and 'क्या ...?'. A feature_capability_question meaning: before it looks for a named feature, the feature-capability handler checks these cues through mentions_role_in_languages_raw against the prompt's own detected language only (English prompts additionally accept a grammatical 'is/are ... enabled/available' frame computed in code). Matched as raw substrings, so no cue word is named in the handler.\"",
' wiktionary "can"',
' defined_by "action"',
' role "feature_capability_question"',
' lexeme "en"',
' word "can you"',
" description \"English interrogative cue 'can you'; a feature_capability_question cue matched as a raw substring that flags the prompt as a capability question.\"",
' word "can formal-ai"',
" description \"English interrogative cue 'can formal-ai'; a feature_capability_question cue matched as a raw substring that flags the prompt as a capability question.\"",
' word "are you able"',
" description \"English interrogative cue 'are you able'; a feature_capability_question cue matched as a raw substring that flags the prompt as a capability question.\"",
' word "are you connected"',
" description \"English interrogative cue 'are you connected'; a feature_capability_question cue matched as a raw substring that flags the prompt as a capability question.\"",
' word "do you support"',
" description \"English interrogative cue 'do you support'; a feature_capability_question cue matched as a raw substring that flags the prompt as a capability question.\"",
' word "do you have"',
" description \"English interrogative cue 'do you have'; a feature_capability_question cue matched as a raw substring that flags the prompt as a capability question.\"",
' word "can i"',
" description \"English interrogative cue 'can i'; a feature_capability_question cue matched as a raw substring that flags the prompt as a capability question.\"",
' lexeme "ru"',
' word "можешь"',
" description \"Russian interrogative cue 'можешь' (romanized mozhesh, can you); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "умеешь"',
" description \"Russian interrogative cue 'умеешь' (romanized umeesh, are you able); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "поддерживаешь"',
" description \"Russian interrogative cue 'поддерживаешь' (romanized podderzhivaesh, do you support); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "у тебя есть"',
" description \"Russian interrogative cue 'у тебя есть' (romanized u tebya est, do you have); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "есть ли"',
" description \"Russian interrogative cue 'есть ли' (romanized est li, is there); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "доступен"',
" description \"Russian interrogative cue 'доступен' (romanized dostupen, available — masculine); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "доступна"',
" description \"Russian interrogative cue 'доступна' (romanized dostupna, available — feminine); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "включен"',
" description \"Russian interrogative cue 'включен' (romanized vklyuchen, enabled — masculine); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "включена"',
" description \"Russian interrogative cue 'включена' (romanized vklyuchena, enabled — feminine); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "подключен"',
" description \"Russian interrogative cue 'подключен' (romanized podklyuchen, connected — masculine); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "подключена"',
" description \"Russian interrogative cue 'подключена' (romanized podklyuchena, connected — feminine); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "можно ли"',
" description \"Russian interrogative cue 'можно ли' (romanized mozhno li, is it possible); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' lexeme "hi"',
' word "क्या"',
" description \"Hindi interrogative cue 'क्या' (romanized kya, the question particle what or whether); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "सकते"',
" description \"Hindi interrogative cue 'सकते' (romanized sakte, can — formal or plural); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "सकती"',
" description \"Hindi interrogative cue 'सकती' (romanized sakti, can — feminine); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "समर्थन"',
" description \"Hindi interrogative cue 'समर्थन' (romanized samarthan, support); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' word "उपलब्ध"',
" description \"Hindi interrogative cue 'उपलब्ध' (romanized uplabdh, available); a feature_capability_question cue matched as a raw substring that flags a capability question.\"",
' lexeme "zh"',
' word "能"',
" description \"Chinese interrogative cue '能' (pinyin neng, can); a feature_capability_question cue matched as a Han substring that flags a capability question.\"",
' word "可以"',
" description \"Chinese interrogative cue '可以' (pinyin keyi, can or may); a feature_capability_question cue matched as a Han substring that flags a capability question.\"",
' word "支持"',
" description \"Chinese interrogative cue '支持' (pinyin zhichi, support); a feature_capability_question cue matched as a Han substring that flags a capability question.\"",
' word "你有"',
" description \"Chinese interrogative cue '你有' (pinyin ni you, you have); a feature_capability_question cue matched as a Han substring that flags a capability question.\"",
' word "您有"',
" description \"Chinese interrogative cue '您有' (pinyin nin you, you have — polite); a feature_capability_question cue matched as a Han substring that flags a capability question.\"",
' word "有没有"',
" description \"Chinese interrogative cue '有没有' (pinyin you meiyou, is there); a feature_capability_question cue matched as a Han substring that flags a capability question.\"",
' word "是否有"',
" description \"Chinese interrogative cue '是否有' (pinyin shifou you, whether there is); a feature_capability_question cue matched as a Han substring that flags a capability question.\"",
' word "启用"',
" description \"Chinese interrogative cue '启用' (pinyin qiyong, to enable); a feature_capability_question cue matched as a Han substring that flags a capability question.\"",
' word "可用"',
" description \"Chinese interrogative cue '可用' (pinyin keyong, available); a feature_capability_question cue matched as a Han substring that flags a capability question.\"",
' meaning "feature_action_arithmetic"',
" gloss \"an action-request frame asking the assistant to actually perform a calculation — 'can you calculate ...', 'can you compute ...'. A feature_action_arithmetic meaning: when a detected capability question also opens with one of these English frames, reconstructed as a space-padded prefix, the handler steps aside so the arithmetic solver answers instead of reporting availability. Only the English frames drive the gate, read through words_for_role_in_languages restricted to English; the other languages stay in the seed for self-description.\"",
' wiktionary "calculate"',
' defined_by "action"',
' role "feature_action_arithmetic"',
' lexeme "en"',
' word "can you calculate"',
" description \"English action-request frame 'can you calculate'; a feature_action_arithmetic cue reconstructed as a space-padded prefix, so when the prompt opens with it the capability handler defers to the arithmetic solver.\"",
' word "can you compute"',
" description \"English action-request frame 'can you compute'; a feature_action_arithmetic cue reconstructed as a space-padded prefix, so when the prompt opens with it the capability handler defers to the arithmetic solver.\"",
' lexeme "ru"',
' word "можешь вычислить"',
" description \"Russian phrase 'можешь вычислить' (romanized mozhesh vychislit, can you calculate); a feature_action_arithmetic form kept in the seed for self-description (only the English frames drive the action gate).\"",
' word "можешь посчитать"',
" description \"Russian phrase 'можешь посчитать' (romanized mozhesh poschitat, can you compute); a feature_action_arithmetic form kept in the seed for self-description (only the English frames drive the action gate).\"",
' lexeme "hi"',
' word "क्या आप गणना कर सकते"',
" description \"Hindi phrase 'क्या आप गणना कर सकते' (romanized kya aap ganana kar sakte, can you calculate); a feature_action_arithmetic form kept in the seed for self-description (only the English frames drive the action gate).\"",
' lexeme "zh"',
' word "你能计算"',
" description \"Chinese phrase '你能计算' (pinyin ni neng jisuan, can you calculate); a feature_action_arithmetic form kept in the seed for self-description (only the English frames drive the action gate).\"",
' meaning "feature_action_planning"',
" gloss \"an action-request frame asking the assistant to actually perform a planning task — 'can you summarize ...', 'can you brainstorm ...', 'can you roleplay ...'. A feature_action_planning meaning: when a detected capability question also contains one of these English frames, reconstructed as a space-padded token, the handler steps aside so the primary planning handler answers. Only the English frames drive the gate, read through words_for_role_in_languages restricted to English; the other languages stay in the seed for self-description.\"",
' wiktionary "summarize"',
' defined_by "action"',
' role "feature_action_planning"',
' lexeme "en"',
' word "can you summarize"',
" description \"English action-request frame 'can you summarize'; a feature_action_planning cue reconstructed as a space-padded token, so when the prompt contains it the capability handler defers to the primary handler.\"",
' word "can you brainstorm"',
" description \"English action-request frame 'can you brainstorm'; a feature_action_planning cue reconstructed as a space-padded token, so when the prompt contains it the capability handler defers to the primary handler.\"",
' word "can you roleplay"',
" description \"English action-request frame 'can you roleplay'; a feature_action_planning cue reconstructed as a space-padded token, so when the prompt contains it the capability handler defers to the primary handler.\"",
' lexeme "ru"',
' word "можешь резюмировать"',
" description \"Russian phrase 'можешь резюмировать' (romanized mozhesh rezyumirovat, can you summarize); a feature_action_planning form kept in the seed for self-description (only the English frames drive the action gate).\"",
' word "можешь провести мозговой штурм"',
" description \"Russian phrase 'можешь провести мозговой штурм' (romanized mozhesh provesti mozgovoy shturm, can you brainstorm); a feature_action_planning form kept in the seed for self-description (only the English frames drive the action gate).\"",
' word "можешь сыграть роль"',
" description \"Russian phrase 'можешь сыграть роль' (romanized mozhesh sygrat rol, can you roleplay); a feature_action_planning form kept in the seed for self-description (only the English frames drive the action gate).\"",
' lexeme "hi"',
' word "क्या आप सारांश कर सकते"',
" description \"Hindi phrase 'क्या आप सारांश कर सकते' (romanized kya aap saraansh kar sakte, can you summarize); a feature_action_planning form kept in the seed for self-description (only the English frames drive the action gate).\"",
' lexeme "zh"',
' word "你能总结"',
" description \"Chinese phrase '你能总结' (pinyin ni neng zongjie, can you summarize); a feature_action_planning form kept in the seed for self-description (only the English frames drive the action gate).\"",
"meanings",
' meaning "playwright"',
" gloss \"the Playwright browser-automation and end-to-end testing tool — the named entity a 'write me a Playwright script' request is about. The playwright-script handler asks whether the tool is named by walking this meaning's forms through mentions_role_raw (a raw substring check across every language), so the proper noun lives here, not in the code. One English form is the common misspelling 'playright'; it carries an action naming the canonical spelling 'playwright', and the handler reports a spelling correction when a form whose action is set occurs in the prompt — so the typo and its fix are data, not a literal in the code.\"",
' wiktionary "playwright"',
' defined_by "entity"',
' role "playwright_tool_name"',
' lexeme "en"',
' word "playwright"',
' description "English proper noun naming the Playwright automation tool; a playwright_tool_name matched as a raw substring of the normalized prompt."',
' word "playright"',
" description \"English misspelling of 'playwright' (the 'w' dropped); a playwright_tool_name matched as a raw substring. Its action names the canonical spelling, so the handler reports the correction without naming either form in the code.\"",
' action "playwright"',
' lexeme "ru"',
' word "плейврайт"',
" description \"Russian transliteration 'плейврайт' (romanized pleyvrayt) of the Playwright tool name; a playwright_tool_name matched as a raw substring.\"",
' word "плейрайт"',
" description \"Russian transliteration 'плейрайт' (romanized pleyrayt) of the common 'playright' misspelling; a playwright_tool_name matched as a raw substring.\"",
' lexeme "hi"',
' word "प्लेराइट"',
" description \"Hindi transliteration 'प्लेराइट' (romanized pleraait) of the Playwright tool name; a playwright_tool_name matched as a raw substring.\"",
' lexeme "zh"',
' word "普莱赖特"',
" description \"Chinese phonetic transliteration '普莱赖特' (pinyin pulailaite) of the Playwright tool name; a playwright_tool_name matched as a raw substring.\"",
' meaning "playwright_script_request_cue"',
' gloss "a cue that a prompt naming Playwright is asking for a script rather than discussing the tool — an artifact noun (script, test, spec, code) or an authoring frame (write, create, generate, make, build, can you, could you, and their other-language equivalents). The playwright-script handler routes only when a playwright_tool_name and one of these cues both occur, each checked through mentions_role_raw (a raw substring across every language), so the cue vocabulary lives in the data rather than in a hand-listed array in the code."',
' wiktionary "script"',
' defined_by "concept"',
' role "playwright_script_cue"',
' lexeme "en"',
' word "script"',
" description \"English noun 'script' naming the artifact to author; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' word "test"',
" description \"English noun 'test' naming the artifact to author; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' word "spec"',
" description \"English noun 'spec' (specification) naming the artifact to author; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' word "code"',
" description \"English noun 'code' naming the artifact to author; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' word "write"',
" description \"English verb 'write' opening an authoring request; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' word "create"',
" description \"English verb 'create' opening an authoring request; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' word "generate"',
" description \"English verb 'generate' opening an authoring request; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' word "make"',
" description \"English verb 'make' opening an authoring request; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' word "build"',
" description \"English verb 'build' opening an authoring request; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' word "can you"',
" description \"English polite frame 'can you' opening an authoring request; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' word "could you"',
" description \"English polite frame 'could you' opening an authoring request; a playwright_script_cue matched as a raw substring of the normalized prompt.\"",
' lexeme "ru"',
' word "скрипт"',
" description \"Russian noun 'скрипт' (romanized skript, script) naming the artifact to author; a playwright_script_cue matched as a raw substring.\"",
' word "сценар"',
" description \"Russian stem 'сценар' (romanized stsenar) of 'сценарий' (scenario/script); a playwright_script_cue matched as a raw substring so the inflected forms are caught.\"",
' word "тест"',
" description \"Russian noun 'тест' (romanized test) naming the artifact to author; a playwright_script_cue matched as a raw substring.\"",
' word "код"',
" description \"Russian noun 'код' (romanized kod, code) naming the artifact to author; a playwright_script_cue matched as a raw substring.\"",
' word "напиши"',
" description \"Russian imperative 'напиши' (romanized napishi, write) opening an authoring request; a playwright_script_cue matched as a raw substring.\"",
' word "написать"',
" description \"Russian infinitive 'написать' (romanized napisat, to write) opening an authoring request; a playwright_script_cue matched as a raw substring.\"",
' word "можешь"',
" description \"Russian frame 'можешь' (romanized mozhesh, can you) opening an authoring request; a playwright_script_cue matched as a raw substring.\"",
' word "сделай"',
" description \"Russian imperative 'сделай' (romanized sdelay, make) opening an authoring request; a playwright_script_cue matched as a raw substring.\"",
' word "создай"',
" description \"Russian imperative 'создай' (romanized sozday, create) opening an authoring request; a playwright_script_cue matched as a raw substring.\"",
' lexeme "hi"',
' word "स्क्रिप्ट"',
" description \"Hindi noun 'स्क्रिप्ट' (romanized skript, script) naming the artifact to author; a playwright_script_cue matched as a raw substring.\"",
' word "टेस्ट"',
" description \"Hindi noun 'टेस्ट' (romanized test) naming the artifact to author; a playwright_script_cue matched as a raw substring.\"",
' word "कोड"',
" description \"Hindi noun 'कोड' (romanized kod, code) naming the artifact to author; a playwright_script_cue matched as a raw substring.\"",
' word "लिखो"',
" description \"Hindi imperative 'लिखो' (romanized likho, write) opening an authoring request; a playwright_script_cue matched as a raw substring.\"",
' word "बनाओ"',
" description \"Hindi imperative 'बनाओ' (romanized banao, make/create) opening an authoring request; a playwright_script_cue matched as a raw substring.\"",
' lexeme "zh"',
' word "脚本"',
" description \"Chinese noun '脚本' (pinyin jiaoben, script) naming the artifact to author; a playwright_script_cue matched as a raw substring.\"",
' word "测试"',
" description \"Chinese noun '测试' (pinyin ceshi, test) naming the artifact to author; a playwright_script_cue matched as a raw substring.\"",
' word "代码"',
" description \"Chinese noun '代码' (pinyin daima, code) naming the artifact to author; a playwright_script_cue matched as a raw substring.\"",
' word "写"',
" description \"Chinese verb '写' (pinyin xie, write) opening an authoring request; a playwright_script_cue matched as a raw substring.\"",
' word "生成"',
" description \"Chinese verb '生成' (pinyin shengcheng, generate) opening an authoring request; a playwright_script_cue matched as a raw substring.\"",
"meanings",
' meaning "compare"',
" gloss \"the act of comparing two or more topics, and the request for the comparison drawn as a table. The research comparison-table handler asks whether a follow-up prompt wants a table by checking these triggers token-bounded through mentions_role; a match alone opens the handler. The phrase 'comparison table' and the verbs 'compare'/'comparing' are the strong triggers, so the surface vocabulary lives here rather than in a padded-contains list in the code.\"",
' wiktionary "compare"',
' defined_by "action"',
' role "comparison_table_trigger"',
' lexeme "en"',
' word "comparison table"',
" description \"English phrase 'comparison table' naming the requested artifact; a comparison_table_trigger matched as a whole phrase (token-bounded).\"",
' word "compare"',
" description \"English verb 'compare' asking for a comparison; a comparison_table_trigger matched as a whole token.\"",
' word "comparing"',
" description \"English gerund 'comparing' asking for a comparison; a comparison_table_trigger matched as a whole token.\"",
' lexeme "ru"',
' word "сравнительная таблица"',
" description \"Russian phrase 'сравнительная таблица' (romanized sravnitelnaya tablitsa, comparison table) naming the requested artifact; a comparison_table_trigger matched token-bounded.\"",
' word "сравнить"',
" description \"Russian infinitive 'сравнить' (romanized sravnit, to compare) asking for a comparison; a comparison_table_trigger matched token-bounded.\"",
' word "сравнение"',
" description \"Russian noun 'сравнение' (romanized sravnenie, comparison) asking for a comparison; a comparison_table_trigger matched token-bounded.\"",
' lexeme "hi"',
' word "तुलना तालिका"',
" description \"Hindi phrase 'तुलना तालिका' (romanized tulna talika, comparison table) naming the requested artifact; a comparison_table_trigger matched token-bounded.\"",
' word "तुलना"',
" description \"Hindi noun 'तुलना' (romanized tulna, comparison) asking for a comparison; a comparison_table_trigger matched token-bounded.\"",
' lexeme "zh"',
' word "比较表"',
" description \"Chinese phrase '比较表' (pinyin bijiaobiao, comparison table) naming the requested artifact; a comparison_table_trigger matched as a substring.\"",
' word "比较"',
" description \"Chinese verb '比较' (pinyin bijiao, compare) asking for a comparison; a comparison_table_trigger matched as a substring.\"",
' word "对比"',
" description \"Chinese verb '对比' (pinyin duibi, contrast/compare) asking for a comparison; a comparison_table_trigger matched as a substring.\"",
' meaning "table"',
' gloss "a table — a grid of rows and columns that lays values out for reading. The research comparison-table handler treats the bare noun as a weak signal: a table is requested only when the noun co-occurs with a difference cue, both checked token-bounded through mentions_role. The noun lives here so the weak-signal arm of the gate references the concept, not a literal word in the code."',
' wiktionary "table"',
' defined_by "concept"',
' role "comparison_table_noun"',
' lexeme "en"',
' word "table"',
" description \"English noun 'table' naming the grid artifact; a comparison_table_noun matched as a whole token.\"",
' lexeme "ru"',
' word "таблица"',
" description \"Russian noun 'таблица' (romanized tablitsa, table) naming the grid artifact; a comparison_table_noun matched token-bounded.\"",
' lexeme "hi"',
' word "तालिका"',
" description \"Hindi noun 'तालिका' (romanized talika, table) naming the grid artifact; a comparison_table_noun matched token-bounded.\"",
' lexeme "zh"',
' word "表格"',
" description \"Chinese noun '表格' (pinyin biaoge, table) naming the grid artifact; a comparison_table_noun matched as a substring.\"",
' meaning "differences"',
' gloss "the differences between compared topics — the relation that a comparison surfaces. The research comparison-table handler treats this plural cue as the partner of the bare table noun: when both occur the weak-signal arm of the gate opens, each checked token-bounded through mentions_role. The cue lives here so the code references the relation rather than a padded-contains literal."',
' wiktionary "difference"',
' defined_by "relation"',
' role "comparison_difference_cue"',
' lexeme "en"',
' word "differences"',
" description \"English plural noun 'differences' naming the relation a comparison surfaces; a comparison_difference_cue matched as a whole token.\"",
' lexeme "ru"',
' word "различия"',
" description \"Russian plural noun 'различия' (romanized razlichiya, differences) naming the relation a comparison surfaces; a comparison_difference_cue matched token-bounded.\"",
' word "отличия"',
" description \"Russian plural noun 'отличия' (romanized otlichiya, differences) naming the relation a comparison surfaces; a comparison_difference_cue matched token-bounded.\"",
' lexeme "hi"',
' word "अंतर"',
" description \"Hindi noun 'अंतर' (romanized antar, difference) naming the relation a comparison surfaces; a comparison_difference_cue matched token-bounded.\"",
' lexeme "zh"',
' word "差异"',
" description \"Chinese noun '差异' (pinyin chayi, difference) naming the relation a comparison surfaces; a comparison_difference_cue matched as a substring.\"",
' word "区别"',
" description \"Chinese noun '区别' (pinyin qubie, difference) naming the relation a comparison surfaces; a comparison_difference_cue matched as a substring.\"",
' meaning "research_prompt_signal"',
" gloss \"a signal that an earlier turn was a research request — the prior prompt the comparison-table follow-up reuses for its topics. Each surface marks its shape with the ellipsis … (U+2026): a trailing ellipsis is a prefix surface matched when the prompt starts with the literal before the slot; a surface with no ellipsis is a bare marker matched anywhere as a whole token. The handler reads the prefix surfaces' literals and the bare surfaces through the lexicon, so the research openers live in the data, not in a starts_with/contains list in the code.\"",
' wiktionary "research"',
' defined_by "concept"',
' role "research_prompt_signal"',
' lexeme "en"',
' word "search …"',
" description \"English prefix surface; the prompt opens with 'search ' before the query that follows the … slot (search X). A research_prompt_signal matched by prefix.\"",
' word "find information …"',
" description \"English prefix surface; the prompt opens with 'find information ' before the topic that follows the … slot. A research_prompt_signal matched by prefix.\"",
' word "look up information …"',
" description \"English prefix surface; the prompt opens with 'look up information ' before the topic that follows the … slot. A research_prompt_signal matched by prefix.\"",
' word "search for information"',
" description \"English bare marker 'search for information'; a research_prompt_signal matched anywhere as a whole phrase.\"",
' word "web search"',
" description \"English bare marker 'web search'; a research_prompt_signal matched anywhere as a whole phrase.\"",
' word "research"',
" description \"English bare marker 'research'; a research_prompt_signal matched anywhere as a whole token.\"",
' lexeme "ru"',
' word "поиск"',
" description \"Russian noun 'поиск' (romanized poisk, search); a research_prompt_signal bare marker matched token-bounded.\"",
' word "исследование"',
" description \"Russian noun 'исследование' (romanized issledovanie, research); a research_prompt_signal bare marker matched token-bounded.\"",
' word "веб-поиск"',
" description \"Russian phrase 'веб-поиск' (romanized veb-poisk, web search); a research_prompt_signal bare marker matched token-bounded.\"",
' lexeme "hi"',
' word "खोज"',
" description \"Hindi noun 'खोज' (romanized khoj, search); a research_prompt_signal bare marker matched token-bounded.\"",
' word "अनुसंधान"',
" description \"Hindi noun 'अनुसंधान' (romanized anusandhaan, research); a research_prompt_signal bare marker matched token-bounded.\"",
' lexeme "zh"',
' word "搜索"',
" description \"Chinese verb '搜索' (pinyin sousuo, search); a research_prompt_signal bare marker matched as a substring.\"",
' word "研究"',
" description \"Chinese noun '研究' (pinyin yanjiu, research); a research_prompt_signal bare marker matched as a substring.\"",
' meaning "key_differences"',
" gloss \"the key-differences comparison criterion — the column asking what distinguishes each topic from the others. The comparison-table handler walks the research_criterion meanings in declaration order and, for each text fragment, adds the criterion when any of its surface words occurs as a raw substring; the matched meaning's slug keys the column. Declaration order is column order, so this meaning is listed first. Its English triggers 'key difference' and 'difference' live here, not in the code.\"",
' wiktionary "difference"',
' defined_by "relation"',
' role "research_criterion"',
' lexeme "en"',
' word "key difference"',
" description \"English phrase 'key difference' naming the key-differences criterion; a research_criterion matched as a raw substring.\"",
' word "difference"',
" description \"English noun 'difference' naming the differences criterion (also catches 'differences'); a research_criterion matched as a raw substring.\"",
' lexeme "ru"',
' word "ключевые различия"',
" description \"Russian phrase 'ключевые различия' (romanized klyuchevye razlichiya, key differences) naming the criterion; a research_criterion matched as a raw substring.\"",
' word "различия"',
" description \"Russian noun 'различия' (romanized razlichiya, differences) naming the criterion; a research_criterion matched as a raw substring.\"",
' lexeme "hi"',
' word "मुख्य अंतर"',
" description \"Hindi phrase 'मुख्य अंतर' (romanized mukhya antar, key differences) naming the criterion; a research_criterion matched as a raw substring.\"",
' word "अंतर"',
" description \"Hindi noun 'अंतर' (romanized antar, difference) naming the criterion; a research_criterion matched as a raw substring.\"",
' lexeme "zh"',
' word "主要区别"',
" description \"Chinese phrase '主要区别' (pinyin zhuyao qubie, key differences) naming the criterion; a research_criterion matched as a substring.\"",
' word "区别"',
" description \"Chinese noun '区别' (pinyin qubie, difference) naming the criterion; a research_criterion matched as a substring.\"",
' meaning "use_cases"',
" gloss \"the use-cases comparison criterion — the column summarising where each topic applies in practice. The comparison-table handler adds this criterion when a text fragment contains one of its surface words as a raw substring; the slug 'use_cases' keys the column. Its English triggers 'use case' and 'application' live here, not in the code.\"",
' wiktionary "use case"',
' defined_by "concept"',
' role "research_criterion"',
' lexeme "en"',
' word "use case"',
" description \"English phrase 'use case' naming the use-cases criterion; a research_criterion matched as a raw substring.\"",
' word "application"',
" description \"English noun 'application' naming a practical use; a research_criterion matched as a raw substring.\"",
' lexeme "ru"',
' word "сценарии использования"',
" description \"Russian phrase 'сценарии использования' (romanized stsenarii ispolzovaniya, use cases) naming the criterion; a research_criterion matched as a raw substring.\"",
' word "применение"',
" description \"Russian noun 'применение' (romanized primenenie, application) naming a practical use; a research_criterion matched as a raw substring.\"",
' lexeme "hi"',
' word "उपयोग के मामले"',
" description \"Hindi phrase 'उपयोग के मामले' (romanized upyog ke maamle, use cases) naming the criterion; a research_criterion matched as a raw substring.\"",
' word "अनुप्रयोग"',
" description \"Hindi noun 'अनुप्रयोग' (romanized anuprayog, application) naming a practical use; a research_criterion matched as a raw substring.\"",
' lexeme "zh"',
' word "用例"',
" description \"Chinese noun '用例' (pinyin yongli, use case) naming the criterion; a research_criterion matched as a substring.\"",
' word "应用"',
" description \"Chinese noun '应用' (pinyin yingyong, application) naming a practical use; a research_criterion matched as a substring.\"",
' meaning "advantages"',
" gloss \"the advantages comparison criterion — the column listing each topic's strengths. The comparison-table handler adds this criterion when a text fragment contains one of its surface words as a raw substring; the slug 'advantages' keys the column. Its English triggers are 'advantage' and 'pro ' (with the trailing space that keeps it from matching inside unrelated words); both live here, not in the code.\"",
' wiktionary "advantage"',
' defined_by "property"',
' role "research_criterion"',
' lexeme "en"',
' word "advantage"',
" description \"English noun 'advantage' naming the advantages criterion (also catches 'advantages'); a research_criterion matched as a raw substring.\"",
' word "pro "',
" description \"English noun 'pro' with a trailing space ('pro ') naming an advantage; a research_criterion matched as a raw substring, the space keeping it from matching inside words like 'process'.\"",
' lexeme "ru"',
' word "преимущества"',
" description \"Russian plural noun 'преимущества' (romanized preimushchestva, advantages) naming the criterion; a research_criterion matched as a raw substring.\"",
' word "плюсы"',
" description \"Russian plural noun 'плюсы' (romanized plyusy, pros) naming advantages; a research_criterion matched as a raw substring.\"",
' lexeme "hi"',
' word "फायदे"',
" description \"Hindi plural noun 'फायदे' (romanized faayde, advantages) naming the criterion; a research_criterion matched as a raw substring.\"",
' word "लाभ"',
" description \"Hindi noun 'लाभ' (romanized laabh, benefit) naming an advantage; a research_criterion matched as a raw substring.\"",
' lexeme "zh"',
' word "优点"',
" description \"Chinese noun '优点' (pinyin youdian, advantages) naming the criterion; a research_criterion matched as a substring.\"",
' word "优势"',
" description \"Chinese noun '优势' (pinyin youshi, advantage) naming the criterion; a research_criterion matched as a substring.\"",
' meaning "disadvantages"',
" gloss \"the disadvantages comparison criterion — the column listing each topic's drawbacks. The comparison-table handler adds this criterion when a text fragment contains one of its surface words as a raw substring; the slug 'disadvantages' keys the column. Its English triggers are 'disadvantage' and ' con ' (with surrounding spaces that keep it from matching inside unrelated words); both live here, not in the code.\"",
' wiktionary "disadvantage"',
' defined_by "property"',
' role "research_criterion"',
' lexeme "en"',
' word "disadvantage"',
" description \"English noun 'disadvantage' naming the disadvantages criterion (also catches 'disadvantages'); a research_criterion matched as a raw substring.\"",
' word " con "',
" description \"English noun 'con' with surrounding spaces (' con ') naming a drawback; a research_criterion matched as a raw substring, the spaces keeping it from matching inside words like 'control'.\"",
' lexeme "ru"',
' word "недостатки"',
" description \"Russian plural noun 'недостатки' (romanized nedostatki, disadvantages) naming the criterion; a research_criterion matched as a raw substring.\"",
' word "минусы"',
" description \"Russian plural noun 'минусы' (romanized minusy, cons) naming drawbacks; a research_criterion matched as a raw substring.\"",
' lexeme "hi"',
' word "नुकसान"',
" description \"Hindi noun 'नुकसान' (romanized nuksaan, disadvantage/harm) naming the criterion; a research_criterion matched as a raw substring.\"",
' word "हानि"',
" description \"Hindi noun 'हानि' (romanized haani, harm) naming a drawback; a research_criterion matched as a raw substring.\"",
' lexeme "zh"',
' word "缺点"',
" description \"Chinese noun '缺点' (pinyin quedian, disadvantages) naming the criterion; a research_criterion matched as a substring.\"",
' word "劣势"',
" description \"Chinese noun '劣势' (pinyin lieshi, disadvantage) naming the criterion; a research_criterion matched as a substring.\"",
"meanings",
' meaning "conversation_topic_opener"',
" gloss \"a conversational opener that proposes a topic to discuss — the let-us-talk-about-X phrasing that introduces a subject for open conversation, independent of the language used. Each surface is a prefix carrying the … (U+2026) slot at the end, where the topic follows. A surface whose action child is 'scan' is also matched when it occurs anywhere in the prompt, not only at the start, so an opener embedded after a greeting is still recognized.\"",
' wiktionary "talk"',
' defined_by "inquiry"',
' defined_by "action"',
' role "conversation_topic_opener"',
' lexeme "en"',
" word \"let's talk about …\"",
' description "English conversational opener; the topic to discuss follows the … slot."',
' word "lets talk about …"',
' description "English conversational opener written without the apostrophe; the topic follows the … slot."',
' word "can we talk about …"',
' description "English conversational opener phrased as a question; the topic follows the … slot."',
' word "talk about …"',
' description "English bare conversational opener; the topic follows the … slot."',
' lexeme "ru"',
' word "давай поговорим о …"',
' description "Russian conversational opener (romanized davaj pogovorim o, let us talk about); the topic follows the … slot."',
' word "давай поговорим об …"',
' description "Russian conversational opener before a vowel (romanized davaj pogovorim ob, let us talk about); the topic follows the … slot."',
' word "давайте поговорим о …"',
' description "Russian polite or plural conversational opener (romanized davajte pogovorim o, let us talk about); the topic follows the … slot."',
' word "давайте поговорим об …"',
' description "Russian polite or plural opener before a vowel (romanized davajte pogovorim ob, let us talk about); the topic follows the … slot."',
' word "поговорим о …"',
' action "scan"',
' description "Russian conversational opener (romanized pogovorim o, let us talk about); the topic follows the … slot, and this surface is also scanned anywhere in the prompt because the bare verb often follows a greeting."',
' word "поговорим об …"',
' description "Russian conversational opener before a vowel (romanized pogovorim ob, let us talk about); the topic follows the … slot."',
' word "обсудим …"',
' description "Russian conversational opener (romanized obsudim, let us discuss); the topic follows the … slot."',
' lexeme "hi"',
' word "चलो बात करें …"',
' description "Hindi conversational opener (romanized chalo baat karen, let us talk); the topic follows the … slot."',
' word "बात करें …"',
' description "Hindi conversational opener (romanized baat karen, let us talk); the topic follows the … slot."',
' lexeme "zh"',
' word "聊聊…"',
' description "Chinese conversational opener (pinyin liaoliao, let us chat) with no trailing space; the topic follows the … slot."',
' word "谈谈…"',
' description "Chinese conversational opener (pinyin tantan, let us discuss) with no trailing space; the topic follows the … slot."',
"meanings",
' meaning "summary_statement_kind"',
' gloss "the kind of statement the project-summarization classifier recognizes in a sentence of prose — install, example, language, stars, purpose, use case or feature. This genus groups the seven summary_classification_cue leaves so they are built from a shared concept instead of being listed as raw cue arrays in the code. The summary_statement_kind role is structural: no handler queries it directly; it exists so the ontology records that the seven cue meanings are kinds of statement the summarizer reasons about."',
' wiktionary "statement"',
' defined_by "concept"',
' role "summary_statement_kind"',
' lexeme "en"',
' word "statement kind"',
' description "English label for the category a prose sentence falls into during summarization; the summary_statement_kind genus lexicalized in English."',
' word "sentence kind"',
' description "English synonym for the classified category of a sentence; the summary_statement_kind genus lexicalized in English."',
' lexeme "ru"',
' word "вид утверждения"',
' description "Russian phrase (romanized vid utverzhdeniya, kind of statement); the summary_statement_kind genus lexicalized in Russian."',
' word "тип предложения"',
' description "Russian phrase (romanized tip predlozheniya, kind of sentence); the summary_statement_kind genus lexicalized in Russian."',
' lexeme "hi"',
' word "कथन का प्रकार"',
' description "Hindi phrase (romanized kathan ka prakar, kind of statement); the summary_statement_kind genus lexicalized in Hindi."',
' word "वाक्य का प्रकार"',
' description "Hindi phrase (romanized vakya ka prakar, kind of sentence); the summary_statement_kind genus lexicalized in Hindi."',
' lexeme "zh"',
' word "陈述类型"',
' description "Chinese phrase (pinyin chenshu leixing, statement kind); the summary_statement_kind genus lexicalized in Chinese."',
' word "句子类型"',
' description "Chinese phrase (pinyin juzi leixing, sentence kind); the summary_statement_kind genus lexicalized in Chinese."',
' meaning "summary_kind_install"',
' gloss "a sentence that explains how to install the project. The summary_classification_cue role marks the surface fragments that signal this Install kind; the summarizer classifies a sentence as Install when its lowercased text contains any of these fragments. Matched as raw lowercase substrings, so embedded spaces in a fragment are significant and inflected or compound forms are caught in every supported language."',
' wiktionary "install"',
' defined_by "summary_statement_kind"',
' role "summary_classification_cue"',
' lexeme "en"',
' word "to install"',
' description "English Install cue (the infinitive of install); a summary_classification_cue matched as a raw lowercase substring."',
' word "install with"',
' description "English Install cue introducing the installation command; a summary_classification_cue matched as a raw lowercase substring."',
' word "installation"',
' description "English Install cue (the noun installation); a summary_classification_cue matched as a raw lowercase substring."',
' word "npm install"',
' description "English Install cue for the npm package manager command; a summary_classification_cue matched as a raw lowercase substring."',
' word "cargo install"',
' description "English Install cue for the Cargo package manager command; a summary_classification_cue matched as a raw lowercase substring."',
' word "pip install"',
' description "English Install cue for the pip package manager command; a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "ru"',
' word "установить"',
' description "Russian Install cue (romanized ustanovit, to install); a summary_classification_cue matched as a raw lowercase substring."',
' word "установка"',
' description "Russian Install cue (romanized ustanovka, installation); a summary_classification_cue matched as a raw lowercase substring."',
' word "установите"',
' description "Russian Install cue (romanized ustanovite, install in the imperative); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "hi"',
' word "इंस्टॉल करें"',
' description "Hindi Install cue (romanized install karen, install it); a summary_classification_cue matched as a raw lowercase substring."',
' word "स्थापना"',
' description "Hindi Install cue (romanized sthapana, installation); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "zh"',
' word "安装"',
' description "Chinese Install cue (pinyin anzhuang, to install); a summary_classification_cue matched as a raw lowercase substring."',
' word "安装方法"',
' description "Chinese Install cue (pinyin anzhuang fangfa, installation method); a summary_classification_cue matched as a raw lowercase substring."',
' meaning "summary_kind_example"',
' gloss "a sentence that gives an example or a runnable command. The summary_classification_cue role marks the surface fragments that signal this Example kind; the summarizer classifies a sentence as Example when its lowercased text contains any of these fragments. Several fragments are language-neutral code markers (a fenced code block, a shell prompt, a flag run) carried under the English lexeme. Matched as raw lowercase substrings, so embedded spaces are significant."',
' wiktionary "example"',
' defined_by "summary_statement_kind"',
' role "summary_classification_cue"',
' lexeme "en"',
' word "for example"',
' description "English Example cue introducing an illustration; a summary_classification_cue matched as a raw lowercase substring."',
' word "example:"',
' description "English Example cue (the word example followed by a colon); a summary_classification_cue matched as a raw lowercase substring."',
' word "e.g."',
' description "English Example cue (the abbreviation of the Latin exempli gratia); a summary_classification_cue matched as a raw lowercase substring."',
' word "run --"',
' description "English Example cue for a command invoked with a long flag; a summary_classification_cue matched as a raw lowercase substring."',
' word "$ "',
' description "English Example cue for a shell prompt; the trailing space is significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word "```"',
' description "Language-neutral Example cue for a fenced code block (three backticks), carried under the English lexeme; a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "ru"',
' word "выполни"',
' description "Russian Example cue (romanized vypolni, run or execute in the imperative); a summary_classification_cue matched as a raw lowercase substring."',
' word "например"',
' description "Russian Example cue (romanized naprimer, for example); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "hi"',
' word "उदाहरण के लिए"',
' description "Hindi Example cue (romanized udaharan ke lie, for example); a summary_classification_cue matched as a raw lowercase substring."',
' word "उदाहरण:"',
' description "Hindi Example cue (romanized udaharan, example, followed by a colon); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "zh"',
' word "例如"',
' description "Chinese Example cue (pinyin liru, for example); a summary_classification_cue matched as a raw lowercase substring."',
' word "比如"',
' description "Chinese Example cue (pinyin biru, for instance); a summary_classification_cue matched as a raw lowercase substring."',
' meaning "summary_kind_language"',
' gloss "a short sentence that states which programming language the project is written in. The summary_classification_cue role marks the surface fragments that signal this Language kind. Unlike the other kinds this one is guarded by length: the summarizer only classifies a sentence as Language when it both contains a cue and has at most twelve whitespace-separated words, so a long feature sentence that merely contains is a falls through to the later kinds. Matched as raw lowercase substrings, so embedded spaces are significant."',
' wiktionary "language"',
' defined_by "summary_statement_kind"',
' role "summary_classification_cue"',
' lexeme "en"',
' word "written in "',
' description "English Language cue (written in a language); the trailing space is significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word "language:"',
' description "English Language cue (the word language followed by a colon); a summary_classification_cue matched as a raw lowercase substring."',
' word "is a "',
' description "English Language cue (is a, as in is a Rust project); the trailing space is significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word "build with "',
' description "English Language cue (built with a language or toolchain); the trailing space is significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "ru"',
' word "написан на "',
' description "Russian Language cue (romanized napisan na, written in); the trailing space is significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word "на языке "',
' description "Russian Language cue (romanized na yazyke, in the language of); the trailing space is significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "hi"',
' word "में लिखा"',
' description "Hindi Language cue (romanized mein likha, written in); a summary_classification_cue matched as a raw lowercase substring."',
' word "भाषा:"',
' description "Hindi Language cue (romanized bhasha, language, followed by a colon); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "zh"',
' word "语言"',
' description "Chinese Language cue (pinyin yuyan, language); a summary_classification_cue matched as a raw lowercase substring."',
' word "编写"',
' description "Chinese Language cue (pinyin bianxie, to write or compile, as in written in a language); a summary_classification_cue matched as a raw lowercase substring."',
' meaning "summary_kind_stars"',
' gloss "a sentence that reports how many stars the project has on a hosting site. The summary_classification_cue role marks the surface fragments that signal this Stars kind; the summarizer classifies a sentence as Stars when its lowercased text contains any of these fragments. Matched as raw lowercase substrings, so embedded spaces and the star glyph are significant and inflected forms are caught in every supported language."',
' wiktionary "star"',
' defined_by "summary_statement_kind"',
' role "summary_classification_cue"',
' lexeme "en"',
' word " stars"',
' description "English Stars cue (the plural noun stars); the leading space is significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word "github stars"',
' description "English Stars cue naming the GitHub star count; a summary_classification_cue matched as a raw lowercase substring."',
' word "★"',
' description "Stars cue for the black star glyph used as a star indicator; a summary_classification_cue matched as a raw lowercase substring."',
' word "stargazers"',
' description "English Stars cue (the people who starred a repository); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "ru"',
' word "звёзды"',
' description "Russian Stars cue (romanized zvyozdy, stars); a summary_classification_cue matched as a raw lowercase substring."',
' word "звезд"',
' description "Russian Stars cue (romanized zvezd, the genitive stem of stars); a summary_classification_cue matched as a raw lowercase substring so звезда, звёзд and звездам are all caught."',
' lexeme "hi"',
' word "सितारे"',
' description "Hindi Stars cue (romanized sitare, stars); a summary_classification_cue matched as a raw lowercase substring."',
' word "तारे"',
' description "Hindi Stars cue (romanized tare, stars); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "zh"',
' word "星标"',
' description "Chinese Stars cue (pinyin xingbiao, star mark, the GitHub star); a summary_classification_cue matched as a raw lowercase substring."',
' word "星数"',
' description "Chinese Stars cue (pinyin xingshu, star count); a summary_classification_cue matched as a raw lowercase substring."',
' meaning "summary_kind_purpose"',
' gloss "a sentence that states what the project is for — its purpose or what it helps you do. The summary_classification_cue role marks the surface fragments that signal this Purpose kind; the summarizer classifies a sentence as Purpose when its lowercased text contains any of these fragments. Matched as raw lowercase substrings, so embedded spaces are significant and inflected forms are caught in every supported language."',
' wiktionary "purpose"',
' defined_by "summary_statement_kind"',
' role "summary_classification_cue"',
' lexeme "en"',
' word "is for "',
' description "English Purpose cue (is for some use); the trailing space is significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word "is the ai"',
' description "English Purpose cue (is the AI that does something); a summary_classification_cue matched as a raw lowercase substring."',
' word "is an ai"',
' description "English Purpose cue (is an AI for something); a summary_classification_cue matched as a raw lowercase substring."',
' word "is used to"',
' description "English Purpose cue (is used to do something); a summary_classification_cue matched as a raw lowercase substring."',
' word "is meant to"',
' description "English Purpose cue (is meant to do something); a summary_classification_cue matched as a raw lowercase substring."',
' word "is designed to"',
' description "English Purpose cue (is designed to do something); a summary_classification_cue matched as a raw lowercase substring."',
' word "helps you"',
' description "English Purpose cue (helps you do something); a summary_classification_cue matched as a raw lowercase substring."',
' word "lets you"',
' description "English Purpose cue (lets you do something); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "ru"',
' word "это ии"',
' description "Russian Purpose cue (romanized eto ii, this is an AI); a summary_classification_cue matched as a raw lowercase substring."',
' word "предназнач"',
' description "Russian Purpose cue (romanized prednaznach, the stem of is intended for); a summary_classification_cue matched as a raw lowercase substring so предназначен and предназначена are both caught."',
' lexeme "hi"',
' word "के लिए है"',
' description "Hindi Purpose cue (romanized ke lie hai, is for); a summary_classification_cue matched as a raw lowercase substring."',
' word "मदद करता है"',
' description "Hindi Purpose cue (romanized madad karta hai, helps); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "zh"',
' word "用于"',
' description "Chinese Purpose cue (pinyin yongyu, is used for); a summary_classification_cue matched as a raw lowercase substring."',
' word "旨在"',
' description "Chinese Purpose cue (pinyin zhizai, is designed to); a summary_classification_cue matched as a raw lowercase substring."',
' word "帮助你"',
' description "Chinese Purpose cue (pinyin bangzhu ni, helps you); a summary_classification_cue matched as a raw lowercase substring."',
' meaning "summary_kind_use_case"',
' gloss "a sentence that describes when to use the project — its use case. The summary_classification_cue role marks the surface fragments that signal this UseCase kind; the summarizer classifies a sentence as UseCase when its lowercased text contains any of these fragments. Matched as raw lowercase substrings, so embedded spaces are significant and the cue generalizes to every supported language."',
' wiktionary "use case"',
' defined_by "summary_statement_kind"',
' role "summary_classification_cue"',
' lexeme "en"',
' word "use it when"',
' description "English UseCase cue (use it when some condition holds); a summary_classification_cue matched as a raw lowercase substring."',
' word "use this when"',
' description "English UseCase cue (use this when some condition holds); a summary_classification_cue matched as a raw lowercase substring."',
' word "when you need"',
' description "English UseCase cue (when you need something); a summary_classification_cue matched as a raw lowercase substring."',
' word "ideal for"',
' description "English UseCase cue (is ideal for some scenario); a summary_classification_cue matched as a raw lowercase substring."',
' word "useful when"',
' description "English UseCase cue (is useful when some condition holds); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "ru"',
' word "используйте когда"',
' description "Russian UseCase cue (romanized ispolzuyte kogda, use it when); a summary_classification_cue matched as a raw lowercase substring."',
' word "когда нужно"',
' description "Russian UseCase cue (romanized kogda nuzhno, when it is needed); a summary_classification_cue matched as a raw lowercase substring."',
' word "идеально для"',
' description "Russian UseCase cue (romanized idealno dlya, ideal for); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "hi"',
' word "जब आपको चाहिए"',
' description "Hindi UseCase cue (romanized jab aapko chahie, when you need); a summary_classification_cue matched as a raw lowercase substring."',
' word "के लिए आदर्श"',
' description "Hindi UseCase cue (romanized ke lie adarsh, ideal for); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "zh"',
' word "当你需要"',
' description "Chinese UseCase cue (pinyin dang ni xuyao, when you need); a summary_classification_cue matched as a raw lowercase substring."',
' word "适用于"',
' description "Chinese UseCase cue (pinyin shiyong yu, is suitable for); a summary_classification_cue matched as a raw lowercase substring."',
' meaning "summary_kind_feature"',
' gloss "a sentence that lists a feature the project provides, supports, offers or ships. The summary_classification_cue role marks the surface fragments that signal this Feature kind; the summarizer classifies a sentence as Feature when its lowercased text contains any of these fragments. The English fragments keep their surrounding spaces so a verb is matched as a whole word. Matched as raw lowercase substrings, so embedded spaces are significant and inflected forms are caught in every supported language."',
' wiktionary "feature"',
' defined_by "summary_statement_kind"',
' role "summary_classification_cue"',
' lexeme "en"',
' word " supports "',
' description "English Feature cue (the project supports something); the surrounding spaces are significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word " provides "',
' description "English Feature cue (the project provides something); the surrounding spaces are significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word " offers "',
' description "English Feature cue (the project offers something); the surrounding spaces are significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word " exposes "',
' description "English Feature cue (the project exposes something); the surrounding spaces are significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word " ships "',
' description "English Feature cue (the project ships something); the surrounding spaces are significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word " orchestrates "',
' description "English Feature cue (the project orchestrates something); the surrounding spaces are significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "ru"',
' word " предоставляет "',
' description "Russian Feature cue (romanized predostavlyaet, provides); the surrounding spaces are significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' word " поддерживает "',
' description "Russian Feature cue (romanized podderzhivaet, supports); the surrounding spaces are significant and the fragment is a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "hi"',
' word "समर्थन करता है"',
' description "Hindi Feature cue (romanized samarthan karta hai, supports); a summary_classification_cue matched as a raw lowercase substring."',
' word "प्रदान करता है"',
' description "Hindi Feature cue (romanized pradan karta hai, provides); a summary_classification_cue matched as a raw lowercase substring."',
' lexeme "zh"',
' word "支持"',
' description "Chinese Feature cue (pinyin zhichi, supports); a summary_classification_cue matched as a raw lowercase substring."',
' word "提供"',
' description "Chinese Feature cue (pinyin tigong, provides); a summary_classification_cue matched as a raw lowercase substring."',
"meanings",
' meaning "program_language"',
" gloss \"the genus of the programming languages the coding catalog can target; a structural parent that is never matched on its own. Each program_language_* leaf below names one catalog target (rust, python, …) and carries that target's alias surfaces across every supported language. Defined_by software_language so it inherits the broader programming-language concept and, through it, the software-artifact and link roots.\"",
' wiktionary "programming language"',
' defined_by "software_language"',
' role "program_language"',
' lexeme "en"',
' word "programming language"',
' description "English noun phrase naming the genus of catalog target languages; structural, never matched on its own."',
' lexeme "ru"',
' word "язык программирования"',
' description "Russian noun phrase (romanized yazyk programmirovaniya) for a programming language; the structural genus surface."',
' lexeme "hi"',
' word "प्रोग्रामिंग भाषा"',
' description "Hindi noun phrase (romanized programming bhasha) for a programming language; the structural genus surface."',
' lexeme "zh"',
' word "编程语言"',
' description "Chinese noun (pinyin biancheng yuyan) for a programming language; the structural genus surface."',
' meaning "program_language_rust"',
' gloss "the Rust programming language as a coding-catalog target (canonical slug rust); its alias surfaces let a prompt that names Rust resolve the rust execution template. Defined_by program_language (the catalog genus) and language_rust (the canonical Rust concept shared with the unknown-language extractor). Names are single tokens, matched on whitespace boundaries (substring for CJK)."',
' wiktionary "Rust"',
' defined_by "program_language"',
' defined_by "language_rust"',
' role "program_language_alias"',
' lexeme "en"',
' word "rust"',
' description "English proper noun and canonical slug for the Rust programming language; the primary catalog alias."',
' word "rs"',
' description "English abbreviation (the .rs source-file extension) for Rust; a short catalog alias."',
' lexeme "ru"',
' word "раст"',
' description "Russian noun (romanized rast) for the Rust language; the Russian catalog alias."',
' word "расте"',
' description "Russian prepositional-case form (romanized raste, as in na raste) of the Rust language name; a Russian catalog alias."',
' lexeme "hi"',
' word "रस्ट"',
' description "Hindi noun (romanized rust, a loanword) for the Rust language; the Hindi catalog alias."',
' lexeme "zh"',
' word "rust"',
' description "The Latin-script name Rust as written in Chinese text for the Rust language; the Chinese catalog alias."',
' meaning "program_language_python"',
' gloss "the Python programming language as a coding-catalog target (canonical slug python); its alias surfaces resolve the python execution template. Defined_by program_language and language_python (the shared canonical Python concept)."',
' wiktionary "Python"',
' defined_by "program_language"',
' defined_by "language_python"',
' role "program_language_alias"',
' lexeme "en"',
' word "python"',
' description "English proper noun and canonical slug for the Python programming language; the primary catalog alias."',
' word "py"',
' description "English abbreviation (the .py source-file extension) for Python; a short catalog alias."',
' lexeme "ru"',
' word "питон"',
' description "Russian noun (romanized piton) for the Python language; the Russian catalog alias."',
' word "питоне"',
' description "Russian prepositional-case form (romanized pitone, as in na pitone) of the Python language name; a Russian catalog alias."',
' lexeme "hi"',
' word "पायथन"',
' description "Hindi noun (romanized python, a loanword) for the Python language; the Hindi catalog alias."',
' lexeme "zh"',
' word "python"',
' description "The Latin-script name Python as written in Chinese text for the Python language; the Chinese catalog alias."',
' meaning "program_language_javascript"',
' gloss "the JavaScript programming language as a coding-catalog target (canonical slug javascript); its alias surfaces resolve the javascript execution template. Defined_by program_language and language_javascript (the shared canonical JavaScript concept)."',
' wiktionary "JavaScript"',
' defined_by "program_language"',
' defined_by "language_javascript"',
' role "program_language_alias"',
' lexeme "en"',
' word "javascript"',
' description "English proper noun and canonical slug for the JavaScript programming language; the primary catalog alias."',
' word "js"',
' description "English abbreviation (the .js source-file extension) for JavaScript; a short catalog alias."',
' word "node"',
' description "English proper noun for Node.js, the JavaScript runtime; a surface that names the JavaScript target."',
' lexeme "ru"',
' word "джаваскрипт"',
' description "Russian noun (romanized dzhavaskript) for the JavaScript language; the Russian catalog alias."',
' lexeme "hi"',
' word "जावास्क्रिप्ट"',
' description "Hindi noun (romanized javascript, a loanword) for the JavaScript language; the Hindi catalog alias."',
' lexeme "zh"',
' word "javascript"',
' description "The Latin-script name JavaScript as written in Chinese text for the JavaScript language; the Chinese catalog alias."',
' meaning "program_language_typescript"',
' gloss "the TypeScript programming language as a coding-catalog target (canonical slug typescript); its alias surfaces resolve the typescript execution template. Defined_by program_language; TypeScript has no separate unknown-language archetype, so the genus is its only parent."',
' wiktionary "TypeScript"',
' defined_by "program_language"',
' role "program_language_alias"',
' lexeme "en"',
' word "typescript"',
' description "English proper noun and canonical slug for the TypeScript programming language; the primary catalog alias."',
' word "ts"',
' description "English abbreviation (the .ts source-file extension) for TypeScript; a short catalog alias."',
' lexeme "ru"',
' word "тайпскрипт"',
' description "Russian noun (romanized taypskript) for the TypeScript language; the Russian catalog alias."',
' lexeme "hi"',
' word "टाइपस्क्रिप्ट"',
' description "Hindi noun (romanized typescript, a loanword) for the TypeScript language; the Hindi catalog alias."',
' lexeme "zh"',
' word "typescript"',
' description "The Latin-script name TypeScript as written in Chinese text for the TypeScript language; the Chinese catalog alias."',
' meaning "program_language_go"',
' gloss "the Go programming language as a coding-catalog target (canonical slug go); its alias surfaces resolve the go execution template. Defined_by program_language."',
' wiktionary "Go"',
' defined_by "program_language"',
' role "program_language_alias"',
' lexeme "en"',
' word "go"',
' description "English proper noun and canonical slug for the Go programming language; the primary catalog alias, matched only as a whole token so a stray go verb never fires it."',
' word "golang"',
' description "English compound (go plus lang) commonly used to name the Go language unambiguously; a catalog alias."',
' lexeme "ru"',
' word "го"',
' description "Russian noun (romanized go) for the Go language; the Russian catalog alias."',
' lexeme "hi"',
' word "गो"',
' description "Hindi noun (romanized go, a loanword) for the Go language; the Hindi catalog alias."',
' lexeme "zh"',
' word "go"',
' description "The Latin-script name Go as written in Chinese text for the Go language; the Chinese catalog alias."',
' meaning "program_language_c"',
' gloss "the C programming language as a coding-catalog target (canonical slug c); its alias surfaces resolve the c execution template. Defined_by program_language. The single-letter name is matched only as a whole token, so it never fires inside another word."',
' wiktionary "C"',
' defined_by "program_language"',
' role "program_language_alias"',
' lexeme "en"',
' word "c"',
' description "English single-letter canonical slug for the C programming language; the primary catalog alias, matched only as a whole token."',
' lexeme "ru"',
' word "си"',
' description "Russian noun (romanized si) naming the C programming language; the Russian catalog alias, matched as a whole token."',
' lexeme "hi"',
' word "सी"',
' description "Hindi noun (romanized si) naming the C programming language; the Hindi catalog alias."',
' lexeme "zh"',
' word "c"',
' description "The Latin-script letter C as written in Chinese text for the C language; the Chinese catalog alias."',
' meaning "program_language_cpp"',
' gloss "the C++ programming language as a coding-catalog target (canonical slug cpp); its alias surfaces resolve the cpp execution template. Defined_by program_language. The c++ surface carries the plus signs verbatim, distinct from the bare c token so a C++ request never collapses onto C."',
' wiktionary "C++"',
' defined_by "program_language"',
' role "program_language_alias"',
' lexeme "en"',
' word "cpp"',
' description "English canonical slug for the C++ programming language (the cpp spelling avoids the plus signs); the primary catalog alias."',
' word "c++"',
' description "English proper name C++ written with its plus signs; a catalog alias matched as a whole token distinct from the bare c."',
' word "cplusplus"',
' description "English spelled-out form of C++ (c-plus-plus); a catalog alias."',
' lexeme "ru"',
' word "сиплюсплюс"',
' description "Russian spelled-out form (romanized siplyusplyus, si-plus-plus) of the C++ language name; the Russian catalog alias."',
' lexeme "hi"',
' word "सीपीपी"',
' description "Hindi transliteration (romanized cpp) of the C++ language name; the Hindi catalog alias."',
' lexeme "zh"',
' word "c++"',
' description "The Latin-script name C++ as written in Chinese text for the C++ language; the Chinese catalog alias."',
' meaning "program_language_java"',
' gloss "the Java programming language as a coding-catalog target (canonical slug java); its alias surfaces resolve the java execution template. Defined_by program_language."',
' wiktionary "Java"',
' defined_by "program_language"',
' role "program_language_alias"',
' lexeme "en"',
' word "java"',
' description "English proper noun and canonical slug for the Java programming language; the primary catalog alias."',
' lexeme "ru"',
' word "джава"',
' description "Russian noun (romanized dzhava) for the Java language; the Russian catalog alias."',
' lexeme "hi"',
' word "जावा"',
' description "Hindi noun (romanized java, a loanword) for the Java language; the Hindi catalog alias."',
' lexeme "zh"',
' word "java"',
' description "The Latin-script name Java as written in Chinese text for the Java language; the Chinese catalog alias."',
' meaning "program_language_csharp"',
' gloss "the C# programming language as a coding-catalog target (canonical slug csharp); its alias surfaces resolve the csharp execution template. Defined_by program_language. The c# surface carries the sharp sign verbatim, distinct from the bare c token."',
' wiktionary "C Sharp (programming language)"',
' defined_by "program_language"',
' role "program_language_alias"',
' lexeme "en"',
' word "csharp"',
' description "English canonical slug for the C# programming language (the csharp spelling avoids the sharp sign); the primary catalog alias."',
' word "c#"',
' description "English proper name C# written with its sharp sign; a catalog alias matched as a whole token distinct from the bare c."',
' word "cs"',
' description "English abbreviation (the .cs source-file extension) for C#; a short catalog alias."',
' word "dotnet"',
' description "English proper noun for .NET, the runtime and platform C# targets; a surface that names the C# target."',
' lexeme "ru"',
' word "сишарп"',
' description "Russian spelled-out form (romanized sisharp, si-sharp) of the C# language name; the Russian catalog alias."',
' lexeme "hi"',
' word "सीशार्प"',
' description "Hindi transliteration (romanized csharp) of the C# language name; the Hindi catalog alias."',
' lexeme "zh"',
' word "c#"',
' description "The Latin-script name C# as written in Chinese text for the C# language; the Chinese catalog alias."',
' meaning "program_language_ruby"',
' gloss "the Ruby programming language as a coding-catalog target (canonical slug ruby); its alias surfaces resolve the ruby execution template. Defined_by program_language."',
' wiktionary "Ruby (programming language)"',
' defined_by "program_language"',
' role "program_language_alias"',
' lexeme "en"',
' word "ruby"',
' description "English proper noun and canonical slug for the Ruby programming language; the primary catalog alias."',
' word "rb"',
' description "English abbreviation (the .rb source-file extension) for Ruby; a short catalog alias."',
' lexeme "ru"',
' word "руби"',
' description "Russian noun (romanized rubi) for the Ruby language; the Russian catalog alias."',
' lexeme "hi"',
' word "रूबी"',
' description "Hindi noun (romanized ruby, a loanword) for the Ruby language; the Hindi catalog alias."',
' lexeme "zh"',
' word "ruby"',
' description "The Latin-script name Ruby as written in Chinese text for the Ruby language; the Chinese catalog alias."',
' meaning "program_task"',
' gloss "the genus of the coding tasks the catalog can synthesize; a structural parent that is never matched on its own. Each program_task_* leaf below names one catalog task (hello_world, list_files, …) and carries the phrasings that request it across every supported language. Defined_by program (the whole-program genus) so it reaches the code and link roots. Task phrasings are multi-word and matched on phrase boundaries (substring for CJK)."',
' wiktionary "task"',
' defined_by "program"',
' role "program_task"',
' lexeme "en"',
' word "coding task"',
' description "English noun phrase naming the genus of catalog tasks; structural, never matched on its own."',
' lexeme "ru"',
' word "задача программирования"',
' description "Russian noun phrase (romanized zadacha programmirovaniya) for a programming task; the structural genus surface."',
' lexeme "hi"',
' word "प्रोग्रामिंग कार्य"',
' description "Hindi noun phrase (romanized programming karya) for a programming task; the structural genus surface."',
' lexeme "zh"',
' word "编程任务"',
' description "Chinese noun (pinyin biancheng renwu) for a programming task; the structural genus surface."',
' meaning "program_task_hello_world"',
' gloss "the hello-world coding task as a catalog target (slug hello_world): print the greeting hello world. Defined_by program_task (the catalog genus) and hello_world (the canonical hello-world archetype whose greeting surfaces these aliases reuse)."',
' wiktionary "hello world"',
' defined_by "program_task"',
' defined_by "hello_world"',
' role "program_task_alias"',
' lexeme "en"',
' word "hello world"',
' description "English two-word phrase requesting the archetypal first program; matched as a phrase so a stray hello or world alone never fires it."',
' lexeme "ru"',
' word "хелло ворлд"',
' description "Russian transliteration (romanized khello vorld) of hello world, as commonly written in programming tutorials; a catalog alias for the hello_world task."',
' lexeme "hi"',
' word "हैलो वर्ल्ड"',
' description "Hindi transliteration (romanized hailo varld) of hello world; a catalog alias for the hello_world task."',
' lexeme "zh"',
' word "你好世界"',
' description "Chinese phrase (pinyin nihao shijie, hello world); a catalog alias for the hello_world task, matched as a substring."',
' meaning "program_task_count_to_three"',
' gloss "the count-to-three coding task as a catalog target (slug count_to_three): print 1, 2, 3. Defined_by program_task. The phrasings keep the number three or 3 so the task never answers a different count."',
' wiktionary "counting"',
' defined_by "program_task"',
' role "program_task_alias"',
' lexeme "en"',
' word "count to three"',
' description "English phrase requesting a program that counts to three; a catalog alias for the count_to_three task."',
' word "count to 3"',
' description "English phrase with the numeral 3 requesting a count to three; a catalog alias."',
' word "counts to three"',
' description "English third-person phrasing (counts to three) of the count-to-three request; a catalog alias."',
' word "counts to 3"',
' description "English third-person phrasing with the numeral 3; a catalog alias."',
' lexeme "ru"',
' word "посчитай до трёх"',
' description "Russian phrase (romanized poschitay do tryokh, count to three); a catalog alias for the count_to_three task."',
' word "посчитай до 3"',
' description "Russian phrase with the numeral 3 (romanized poschitay do 3); a catalog alias."',
' lexeme "hi"',
' word "तीन तक गिनें"',
' description "Hindi phrase (romanized teen tak ginen, count to three); a catalog alias for the count_to_three task."',
' word "3 तक गिनें"',
' description "Hindi phrase with the numeral 3 (romanized 3 tak ginen); a catalog alias."',
' lexeme "zh"',
' word "数到三"',
' description "Chinese phrase (pinyin shu dao san, count to three); a catalog alias for the count_to_three task, matched as a substring."',
' word "数到3"',
' description "Chinese phrase with the numeral 3 (pinyin shu dao 3); a catalog alias, matched as a substring."',
' meaning "program_task_list_files"',
' gloss "the list-files coding task as a catalog target (slug list_files): list the files in the current directory. Defined_by program_task. Every supported prompt language carries its natural phrasings so the whole class of list-files requests resolves, not just one language."',
' wiktionary "directory"',
' defined_by "program_task"',
' role "program_task_alias"',
' lexeme "en"',
' word "list files in the current directory"',
' description "English phrase, the canonical request to list files in the current directory; a catalog alias for the list_files task."',
' word "list files in current directory"',
' description "English phrase (article elided) requesting a current-directory listing; a catalog alias."',
' word "list files in the directory"',
' description "English phrase requesting a directory listing; a catalog alias for the list_files task."',
' word "list the files in the current directory"',
' description "English phrase with the article the requesting a current-directory listing; a catalog alias."',
' word "lists files in the current directory"',
' description "English third-person phrasing (lists files) of the current-directory listing request; a catalog alias."',
' word "lists the files in the current directory"',
' description "English third-person phrasing with the article the; a catalog alias."',
' word "list files in a directory"',
' description "English phrase with the article a requesting a directory listing; a catalog alias."',
' word "list directory files"',
' description "English compact phrasing (list directory files) of the listing request; a catalog alias."',
' word "list files"',
' description "English bare phrase list files; a catalog alias for the list_files task, matched on phrase boundaries."',
' word "lists files"',
' description "English third-person bare phrasing lists files; a catalog alias."',
' word "files in the current directory"',
" description \"English noun phrase naming the current directory's files; a catalog alias for the list_files task.\"",
' word "files in current directory"',
" description \"English noun phrase (article elided) naming the current directory's files; a catalog alias.\"",
' lexeme "ru"',
' word "список файлов в текущей директории"',
' description "Russian phrase (romanized spisok faylov v tekushchey direktorii, list of files in the current directory); a catalog alias for the list_files task."',
' word "список файлов в текущем каталоге"',
' description "Russian phrase using katalog for directory (romanized spisok faylov v tekushchem kataloge); a catalog alias."',
' word "список файлов в директории"',
' description "Russian phrase (romanized spisok faylov v direktorii, list of files in the directory); a catalog alias."',
' word "список файлов в каталоге"',
' description "Russian phrase using katalog (romanized spisok faylov v kataloge); a catalog alias."',
' word "выдаёт список файлов"',
' description "Russian third-person phrasing (romanized vydayot spisok faylov, outputs a list of files), as written by the issue #312 reporter; a catalog alias."',
' word "выдает список файлов"',
' description "Russian third-person phrasing without the yo letter (romanized vydaet spisok faylov); a catalog alias."',
' word "выводит список файлов"',
' description "Russian third-person phrasing (romanized vyvodit spisok faylov, prints a list of files); a catalog alias."',
' word "вывести список файлов"',
' description "Russian infinitive phrasing (romanized vyvesti spisok faylov, to print a list of files); a catalog alias."',
' word "вывод списка файлов"',
' description "Russian nominal phrasing (romanized vyvod spiska faylov, output of a list of files); a catalog alias."',
' word "список файлов"',
' description "Russian bare phrase (romanized spisok faylov, list of files); a catalog alias for the list_files task."',
' word "файлы в текущей директории"',
' description "Russian noun phrase (romanized fayly v tekushchey direktorii, files in the current directory); a catalog alias."',
' word "файлы в текущем каталоге"',
' description "Russian noun phrase using katalog (romanized fayly v tekushchem kataloge); a catalog alias."',
' lexeme "hi"',
' word "फ़ाइलों की सूची"',
' description "Hindi phrase (romanized failon ki suchi, list of files); a catalog alias for the list_files task."',
' word "फाइलों की सूची"',
' description "Hindi phrase without the nuqta (romanized failon ki suchi); a catalog alias."',
' word "वर्तमान निर्देशिका की फ़ाइलें"',
' description "Hindi phrase (romanized vartman nirdeshika ki failen, files of the current directory); a catalog alias."',
' word "वर्तमान निर्देशिका की फाइलें"',
' description "Hindi phrase without the nuqta (romanized vartman nirdeshika ki failen); a catalog alias."',
' word "निर्देशिका की फ़ाइलें"',
' description "Hindi phrase (romanized nirdeshika ki failen, files of the directory); a catalog alias."',
' lexeme "zh"',
' word "列出当前目录中的文件"',
' description "Chinese phrase (pinyin liechu dangqian mulu zhong de wenjian, list the files in the current directory); a catalog alias, matched as a substring."',
' word "列出当前目录中文件"',
' description "Chinese phrase eliding the particle de (pinyin liechu dangqian mulu zhong wenjian); a catalog alias."',
' word "列出当前目录的文件"',
" description \"Chinese phrase (pinyin liechu dangqian mulu de wenjian, list the current directory's files); a catalog alias.\"",
' word "列出当前目录文件"',
' description "Chinese compact phrasing (pinyin liechu dangqian mulu wenjian); a catalog alias."',
' word "列出目录中的文件"',
' description "Chinese phrase (pinyin liechu mulu zhong de wenjian, list the files in the directory); a catalog alias."',
' word "列出文件"',
' description "Chinese bare phrase (pinyin liechu wenjian, list files); a catalog alias, matched as a substring."',
' meaning "program_task_list_files_arg"',
' gloss "the list-files-with-a-path-argument coding task as a catalog target (slug list_files_arg): list the files in a directory passed as a command-line argument. Defined_by program_task. A bare accept-a-path-argument modification also maps here through the program-plan rules; these aliases let an explicit single-turn request resolve directly."',
' wiktionary "argument"',
' defined_by "program_task"',
' role "program_task_alias"',
' lexeme "en"',
' word "list files in the directory given as a path argument"',
' description "English phrase, the canonical request to list files in a directory given as a path argument; a catalog alias for the list_files_arg task."',
' word "list files in a directory given as an argument"',
' description "English phrase requesting a listing of a directory given as an argument; a catalog alias."',
' word "list files in the directory passed as an argument"',
' description "English phrase using passed as an argument; a catalog alias."',
' word "list files in a path argument"',
' description "English compact phrasing referencing a path argument; a catalog alias."',
' word "list files with a path argument"',
' description "English phrase requesting a listing that takes a path argument; a catalog alias."',
' word "list files accepting a path argument"',
' description "English phrase using accepting a path argument; a catalog alias."',
' lexeme "ru"',
' word "список файлов в каталоге переданном как аргумент"',
' description "Russian phrase (romanized spisok faylov v kataloge peredannom kak argument, list of files in a directory passed as an argument); a catalog alias for the list_files_arg task."',
' word "список файлов в директории переданной как аргумент"',
' description "Russian phrase using direktoriya (romanized spisok faylov v direktorii peredannoy kak argument); a catalog alias."',
' word "список файлов по пути из аргумента"',
' description "Russian phrase (romanized spisok faylov po puti iz argumenta, list of files by the path from the argument); a catalog alias."',
' lexeme "hi"',
' word "पथ तर्क के रूप में दी गई निर्देशिका की फ़ाइलों की सूची"',
' description "Hindi phrase (romanized path tark ke roop mein di gayi nirdeshika ki failon ki suchi, list of files of the directory given as a path argument); a catalog alias for the list_files_arg task."',
' lexeme "zh"',
' word "列出作为路径参数给出的目录中的文件"',
' description "Chinese phrase (pinyin liechu zuowei lujing canshu gei chu de mulu zhong de wenjian, list the files in the directory given as a path argument); a catalog alias, matched as a substring."',
' word "列出路径参数指定目录中的文件"',
' description "Chinese phrase (pinyin liechu lujing canshu zhiding mulu zhong de wenjian, list the files in the directory the path argument specifies); a catalog alias."',
' meaning "program_task_list_files_reverse_sort"',
" gloss \"the reverse-sorted list-files coding task as a catalog target (slug list_files_reverse_sort): list the current directory's files in descending byte order. Defined_by program_task.\"",
' wiktionary "sorting"',
' defined_by "program_task"',
' role "program_task_alias"',
' lexeme "en"',
' word "list files in reverse order"',
' description "English phrase requesting a reverse-ordered listing; a catalog alias for the list_files_reverse_sort task."',
' word "list files sorted in reverse order"',
' description "English phrase using sorted in reverse order; a catalog alias."',
' word "list files in descending order"',
' description "English phrase using descending order; a catalog alias."',
' word "reverse sorted list files"',
' description "English phrase (reverse sorted list files); a catalog alias."',
' lexeme "ru"',
' word "список файлов в обратном порядке"',
' description "Russian phrase (romanized spisok faylov v obratnom poryadke, list of files in reverse order); a catalog alias for the list_files_reverse_sort task."',
' word "список файлов с обратной сортировкой"',
' description "Russian phrase (romanized spisok faylov s obratnoy sortirovkoy, list of files with reverse sorting); a catalog alias."',
' lexeme "hi"',
' word "फ़ाइलों की सूची उल्टे क्रम में"',
' description "Hindi phrase (romanized failon ki suchi ulte kram mein, list of files in reverse order); a catalog alias for the list_files_reverse_sort task."',
' word "फ़ाइलों को उल्टे क्रम में सूचीबद्ध करें"',
' description "Hindi imperative phrase (romanized failon ko ulte kram mein suchibaddh karen, list the files in reverse order); a catalog alias."',
' lexeme "zh"',
' word "按相反顺序列出文件"',
' description "Chinese phrase (pinyin an xiangfan shunxu liechu wenjian, list files in reverse order); a catalog alias, matched as a substring."',
' word "倒序列出文件"',
' description "Chinese phrase (pinyin daoxu liechu wenjian, list files in descending order); a catalog alias."',
' meaning "program_task_list_files_arg_reverse_sort"',
" gloss \"the reverse-sorted list-files-with-a-path-argument coding task as a catalog target (slug list_files_arg_reverse_sort): list a path-argument directory's files in descending byte order. Defined_by program_task.\"",
' wiktionary "sorting"',
' defined_by "program_task"',
' role "program_task_alias"',
' lexeme "en"',
' word "list files from a path argument in reverse order"',
' description "English phrase requesting a reverse-ordered listing of a path-argument directory; a catalog alias for the list_files_arg_reverse_sort task."',
' word "list files with a path argument in reverse order"',
' description "English phrase using with a path argument in reverse order; a catalog alias."',
' word "list files with a path argument sorted descending"',
' description "English phrase using sorted descending; a catalog alias."',
' word "reverse sorted list files with a path argument"',
' description "English phrase (reverse sorted list files with a path argument); a catalog alias."',
' lexeme "ru"',
' word "список файлов по пути из аргумента в обратном порядке"',
' description "Russian phrase (romanized spisok faylov po puti iz argumenta v obratnom poryadke, list of files by the path from the argument in reverse order); a catalog alias for the list_files_arg_reverse_sort task."',
' word "список файлов из аргумента с обратной сортировкой"',
' description "Russian phrase (romanized spisok faylov iz argumenta s obratnoy sortirovkoy, list of files from the argument with reverse sorting); a catalog alias."',
' lexeme "hi"',
' word "पथ तर्क से फ़ाइलों की सूची उल्टे क्रम में"',
' description "Hindi phrase (romanized path tark se failon ki suchi ulte kram mein, list of files from the path argument in reverse order); a catalog alias for the list_files_arg_reverse_sort task."',
' word "पथ तर्क वाली फ़ाइलों को उल्टे क्रम में सूचीबद्ध करें"',
' description "Hindi imperative phrase (romanized path tark vali failon ko ulte kram mein suchibaddh karen, list the path-argument files in reverse order); a catalog alias."',
' lexeme "zh"',
' word "按相反顺序列出路径参数中的文件"',
' description "Chinese phrase (pinyin an xiangfan shunxu liechu lujing canshu zhong de wenjian, list the files in the path argument in reverse order); a catalog alias, matched as a substring."',
' word "倒序列出路径参数指定目录中的文件"',
' description "Chinese phrase (pinyin daoxu liechu lujing canshu zhiding mulu zhong de wenjian, list the files in the path-argument directory in descending order); a catalog alias."',
' meaning "program_task_fizzbuzz"',
' gloss "the FizzBuzz coding task as a catalog target (slug fizzbuzz): print 1..15 replacing multiples of three with Fizz, of five with Buzz, of both with FizzBuzz. Defined_by program_task."',
' wiktionary "Fizz buzz"',
' defined_by "program_task"',
' role "program_task_alias"',
' lexeme "en"',
' word "fizzbuzz"',
' description "English one-word name of the FizzBuzz exercise; the primary catalog alias for the fizzbuzz task."',
' word "fizz buzz"',
' description "English two-word spelling fizz buzz of the FizzBuzz exercise; a catalog alias."',
' lexeme "ru"',
' word "физзбазз"',
' description "Russian transliteration (romanized fizzbazz) of FizzBuzz; a catalog alias for the fizzbuzz task."',
' word "физз базз"',
' description "Russian two-word transliteration (romanized fizz bazz); a catalog alias."',
' word "физбаз"',
' description "Russian shortened transliteration (romanized fizbaz) of FizzBuzz; a catalog alias."',
' lexeme "hi"',
' word "फ़िज़बज़"',
' description "Hindi transliteration (romanized fizzbaz) of FizzBuzz; a catalog alias for the fizzbuzz task."',
' word "फिज़बज़"',
' description "Hindi transliteration without the nuqta (romanized fizbaz); a catalog alias."',
' lexeme "zh"',
' word "菲茨巴兹"',
' description "Chinese transliteration (pinyin feici bazi) of FizzBuzz; a catalog alias, matched as a substring."',
' meaning "program_task_factorial"',
' gloss "the factorial coding task as a catalog target (slug factorial): compute 5! = 120. Defined_by program_task. The phrasings keep the number 5 or five so the task never answers a different factorial."',
' wiktionary "factorial"',
' defined_by "program_task"',
' role "program_task_alias"',
' lexeme "en"',
' word "factorial of 5"',
' description "English phrase requesting the factorial of 5; a catalog alias for the factorial task."',
' word "factorial of five"',
' description "English phrase spelling out five; a catalog alias."',
' word "5 factorial"',
' description "English postfix phrasing 5 factorial; a catalog alias."',
' word "five factorial"',
' description "English postfix phrasing spelling out five; a catalog alias."',
' lexeme "ru"',
' word "факториал 5"',
' description "Russian phrase (romanized faktorial 5, factorial of 5); a catalog alias for the factorial task."',
' word "факториал пяти"',
' description "Russian phrase (romanized faktorial pyati, factorial of five); a catalog alias."',
' word "факториал числа 5"',
' description "Russian phrase (romanized faktorial chisla 5, factorial of the number 5); a catalog alias."',
' lexeme "hi"',
' word "5 का फैक्टोरियल"',
' description "Hindi phrase (romanized 5 ka factorial, factorial of 5); a catalog alias for the factorial task."',
' word "पाँच का फैक्टोरियल"',
' description "Hindi phrase spelling out five (romanized panch ka factorial); a catalog alias."',
' lexeme "zh"',
' word "5的阶乘"',
' description "Chinese phrase (pinyin 5 de jiecheng, factorial of 5); a catalog alias, matched as a substring."',
' word "五的阶乘"',
' description "Chinese phrase spelling out five (pinyin wu de jiecheng); a catalog alias."',
' meaning "program_task_reverse_string"',
' gloss "the string-reversal coding task as a catalog target (slug reverse_string): reverse the literal string hello into olleh. Defined_by program_task. The fixed input keeps the verified output unambiguous."',
' wiktionary "string"',
' defined_by "program_task"',
' role "program_task_alias"',
' lexeme "en"',
' word "reverse a string"',
' description "English phrase requesting a string reversal; a catalog alias for the reverse_string task."',
' word "reverse the string hello"',
' description "English phrase naming the literal input hello; a catalog alias."',
' word "reverse hello"',
' description "English compact phrase reverse hello; a catalog alias."',
' word "reverse string hello"',
' description "English phrase reverse string hello; a catalog alias."',
' word "reverse the word hello"',
' description "English phrase using word for the input hello; a catalog alias."',
' lexeme "ru"',
' word "перевернуть строку"',
' description "Russian phrase (romanized perevernut stroku, reverse the string); a catalog alias for the reverse_string task."',
' word "перевернуть строку hello"',
' description "Russian phrase naming the literal input hello (romanized perevernut stroku hello); a catalog alias."',
' word "развернуть строку"',
' description "Russian phrase (romanized razvernut stroku, reverse the string); a catalog alias."',
' lexeme "hi"',
' word "स्ट्रिंग को उलटें"',
' description "Hindi phrase (romanized string ko ultein, reverse the string); a catalog alias for the reverse_string task."',
' word "स्ट्रिंग पलटें"',
' description "Hindi phrase (romanized string palten, flip the string); a catalog alias."',
' lexeme "zh"',
' word "反转字符串"',
' description "Chinese phrase (pinyin fanzhuan zifuchuan, reverse the string); a catalog alias, matched as a substring."',
' word "翻转字符串"',
' description "Chinese phrase with the alternate verb (pinyin fanzhuan zifuchuan, flip the string); a catalog alias."',
' word "反转hello"',
' description "Chinese phrase naming the literal input hello (pinyin fanzhuan hello); a catalog alias."',
' meaning "program_task_sum_to_ten"',
' gloss "the sum-to-ten coding task as a catalog target (slug sum_to_ten): sum the integers 1 through 10 to 55. Defined_by program_task. The fixed range keeps the verified output unambiguous."',
' wiktionary "summation"',
' defined_by "program_task"',
' role "program_task_alias"',
' lexeme "en"',
' word "sum of 1 to 10"',
' description "English phrase requesting the sum of 1 to 10; a catalog alias for the sum_to_ten task."',
' word "sum from 1 to 10"',
' description "English phrase using from 1 to 10; a catalog alias."',
' word "sum the numbers 1 to 10"',
' description "English phrase using the numbers 1 to 10; a catalog alias."',
' word "sum of numbers from 1 to 10"',
' description "English phrase using of numbers from 1 to 10; a catalog alias."',
' word "sum 1 to 10"',
' description "English compact phrase sum 1 to 10; a catalog alias."',
' word "sum to ten"',
' description "English phrase sum to ten spelling out the bound; a catalog alias."',
' lexeme "ru"',
' word "сумма от 1 до 10"',
' description "Russian phrase (romanized summa ot 1 do 10, sum from 1 to 10); a catalog alias for the sum_to_ten task."',
' word "сумма чисел от 1 до 10"',
' description "Russian phrase (romanized summa chisel ot 1 do 10, sum of the numbers from 1 to 10); a catalog alias."',
' word "сумма чисел от одного до десяти"',
' description "Russian phrase spelling out the bounds (romanized summa chisel ot odnogo do desyati, sum of the numbers from one to ten); a catalog alias."',
' lexeme "hi"',
' word "1 से 10 तक का योग"',
' description "Hindi phrase (romanized 1 se 10 tak ka yog, the sum from 1 to 10); a catalog alias for the sum_to_ten task."',
' word "1 से 10 तक योग"',
' description "Hindi phrase eliding ka (romanized 1 se 10 tak yog); a catalog alias."',
' lexeme "zh"',
' word "1到10的和"',
' description "Chinese phrase (pinyin 1 dao 10 de he, the sum from 1 to 10); a catalog alias, matched as a substring."',
' word "1到10求和"',
' description "Chinese phrase using the verb qiu he (pinyin 1 dao 10 qiu he, sum from 1 to 10); a catalog alias."',
' word "求1到10的和"',
' description "Chinese phrase fronting the verb (pinyin qiu 1 dao 10 de he, compute the sum from 1 to 10); a catalog alias."',
' meaning "program_task_fibonacci"',
' gloss "the recursive-Fibonacci coding task as a catalog target (slug fibonacci): define a recursive fibonacci function and print the 10th term (55). Defined_by program_task. The fixed index keeps the verified output unambiguous and the aliases carry the explicit recursive and function phrasings from issue #334."',
' wiktionary "Fibonacci sequence"',
' defined_by "program_task"',
' role "program_task_alias"',
' lexeme "en"',
' word "fibonacci sequence recursively"',
' description "English phrase requesting the Fibonacci sequence computed recursively; a catalog alias for the fibonacci task."',
' word "fibonacci sequence"',
' description "English phrase naming the Fibonacci sequence; a catalog alias."',
' word "recursive fibonacci"',
' description "English phrase recursive fibonacci; a catalog alias."',
' word "fibonacci recursively"',
' description "English phrase fibonacci recursively; a catalog alias."',
' word "fibonacci function"',
' description "English phrase naming a fibonacci function; a catalog alias."',
' word "fibonacci numbers"',
' description "English plural phrase fibonacci numbers; a catalog alias."',
' word "fibonacci number"',
' description "English singular phrase fibonacci number; a catalog alias."',
' word "10th fibonacci number"',
' description "English phrase naming the 10th Fibonacci number; a catalog alias."',
' word "the 10th fibonacci number"',
' description "English phrase with the article naming the 10th Fibonacci number; a catalog alias."',
' word "tenth fibonacci number"',
' description "English phrase spelling out tenth; a catalog alias."',
' word "nth fibonacci number"',
' description "English general phrase nth fibonacci number; a catalog alias."',
' lexeme "ru"',
' word "последовательность фибоначчи"',
' description "Russian phrase (romanized posledovatelnost fibonachchi, Fibonacci sequence); a catalog alias for the fibonacci task."',
' word "числа фибоначчи"',
' description "Russian phrase (romanized chisla fibonachchi, Fibonacci numbers); a catalog alias."',
' word "число фибоначчи"',
' description "Russian singular phrase (romanized chislo fibonachchi, Fibonacci number); a catalog alias."',
' word "рекурсивный фибоначчи"',
' description "Russian phrase (romanized rekursivnyy fibonachchi, recursive Fibonacci); a catalog alias."',
' word "фибоначчи рекурсивно"',
' description "Russian phrase (romanized fibonachchi rekursivno, Fibonacci recursively); a catalog alias."',
' word "10-е число фибоначчи"',
' description "Russian phrase (romanized 10-e chislo fibonachchi, the 10th Fibonacci number); a catalog alias."',
' word "десятое число фибоначчи"',
' description "Russian phrase spelling out tenth (romanized desyatoe chislo fibonachchi); a catalog alias."',
' lexeme "hi"',
' word "फ़िबोनाची अनुक्रम"',
' description "Hindi phrase (romanized fibonacci anukram, Fibonacci sequence); a catalog alias for the fibonacci task."',
' word "फिबोनाची अनुक्रम"',
' description "Hindi phrase without the nuqta (romanized fibonacci anukram); a catalog alias."',
' word "फ़िबोनाची संख्या"',
' description "Hindi phrase (romanized fibonacci sankhya, Fibonacci number); a catalog alias."',
' word "फिबोनाची संख्या"',
' description "Hindi phrase without the nuqta (romanized fibonacci sankhya); a catalog alias."',
' lexeme "zh"',
' word "斐波那契数列"',
' description "Chinese phrase (pinyin feibonaqi shulie, Fibonacci sequence); a catalog alias, matched as a substring."',
' word "斐波那契序列"',
' description "Chinese phrase with the alternate word for sequence (pinyin feibonaqi xulie); a catalog alias."',
' word "斐波那契数"',
' description "Chinese phrase (pinyin feibonaqi shu, Fibonacci number); a catalog alias."',
' word "递归斐波那契"',
' description "Chinese phrase (pinyin digui feibonaqi, recursive Fibonacci); a catalog alias."',
].join("\n");
// Semantic role: a thing a program produces that a later turn can refer back to
// (a result, an output, the program/script/code itself, an ordering).
const ROLE_PROGRAM_ARTIFACT = "program_artifact";
// Semantic role: an operation a follow-up turn can request against the active
// program (sort, reverse, cancel, change, …) — additive or subtractive.
const ROLE_PROGRAM_MODIFICATION = "program_modification";
// Semantic role: a kind of program artifact a user can ask to be authored
// (a program, a script, code, a function) — the noun side of "write a <kind>".
const ROLE_PROGRAM_KIND = "program_kind";
// Semantic role: a verb that requests a program artifact be produced (write,
// create, show, generate, make, build) — the verb side of "write a <kind>".
const ROLE_PROGRAM_REQUEST = "program_request";
// Issue #386 program-synthesis roles — mirror the ROLE_PROGRAM_SYNTHESIS_*
// consts in src/seed/meanings.rs. Their surface words live in
// data/seed/meanings-program-synthesis.lino (embedded in MEANINGS_LINO above).
// The subject/domain/action triple gates a synthesis request; signals
// distinguish one task from another; a task's slug is the Python function name.
const ROLE_PROGRAM_SYNTHESIS_SUBJECT = "program_synthesis_subject";
const ROLE_PROGRAM_SYNTHESIS_DOMAIN = "program_synthesis_domain";
const ROLE_PROGRAM_SYNTHESIS_ACTION = "program_synthesis_action";
const ROLE_PROGRAM_SYNTHESIS_SIGNAL = "program_synthesis_signal";
const ROLE_PROGRAM_SYNTHESIS_TASK = "program_synthesis_task";
// Issue #386 conversational-intent roles — mirror the ROLE_CLARIFICATION_REQUEST
// / ROLE_CAPABILITY_QUERY* / ROLE_SELF_FACT_QUERY / ROLE_SELF_INTRODUCTION_REQUEST
// consts in src/seed/meanings.rs. Their surface words live in
// data/seed/meanings-intent.lino (embedded in MEANINGS_LINO above); the
// recognizers below ask the lexicon by meaning instead of hardcoding phrases.
const ROLE_CLARIFICATION_REQUEST = "clarification_request";
const ROLE_CAPABILITY_QUERY = "capability_query";
const ROLE_CAPABILITY_QUERY_MORE = "capability_query_more";
const ROLE_SELF_FACT_QUERY = "self_fact_query";
const ROLE_SELF_INTRODUCTION_REQUEST = "self_introduction_request";
// Issue #386 known-facts inventory roles — mirror the ROLE_KNOWLEDGE_INVENTORY_*
// / ROLE_KNOWLEDGE_POSSESSION consts in src/seed/roles.rs. Their surface words
// live in data/seed/meanings-intent.lino (the shared `fact` noun plus the
// knowledge_inventory_probe / assistant_knowing / knowledge_inventory_query
// meanings, embedded in MEANINGS_LINO above); isKnownFactQuery composes these
// roles instead of hardcoding per-language phrase arrays.
const ROLE_KNOWLEDGE_INVENTORY_NOUN = "knowledge_inventory_noun";
const ROLE_KNOWLEDGE_INVENTORY_INTERROGATIVE = "knowledge_inventory_interrogative";
const ROLE_KNOWLEDGE_POSSESSION = "knowledge_possession";
const ROLE_KNOWLEDGE_INVENTORY_PHRASE = "knowledge_inventory_phrase";
// Issue #386 conversation-summary roles — mirror the
// ROLE_CONVERSATION_SUMMARY_DIRECTIVE / ROLE_CONVERSATION_REFERENCE /
// ROLE_CONVERSATION_SUMMARY_PHRASE / ROLE_CONVERSATION_SUMMARY_COURTESY consts
// in src/seed/roles.rs. Their per-language surface words live once in the
// embedded MEANINGS_LINO above (data/seed/meanings-intent.lino); the
// isSummarizePrompt recogniser composes these roles instead of hardcoding
// per-language phrase / regex arrays.
const ROLE_CONVERSATION_SUMMARY_DIRECTIVE = "conversation_summary_directive";
const ROLE_CONVERSATION_REFERENCE = "conversation_reference";
const ROLE_CONVERSATION_SUMMARY_PHRASE = "conversation_summary_phrase";
const ROLE_CONVERSATION_SUMMARY_COURTESY = "conversation_summary_courtesy";
// Issue #386 conversation-opener role — mirrors ROLE_CONVERSATION_TOPIC_OPENER
// in src/seed/roles.rs. Its slot-marked surface words live in
// data/seed/meanings-conversation.lino (embedded in MEANINGS_LINO above);
// conversationTopic asks the lexicon for these forms by meaning instead of
// hardcoding a per-language opener array.
const ROLE_CONVERSATION_TOPIC_OPENER = "conversation_topic_opener";
// Issue #386 how-cluster roles — mirror the ROLE_MECHANISM_INQUIRY /
// ROLE_PROCEDURAL_REQUEST consts in src/seed/meanings.rs. Their slot-marked
// surface words live in data/seed/meanings-how.lino (embedded in MEANINGS_LINO
// above); extractHowItWorksSubject / extractProceduralHowToTask ask the lexicon
// for these forms by meaning instead of hardcoding per-language phrase arrays.
const ROLE_MECHANISM_INQUIRY = "mechanism_inquiry";
const ROLE_PROCEDURAL_REQUEST = "procedural_request";
// Issue #386 procedural-cluster cleanup roles — mirror the
// ROLE_PROCEDURAL_TASK_MODIFIER / ROLE_COMMON_TYPO consts in src/seed/roles.rs.
// cleanProceduralFragment / correctCommonProceduralTypos ask the lexicon for
// these forms by meaning instead of hardcoding per-language modifier and typo
// arrays.
const ROLE_PROCEDURAL_TASK_MODIFIER = "procedural_task_modifier";
const ROLE_COMMON_TYPO = "common_typo";
// Issue #386 mechanism-subject cleanup roles — mirror the
// ROLE_MECHANISM_PREDICATE / ROLE_DETAIL_MODIFIER / ROLE_NON_REFERENTIAL_SUBJECT
// consts in src/seed/roles.rs. stripMechanismTail / cleanMechanismSubject ask
// the lexicon for these forms by meaning instead of hardcoding per-language
// predicate, modifier, and pronoun arrays.
const ROLE_MECHANISM_PREDICATE = "mechanism_predicate";
const ROLE_DETAIL_MODIFIER = "detail_modifier";
const ROLE_NON_REFERENTIAL_SUBJECT = "non_referential_subject";
// Slot marker (U+2026 …) carried inside a surface word's text to mark the open
// subject/task position. Mirrors the `split_once('…')` slot derivation on
// WordForm in src/seed/meanings.rs (issue #386).
const SLOT_MARKER = "…";
// Build a surface form { text, action, description, slot, before, after } from a
// raw surface word, its optional canonical action, and its self-describing note.
// The slot classification and the literal text on either side are derived from
// the position of the … marker, exactly as WordForm::slot/before_slot/after_slot
// do in src/seed/meanings.rs: no marker = "bare"; trailing marker = "prefix";
// leading marker = "suffix"; a marker with text on both sides = "circumfix".
function makeWordForm(text, action, description) {
const idx = text.indexOf(SLOT_MARKER);
if (idx === -1) {
return {
text,
action: action || "",
description: description || "",
slot: "bare",
before: text,
after: "",
};
}
const before = text.slice(0, idx);
const after = text.slice(idx + SLOT_MARKER.length);
let slot = "bare";
if (before && after) slot = "circumfix";
else if (before) slot = "prefix";
else if (after) slot = "suffix";
return {
text,
action: action || "",
description: description || "",
slot,
before,
after,
};
}
let cachedMeaningLexicon = null;
// Parse the embedded lexicon once. Each meaning keeps the semantic roles it
// plays, the surface words (across every language) that evidence it, and the
// richer per-form data (action + self-describing note + derived slot) in
// declaration order. Mirrors parse_lexicon in src/seed/meanings.rs.
function meaningLexicon() {
if (cachedMeaningLexicon) return cachedMeaningLexicon;
const root = parseLinoTree(MEANINGS_LINO);
// The lexicon is split across several files (program, units, …), each
// wrapping its records under a top-level `meanings` node. Concatenated, the
// document therefore holds one-or-more `meanings` containers; collect the
// records from every one. If none is present the records sit at the document
// root (kept for robustness). Mirrors parse_lexicon in src/seed/meanings.rs.
const containers = root.children.filter((child) => child.name === "meanings");
const sources = containers.length ? containers : [root];
const meanings = [];
for (const container of sources) {
for (const node of container.children) {
if (node.name !== "meaning") continue;
const roles = [];
const definedBy = [];
const words = [];
const wordForms = [];
// Per-language word groups, so a handler can partition a role's vocabulary
// by language (e.g. head-initial vs. head-final translation verbs) without
// losing the language tag the flat `words` list drops. Mirrors the
// `lexemes` field on Meaning in src/seed/meanings.rs (issue #386).
const lexemes = [];
for (const child of node.children) {
if (child.name === "role") roles.push(child.value);
else if (child.name === "defined_by") definedBy.push(child.value);
else if (child.name === "lexeme") {
const lexemeWords = [];
for (const lexWord of child.children) {
if (lexWord.name !== "word") continue;
words.push(lexWord.value);
lexemeWords.push(lexWord.value);
let action = "";
let description = "";
for (const attr of lexWord.children) {
if (attr.name === "action") action = attr.value;
else if (attr.name === "description") description = attr.value;
}
wordForms.push(makeWordForm(lexWord.value, action, description));
}
lexemes.push({ language: child.value, words: lexemeWords });
}
}
meanings.push({ slug: node.value, roles, definedBy, words, wordForms, lexemes });
}
}
cachedMeaningLexicon = meanings;
return cachedMeaningLexicon;
}
// Does `expected` (a surface word or multi-word phrase) appear in `normalized`?
// CJK surfaces match as substrings; everything else matches on whitespace
// boundaries (whole token or whole phrase). Mirrors surface_present in
// src/seed/meanings.rs — stricter than a raw substring, so a short surface like
// "hp" never matches inside "php" and a phrase like "each step" matches only on
// word boundaries.
function surfacePresent(normalized, expected) {
if (!expected) return false;
const text = String(normalized || "");
if (containsCjk(expected)) return text.includes(expected);
return (
text === expected ||
text.startsWith(`${expected} `) ||
text.endsWith(` ${expected}`) ||
text.includes(` ${expected} `)
);
}
// Is any surface word (any language) of `meaning` evidenced in `normalized`?
// Mirrors Meaning::evidenced_in in src/seed/meanings.rs.
function meaningEvidencedIn(meaning, normalized) {
return meaning.words.some((word) => surfacePresent(normalized, word));
}
// Does `normalized` mention any surface word of any meaning carrying `role`?
// Mirrors Lexicon::mentions_role in src/seed/meanings.rs — the boundary-aware,
// phrase-capable surface_present contract (CJK substring vs. whitespace token).
function lexiconMentionsRole(role, normalized) {
return meaningsWithRole(role).some((meaning) => meaningEvidencedIn(meaning, normalized));
}
// Like lexiconMentionsRole but ignores a meaning's script-independent *value
// surfaces* — word forms with no alphabetic character, such as the operator
// symbol "+" or the numeral "10". Those forms exist so the arithmetic normalizer
// can read a meaning's machine value; they are not spelled words, so operator-
// *word* detection skips them and a bare "+" is recognised as an operator symbol
// by the symbol scan, not double-counted here. Mirrors Lexicon::mentions_role_spelled
// in src/seed/meanings.rs.
function lexiconMentionsRoleSpelled(role, normalized) {
return meaningsWithRole(role).some((meaning) =>
meaning.words
.filter((word) => /\p{Alphabetic}/u.test(word))
.some((word) => surfacePresent(normalized, word)),
);
}
// The first meaning (declaration order) carrying `role` that is evidenced in
// `normalized`, or null. Declaration order encodes priority. Mirrors
// Lexicon::first_role_match in src/seed/meanings.rs.
function firstRoleMatch(role, normalized) {
return meaningsWithRole(role).find((meaning) => meaningEvidencedIn(meaning, normalized)) || null;
}
// Issue #386 calendar roles — mirror the ROLE_CALENDAR_* consts in
// src/seed/meanings.rs. Their surface words live in
// data/seed/meanings-calendar.lino (embedded in MEANINGS_LINO above). The
// calendar handler uses its own boundary-aware matcher (containsCalendarTerm)
// rather than lexiconMentionsRole, so these come with dedicated accessors.
const ROLE_CALENDAR_WEEKDAY = "calendar_weekday";
const ROLE_CALENDAR_DIRECTION_NEXT = "calendar_direction_next";
const ROLE_CALENDAR_DIRECTION_PREVIOUS = "calendar_direction_previous";
const ROLE_CALENDAR_TODAY = "calendar_today";
const ROLE_CALENDAR_DAY_REFERENCE = "calendar_day_reference";
const ROLE_CALENDAR_QUESTION = "calendar_question";
// Every meaning carrying `role`, in lexicon (declaration) order. Mirrors
// Lexicon::meanings_with_role in src/seed/meanings.rs.
function meaningsWithRole(role) {
return meaningLexicon().filter((meaning) => meaning.roles.includes(role));
}
// Every slot-marked surface form carrying `role`, flattened across all meanings
// and languages in declaration order. Recognition code buckets the result by
// form.slot ("bare" / "prefix" / "suffix" / "circumfix") to derive its
// affix-matching strategy from the data. Mirrors Lexicon::role_word_forms in
// src/seed/meanings.rs (issue #386).
function roleWordForms(role) {
const forms = [];
for (const meaning of meaningsWithRole(role)) {
for (const form of meaning.wordForms) forms.push(form);
}
return forms;
}
// The meaning identified by `slug`, or null. Mirrors Lexicon::meaning in
// src/seed/meanings.rs.
function findMeaning(slug) {
return meaningLexicon().find((meaning) => meaning.slug === slug) || null;
}
// Distinct surface words (across all languages) carried by the meaning `slug`,
// or an empty array when no such meaning exists. The coding catalog reads each
// language's and task's alias surfaces from the `program_language_<slug>` /
// `program_task_<slug>` meanings by slug (issue #386), so the matchers name only
// the concept while the words stay self-describing seed data. Mirrors the Rust
// `coding::catalog::alias_surfaces` helper.
function wordsForMeaning(slug) {
return findMeaning(slug)?.words || [];
}
// Distinct surface words (across all languages) for `role`, declaration order.
// Mirrors Lexicon::words_for_role in src/seed/meanings.rs.
function wordsForRole(role) {
const seen = new Set();
const words = [];
for (const meaning of meaningsWithRole(role)) {
for (const word of meaning.words) {
if (!seen.has(word)) {
seen.add(word);
words.push(word);
}
}
}
return words;
}
// Issue #386 translation-command role — mirrors ROLE_TRANSLATION_ACTION in
// src/seed/roles.rs. The per-language command verbs (translate, переведи/
// перевести/опиши, अनुवाद, 翻译/翻譯) live once in the embedded MEANINGS_LINO
// (data/seed/meanings-translation.lino) under the `translate` meaning; the gate
// and source-inferencer reference the concept, not the raw words.
const ROLE_TRANSLATION_ACTION = "translation_action";
// Distinct surface words for `role` limited to `languages`, declaration order.
// Mirrors Lexicon::words_for_role_in_languages in src/seed/meanings.rs (#386).
function wordsForRoleInLanguages(role, languages) {
const out = [];
for (const meaning of meaningsWithRole(role)) {
for (const lexeme of meaning.lexemes) {
if (!languages.includes(lexeme.language)) continue;
for (const word of lexeme.words) {
if (!out.includes(word)) out.push(word);
}
}
}
return out;
}
// The first language in `priority` whose surface word for `role` appears in
// `normalized` (raw substring), or null when none is present. Answers "which
// language did the user issue this command in?". Mirrors
// Lexicon::first_role_language in src/seed/meanings.rs (#386).
function firstRoleLanguage(role, normalized, priority) {
for (const lang of priority) {
const present = meaningsWithRole(role).some((meaning) =>
meaning.lexemes.some(
(lexeme) =>
lexeme.language === lang &&
lexeme.words.some((word) => normalized.includes(word)),
),
);
if (present) return lang;
}
return null;
}
// The first surface word `meaning` lexicalises in `language`, or null. Mirrors
// Meaning::word_in in src/seed/meanings.rs (issue #386).
function wordIn(meaning, language) {
for (const lexeme of meaning.lexemes) {
if (lexeme.language !== language) continue;
for (const word of lexeme.words) {
if (word) return word;
}
}
return null;
}
// Translate `surface` from `source` to `target` through the meaning carrying
// `role` that lexicalises it: the first such meaning (declaration order) whose
// `source` lexeme lists `surface`, returning its first `target` form, or null.
// Mirrors Lexicon::role_surface_translation in src/seed/meanings.rs (issue #386).
function roleSurfaceTranslation(role, source, target, surface) {
for (const meaning of meaningsWithRole(role)) {
const lists = meaning.lexemes.some(
(lexeme) => lexeme.language === source && lexeme.words.includes(surface),
);
if (lists) return wordIn(meaning, target);
}
return null;
}
// Does any meaning carrying `role` lexicalise `surface` in `language`? Mirrors
// Lexicon::role_lists_surface in src/seed/meanings.rs (issue #386).
function roleListsSurface(role, language, surface) {
return meaningsWithRole(role).some((meaning) =>
meaning.lexemes.some(
(lexeme) => lexeme.language === language && lexeme.words.includes(surface),
),
);
}
// Like roleSurfaceTranslation but the `source` form must also carry the per-form
// grammatical `action` tag (e.g. "genitive"). The worker keeps per-form action on
// the flat wordForms array (no language) and raw strings on each lexeme, so a
// form qualifies when the source lexeme lists `surface` and some wordForm has the
// same text and `action`. Mirrors Lexicon::role_action_surface_translation in
// src/seed/meanings.rs (issue #386).
function roleActionSurfaceTranslation(role, action, source, target, surface) {
for (const meaning of meaningsWithRole(role)) {
const listsInSource = meaning.lexemes.some(
(lexeme) => lexeme.language === source && lexeme.words.includes(surface),
);
const tagged = meaning.wordForms.some(
(form) => form.text === surface && form.action === action,
);
if (listsInSource && tagged) return wordIn(meaning, target);
}
return null;
}
// Issue #386 software-project follow-up roles — mirror the
// ROLE_SOFTWARE_FOLLOWUP_* consts in src/seed/meanings.rs. Their surface words
// live in data/seed/meanings-software-project.lino (embedded in MEANINGS_LINO
// above). detectSoftwareFollowUp matches them as raw substrings (not whole
// tokens), so they come with a dedicated accessor.
const ROLE_SOFTWARE_FOLLOWUP_VERIFICATION = "software_followup_verification";
const ROLE_SOFTWARE_FOLLOWUP_EXECUTION = "software_followup_execution";
const ROLE_SOFTWARE_FOLLOWUP_DEMONSTRATION = "software_followup_demonstration";
// Issue #386 behavior-rules-list roles — mirror the ROLE_RULE_LISTING_* consts
// in src/seed/roles.rs. Their surface words live in
// data/seed/meanings-behavior-rules.lino (embedded in MEANINGS_LINO above).
// isBehaviorRulesList ANDs the three compositional dimensions within one
// language (subject + request + scope) and ORs the standalone phrase role,
// matching every surface as a raw substring exactly like the Rust recogniser.
const ROLE_RULE_LISTING_SUBJECT = "rule_listing_subject";
const ROLE_RULE_LISTING_REQUEST = "rule_listing_request";
const ROLE_RULE_LISTING_SCOPE = "rule_listing_scope";
const ROLE_RULE_LISTING_PHRASE = "rule_listing_phrase";
// Does `normalized` contain any surface word of any meaning carrying `role`,
// matched as a raw substring? Unlike lexiconMentionsRole (whole-token, via
// containsProgramToken), follow-up markers are multi-word phrases ("run the
// tests", "show me"), so a token-boundary match would never find them. Mirrors
// the raw `.contains()` in follow_up_kind
// (src/solver_handlers/software_project_followup.rs).
function lexiconMentionsRoleSubstring(role, normalized) {
return meaningLexicon().some(
(meaning) =>
meaning.roles.includes(role) &&
meaning.words.some((word) => word && normalized.includes(word)),
);
}
// Does any surface form `meaning` lexicalises in one of `languages` appear in
// `normalized` as a raw substring (String.includes)? The language-restricted,
// raw-substring sibling of meaningEvidencedIn. Mirrors
// Meaning::mentions_in_languages_raw in src/seed/meanings.rs (issue #386).
function meaningMentionsInLanguagesRaw(meaning, normalized, languages) {
return meaning.lexemes.some(
(lexeme) =>
languages.includes(lexeme.language) &&
lexeme.words.some((word) => word && normalized.includes(word)),
);
}
// The first meaning (declaration order) carrying `role` whose `languages`
// surface forms occur in `normalized` as a raw substring, or null. Declaration
// order encodes priority. Mirrors Lexicon::first_role_match_in_languages_raw in
// src/seed/meanings.rs (issue #386).
function firstRoleMatchInLanguagesRaw(role, normalized, languages) {
return (
meaningsWithRole(role).find((meaning) =>
meaningMentionsInLanguagesRaw(meaning, normalized, languages),
) || null
);
}
// Does any meaning carrying `role` mention one of its `languages` surface forms
// in `normalized` as a raw substring? Mirrors
// Lexicon::mentions_role_in_languages_raw in src/seed/meanings.rs (issue #386).
function mentionsRoleInLanguagesRaw(role, normalized, languages) {
return meaningsWithRole(role).some((meaning) =>
meaningMentionsInLanguagesRaw(meaning, normalized, languages),
);
}
function detectedProgramModifiers(normalized) {
const slugs = [];
const validModifiers = programModifierSlugs();
for (const operation of operationVocabulary()) {
if (validModifiers.has(operation.slug) && operationFormMatches(normalized, operation)) {
slugs.push(operation.slug);
}
}
return slugs;
}
// --- Substitution engine (mirror of src/substitution.rs) -------------------
function unescapeLinoValue(value) {
let out = "";
for (let index = 0; index < value.length; index += 1) {
const ch = value[index];
if (ch === "\\" && index + 1 < value.length) {
const next = value[index + 1];
if (next === "n") {
out += "\n";
index += 1;
continue;
}
if (next === '"' || next === "\\") {
out += next;
index += 1;
continue;
}
}
out += ch;
}
return out;
}
function parseLinoValue(raw) {
const trimmed = raw.trim();
if (trimmed.length >= 2 && trimmed.startsWith('"') && trimmed.endsWith('"')) {
return unescapeLinoValue(trimmed.slice(1, -1));
}
return trimmed;
}
function parseLinoTree(text) {
const root = { name: "", value: "", depth: -1, children: [] };
const stack = [root];
for (const line of text.split("\n")) {
if (!line.trim()) continue;
const indent = line.length - line.trimStart().length;
const depth = indent / 2;
const rest = line.trim();
const spaceIndex = rest.indexOf(" ");
const name = spaceIndex === -1 ? rest : rest.slice(0, spaceIndex);
const value = spaceIndex === -1 ? "" : parseLinoValue(rest.slice(spaceIndex + 1));
const node = { name, value, depth, children: [] };
while (stack.length && stack[stack.length - 1].depth >= depth) stack.pop();
stack[stack.length - 1].children.push(node);
stack.push(node);
}
return root;
}
function parsePatternNode(text) {
if (!text) throw new Error("pattern node is empty");
if (text.startsWith("$")) return { kind: "variable", variable: text.slice(1) };
const dollar = text.indexOf("$");
if (dollar !== -1) {
return { kind: "prefix", prefix: text.slice(0, dollar), variable: text.slice(dollar + 1) };
}
return { kind: "literal", value: text };
}
function parseLinkPattern(text) {
const index = text.indexOf("->");
if (index === -1) throw new Error(`expected \`from -> to\`, got \`${text}\``);
return {
from: parsePatternNode(text.slice(0, index).trim()),
to: parsePatternNode(text.slice(index + 2).trim()),
};
}
function parseCrudEvent(value) {
const map = {
manual: "manual",
apply: "manual",
create: "create",
created: "create",
read: "read",
select: "read",
query: "read",
update: "update",
updated: "update",
delete: "delete",
deleted: "delete",
};
const key = String(value).trim().toLowerCase();
if (!map[key]) throw new Error(`invalid CRUD event: ${value}`);
return map[key];
}
function parseSubstitutionRule(node) {
const rule = { id: node.value, order: 0, events: [], conditions: [], actions: [] };
for (const child of node.children) {
switch (child.name) {
case "order": {
const parsed = parseInt(child.value, 10);
rule.order = Number.isNaN(parsed) ? 0 : parsed;
break;
}
case "event":
rule.events.push(parseCrudEvent(child.value));
break;
case "when":
rule.conditions.push(parseLinkPattern(child.value));
break;
case "replace": {
const add = child.children
.filter((grandchild) => grandchild.name === "with")
.map((grandchild) => parseLinkPattern(grandchild.value));
rule.actions.push({ remove: parseLinkPattern(child.value), add });
break;
}
default:
break;
}
}
return rule;
}
function parseSubstitutionRules(text) {
const tree = parseLinoTree(text.trim());
const root = tree.children[0];
if (!root || root.name !== "substitution_rules") {
throw new Error("not a substitution_rules document");
}
const idNode = root.children.find((child) => child.name === "id");
const id = idNode ? idNode.value : "";
const rules = root.children
.filter((child) => child.name === "rule")
.map(parseSubstitutionRule);
rules.sort((left, right) =>
left.order - right.order ||
(left.id < right.id ? -1 : left.id > right.id ? 1 : 0),
);
return { id, rules };
}
const LINK_KEY_SEPARATOR = "