Start New Discussion within our Software Development Community

Hi again.
In addition to all the other little projects I'm working on to try and learn VB(express edition), I've decided to try and build an English/Spanish translator. I'm looking for suggestions as to what might be the better route to take as far as treating the retrieval of the translated text from the database that I'm building. For example, when the user enters in the english phrase(or word), the form would return the spanish equivalent (doing more of a literal translation, rather than trying to work out all the nuances of proper grammar).
I'm sure this could probably be accomplished by using a metric poo-ton of If/Then/Else statements, but I would be willing to bet there would be a much cleaner way of doing this. Suggestions? (I'm not looking for someone to do the code for me, just a nudge in the right direction)

As always, Thanks in advance.

I'm sure this could probably be accomplished by using a metric poo-ton of If/Then/Else statements, but I would be willing to bet there would be a much cleaner way of doing this. Suggestions?

HashTables. Custom made for this process, but they won't scale well (really depends on the amount of memory in the machine). They are a 1 to 1 lookup, as in the dictionary you describe.

Database (such as Access). Create a two column table, populate with your translations, then query as: Select SpanishWord from DictionaryTable where EnglishWord = 'FooBar'; XML Files. Properly used, these are basically little databases on disk, easily read, easily loaded into a HashTable, a Datatable, or almost any other structure that typically 'catches' the data from a database call. Not as fast as Access, but great for small tables.

Hope that points you in the right direction! Happy coding!

Ned

This article has been dead for over six months. Start a new discussion instead.