bdeitsch
02-01-2004, 01:33 AM
Help,
I am trying to build a language translator application. I have 16 words in English, French, and German. My application asks the user to input a sentence using the 16 words available. The application will then break the sentence down into individual words. I started to set up 3 different arrays, one for each language, but that didn't work so well. When I searched for a matching word in the English array, and use that words index to find its matching word in the French and German arrays and then display the words, I get nothing. I then tried to use a binarysearch to search the English array, get the words index, and then display the matching word from the other two array with the same index, but I get nothing but negative numbers from the binarysearch. Then I remembered, that I have to sort the array before binarysearch will work, so I sort the English array. Then the words in English didn't match the words in the other two. So I figure I have to set up a structure, called Words, and have 3 sub elements of this structure, called English, French, and German. But I have no idea how to search Words.English for a word and use that to find and display the Word.French and Word.German words. Nothing that I am doing is working. Can anyone help??? I'm down to my last 7 or 8 hairs on my head and I'm about to pull them out too. Thank you
Bdeitsch
I am trying to build a language translator application. I have 16 words in English, French, and German. My application asks the user to input a sentence using the 16 words available. The application will then break the sentence down into individual words. I started to set up 3 different arrays, one for each language, but that didn't work so well. When I searched for a matching word in the English array, and use that words index to find its matching word in the French and German arrays and then display the words, I get nothing. I then tried to use a binarysearch to search the English array, get the words index, and then display the matching word from the other two array with the same index, but I get nothing but negative numbers from the binarysearch. Then I remembered, that I have to sort the array before binarysearch will work, so I sort the English array. Then the words in English didn't match the words in the other two. So I figure I have to set up a structure, called Words, and have 3 sub elements of this structure, called English, French, and German. But I have no idea how to search Words.English for a word and use that to find and display the Word.French and Word.German words. Nothing that I am doing is working. Can anyone help??? I'm down to my last 7 or 8 hairs on my head and I'm about to pull them out too. Thank you
Bdeitsch