Quote from: ison on September 05, 2018, 07:45:39 AM
RomanianCode Select
if( plural )
return gender == Gender.Male ? str + 'i' : str + 'e';
else
return (gender == Gender.Female ? "a " : "un ") + str;
So in this part of the code, i think you are trying to determine the gender of the word by the indefinite article of the word.
In romanian the feminine words have the indefinite article "o " in front not "a " like stated in the code.
e. g. o femeie, o mașină, o sfoară etc.
And we don't have only 2 genders sadly . we have a third gender which is neutral
The indefinite article in singular form is "un " like masculine words, but the plural is formed like the feminine one.
e.g. un scaun, plural: scaune = scaun + e (feminin plural); (chair)
un geamantan, plural: geamantane (suitcase, trunk)
and if i understand again the code right, which i am not very sure since the terminology isn't familiar to me . you only form or search the plural for feminine with termination "e" and for masculine "i".
in that case there are plural words that end in "i" that are actually feminine,
e.g. o vaca, plural: vaci ( cow, which is actually in the game)
o minte, plural: minți (this means mind)
i can't say if there is a rule for this or if there are just some words which make an exception, ironically
e.g. o excepție, plural: excepții which means exception if you haven't guessed already .
I think it has to do with the way the word ends because "vace" would sound wrong, and the others seem to end in "e" already so it can't have double "ee" to form the plural.
I could help further but like i said i don't really understand the logic of the code, as in what the conditions are searching for and what should the functions return.
For example this part of the code
what i understand is that here you are trying to give the words the definitive article form of the words.
Code Select
if( !IsVowel(last) )
return str + "ul";
else if( gender == Gender.Male )
return str + "le";
else
return str + 'a';
so my logic of the code would be
1 it puts a condition if the last letter of the word doesn't end in a vowel
2 it should add the termination "ul"
3 if it does end in a vowel it should see if the gender of the word is masculine
4 if masculine should add the termination "le" ;;; termination "le" is the definitive article form for plural words not for masculine, the "ul" termination is for singular form masculine and neutral genders.
5 if not masculine, hence feminine add the termination "a" ;;; which is correct.
well i won't try and say anything further i think i said a lot and if i say more and i am understanding the code wrong then i am doing stuff in vain .