Hi I am trying to write a program that separates words into syllables using romanian rules.Trying to do this is a lot harder then I thought because I don’t know how I can create this rules.This is what I have so far and I know that the code is not correct at the condition but I need check if the letter in the car array exists in the vocale array then to check if the next letter in car array exists in the consoane array and so one here is the code I know the if condition is typed wrong I just need a solution to check that condition:
String[] vocale = {"a", "e", "i", "o", "u"};
String[] consoane = {"b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z"};
public String DesparteCuvant(String cuv){
String[] car = new String[cuv.length()];
String c = "";
for(int i = 0; i < cuv.length(); i++){
car[i] = cuv.substring(i, i+1);
}
for (int j = 0; j < car.length - 2; j++){
if(car[j] == vocale[] && car[j+1] == consoane[] && car[j+2] == vocale[]){
}
}
return c;
}
Ok, if you just want to get the if statement working this is how i would do it:
And your if statement would look like this: