Class atropa.TextAnalyzer
Version
20130311.
Represents a utility for analyzing text.
Defined in: <node_modules/atropa-TextAnalyzer/src/atropa-TextAnalyzer.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
atropa.TextAnalyzer(text)
Represents a utility for analyzing text.
|
Field Attributes | Field Name and Description |
---|---|
The supplied text.
|
|
Gives the count of words in the text.
|
|
An array of every word in the supplied text.
|
Method Attributes | Method Name and Description |
---|---|
getIndex()
Gets an index of the text.
|
|
getPhraseFrequency(phraseLength)
Gets phrases of the specified length from the text.
|
|
Get the frequency data for each unique word in
the text.
|
Class Detail
atropa.TextAnalyzer(text)
Represents a utility for analyzing text.
Author: Matthew Christopher Kastor-Inare III
☭ Hial Atropa!! ☭.
Author: Matthew Christopher Kastor-Inare III
☭ Hial Atropa!! ☭.
- Parameters:
- {String} text
- The text to analyze.
- Returns:
- {TextAnalyzer} Returns an instance of the text analyzer.
Field Detail
{String}
text
The supplied text. Defaults to an empty string.
{Number}
wordCount
Gives the count of words in the text. Defaults to 0.
{Array}
words
An array of every word in the supplied text.
Defaults to an empty array.
Method Detail
{Array}
getIndex()
- Returns:
- {Array} Returns an array of unique values derived from the text given.
{Object}
getPhraseFrequency(phraseLength)
Gets phrases of the specified length from the text.
- Parameters:
- {Number} phraseLength
- The length of the phrases to extract from the text. Defaults to 2.
- Returns:
- {Object} Returns an object whose keys are phrases and whose values are the number of occurrences of the phrase.
{Object}
getWordFrequency()
Get the frequency data for each unique word in
the text.
Author: Matthew Christopher Kastor-Inare III
☭ Hial Atropa!! ☭.
Author: Matthew Christopher Kastor-Inare III
☭ Hial Atropa!! ☭.
- Returns:
- {Object} Returns an object whose keys are the unique words from the given text and whose values are the count of each words occurrence.