March 5, 200520 yr Well Spanish should be a fairly simple conversion from English. There is some difference in the pronunciation of vowels, but this function ignores the difference between vowels anyway, so you won't need to do anything about those. There aren't many differences between the consonants except for g, j and h. The H is ignored in the English version, so that should be okay. Most of the substitutions like WH and KN, GN etc. are for exceptions to English pronunciation which don't seem to occur in Spanish, so they can be removed. So, I would add these substitutions: J -> H GE -> HE GI -> HI The H is later deleted in the existing function. The R sound is different than English, but distinct from everything else, so it should be okay as is. The K and W only occur in English, so they doesn't need any special treatment. I'm not sure how foreign words with W are pronounced. My dictionary says W is pronounced like V. If so, you could convert W to V. So the Spanish version would probably look something like this: Let ([ Input="." & Upper(TrimAll(SearchText;0;0) )& "."; Norm1=Substitute(Input; [".X";".S"]; ["TIA";"SHA"];["TIO";"SHO"];["CH";"SH"]; ["CE";"SI"];["CI";"SI"];["CY";"SI"];["CK";"K"]; ["GE";"HE"];["GI";"HI"];["GY";"HI"];["J";"H"]; ["Q";"K"];["V";"F"];["X";"KS"] ); Norm2=Upper(Substitute(Norm1; ["E";"A"];["I";"A"];["O";"A"];["U";"A"]; ["WA";"wA"];["WY";"wY"];["YA";"yA"];["Y";""];["W";""])); Norm3=Substitute(Norm2; ["G";"K"];["C";"K"]; ["TH";"S"];["Z";"S"]; ["F";"B"];["P";"B"];["V";"B"];["W";"B"]; ["H";"A"];["N";"M"];["T";"D"]; ["AAA";"A"];["AA";"A"];["AA";"A"]; ["BBB";"B"];["BB";"B"];["BB";"B"]; ["DDD";"D"];["DD";"D"];["DD";"D"]; ["KKK";"K"];["KK";"K"];["KK";"K"]; ["LLL";"L"];["LL";"L"];["LL";"L"]; ["MMM";"M"];["MM";"M"];["MM";"M"]; ["RRR";"R"];["RR";"R"];["RR";"R"]; [".A";".0"];["A";""];[".";""] ); KeyLen=Length(Norm3) ] ; Norm3& Case(KeyLen>4;
March 5, 200520 yr Author That would be another script? (if so, there will be two search scripts? one in Spanish and another in English? ) or I only need to change the previous algorithm, and there will be only one script that performs phonetic search in Spanish and English?) P.S: In Spanish there is a letter that doesn
March 5, 200520 yr Author I forgot... The letters (double L + a vowel) "LL" sound like "Y" (+ a vowel) in Spanish "CE" and "Ci" sound like "SE" and "Si" ... and that would be all about Spanish
March 5, 200520 yr Author Im thinking... Could it be possible to somehow include the pronnonciation of the letters "H", "J" and "Z" in Spanish? "H" is prononced "HACHE" "J" is prononced "JOTA" "Z" is prononced"ZETA" The substitutions would be: HACHE = H JOTA = J ZETA = Z Am i right?
March 6, 200520 yr I've attached another example which does both English and Spanish at the same time without requiring any script. By the way, you didn't mention whether this is for European Spanish or Latin American Spanish. I understand there are a couple of subtle differences. Here are the rules I used. Please correct me if I'm wrong: Spanish J is pronounced as an English H. This is already handled in the function I gave. Spanish H is essentially silent. Again this is already handled. As for Z, My understanding is that European Spanish pronounces it like English 'TH' and Latin American Spanish pronounces it the same as English Z. Either way, the phonetic simplification that is done converts them both to 'S,' so it is already handled too. For LL, I believe the European Spanish pronunciation is LY, while Latin American Spanish pronounces it as Y. I missed that one, so it has been added in. CI and CE convert to SE and SI in both English and Spanish, so no changes needed here. I was aware of Phonetic.fp7.zip
March 6, 200520 yr Author I forgot. Its for Latin American Spanish, but there are a few differences between the prononciation. The sound of the "Z" is all I can think by now. The European SPanish sounds like "C" and Latin American like "S". But you mentioned its already done with the "S" substitution. Spanish "H" is silent. I think "
March 7, 200520 yr Author What exactly does the field (MatchCount) do? Could you explain me a little more about the match tolerance please?
March 7, 200520 yr Author oh, and... Is it possible to make a single NeoPhoneSearch and a single NeoPhone so there are only 2 fields that are related to English and Spanish phonetic searches, instead of 4 like (NeoPhoneSearchEspan; NeoPhoneEspan; NeoPhoneSearch and NeoPhone)B) That way I wont have to search in English and then search in Spanish (double work
March 7, 200520 yr Matchcount gives the number of matching records that are found. Its value appears at the top of each portal. The new functions produce a multikey (several values each on a separate line). If any one of these matches any of the multikey values of one of the textfield words, then it is considered a match and the word will appear in the portal. The tolerance value determines how many key values are created in the search key field. Here is how the multikeys are created. The main key value is created from the function as previously described. Each character in the key corresponds to a consonant sound in the original word. Then, if the key value is longer than 4 characters, two more key values are created. The first is the main key minus the first character, and the second is the main key minus the last character. If the main key is longer than 5 characters, then an additional two keys are created. The first is the main key minus the first two characters, and the second is the main key minus the last two characters. If the tolerance value is set to 0, then only the main key is created. If it is set to 1, then 3 keys are created (if the word is long enough), and if the tolerance is set to 2, all 5 keys are created (again assuming that the word is long enough). This allows you to match smaller parts of words. For example if you enter "mathematic" for the search text, it will return both "mathematic" and "mathematical." The 4 fields could be combined into two fields with the English and Spanish version forming two sets of multikey values, 5 for English and 5 for Spanish for a total of 10 key values. You may want to read up on multikey relationships if you are not familiar with them.
March 7, 200520 yr Author Its kinda difficult.. Could you attach a file with English and Spanish combined field?
March 8, 200520 yr Yes you can combine the fields that way, but you have to be careful about how you do it. I will post another example, but I won't have time until tomorrow sometime.
March 8, 200520 yr Yes you can combine the fields that way, but you have to be careful about how you do it. I will post another example, but I won't have time until tomorrow sometime.
March 8, 200520 yr Yes you can combine the fields that way, but you have to be careful about how you do it. I will post another example, but I won't have time until tomorrow sometime.
March 8, 200520 yr Author Well... its working fine. The only problem I got is when I do a phonetic search (Exemple) for the word "SURE" and if I have in my records the field "SHURE STUFF" it doesn
March 8, 200520 yr Author Well... its working fine. The only problem I got is when I do a phonetic search (Exemple) for the word "SURE" and if I have in my records the field "SHURE STUFF" it doesn
March 8, 200520 yr Author Well... its working fine. The only problem I got is when I do a phonetic search (Exemple) for the word "SURE" and if I have in my records the field "SHURE STUFF" it doesn
March 10, 200520 yr I think the simplest way is to break up multi-word data into individual related fields and then use the phonetic search functions on the related fields.
March 10, 200520 yr I think the simplest way is to break up multi-word data into individual related fields and then use the phonetic search functions on the related fields.
March 10, 200520 yr I think the simplest way is to break up multi-word data into individual related fields and then use the phonetic search functions on the related fields.
February 16, 200619 yr Author Well... It´s been a long time since the last time I played with FM and algorithms. By now I´m like totally newbie on this, since I will have to read and learn all about FM and Search Algorithms. In fact, I almost forgot about FM Forums... At least now I have plenty of time to play around with FM and, perhaps, will give it a try and build a brand new database with phonetic and non-phonetic search functions and investigate my FoxPro database to see what I can found... Bob and everybody who helped me still around?
Create an account or sign in to comment