Softanza
StartFrançais
Softanza
The library documents itself · String

stzWordStream

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

the source: base/string/stzWordStream.ring(opens in a new tab) · All classes · The area reference: String

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; 8 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzWordStream() o1.Feed("the cat saw the dog and the cat ran"). 5 methods have none yet. Examples run on 2026-10-04 07:31 inside the library at commit 0e72e2e2c.

Method
Explanation, as the source carries it
init
Default = case-INsensitive (folded counting). For case-sensitive accumulation use StzWordStreamCS(1) or .SetCaseSensitive(1) before feeding.no extension
SetCaseSensitive
Reconfigure case-sensitivity. Only meaningful BEFORE any Feed -- it discards the (empty) accumulator and starts a fresh one.
composed example
o1 = new stzWordStream()
o1.SetCaseSensitive(TRUE)
o1.Feed("Cat cat")
? o1.DistinctWords()
#--> 2
composed from the signature, run for this page
no extension
Engine
(no comment in the source: the name reads as a sentence) engineno extension
Feed
feeding dataalso written: Add · FeedChunk
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
o1.Feed("one two two three")
? o1.NumberOfWords()
#--> 13
composed from the signature, run for this page
QCSXTZZZIBWUMany
FeedChunks
feeding data
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
o1.FeedChunks([ "one two", "two three" ])
? o1.NumberOfWords()
#--> 13
composed from the signature, run for this page
no extension
TopWords
[[word, count], ...] over EVERYTHING fed so far, top-N by count.
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
? @@( o1.TopWords(2) )
#--> [ [ "the", 3 ], [ "cat", 2 ] ]
composed from the signature, run for this page
no extension
WordsAndTheirCounts
[[word, count], ...] over everything fed, in first-appearance order.
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
? @@( o1.WordsAndTheirCounts() )
#--> [ [ "the", 3 ], [ "cat", 2 ], [ "saw", 1 ], [ "dog", 1 ], [ "and", 1 ], [ "ran", 1 ] ]
composed from the signature, run for this page
no extension
MostFrequentWords
Just the words of the top-N (drops the counts).
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
? @@( o1.MostFrequentWords(2) )
#--> [ "the", "cat" ]
composed from the signature, run for this page
no extension
MostFrequentWord
querying
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
? o1.MostFrequentWord()
#--> the
composed from the signature, run for this page
no extension
TotalWords
Total tokens fed (with multiplicity).also written: NumberOfWordsno extension
DistinctWords
Size of the vocabulary (distinct words) accumulated so far.also written: VocabularySize · NumberOfDistinctWords
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
? o1.DistinctWords()
#--> 6
composed from the signature, run for this page
no extension
Free
Haro has no destructors -- free the engine-side accumulator explicitly when done (safe to call more than once).no extension
Release
Same as Free: Haro has no destructors -- free the engine-side accumulator explicitly when done (safe to call more than once).no extension