The library documents itself · NLP & linguistics
stzNaturalEngine
64 own methods · 0 forms written with extensions, listed under their method
the source: base/natural/stzNatural.ring(opens in a new tab) · All classes · The area reference: NLP & linguistics
Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean
Examples: 0 come from the library's tests; 24 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzNaturalEngine("en", "", [], ""). 40 methods have none yet. Examples run on 2026-10-03 20:34 inside the library at commit 0e72e2e2c.
Method
Explanation, as the source carries it
init
(no comment in the source: the name reads as a sentence) initno extension
InterpolateContext
(no comment in the source: the name reads as a sentence) interpolate contextno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.InterpolateContext("a", [ 2, 3 ])
#--> acomposed from the signature, run for this pageFindContextPlaceholders
(no comment in the source: the name reads as a sentence) find context placeholdersno extension
GetContextValue
(no comment in the source: the name reads as a sentence) get context valueno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.GetContextValue("a", [ 2, 3 ])
#--> not_foundcomposed from the signature, run for this pageNormalizeKey
(no comment in the source: the name reads as a sentence) normalize keyno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.NormalizeKey("a")
#--> Acomposed from the signature, run for this pageFindInList
(no comment in the source: the name reads as a sentence) find in listno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.FindInList([ 2, 3 ], "a")
#--> not_foundcomposed from the signature, run for this pageExecute
(no comment in the source: the name reads as a sentence) executeno extension
TokenizeCode
(no comment in the source: the name reads as a sentence) tokenize codeno extension
SmartSplit
(no comment in the source: the name reads as a sentence) smart splitno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? @@( o1.SmartSplit("a") )
#--> [ "a" ]composed from the signature, run for this pageLooksEvalSafeList
Only these SHAPES may be eval'd as list literals: a bracketed [ ... ] form, or a pure numeric range like 1:5. Prose that isListInString() mistakes for a range ("note:") is rejected.no extension
PairedQuoteSections
Non-overlapping quote pairing: positions 1-2, 3-4, ... form the quoted sections. An unmatched trailing quote is simply ignored. An apostrophe with a LETTER on both sides is part of a word ("it's", "don't"), not a string delimiter.no extension
NormalizeForeignDigits
Normalize the language's digits and list punctuation OUTSIDE quoted strings (Arabic-Indic numerals in a value list must become ASCII for the list eval; a quoted string keeps its script untouched).no extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.NormalizeForeignDigits("a")
#--> acomposed from the signature, run for this pageMapDigits
(no comment in the source: the name reads as a sentence) map digitsno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.MapDigits("a")
#--> acomposed from the signature, run for this pageStripEdgePunct
A word without clinging trailing punctuation ("empty?" -> "empty"). BYTE-based whole-mark matching (StzLeft/StzRight take byte counts while StzLen counts codepoints -- mixing them mangles multibyte words; exact byte-suffix comparison is UTF-8-safe).no extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.StripEdgePunct("a")
#--> acomposed from the signature, run for this pagePhraseResolve
MULTI-WORD PHRASE resolution: head word + up to two following content words (ignored words skipped), longest EXACT method-name join wins -- "remove [its] duplicates" -> removeduplicates, "is [it] empty" -> isempty. Returns [ semanticId, nextIndex, matchedPhrase ] or [ "", 0, "" ]. Only consulted when at least one word is dictionary-unknown, so pure-dictionary programs never pay the lazy lexicon growth.no extension
LoadLanguageData
(no comment in the source: the name reads as a sentence) load language datano extension
LangResolvable
May unknown words of the active language be resolved at all? English always (the unified lexicon); others when a pack exists.no extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.LangResolvable()
#--> 1composed from the signature, run for this pageSetStrict
(no comment in the source: the name reads as a sentence) set strictno extension
SetAllowedOperations
(no comment in the source: the name reads as a sentence) set allowed operationsno extension
FindLanguageDefinition
(no comment in the source: the name reads as a sentence) find language definitionno extension
Process
(no comment in the source: the name reads as a sentence) processno extension
ConvertToSemanticTokens
(no comment in the source: the name reads as a sentence) convert to semantic tokensno extension
ShouldTreatAsLiteral
(no comment in the source: the name reads as a sentence) should treat as literalno extension
FallbackEligible
May an unknown word at the current position be fallback-resolved to an action? NO whenever the word sits in a VALUE position: right after an OBJECT_* (it is the creation value: Create a string with capitals), right after a VALUE_INDICATOR, or right after a METHOD_* that still expects parameters (Replace dot with underscore). In all those spots the word must stay a literal -- resolution would corrupt the program.no extension
IsIgnoredWord
(no comment in the source: the name reads as a sentence) is ignored wordno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.IsIgnoredWord("a")
#--> 1composed from the signature, run for this pageToSemantic
(no comment in the source: the name reads as a sentence) to semanticno extension
GenerateCodeFromSemantics
(no comment in the source: the name reads as a sentence) generate code from semanticsalso written: Codeno extension
FindDefineIndex
(no comment in the source: the name reads as a sentence) find define indexno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.FindDefineIndex("a")
#--> 0composed from the signature, run for this pageProcessObjectCreation
(no comment in the source: the name reads as a sentence) process object creationno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? @@( o1.ProcessObjectCreation(2) )
#--> [ [ "code", "" ], [ "next_index", 3 ] ]composed from the signature, run for this pageProcessObjectNaming
'... called <name>': alias the CURRENT object as o_<name>. The next literal token after NAME_INDICATOR is the name (guards make sure it stayed literal even if it collides with a dictionary word).no extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? @@( o1.ProcessObjectNaming(2) )
#--> [ [ "code", "" ], [ "next_index", 3 ] ]composed from the signature, run for this pageProcessObjectSwitch
'Use <name>': switch the live object to a previously named one. Unknown names are skipped with a debug note (permissive execution).no extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.ProcessObjectSwitch(2)
#--> 3composed from the signature, run for this pageProcessValueKeep
'Keep it as <name>': bind the current result to a VALUE variable. pbFromQuery says whether a query line just set @result.no extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? @@( o1.ProcessValueKeep(2, TRUE) )
#--> [ [ "code", "" ], [ "next_index", 3 ] ]composed from the signature, run for this pageValueRefOf
RECALL: the bound variable for a literal token, or "" -- only bare WORDS recall (a quoted 'sep' is data, never a reference).no extension
SanitizedName
(no comment in the source: the name reads as a sentence) sanitized nameno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.SanitizedName("a")
#--> acomposed from the signature, run for this pageNamedObjects
(no comment in the source: the name reads as a sentence) named objectsno extension
ProcessMethod
(no comment in the source: the name reads as a sentence) process methodno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? @@( o1.ProcessMethod(2, "a") )
#--> [ [ "code", "" ], [ "next_index", 3 ] ]composed from the signature, run for this pageExtractMethodParameters
(no comment in the source: the name reads as a sentence) extract method parametersno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? @@( o1.ExtractMethodParameters(2, 5) )
#--> [ [ "params", [ ] ], [ "next_index", 3 ] ]composed from the signature, run for this pageExtractParamsBackward
VERB-FINAL grammar: the parameters precede their verb ("'.'" instead- of "'_'" put). Walk backward to the previous action/creation boundary collecting unconsumed literals, keep the LAST nParamCount in textual order, and mark them consumed so no later verb re-grabs them.no extension
ProcessMethodWithModifiers
(no comment in the source: the name reads as a sentence) process method with modifiersno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? @@( o1.ProcessMethodWithModifiers(2, "a") )
#--> [ [ "code", "" ], [ "next_index", 3 ] ]composed from the signature, run for this pageGetSemanticOperation
(no comment in the source: the name reads as a sentence) get semantic operationno extension
Result
(no comment in the source: the name reads as a sentence) resultno extension
Answers
INTERROGATIVE NARRATIONS (the stzChainOfTruth absorption, NATURAL_VISION step 4): every QUERY in the narration records its answer, in order. A chain of truth is now just a narration that asks several questions: Naturally("Create a string with 'ring' Is it lowercase ? Does it contain 'g' ?").AllYes() #--> 1 Result() stays "the last thing produced" (unchanged contract); Answers() exposes the full record; AllYes()/AnyYes() fold it.no extension
AllYes
(no comment in the source: the name reads as a sentence) all yesalso written: AllTrueno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.AllYes()
#--> 0composed from the signature, run for this pageAnyYes
(no comment in the source: the name reads as a sentence) any yesalso written: AnyTrueno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.AnyYes()
#--> 0composed from the signature, run for this pageOriginalCode
(no comment in the source: the name reads as a sentence) original codeno extension
NaturalCode
(no comment in the source: the name reads as a sentence) natural codeno extension
Understood
PARAPHRASE-BACK (the Boeing-CPL trust loop): say what was UNDERSTOOD, in plain words derived from the interpreted tokens -- so the writer of a loosely-phrased (or vocalized Arabic) narration sees the canonical reading before trusting the result.no extension
SuggestNext
(no comment in the source: the name reads as a sentence) suggest nextno extension
Unresolved
UNDERSTANDABILITY: the action-position words this run could not interpret, each with the nearest known word as a suggestion -- [ [word, suggestion], ... ]. Execution is permissive (unknown words degrade to literals); this is the honest report of it.no extension
UnderstoodAll
(no comment in the source: the name reads as a sentence) understood allno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.UnderstoodAll()
#--> 1composed from the signature, run for this pageAnalyze
Dry run: tokenize + interpret WITHOUT generating or executing any code. Returns the lint report.no extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? @@( o1.Analyze("a") )
#--> [ [ "understood", 1 ], [ "unresolved", [ ] ] ]composed from the signature, run for this pageContext
(no comment in the source: the name reads as a sentence) contextno extension
EnableDebug
(no comment in the source: the name reads as a sentence) enable debugno extension
DisableDebug
(no comment in the source: the name reads as a sentence) disable debugno extension
AddToDebugLog
(no comment in the source: the name reads as a sentence) add to debug logno extension
DebugLog
(no comment in the source: the name reads as a sentence) debug logno extension
ClearDebugLog
(no comment in the source: the name reads as a sentence) clear debug logno extension
ClearDebug
(no comment in the source: the name reads as a sentence) clear debugno extension
Language
(no comment in the source: the name reads as a sentence) languageno extension
composed example
o1 = new stzNaturalEngine("en", "", [], "")
? o1.Language()
#--> encomposed from the signature, run for this pageIgnoredWords
(no comment in the source: the name reads as a sentence) ignored wordsno extension
Mappings
(no comment in the source: the name reads as a sentence) mappingsno extension
Values
(no comment in the source: the name reads as a sentence) valuesno extension
Tokens
(no comment in the source: the name reads as a sentence) tokensno extension
Object
(no comment in the source: the name reads as a sentence) objectno extension

