[Gambas-user] (no subject)

Doriano Blengino doriano.blengino at ...1909...
Thu Apr 2 07:51:35 CEST 2009


vlahonick vlahonick ha scritto:
> thanks to all of you (special thanks to dominique tha solved the previous problem) the project going on :D
> but now another problem appears...
> THE DIFTHONGS and the finishing greek sigma...
> the code below is about the sigma but in greek is one more "ς" tha goes only if a word ENDS with SIGMA (Σ/σ/ς)
>  
> IF sInChar = "σ" THEN sRetChar = "s"
>
> so how i can write tha if the last letter in the textbox1.text is "s" that textbox2.text have to write "ς"  ???
>
> this is the first problem of the part...
>
> and now how i can write that if in the textbox1.text the user writes "ου" it should appear "u" ????
> because is different if the tou letters "ο" and "υ" are the one after other and other if they dont.
> example : ουγκάντα->ugada , πουλημένος->pulimenos | υψηλότατος->ipsolotatos
> so u see tha in ugada and pulimenos example if the two leters (ο,υ) are one after other the pronoced like "u"
> so how i can do that?
> because i already had write :
>
> IF sInChar = "υ" THEN sRetChar = "i"
> IF sInChar = "ο" THEN sRetChar = "o"
>
> so at this moment the program understand them different
>
> example :
>
> if i wrote ουγκάντα program gives oigada but the correct is UGADA
>
> (ugada is how Uganda(the country) is pronaunced in greek)
>
> so now somehow i have to write that if these two letter are together (one after other|ο,υ|) they should give the
> result "u".
> of course doesnt matter if a word stars or ends or if these two letters are in the middle of the word.
> their result is always "u".
>
> ANY HELP???
>   
I am not sure to have got it rightly, but I am sure about this: if you 
can explain something to a person, then you can explain the same thing 
to gambas. You just said that if a O is followed by a U, (sorry for 
using latin letters - you understand), then the output is a single U. So 
write it in gambas: you take an input word, and analyze it letter by 
letter. If a letter is TAU, you output "T"; if a letter is OMEGA, you:

    1) peek at the next letter.
         1a) If it is "U", you output "U" and increment the scanning index
         1b) If it is not "U", you output "O"

    2) increment index and loop

...and so on.

Another way, which works if your input text *does not* contain latin 
letters, is to substitute it piece by piece, starting with exceptions 
like diphtongs. Take your Uganda: "ουγκάντα". Search for all the 
diphtongs - start with "ου": found in position one. Delete two chars, 
and put in place "U". Now you have "Uγκάντα". Search for other diphtongs 
- none found. Then, search for single letters. "α" found in position 7; 
delete it and place an "A"; you get "UγκάντA". And so on...

May be things can get more complicated if you take whole sentences; in 
Italian the correct pronunciation sometimes changes slightly depending 
on the words. For example, "to Milan" becomes "a Milano", and it is 
pronounced normally. But "to Rome" becomes "a Roma", but should be 
pronounced "arroma", with a geminated "R" present only when speaked. I 
suppose Greek has these exceptions too...

Regards,

-- 
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."





More information about the User mailing list