WordFreq: counts the frequency with which words appear in a file.
More...
#include "word_counter.h"
template<template< class K, class V > class Dict>
class WordFreq< Dict >
WordFreq: counts the frequency with which words appear in a file.
- Author
- Chase Geigle
- Date
- Spring 2011
-
Summer 2012
◆ WordFreq()
template<template< class K, class V > class Dict>
Constructs a WordFreq from the given filename.
- Parameters
-
filename | File to read in words from. |
◆ getWords()
template<template< class K, class V > class Dict>
Returns all words, along with their frequencies, that are above a given threshold.
- Parameters
-
threshold | The frequency a word must be at or above in order to be added to the returned vector. |
- Returns
- A vector of (string, int) pairs that represent words and their frequencies, filtered to only include those words with frequencies at or above threshold.
- Todo:
- Implement this function.
- See also
- char_counter.cpp if you're having trouble.
◆ filename
template<template< class K, class V > class Dict>
Name of the file we are reading from.
The documentation for this class was generated from the following files: