AnagramFinder class.
More...
#include "anagram_finder.h"
template<template< class K, class V > class Dict>
class AnagramFinder< Dict >
AnagramFinder class.
Provides an interface for finding anagrams in a set of strings or within a file.
- Author
- Chase Geigle
- Date
- Spring 2011
-
Summer 2012
◆ AnagramFinder() [1/2]
template<template< class K, class V > class Dict>
Constructs an AnagramFinder based on a filename to read potential anagrams from.
- Parameters
-
ifilename | The name of the file to read in. |
◆ AnagramFinder() [2/2]
template<template< class K, class V > class Dict>
Constructs an AnagramFinder based on a set of strings instead of a filename.
- Parameters
-
istrings | The set of strings to use for this finder. |
◆ getAnagrams()
template<template< class K, class V > class Dict>
Retrieves a set of words that are anagrams of a given word.
- Parameters
-
word | The word we wish to find anagrams of inside the finder. |
◆ writeAnagrams()
template<template< class K, class V > class Dict>
Retrieves a set of anagrams in the finder of a given words, but writes them out to a file instead of returning a vector.
- Parameters
-
word | The word we wish to find anagrams of inside the finder. |
output_file | The name of the file we want to write to. |
◆ checkWord()
template<template< class K, class V > class Dict>
Determines if the given word is an anagram of the test word.
- Parameters
-
word | Word that is possibly an anagram. |
test | Word to check against. |
- Returns
- A boolean value indicating whether word is an anagram of test.
- Todo:
- Implement this function! You should use the provided templated hashtable class Dict.
◆ file
template<template< class K, class V > class Dict>
Indicates whether a file was used to build the finder or not.
◆ filename
template<template< class K, class V > class Dict>
Name of the file to read anagrams from.
Only set if the file-based constructor is used.
◆ strings
template<template< class K, class V > class Dict>
Set of strings to find anagrams in.
Only set if the std::vector constructor is used.
The documentation for this class was generated from the following files: