-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.hpp
102 lines (88 loc) · 2.89 KB
/
functions.hpp
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef FUNCTIONS_HPP
#define FUNCTIONS_HPP
#include <string>
/**
* TODO: Implement this function
* @param word word to change to lowercase
* @return result of changing every character in word to lowercase
*/
std::string StringToLower(const std::string& word);
/**
* TODO: Implement this function
* @param v1 first character in potential vowel group
* @param v2 second character in potential vowel group
* @return true if v1 and v2 form a valid vowel group
*/
bool IsVowelGroup(const char& v1, const char& v2);
/**
* TODO: Complete this function
* @param v potential vowel character
* @return true if v is a vowel
*/
bool IsVowel(const char& v);
/**
* TODO: Complete this function
* @param c potential consonant character
* @return true if c is a consonant
*/
bool IsConsonant(const char& c);
/**
* TODO: Implement this function
* returns true if the input c is a valid character in the Hawaiian language
* returns false otherwise
*/
bool IsValidCharacter(const char& c);
/**
* TODO: Implement this function
* returns true if every character in the word is a valid character
* in the Hawaiian language
* returns false otherwise
*/
bool IsValidWord(const std::string& word);
/**
* TODO: Implement this function
* @param c consonant to get pronunciation of
* @param prev character before c, used for determining w translation
* set to null character as default if no value is passed in
* @return pronunciation of the consonant c as a string
*/
char ConsonantPronunciation(const char& c, const char& prev = '\0');
/**
* TODO: Implement this function
* @param v1 first vowel in a vowel grouping
* @param v2 second vowel in a vowel grouping
* @return the pronunciation of the vowel grouping made up of v1 and v2
* as a string
*/
std::string VowelGroupPronunciation(const char& v1, const char& v2);
/**
* TODO: Implement this function
* @param v single vowel to get pronunciation of
* @return the pronunciation of v as a string
*/
std::string SingleVowelPronunciation(const char& v);
/**
* TODO: Implement this function
* @param prev first character in set of three passed to function
* @param curr second character in set of three passed to function
* @param next third character in set of three passed to function
* @return pronunciation of curr using next and prev as needed to determine
* result
*/
std::string ProcessCharacter(const char& prev,
const char& curr,
const char& next);
/**
* TODO: Implement this function
* @param word string to get pronunciation of
* @return pronunciation of word
*/
std::string Pronunciation(const std::string& word);
/**
* TODO: Implement this function
* @param hawaiian_word word to get pronunciation of
* @return the pronunciation of hawaiian_word as a string if valid
* and throws an invalid_argument error if not valid
*/
std::string GetPronunciation(const std::string& hawaiian_word);
#endif