Softanza
StartFrançais
Softanza
The library documents itself · NLP & linguistics

stzCorpus

19 own methods · 1 forms written with extensions, listed under their method

the source: base/linguistic/stzCorpus.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; 11 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzCorpus("seed document about cats"). 8 methods have none yet. Examples run on 2026-10-03 12:54 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
AddDocument
(no comment in the source: the name reads as a sentence) add documentQCSXTZZZIBWU
Documents
(no comment in the source: the name reads as a sentence) documents
composed example
o1 = new stzCorpus("seed document about cats")
? @@( o1.Documents() )
#--> [ "seed document about cats" ]
composed from the signature, run for this page
no extension
NumberOfDocuments
(no comment in the source: the name reads as a sentence) number of documents
composed example
o1 = new stzCorpus("seed document about cats")
? o1.NumberOfDocuments()
#--> 1
composed from the signature, run for this page
no extension
FreeModel
Haro has no destructors -- free the engine model explicitly when done.no extension
FreeLm
Same as FreeModel: Haro has no destructors -- free the engine model explicitly when done.no extension
NumberOfWords
vocabulary & frequency
composed example
o1 = new stzCorpus("seed document about cats")
? o1.NumberOfWords()
#--> 4
composed from the signature, run for this page
no extension
Vocabulary
(no comment in the source: the name reads as a sentence) vocabulary
composed example
o1 = new stzCorpus("seed document about cats")
? @@( o1.Vocabulary() )
#--> [ "document", "cats", "seed", "about" ]
composed from the signature, run for this page
no extension
VocabularySize
(no comment in the source: the name reads as a sentence) vocabulary size
composed example
o1 = new stzCorpus("seed document about cats")
? o1.VocabularySize()
#--> 4
composed from the signature, run for this page
no extension
FreqOf
(no comment in the source: the name reads as a sentence) freq of
composed example
o1 = new stzCorpus("seed document about cats")
? o1.FreqOf("an")
#--> 0
composed from the signature, run for this page
no extension
MostFrequent
top-n words by count, as [ word, count ] pairs (engine-sorted)
composed example
o1 = new stzCorpus("seed document about cats")
? @@( o1.MostFrequent(2) )
#--> [ [ "document", 1 ], [ "cats", 1 ] ]
composed from the signature, run for this page
no extension
BigramProbability
P(w2|w1) = (count(w1 w2) + 1) / (count(w1) + V) -- Laplace smoothing
composed example
o1 = new stzCorpus("seed document about cats")
? o1.BigramProbability("an", "an")
#--> 0.25
composed from the signature, run for this page
no extension
LogProbability
(no comment in the source: the name reads as a sentence) log probability
composed example
o1 = new stzCorpus("seed document about cats")
? o1.LogProbability("an")
#--> 0
composed from the signature, run for this page
no extension
Perplexity
perplexity = exp( -avg log P ) -- LOWER means more in-domain. The scalar formula is Haro's to craft; the log-probability under it is the engine's.no extension
NumberOfDocumentsWith
TF-IDF (the vectorizer feeding the ML floor)
composed example
o1 = new stzCorpus("seed document about cats")
? o1.NumberOfDocumentsWith("an")
#--> 0
composed from the signature, run for this page
no extension
TfOf
(no comment in the source: the name reads as a sentence) tf ofno extension
IdfOf
smoothed idf = log( (1+D) / (1+df) ) + 1 -- computed engine-side, so the formula lives in ONE place and TopTermsOf cannot drift from it.
composed example
o1 = new stzCorpus("seed document about cats")
? o1.IdfOf("an")
#--> 1.69
composed from the signature, run for this page
no extension
TfIdfOf
(no comment in the source: the name reads as a sentence) tf idf ofno extension
TopTermsOf
the document's most DISTINCTIVE terms by TF-IDF (engine-sorted), as [ word, tfidf ] pairsno extension