The library documents itself · NLP & linguistics
stzText
82 own methods · 28 forms written with extensions, listed under their method · Also inherits from stzStringText (113)
the source: base/linguistic/stzText.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: 2 come from the library's tests; 53 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzText("Alice met Bob in Paris. The weather was fine."). 27 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
StemmedInLanguage
Reduce inflected words to their stem ("running"->"run"). Stemmed() defaults to English; *InLanguage(cLang) selects one of the 25 Snowball languages.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.StemmedInLanguage("en")
#--> alic met bob in pari. the weather was fine.composed from the signature, run for this pageStemmed
The text with every word reduced to its root/stem ("running" -> "run").also written: Stemno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.Stemmed()
#--> alic met bob in pari. the weather was fine.composed from the signature, run for this pageStemmedWordsInLanguage
stemming (snowball, 25 languages)no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.StemmedWordsInLanguage("en") )
#--> [ "alic", "met", "bob", "in", "pari", "the", "weather", "was", "fine" ]composed from the signature, run for this pageStemmedWords
stemming (snowball, 25 languages)also written: WordsStemmedno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.StemmedWords() )
#--> [ "alic", "met", "bob", "in", "pari", "the", "weather", "was", "fine" ]composed from the signature, run for this pageSupportedStemmerLanguages
stemming (snowball, 25 languages)no extension
SupportedLemmaLanguages
stemming (snowball, 25 languages)no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.SupportedLemmaLanguages() )
#--> [ "english", "french", "arabic" ]composed from the signature, run for this pageSynonyms
Words with the same or a similar meaning (synonyms, from WordNet).QCSXTZZZIBWUQQ
Hypernyms
More general "is-a" parent words for the term (dog -> animal), from WordNet.QCSXTZZZIBWUQQ
IsSynonymOf
wordnet (synonyms + hypernyms)no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.IsSynonymOf("an")
#--> 0composed from the signature, run for this pageHasSynonyms
wordnet (synonyms + hypernyms)no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.HasSynonyms()
#--> 0composed from the signature, run for this pageLemmatizedInLanguage
The text lemmatized in the given language.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.LemmatizedInLanguage("en")
#--> Alice meet Bob in Paris. The weather be fine.composed from the signature, run for this pageLemmatized
The text with every word reduced to its dictionary base form / lemma ("better" -> "good", "ran" -> "run"). Smarter than stemming.also named: base form dictionary form root word canonical form normalize words Stemmed AutoLemmatizedalso written: Lemmano extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.Lemmatized()
#--> Alice meet Bob in Paris. The weather be fine.composed from the signature, run for this pageLemmatizedWordsInLanguage
The lemma of each word, in the given language.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.LemmatizedWordsInLanguage("en") )
#--> [ "Alice", "meet", "Bob", "in", "Paris", "The", "weather", "be", "fine" ]composed from the signature, run for this pageLemmatizedWords
The lemma of each word (English).also written: WordsLemmatizedno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.LemmatizedWords() )
#--> [ "Alice", "meet", "Bob", "in", "Paris", "The", "weather", "be", "fine" ]composed from the signature, run for this pageSentimentScore
The overall sentiment score (compound polarity) in [-1, 1]: negative to positive.also written: SentimentCompoundno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.SentimentScore()
#--> 0.20composed from the signature, run for this pageThe overall tone/mood of the text as "positive", "negative", or "neutral". 1 examples runalso named: mood emotion feeling attitude opinion how positive or negative SentimentScore IsPositive IsNegativeno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.Sentiment()
#--> positivecomposed from the signature, run for this pagePositiveScore
The positive sentiment score of the text (VADER).no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.PositiveScore()
#--> 0.18composed from the signature, run for this pageNegativeScore
The negative sentiment score of the text (VADER).no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.NegativeScore()
#--> 0composed from the signature, run for this pageNeutralScore
The neutral sentiment score of the text (VADER).no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.NeutralScore()
#--> 0.82composed from the signature, run for this pageTRUE if the sentiment score reaches +0.05. 1 examples runno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.IsPositive()
#--> 1composed from the signature, run for this pageIsNegative
TRUE if the sentiment score is -0.05 or below.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.IsNegative()
#--> 0composed from the signature, run for this pageSentimentExplained
The sentiment verdict as a human-readable sentence.no extension
POSTags
The part-of-speech tag (noun, verb, adjective...) for each word.also written: PartOfSpeechTagsno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.POSTags() )
#--> [ "NNP", "VBD", "NNP", "IN", "NNP", "DT", "NN", "VBD", "JJ" ]composed from the signature, run for this pageTaggedWords
part-of-speech tagging (penn treebank)also written: WordsWithPOSno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.TaggedWords() )
#--> [ [ "Alice", "NNP" ], [ "met", "VBD" ], [ "Bob", "NNP" ], [ "in", "IN" ], [ "Paris", "NNP" ], [ "The", "DT" ], [ "weather", "NN" ], [ "was", "VBD" ], [ "fine", "JJ" ] ]composed from the signature, run for this pageChunks
POS-PATTERN CHUNKING (R3, the NLTK offensive): PATTERNS OVER TAGS. ? Q("The quick brown fox...").TextQ().Chunks("DT? JJ* NN+") #--> [ "The quick brown fox", "the lazy dog" ] Grammar: Penn tags separated by spaces, each with an optional quantifier -- ? (0/1), * (0+), + (1+), none (exactly 1). A tag matches by PREFIX (NN covers NN/NNS/NNP/NNPS). Covers NLTK's RegexpParser chunking with a cleaner grammar. The executor is a deterministic greedy scanner over the tag stream (like NLTK's); a Listex-native executor can swap in behind this same surface.no extension
ParseTree
part-of-speech tagging (penn treebank)QCSXTZZZIBWU
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.ParseTree()
#--> (S (NP Alice/NNP) (VP met/VBD (NP Bob/NNP) (PP in/IN (NP Paris/NNP))) (NP The/DT weather/NN) (VP was/VBD) fine/JJ)composed from the signature, run for this pageParseTreeWithQ
custom cascade: paGrammar = [ [ label, "TAG-pattern" ], ... ]no extension
NounPhrases
the flagship sugar: DT? JJ* NN+ -- the classic noun-phrase shapeno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.NounPhrases() )
#--> [ "Alice", "Bob", "Paris", "The weather" ]composed from the signature, run for this pageNamedEntities() -- [[entity, type], ...]. Upgrades to TRANSFORMER NER (a BERT token-classification head) when a NER-head GGUF is loaded (StzUseNeuralModel with e.g. bert-base-NER); otherwise the rule-based engine NER. Both emit the same PERSON/ORGANIZATION/LOCATION type vocabulary, so PersonNames()/ Organizations()/Locations() and EntitiesOfType() work either way. 2 examples runalso named: who and what is mentioned people places organizations proper names PersonNames Organizations Locations EntitiesOfTypealso written: Entities
t = new stzText("Barack Obama visited Paris.")
# NeuralEntities() is empty without a NER-head model
? @@(t.NeuralEntities())
# NamedEntities() still works via the rule-based fallback
? len(t.NamedEntities()) >= 1
#--> [ ]
#--> 1library testno extensionNeuralEntities() -- the transformer-NER result explicitly: [[entity, type], ...] via the loaded NER-head model; [] if none is loaded (DATA). 1 examples run
t = new stzText("Barack Obama visited Paris.")
# NeuralEntities() is empty without a NER-head model
? @@(t.NeuralEntities())
# NamedEntities() still works via the rule-based fallback
? len(t.NamedEntities()) >= 1
#--> [ ]
#--> 1library testno extensionRegister this text's named entities into the shared world ($oWorldEntities) -- EXPLICIT by design: NER over arbitrary text must never pollute the world silently. Returns how many were NEW. 1 examples runalso written: EntitiesToWorldno extension
EntitiesOfType
The named entities of one type (e.g. "PERSON") mentioned in the text.no extension
The people (person names) mentioned in the text. 1 examples runno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.PersonNames() )
#--> [ "Alice", "Bob" ]composed from the signature, run for this pageOrganizations
The organizations and companies mentioned in the text.no extension
Locations
The places and locations mentioned in the text.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.Locations() )
#--> [ "Paris" ]composed from the signature, run for this pageThe rule-based NER above detects + coarsely types spans. These re-TYPE an entity against ARBITRARY, user-defined types BY MEANING (zero-shot, via the neural model when loaded; lexical fallback otherwise) -- so the type set adapts to any domain, and "Paris" the city vs the person is disambiguated by meaning. (A real token-classification NER-head GGUF, once available, plugs onto the per-token engine substrate -- neural_embed_tokens -- underneath.) EntityTypeOf(entity, types) -- the candidate type whose MEANING best matches the entity mention (DATA, a string). 1 examples runno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.EntityTypeOf("an", [ "an", "a" ])
#--> ancomposed from the signature, run for this pageEntitiesTypedAs(types) -- every detected entity re-typed against `types` by meaning: [[entity, best_type], ...] (DATA). 1 examples runQCSXTZZZIBWUQQ
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.EntitiesTypedAs([ "an", "a" ]) )
#--> [ [ "Alice", "an" ], [ "Bob", "an" ], [ "Paris", "an" ] ]composed from the signature, run for this pageContentWords
The meaningful content words, with common stopwords (the, a, of...) removed.also written: Keywordsno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.ContentWords() )
#--> [ "Alice", "met", "Bob", "Paris", "weather", "fine" ]composed from the signature, run for this pageWithoutStopwords
The text with the stopwords removed.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.WithoutStopwords()
#--> Alice met Bob Paris weather finecomposed from the signature, run for this pageIsStopword
TRUE if the text is a stopword.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.IsStopword()
#--> 0composed from the signature, run for this pageReadingEase
How easy the text is to read as a Flesch reading-ease score (higher = easier).also written: FleschReadingEaseno extension
ReadabilityGrade
The US school grade level needed to read the text (Flesch-Kincaid grade).also written: FleschKincaidGradeno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.FleschKincaidGrade()
#--> 1.90composed from the signature, run for this pageReadabilityExplained
The readability verdict as a human-readable sentence.no extension
KeyPhrases
The n most important multi-word key phrases (main topics/themes) in the text.also named: main topics themes subjects what it is about important phrases main ideas key ideas key points the gist RankedKeywords TopKeyPhraseQCSXTZZZIBWUQQ
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.KeyPhrases(2) )
#--> [ "Alice met Bob", "Paris" ]composed from the signature, run for this pageTopKeyPhrase
The single best key phrase of the text.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.TopKeyPhrase()
#--> Alice met Bobcomposed from the signature, run for this pageRankedKeywords
The n most important single keywords, ranked by importance (TextRank).QCSXTZZZIBWUQQ
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.RankedKeywords(2) )
#--> [ "Bob", "Paris" ]composed from the signature, run for this pageSummarySentences
textrank (graph keywords + extractive summary)QCSXTZZZIBWUQQ
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.SummarySentences(2) )
#--> [ "Alice met Bob in Paris.", "The weather was fine." ]composed from the signature, run for this pageSummarizedIn
A short summary of the text in n sentences (extractive: the most important sentences, joined). Summary(n) is the alias.also named: summarize summarise shorten condense brief briefly tldr gist key points SummarySentences KeyPhrasesalso written: Summaryno extension
WordsThatAre
The words carrying the given Penn part-of-speech tag.QCSXTZZZIBWU
Nouns
The nouns (naming words: people, things, ideas) in the text.QCSXTZZZIBWU
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.Nouns() )
#--> [ "Alice", "Bob", "Paris", "weather" ]composed from the signature, run for this pageProperNouns
The proper nouns (capitalized names) in the text.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.ProperNouns() )
#--> [ "Alice", "Bob", "Paris" ]composed from the signature, run for this pageVerbs
The verbs (action words) in the text.QCSXTZZZIBWU
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.Verbs() )
#--> [ "met", "was" ]composed from the signature, run for this pageAdjectives
The adjectives (describing words) in the text.QCSXTZZZIBWU
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.Adjectives() )
#--> [ "fine" ]composed from the signature, run for this pageAdverbs
The adverbs (how/when/where modifiers) in the text.no extension
Pronouns
The pronouns (he, she, it, they...) in the text.no extension
SentencesThatAre
sentence filters (sentiment / similarity)no extension
PositiveSentences
sentence filters (sentiment / similarity)no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.PositiveSentences() )
#--> [ "The weather was fine." ]composed from the signature, run for this pageNegativeSentences
sentence filters (sentiment / similarity)no extension
MostPositiveSentence
sentence filters (sentiment / similarity)no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.MostPositiveSentence()
#--> The weather was fine.composed from the signature, run for this pageMostNegativeSentence
sentence filters (sentiment / similarity)no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.MostNegativeSentence()
#--> Alice met Bob in Paris.composed from the signature, run for this pageMostSimilarSentenceTo
sentence filters (sentiment / similarity)also written: MostSemanticallySimilarSentenceTono extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.MostSimilarSentenceTo("an")
#--> Alice met Bob in Paris.composed from the signature, run for this pageUpgrades text similarity from lexical bag-of-words to true MEANING via a runtime neural model (load one process-wide with StzNeuralModelQ(path)). With no model loaded these degrade gracefully to the lexical path, so code keeps working and auto-improves once a model is present. TRUE if a runtime embedding model is loaded and ready. 1 examples runalso written: IsSemanticModelReadyno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.HasSemanticModel()
#--> 0composed from the signature, run for this pageEmbedding() -- this text's sentence-embedding vector (list of floats) via the loaded model; [] if none is loaded (DATA, per Softanza's Q rule). 1 examples runalso written: EmbeddingVectorQCSXTZZZIBWU
SemanticSimilarityWith(other) -- cosine of the two texts' embeddings in [-1, 1]; falls back to lexical cosine when no model is loaded (DATA). 1 examples runalso written: SemanticSimilarityTono extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.SemanticSimilarityWith("an")
#--> 0composed from the signature, run for this pageSummarizedAbstractively
IsSemanticallySimilarTo(other, threshold) -- TRUE if the meaning-similarity meets the threshold (default 0.5). GENERATE a fresh summary of the text (not sentence extraction). When no generative model is loaded, degrades to the extractive Summary.QCSXTZZZIBWU
AnswerAbout
ANSWER a question ABOUT the text (grounded generation): the text is the context, the question is asked over it. "" when no model / no text.QCSXTZZZIBWU
semantic layer (neural embeddings) 2 examples runno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.IsSemanticallySimilarTo("an", 2)
#--> 0composed from the signature, run for this pageClassify this text against ARBITRARY candidate labels with no training: rank each label by how closely its MEANING matches the text (embedding cosine when a model is loaded, else lexical). Pass richer label strings (e.g. "about sports") for sharper separation. Classify(labels) -- ranked [label, score] pairs, most similar first (DATA). 1 examples runalso written: ClassificationOfQCSXTZZZIBWUQQ
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.Classify([ "an", "a" ]) )
#--> [ [ "an", 0 ], [ "a", 0 ] ]composed from the signature, run for this pageClassifiedAs(labels) -- the single best-matching label (DATA, a string). 1 examples runQCSXTZZZIBWU
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.ClassifiedAs([ "an", "a" ])
#--> ancomposed from the signature, run for this pageClassificationConfidence
The score (similarity) the winning label got, in [-1, 1] (DATA).no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.ClassificationConfidence([ "an", "a" ])
#--> 0composed from the signature, run for this pageLanguage
Detect which natural language the text is written in.also named: what language which tongue detect language idiom localealso written: DetectedLanguageno extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.Language()
#--> englishcomposed from the signature, run for this pageAutoLemmatized
The text lemmatized in its own detected language.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.AutoLemmatized()
#--> Alice meet Bob in Paris. The weather be fine.composed from the signature, run for this pageAutoStemmed
The text stemmed in its own detected language.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.AutoStemmed()
#--> alic met bob in pari. the weather was fine.composed from the signature, run for this pageProfile
A content profile of the text (keywords, entities, sentiment...).no extension
LexicalDiversity
Vocabulary richness: the ratio of unique words to total words (type-token ratio).also written: TypeTokenRationo extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.LexicalDiversity()
#--> 1composed from the signature, run for this pageStyleProfile
A style profile of the text (word lengths, variety...).no extension
InContextWithWindow
The occurrences of the word with n words of context around each.no extension
InContext
Every occurrence of a word shown with its surrounding context (a concordance / keyword-in-context view).also written: Concordanceno extension
ComparedTo
Compare this text with another: their similarity, sentiment difference, readability difference, and shared keywords.no extension
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.ComparedTo("an") )
#--> [ [ "similarity", 0 ], [ "sentiment_delta", 0.20 ], [ "grade_delta", 5.30 ], [ "shared_keywords", [ ] ] ]composed from the signature, run for this pageShowTagged
Print each word with its part-of-speech tag.no extension
ShowEntities
Print the named entities found in the text.no extension
ShowSentiment
Print the sentiment of each sentence.no extension
The sentences of the text, as a list.defined in stzStringText; its extensions hereQCSXTZZZIBWUQQ
The words of the text, as a list (engine-extracted).defined in stzStringText; its extensions hereQCSXTZZZIBWUQQExcept

