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 |
Undocumented |
Function | count |
Undocumented |
Function | merge |
Undocumented |
Function | wordcloud |
Takes a {string: count} dict, returns a PIL image object. |
Function | wordcloud |
Work from a non-processed string; makes choices in tokenizing and counting. |
Function | wordcloud |
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:str | Undocumented |
tokenizer | Undocumented |
stopwords | Undocumented |
stopwords | 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:dict | Undocumented |
width:int | Undocumented |
height:int | Undocumented |
background | Undocumented |
min | Undocumented |
**kwargs | Undocumented |
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:str | Undocumented |
tokenizer | Undocumented |
counter | Undocumented |
**kwargs | Undocumented |
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 | |
stringList[ | Undocumented |
counter | Undocumented |
**kwargs | Undocumented |