MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / suspect_word

Function suspect_word

extlibs/soloud/src/audiosource/speech/tts.cpp:1202–1230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1200}
1201
1202static int suspect_word(const char *s, int n)
1203{
1204 int i = 0;
1205 int seen_lower = 0;
1206 int seen_upper = 0;
1207 int seen_vowel = 0;
1208 int last = 0;
1209
1210 for (i = 0; i < n; i++)
1211 {
1212 char ch = *s++;
1213
1214 if (i && last != '-' && isupper(ch))
1215 seen_upper = 1;
1216
1217 if (islower(ch))
1218 {
1219 seen_lower = 1;
1220 ch = toupper(ch);
1221 }
1222
1223 if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U' || ch == 'Y')
1224 seen_vowel = 1;
1225
1226 last = ch;
1227 }
1228
1229 return !seen_vowel || (seen_upper && seen_lower) || !seen_lower;
1230}
1231
1232static int xlate_word(const char *word, int n, darray *phone)
1233{

Callers 2

xlate_wordFunction · 0.85
xlate_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected