string_stats library

string_stats provides utility functions and classes for determining basic frequency statistics on strings. Provides support for asynchronous or incremental accumulation.

Classes

AllCharFrequencyCounter
Facilitates performing all_char_frequency on a stream of strings.
AllWordFrequencyCounter
Facilitates performing all_word_frequency on a stream of strings.
CharCounter
Facilitates performing char_count on a stream of strings.
CharFrequencyCounter
Facilitates performing char_frequency on a stream of strings.
Position
Position class represents a substrings beginning and ending position. Within a Greater String.
StatisticsCounter
Facilitates collecting statistics on a stream of strings.
StringStatistics
SubStringFrequencyCounter
Facilitates performing substring_frequency on a stream of strings.
WordCounter
Facilitates performing word_count on a stream of strings.
WordFrequencyCounter
Facilitates performing word_frequency on a stream of strings.

Extensions

StringTests on String

Functions

allCharFrequency(String str, {bool filterNonChars = true}) Map<String, int>
Counts the frequency of all characters in the parameter string.
allPositionsWord(String str, String word, {String leftOvers = '', bool continues = false, bool ignorePunctuation = false}) Set<Position>
Determines all of the Positions of a specified word in parameter string str.
allWordFrequency(String str, {String leftOvers = '', bool continues = false, bool ignorePunctuation = false}) Map<String, int>
Returns the frequency of all words in a given string str.
allWordsPositions(String str, {String leftOvers = '', bool continues = false, bool ignorePunctuation = false}) Map<String, Set<Position>>
Returns the Positions of every word in the string.
charCount(String str, {bool filterNonChars = true}) int
Counts the number of characters in str.
charFrequency(String str, String char, {bool filterNonChars = true}) int
Determines the frequency of char in str.
emptyLineCount(String str) int
Counts the number of empty lines in str.
firstPositionWord(String? str, String? word, {String? leftOvers = '', bool? continues = false, bool? ignorePunctuation = false}) Position?
Returns the first Position of word in the str.
lineCount(String str) int
Determines the number of lines in str.
nonEmptyLineCount(String str) int
Determines the number of lines that are non-empty.
statistics(String str, {bool filterNonChars = true, String leftOvers = '', bool continues = false, bool inWord = false, bool ignorePunctuation = false}) StringStatistics
Finds the data points in StringStatistics for provided string.
subStringFrequency(String? str, String? substr, {int? lastPos = 0}) int?
Finds the number of times substr is present within str.
wordCount(String str, {bool inWord = false, bool ignorePunctuation = false}) int
Finds the number of words in str
wordFrequency(String? str, String? word, {int? lastPos = 0, bool? ignorePunctuation = false}) int?
Determines the frequency of word within string.