Last Modified
2013-06-22 01:10:47 +0000
Requires
  • linguistics/en/infinitive
  • linguistics/en/wordnet
  • linguistics/en/linkparser

Description

Linguistics::EN

This module contains English-language linguistic functions for the Linguistics module. It can be either loaded directly, or by passing some variant of 'en' or 'eng' to the Linguistics::use method.

The functions contained by the module provide:

Plural Inflections

Plural forms of all nouns, most verbs, and some adjectives are provided. Where appropriate, "classical" variants (for example: "brother" -> "brethren", "dogma" -> "dogmata", etc.) are also provided.

These can be accessed via the #plural, #plural_noun, #plural_verb, and #plural_adjective methods.

Indefinite Articles

Pronunciation-based "a"/"an" selection is provided for all English words, and most initialisms.

See: #a, #an, and #no.

Numbers to Words

Conversion from Numeric values to words are supported using the American "thousands" system. E.g., 2561 => "two thousand, five hundred and sixty-one".

See the #numwords method.

Ordinals

It is also possible to inflect numerals (1,2,3) and number words ("one", "two", "three") to ordinals (1st, 2nd, 3rd) and ordinates ("first", "second", "third").

Conjunctions

This module also supports the creation of English conjunctions from Arrays of Strings or objects which respond to the #to_s message. Eg.,

%w{cow pig chicken cow dog cow duck duck moose}.en.conjunction
  ==> "three cows, two ducks, a pig, a chicken, a dog, and a moose"

Infinitives

Returns the infinitive form of English verbs:

"dodging".en.infinitive
  ==> "dodge"

Authors

Acknowledgements

The inflection functions of this module were adapted from Damien Conway's Lingua::EN::Inflect Perl module:

Copyright (c) 1997-2000, Damian Conway. All Rights Reserved.
This module is free software. It may be used, redistributed
  and/or modified under the same terms as Perl itself.

The conjunctions code was adapted from the Lingua::Conjunction Perl module written by Robert Rothenberg and Damian Conway, which has no copyright statement included.

Copyright (c) 2003-2008, Michael Granger All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
  this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the name of the author/s, nor the names of the project's
  contributors may be used to endorse or promote products derived from this
  software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.