C# Class FrequencyAnalyzer.FrequencyCalculation

Contains the logic for calculating the frequency of each word in the document. This class should be run using a BackgroundWorker object, which is then passed in as a parameter in the constructor.
Datei anzeigen Open project: angusmacdonald/word-frequency-analyzer Class Usage Examples

Public Methods

Method Description
FrequencyCalculation ( BackgroundWorker bw, Words words, int start_word, int end_word, bool tosave ) : System

Set up the class with the BackgroundWorker class being used for this comptuation (to allow for callbacks), the words in the document, the total number of tokens, and an indication of whether the results will be displayed onscreen or saved to file.

isNumeric ( string val ) : bool

http://www.codeproject.com/KB/cs/IsNumeric.aspx

Private Methods

Method Description
getResult ( ) : ResultContainer

Calculate the number of occurences of each word contained in the 'words' field.

isToBeCounted ( String word ) : bool

Whether the given word is to be counted as part of the word frequencies. It will be counted if it is not part of the ignore list and (if ignoring numbers is enabled) if it is not a number.

Method Details

FrequencyCalculation() public method

Set up the class with the BackgroundWorker class being used for this comptuation (to allow for callbacks), the words in the document, the total number of tokens, and an indication of whether the results will be displayed onscreen or saved to file.
public FrequencyCalculation ( BackgroundWorker bw, Words words, int start_word, int end_word, bool tosave ) : System
bw System.ComponentModel.BackgroundWorker the BackgroundWorker class being used for this comptuation (to allow for callbacks)
words Words an array of the words in the document
start_word int the word on which this frequency calculator will start counting (including punctuation marks) from the words array. /// The lowest allowable value for this parameter is 1.
end_word int
tosave bool whether the result will be saved to CSV (true) or displayed in the taskpane (false).
return System

isNumeric() public method

http://www.codeproject.com/KB/cs/IsNumeric.aspx
public isNumeric ( string val ) : bool
val string
return bool