-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDictionary.h
More file actions
80 lines (57 loc) · 1.63 KB
/
Dictionary.h
File metadata and controls
80 lines (57 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef DICTIONARY_H
#define DICTIONARY_H
#include <vector>
#include <string>
/*
Author: Steven Steele
Date: February 19, 2018
Assignment: Lab_02
*/
/*
Class to use a dictionary for getting words of specific parts of
speech
*/
class Dictionary {
private:
/////////////////////////
// Vectors to hold the words
std::vector<std::string> nouns;
std::vector<std::string> verbs;
std::vector<std::string> adverbs;
std::vector<std::string> adjectives;
std::vector<std::string> prepositions;
std::vector<std::string> articles;
// Read in files functions
bool readNouns(std::string file);
bool readAdverbs(std::string file);
bool readAdjectives(std::string file);
bool readPrepositions(std::string file);
bool readVerbs(std::string file);
bool readArticles(std::string file);
int getRandomNumber(int minVal, int maxVal);
public:
// Constructor
// Takes the names of the files to get the words from
Dictionary(std::string nounfile, std::string verbfile, std::string adverbfile, std::string adjfile, std::string prepfile, std::string articlefile);
// Returns a random noun
std::string getNoun();
// Returns a random article
std::string getArticle();
// Returns a random adjective
std::string getAdjective();
// Returns a random preposition
std::string getPreposition();
// Returns a random adverb
std::string getAdverb();
// Returns a random verb
std::string getVerb();
// Returns a proper article
std::string getProperArticle(char c);
// Returns a noun phrase
std::string generateNounPhrase();
// Returns a verb phrase
std::string generateVerbPhrase();
// Returns a sentence
std::string generateSentence();
};
#endif