Class Index | File Index

Classes


Class atropa.TextAnalyzer


Version 20130311.
Represents a utility for analyzing text.
Defined in: <node_modules/atropa-TextAnalyzer/src/atropa-TextAnalyzer.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
Represents a utility for analyzing text.
Field Summary
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 Summary
Method Attributes Method Name and Description
 
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!! ☭.
Parameters:
{String} text
The text to analyze.
Returns:
{TextAnalyzer} Returns an instance of the text analyzer.
Requires:
atropa.string
atropa.arrays
atropa.setAsOptionalArg
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()
Gets an index of the text.
Author: Matthew Christopher Kastor-Inare III
☭ Hial Atropa!! ☭.
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!! ☭.
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.

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Nov 17 2022 14:29:55 GMT-0500 (Eastern Standard Time)