dimanche 8 octobre 2017

Data structure for multi-language dictionary

I am trying to make a multi-language dictionary let us say English - German dictionary.

I think that I need a language class and a word class, but different languages have different word types and verb tenses, for example, in the German language there are different word genders (Masculine, Feminine, Neuter).

now my question is how to represent the different languages in code :

1- language parent class, word parent class 2- language "a" class, word "inLanguageA" class and different word types and functions 3- language "b" class, word "inLanguageB" class and different word types and functions

so that I would be able to get wordInLanguageA.meaning(inLanguageB).

and what is the best way to nest the classes for a language for example :

should German be a new class that implements the interface language or a child for the parent class language and what about the word type how can I handle that? German has this types ( Noun, Verb, Adjective) and every type should have his own methods and sometimes a relationship could exist between one or two types ("gehen": verb "to go" , "gehend": Adjective "going")

Aucun commentaire:

Enregistrer un commentaire