Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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

In reply to Re^2: Draft - Lingua::ES::Conjugate by Ea
in thread Draft - Lingua::ES::Conjugate by Ea

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found