module documentation

Create wordcloud images; mostly a thin wrapper module around an existing wordcloud module.

The wordcloud module we use likes to wrap all logic and parameters in one big class, so this (thin) wrapper module exists largely to separate out the counting,

  • to introduce some flexibility in how we count in a wordcloud.
  • and to make those counting functions usable for other things

That image will look a bunch cleaner when you have cleaned up the string:count, so take a look at using the counting helper functions in helpers.strings.

Function count_from_string Undocumented
Function count_from_stringlist Undocumented
Function merge_counts Undocumented
Function wordcloud_from_freqs Takes a {string: count} dict, returns a PIL image object.
Function wordcloud_from_string Work from a non-processed string; makes choices in tokenizing and counting.
Function wordcloud_from_stringlist Work from a non-processed string; makes choices in counting.
def count_from_string(s, tokenizer=wetsuite.helpers.strings.simple_tokenize, stopwords=(), stopwords_i=()):

Undocumented

Parameters
s:strUndocumented
tokenizerUndocumented
stopwordsUndocumented
stopwords_iUndocumented
def count_from_stringlist(string_list, stopwords=(), stopwords_i=()):

Undocumented

Parameters
string_list:List[str]Undocumented
stopwordsUndocumented
stopwords_iUndocumented
def merge_counts(count_dicts):

Undocumented

Parameters
count_dicts:List[dict]Undocumented
def wordcloud_from_freqs(freqs, width=1200, height=300, background_color='white', min_font_size=10, **kwargs):

Takes a {string: count} dict, returns a PIL image object.

Parameters
freqs:dictUndocumented
width:intUndocumented
height:intUndocumented
background_colorUndocumented
min_font_sizeUndocumented
**kwargsUndocumented
Returns
a PIL image (you can e.g. display() or .save() this)
def wordcloud_from_string(s, tokenizer=wetsuite.helpers.strings.simple_tokenize, counter=wetsuite.helpers.strings.count_case_insensitive, **kwargs):

Work from a non-processed string; makes choices in tokenizing and counting.

Parameters
s:strUndocumented
tokenizerUndocumented
counterUndocumented
**kwargsUndocumented
def wordcloud_from_stringlist(string_list, counter=wetsuite.helpers.strings.count_case_insensitive, **kwargs):

Work from a non-processed string; makes choices in counting.

Parameters
string_list:List[str]Undocumented
counterUndocumented
**kwargsUndocumented