Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Draft - Lingua::ES::Conjugate

by Ea (Chaplain)
on Dec 19, 2011 at 15:34 UTC ( [id://944262]=note: print w/replies, xml ) Need Help??


in reply to Re: Draft - Lingua::ES::Conjugate
in thread Draft - Lingua::ES::Conjugate

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?

Que vayas bien,
Boyd

Replies are listed 'Best First'.
Re^3: Draft - Lingua::ES::Conjugate
by dHarry (Abbot) on Dec 19, 2011 at 17:38 UTC

    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://944262]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-19 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found