Skip to content
Snippets Groups Projects
Commit 9ecbc852 authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

ultimo filtroooooo

parent 05ab74d3
No related branches found
No related tags found
No related merge requests found
......@@ -11,5 +11,6 @@ int filter2(std::string text);
int filter3(std::string text);
int filter4(std::string text);
int filter5(std::string text);
int filter6(std::string text);
int filter7(std::string text);
int filter8(std::string text);
......@@ -26,7 +26,7 @@ int main(int argc, char *argv[]){
crip = text.str();
parser(crip);
std::cout << crip << std::endl;
//std::cout << crip << std::endl;
dict.open(dictName, std::ifstream::in);
if(!dict.good()){
......@@ -75,6 +75,8 @@ int filter(std::string text){
return REJECTED;
else if (filter5(text) == REJECTED)
return REJECTED;
else if (filter6(text) == REJECTED)
return REJECTED;
else if (filter7(text) == REJECTED)
return REJECTED;
else
......@@ -194,6 +196,23 @@ int filter5(std::string text){
return rej;
}
int filter6(std::string text){
// ('b'|'c'|'d'|'f'|'h'|'k'|'p'|'q'|'t'|'w'|'y') + !(vogal|'r'|'h'|'l') ||
size_t i;
int rej = ACCEPTED;
for (i=0; i<text.size()-1; ++i){
if(text[i]=='b' || text[i]=='c' || text[i]=='d' || text[i]=='f' ||
text[i]=='h' || text[i]=='k' || text[i]=='p' || text[i]=='q' ||
text[i]=='t' || text[i]=='w' || text[i]=='y'){
if(!isVowel(text[i+1]) && text[i+1]!='r' && text[i+1]!='h' && text[i+1]!='l'){
rej = REJECTED;
break;
}
}
}
return rej;
}
int filter7(std::string text){
size_t i;
int rej = ACCEPTED;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment