I developed the first Spanish verb conjugator in 1995. I chose Visual Basic 1.0 as the programming tool, more or less for two reasons: 1. I could write the software for Microsoft Windows; 2. the tool was free (I got it together with a computer magazine).
Spanish verbs are quite logical in the conjugation. By removing the two last characters from the end of the infinitive, we obtain the stem. And by applying certain endings we can get all the conjugated forms of the verb. Generally the endings depend on the conjugation (whether the verb infinitive ends -ar, -er, or -ir).
By simply applying the endings to the stem the conjugator can conjugate all regular verbs of the Spanish language, which account more than 90% of all the verbs. I porgrammed this in one afternoon.
In order to work well, the conjugator must also be able to conjugate all irregular verbs. This was the tricky part; all irregular verbs had to be put in different categories according to the irregularities that they show. So I wrote a dictionary that contained the irregular verbs and information about the irregularities. This was time consuming and required that the verbs were checked in various books.
At this point I decided to mark all irregularities in red. In means of programming it was done easily; if special rules were applied, use red language.
In addition to irregularities there is something that is called ortographic change. In practice it means that a letter ot two are replced with some other letter in certain situations. The ortigraphic rules are regular, so it was a matter of a few codelines.
Finally as you can imagine, am automated verb conjugator can conjugate the verb in any form. Now there are some verbs in Spanish that are not conjugated in all forms. I chose to mark these forms in grey. Unfortunately I had to build again a dictionary with information of non-existing forms.
To put this together, a Spanish verb conjugator works like this:
- Check from dictionary, if the verb is irregular.
- If the verb is not found in dictionary, consider that it is regular.
- Remove the infinitive ending (-ar, -er, or -ir).
- Apply the special rules for irregular verbs.
- Add the verb endings and apply the ortographic rules.