public class WordCounter extends AbstractFlow
Flow parses input string into individual words, then performs per-word counts and other calculations like total number of words seen, average length of words seen, unique words seen, and also tracks the words most often associated with each other word.
The first Flowlet is the WordSplitter, which splits the sentence into individual words, cleans up non-alpha characters, and then sends the sentences to the WordAssociater and the words on to the WordCounter.
The next Flowlet is the WordAssociater that will track word associations between all of the words within the input string.
The next Flowlet is the Counter, which performs the necessary data operations to do the word count and count other word statistics.
The last Flowlet is the UniqueCounter, which calculates and updates the unique number of words seen.
| Constructor and Description |
|---|
WordCounter(WordCount.WordCountConfig config) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure() |
addFlowlet, addFlowlet, addFlowlet, addFlowlet, configure, configureFlow, connect, connect, connect, connect, connectStream, connectStream, getConfigurer, setDescription, setNameaddDatasetModule, addDatasetType, addStream, addStream, createDataset, createDataset, createDataset, createDatasetpublic WordCounter(WordCount.WordCountConfig config)
protected void configure()
configure in class AbstractFlowCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.