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.no extension
composed example
o1 = new stzWordStream()
o1.SetCaseSensitive(TRUE)
o1.Feed("Cat cat")
? o1.DistinctWords()
#--> 2composed from the signature, run for this pageEngine
(no comment in the source: the name reads as a sentence) engineno extension
Feed
feeding dataalso written: Add · FeedChunkQCSXTZZZIBWUMany
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
o1.Feed("one two two three")
? o1.NumberOfWords()
#--> 13composed from the signature, run for this pageFeedChunks
feeding datano extension
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
o1.FeedChunks([ "one two", "two three" ])
? o1.NumberOfWords()
#--> 13composed from the signature, run for this pageTopWords
[[word, count], ...] over EVERYTHING fed so far, top-N by count.no extension
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 pageWordsAndTheirCounts
[[word, count], ...] over everything fed, in first-appearance order.no extension
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 pageMostFrequentWords
Just the words of the top-N (drops the counts).no extension
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 pageMostFrequentWord
queryingno extension
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
? o1.MostFrequentWord()
#--> thecomposed from the signature, run for this pageTotalWords
Total tokens fed (with multiplicity).also written: NumberOfWordsno extension
DistinctWords
Size of the vocabulary (distinct words) accumulated so far.also written: VocabularySize · NumberOfDistinctWordsno extension
composed example
o1 = new stzWordStream()
o1.Feed("the cat saw the dog and the cat ran")
? o1.DistinctWords()
#--> 6composed from the signature, run for this pageFree
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

