Softanza
StartFrançais
Softanza
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.
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 page
no extension
Stemmed
The text with every word reduced to its root/stem ("running" -> "run").also written: Stem
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 page
no extension
StemmedWordsInLanguage
stemming (snowball, 25 languages)
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 page
no extension
StemmedWords
stemming (snowball, 25 languages)also written: WordsStemmed
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 page
no extension
SupportedStemmerLanguages
stemming (snowball, 25 languages)no extension
SupportedLemmaLanguages
stemming (snowball, 25 languages)
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 page
no extension
Synonyms
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)
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.IsSynonymOf("an")
#--> 0
composed from the signature, run for this page
no extension
HasSynonyms
wordnet (synonyms + hypernyms)
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.HasSynonyms()
#--> 0
composed from the signature, run for this page
no extension
LemmatizedInLanguage
The text lemmatized in the given language.
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 page
no extension
Lemmatized
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: Lemma
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 page
no extension
LemmatizedWordsInLanguage
The lemma of each word, in the given language.
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 page
no extension
LemmatizedWords
The lemma of each word (English).also written: WordsLemmatized
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 page
no extension
SentimentScore
The overall sentiment score (compound polarity) in [-1, 1]: negative to positive.also written: SentimentCompound
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.SentimentScore()
#--> 0.20
composed from the signature, run for this page
no extension
The 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 IsNegative
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.Sentiment()
#--> positive
composed from the signature, run for this page
no extension
PositiveScore
The positive sentiment score of the text (VADER).
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.PositiveScore()
#--> 0.18
composed from the signature, run for this page
no extension
NegativeScore
The negative sentiment score of the text (VADER).
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.NegativeScore()
#--> 0
composed from the signature, run for this page
no extension
NeutralScore
The neutral sentiment score of the text (VADER).
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.NeutralScore()
#--> 0.82
composed from the signature, run for this page
no extension
TRUE if the sentiment score reaches +0.05. 1 examples run
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.IsPositive()
#--> 1
composed from the signature, run for this page
no extension
IsNegative
TRUE if the sentiment score is -0.05 or below.
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.IsNegative()
#--> 0
composed from the signature, run for this page
no extension
SentimentExplained
The sentiment verdict as a human-readable sentence.no extension
POSTags
The part-of-speech tag (noun, verb, adjective...) for each word.also written: PartOfSpeechTags
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 page
no extension
TaggedWords
part-of-speech tagging (penn treebank)also written: WordsWithPOS
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 page
no extension
Chunks
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)
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 page
QCSXTZZZIBWU
ParseTreeWithQ
custom cascade: paGrammar = [ [ label, "TAG-pattern" ], ... ]no extension
NounPhrases
the flagship sugar: DT? JJ* NN+ -- the classic noun-phrase shape
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 page
no extension
NamedEntities() -- [[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
#--> [ ]
#--> 1
library testno extension
NeuralEntities() -- 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
#--> [ ]
#--> 1
library testno extension
Register 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 run
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 page
no extension
Organizations
The organizations and companies mentioned in the text.no extension
Locations
The places and locations mentioned in the text.
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.Locations() )
#--> [ "Paris" ]
composed from the signature, run for this page
no extension
The 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 run
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.EntityTypeOf("an", [ "an", "a" ])
#--> an
composed from the signature, run for this page
no extension
EntitiesTypedAs(types) -- every detected entity re-typed against `types` by meaning: [[entity, best_type], ...] (DATA). 1 examples run
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 page
QCSXTZZZIBWUQQ
ContentWords
The meaningful content words, with common stopwords (the, a, of...) removed.also written: Keywords
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 page
no extension
WithoutStopwords
The text with the stopwords removed.
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.WithoutStopwords()
#--> Alice met Bob Paris weather fine
composed from the signature, run for this page
no extension
IsStopword
TRUE if the text is a stopword.
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.IsStopword()
#--> 0
composed from the signature, run for this page
no extension
ReadingEase
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: FleschKincaidGrade
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.FleschKincaidGrade()
#--> 1.90
composed from the signature, run for this page
no extension
ReadabilityExplained
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 TopKeyPhrase
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 page
QCSXTZZZIBWUQQ
TopKeyPhrase
The single best key phrase of the text.
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.TopKeyPhrase()
#--> Alice met Bob
composed from the signature, run for this page
no extension
RankedKeywords
The n most important single keywords, ranked by importance (TextRank).
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 page
QCSXTZZZIBWUQQ
SummarySentences
textrank (graph keywords + extractive summary)
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 page
QCSXTZZZIBWUQQ
SummarizedIn
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.
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 page
QCSXTZZZIBWU
ProperNouns
The proper nouns (capitalized names) in the text.
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 page
no extension
Verbs
The verbs (action words) in the text.
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 page
QCSXTZZZIBWU
Adjectives
The adjectives (describing words) in the text.
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? @@( o1.Adjectives() )
#--> [ "fine" ]
composed from the signature, run for this page
QCSXTZZZIBWU
Adverbs
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)
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 page
no extension
NegativeSentences
sentence filters (sentiment / similarity)no extension
MostPositiveSentence
sentence filters (sentiment / similarity)
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 page
no extension
MostNegativeSentence
sentence filters (sentiment / similarity)
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 page
no extension
MostSimilarSentenceTo
sentence filters (sentiment / similarity)also written: MostSemanticallySimilarSentenceTo
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 page
no extension
Upgrades 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: IsSemanticModelReady
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.HasSemanticModel()
#--> 0
composed from the signature, run for this page
no extension
Embedding() -- 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: SemanticSimilarityTo
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.SemanticSimilarityWith("an")
#--> 0
composed from the signature, run for this page
no extension
SummarizedAbstractively
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 run
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.IsSemanticallySimilarTo("an", 2)
#--> 0
composed from the signature, run for this page
no extension
Classify 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: ClassificationOf
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 page
QCSXTZZZIBWUQQ
ClassifiedAs(labels) -- the single best-matching label (DATA, a string). 1 examples run
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.ClassifiedAs([ "an", "a" ])
#--> an
composed from the signature, run for this page
QCSXTZZZIBWU
ClassificationConfidence
The score (similarity) the winning label got, in [-1, 1] (DATA).
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.ClassificationConfidence([ "an", "a" ])
#--> 0
composed from the signature, run for this page
no extension
Language
Detect which natural language the text is written in.also named: what language which tongue detect language idiom localealso written: DetectedLanguage
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.Language()
#--> english
composed from the signature, run for this page
no extension
AutoLemmatized
The text lemmatized in its own detected language.
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 page
no extension
AutoStemmed
The text stemmed in its own detected language.
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 page
no extension
Profile
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: TypeTokenRatio
composed example
o1 = new stzText("Alice met Bob in Paris. The weather was fine.")
? o1.LexicalDiversity()
#--> 1
composed from the signature, run for this page
no extension
StyleProfile
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.
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 page
no extension
ShowTagged
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