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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
//! Converts strings to Pig Latin.
//! # Use
//! ```text
//! igpay "example string"
//! ```
//!
//! Igpay will remove all capital letters and punctuation. It is the simplest form of a Pig Latin
//! translator.
//! In addition to this, it cannot be piped into:
//! ```text
//! echo "hello" | igpay
//! ```
//!
//! Pig latin is not a well-defined language. As a result of this, Igpay's idea of Pig Latin may not be the same as another translator's.
//!
//! ### The rules for Igpay's translation are as follows:
//! - All strings inputted to Igpay are trimmed.
//! - All strings inputted to Igpay are converted to lowercase.
//!
//! #### For words beginning with an English consonant
//! - Words have that first consonant removed and appended to
//! the end of the string.
//! - The string `"ay "` (notice the trailing whitespace) is appended to the string.
//!
//! #### For words beginning with an vowel defined in [VOWELS](https://docs.rs/igpay/latest/igpay/constant.VOWELS.html)
//! - Words have the string `"hay "` (notice the trailing whitespace) appended to them.
//!
//! #### After (applies to all)
//! - All words are pushed to a new string.
//! - Resulting string is trimmed, then returned.
/// Array of vowels in English.
/// # Examples
///
/// - VOWELS can be used simply as a useful
/// [array](https://doc.rust-lang.org/stable/std/primitive.array.html) of English vowels:
/// ```
/// use igpay::VOWELS;
///
/// let letter = VOWELS[3];
///
/// assert_eq!(letter, 'o');
/// ```
///
/// - It can, however, also be used to check a
/// [char](https://doc.rust-lang.org/stable/std/primitive.char.html) to find if it is a vowel:
/// ```
/// use igpay::VOWELS;
///
/// let foo = "an example";
///
/// let mut is_vowel: Vec<bool> = Vec::new();
///
/// for character in foo.chars() {
/// is_vowel.push(VOWELS.contains(&character));
/// }
///
/// assert_eq!(is_vowel, vec![
/// true, false, false, true, false, true, false, false, false, true
/// ]);
/// ```
pub const VOWELS: = ;