c# - Best data structure for representing English-verb-forms-like information -


update: have formulated question in abstract terms, way less illustrative. please don't downvote being specific.

i need come data structure keep information english verb forms. in cases verb can in 1 of 4 forms: base, present participle, past participle , past simple, example:

  • take
  • taking
  • taken
  • took

it's seemingly easy define 4 types each form , on it. there few exceptions ruin simple idea.

  1. present single third person form, in our example "he/she/it takes".
  2. copular verb "to be" has multiple irregular forms in present tense: "am", "is", "are" , "was" , "were" in past tense
  3. verbs "may" don't inflect in present single third person form: "she may".

what data structure efficient, accurate yet unambiguous representing such information (with exceptional cases) given following requirements have met:

  • for arbitrary form answer question conjugations form represents
  • for arbitrary conjugation , form answer question whether form represents given conjugation or not?

update: efficient meant that

  • answering stated questions should rather fast slow
  • memory consumption should rather low high
  • definition of data structure should rather concise verbose (i understand efficiency subject trade-offs)

tables need:

infinitives -------- infinitiveid name  tenses (i.e. present, preterite, imperative, past, present continuous,          past continuous, past perfect continuous, future, etc., etc.) ------ tenseid name   subjects (i.e. i, you, he/she, we, plural you, they) ------- subjectid name  conjugations ------------ infinitiveid  tenseid  subjectid conjugation 

infinitiveid smallint unless have more 32,000 verbs (which highly doubt). tenseid , subjectid tinyint, infinitiveid int, , name fields varchar.

your update on 'efficient' rather meaningless because you've said "i want best of worlds, though realize there have trade-offs". haven't told how plan use this. example, going publicly accessible database that's getting hammered high amounts of traffic? going grammar checker in word processor 1 person using @ time? don't know how tell best trade-offs if don't tell you're doing it.

without knowing more do, suggestion not worry memory requirement @ all. make huge lookup table every single possibility (understanding there ton of repetition of verbs on conjugations use same forms). can't imagine have enough verbs doing put close consider big database.

edit:

a possible improvement above add table contains unique verb conjugations. way conjugations table reference id table rather having repeat actual text of verb on , on again.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -