bag

fun String.bag(filter: String = "default", stemmer: Stemmer? = porter): Map<String, Int>

Returns the bag of words. The bag-of-words model is a simple representation of text as the bag of its words, disregarding grammar and word order but keeping multiplicity.

Parameters

filter

stop list for filtering.

stemmer

stemmer to transform a word into its root form.