Gracias, Harry
I like treeware myself. This site only displays the first lines of code and provides a download link at the end of the code section to improve readability. I've got a good idea of all the verbs required, just not enough energy to finish it at the moment. The compound tenses are the ones that are bugging me a bit. I had hoped that all I would have to do is to run the auxiliary verb "haber" through the conjugate method and then add on the past participle, but the tail end of the conjugate sub makes that an ugly modification.
Currently, it's
my $verb_class = get_class($conj);
my $stem = get_stem($conj);
my $ending = $endings->{$conj->{tense}}->{$verb_class}->[ _get_end
+ing_index($conj) ]
or carp "No ending found for $conj->{tense} tense
+of $conj->{verb} in conjugate( @_ )\n";
if ( my $pronoun = is_reflexive($conj) ) {
# commands and infinitives can have the pronoun afterwards, wh
+ich changes the accenting
return "$pronoun $stem$ending";
}
return $stem . $ending;
The irregular verbs are being handled by hashes that hold the special cases which weren't as bad as I'd expected. The imperfect, future and conditional are finished as are the regular forms of the present, preterite and subjunctives. There are a dozen classes of spelling changes which need to be handled and I've glossed over the imperative. As I'm only conjugating verbs for now, I'm not considering object pronouns which can get caught up between the verbs or stuck on the end. Just trying to keep it simple.
I do wonder why this hasn't been written before now. It isn't that hard and should have some uses. Essentially, it's the reverse of Lingua::StopWords for Spanish verbs. Personally, I could see this in the backend of a quiz site or app. Any thoughts on where you'd think it would be useful?
| [reply] [d/l] |
Any thoughts on where you'd think it would be useful?
I can see it go into a website to learn Spanish, maybe complemented by:
- A dictionary
- Common usage of the verbs
I can also see it acting as a building block for other applications, e.g. generating sentences, validating sentences etc.
| [reply] |
As a former native Spaniard, i can assure you this:
Indicativo (presente, imperfecto, pretérito, futuro, condicional)
Tiempos compuestos (pretérito perfecto, pluscuamperfecto, futuro perfecto, condicional perfecto)
Subjuntivo (presente, imperfecto, futuro)
Imperativo (afirmativo, negativo)
It's just to make it sound as we have some sort of "lexical rules" or "coherent structures", as well as the accented words, plus middle H usage, v or b, y or LL, etc...
We can just survive a whole life with the basic verbs and about 100 words...
Don't be fooled by the Real Academia Española, we send there all the elder writers/bookworms to have them busy over "language quality", to prevent them from raving at wild 60+ parties over Benidorm! (tourists could not follow their rythm overnight and fainted, increasing national healthcare costs).
Remember, never try to follow the lead of a Spaniard on a party, no matter how old he/she is, he/she is being training hard since chilhood!... You won't ever know what hit you!! =8-P
| [reply] |