Programming a Spanish Verb Conjugator

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:

  1. Check from dictionary, if the verb is irregular.
  2. If the verb is not found in dictionary, consider that it is regular.
  3. Remove the infinitive ending (-ar, -er, or -ir).
  4. Apply the special rules for irregular verbs.
  5. Add the verb endings and apply the ortographic rules.

That’s it!

Related links:

Hello Värmland

In summer 2009 I convinced my family to visit Värmland during our summer vacations in Sweden — although Värmland was aside from our planned route.

So why did I want to visit Värmland?

Traffic sign: a Finnish name in the middle of Sweden
Traffic sign: a Finnish name in the middle of Sweden

Well, I had read that pretty recently there were Finnish speaking people living there: “The early 17th century marked the beginning of a substantial immigration from Finland. The areas where they centred were known as Finnskog. They kept their Finnish customs and language until the late 19th century. The last native resident to speak Finnish here died in the 1980’s.”.

After all we didn’t expect to talk there in Finnish, or more specifically “Forest Finnish”. But it was more than astonishing to see Finnish names on the traffic signs in the heart of Sweden!

Links:

Hello Öland!

The header picture on this Verb Conjugation Blog was taken last summer (2010) in Öland, Sweden.

We didn’t plan to visit Öland during our summer vacation in Sweden. But, because the weather was hot and our car had air-conditioning we decided to make a round-trip there.

Afterwards I learnt that there are lots of runes carved in stones in Öland. We should have stopped and checked them. Nevertheless, now I’ve studied the runic alphabet and Old Swedish to that degree that I’m looking forward in visiting Öland again.

Before doing that, however, I’ll study these pages: