项目作者: rossmeissl

项目描述 :
English verb conjugation for Ruby (and Rails)
高级语言: Ruby
项目地址: git://github.com/rossmeissl/verbs.git
创建时间: 2009-11-23T21:18:45Z
项目社区:https://github.com/rossmeissl/verbs

开源协议:MIT License

下载


Verbs

Conjugates most common english verbs for all persons, tenses, standard aspects, and modern moods (with active diathesis). Standard and exceptional spelling rules are obeyed.

  1. Verbs::Conjugator.conjugate :be, :tense => :past, :person => :second, :plurality => :singular, :aspect => :perfective
  2. # => :were
  3. 'be nice'.verb.conjugate :subject => 'Matz'
  4. # => "Matz is nice"
  5. :sleep.verb.conjugate :tense => :future, :person => :first, :plurality => :singular, :aspect => :progressive, :subject => true
  6. # => :"I will be sleeping"

Installation

  1. gem install verbs

Options

This library takes a rather strict view of English verb conjugation.

:tense

One of :past, :present, or :future. Defaults to :present.

:person

One of :first, :second, or :third. Defaults to :third.

:plurality

Either :singular or :plural. Defaults to :singular.

:aspect

One of :habitual, :perfect, :perfective, :progressive, or
:prospective. Defaults to :habitual (:perfective for past tense).

See below for a guide to verb aspect.

:mood

One of :indicative, :imperative, or :subjunctive. Defaults to
:indicative.

:subject

Set this to a string to prepend the conjugated verb with it. When set to true, a standard personal pronoun will be used.

:diathesis

One of :active or :passive. Defaults to :active.

Tense/aspect quick reference

EXAMPLE TENSE ASPECT
I used to accept past habitual
I had accepted past perfect
I accepted past perfective
I was accepting past progressive
I was about to accept past prospective
I accept present habitual
I have accepted present perfect
I am having accepted present perfective
I am accepting present progressive
I am about to accept present prospective
I will accept future habitual
I will have accepted future perfect

Acknowledgements

Copyright (c) 2012 Andy Rossmeissl. See LICENSE for details.