kantoniko / ladino-diksionaryo-code

GNU Affero General Public License v3.0
2 stars 1 forks source link

Conjugation of regular verbs #53

Open szabgab opened 1 year ago

szabgab commented 1 year ago

There are 3 types of verbs with regular conjugation depending on the ending of the verb -ir, -er, -ar. We already have some partial implementation generating some of the conjugated versions of these verbs, but we would like to have something that can

  1. recognize a conjugated word in the front-end preferably without holding all the conjugations of all the words in memory.
  2. List the conjugations on the web site.

So we might need two implementations. One in Python and one in JavaScript.

For irregular words we will probably have to list all the cases.

It is quite easy to list all the verbs and we have list of irregular verbs in the config.yaml file in the data repo

We have the tables for the conjugations of the regular verbs:

One idea might be in the front end if the user types in a word we don't recognize, then try to figure out if it is the conjugation of a regular verb.

  1. Brute force: We could go over all the verbs, generate all the conjugations and see if any of them matches.
  2. Improved brute force: only go over the regular verbs for which the same first 2 letters are the same as the word typed in by the user. I think this solution would be fast enough that we don't need to implement 3
  3. Some clever algorithm that could deduct the original verb from the conjugated form.

This way we don't need to keep all the generated words in memory.