Module | Linguistics |
In: |
lib/linguistics.rb
lib/linguistics/iso639.rb |
linguistics/iso639.rb - A hash of International 2- and 3-letter ISO639-1 and ISO639-2 language codes. Each entry has two keys:
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.
VERSION | = | '1.0.9' | Release version | |
DefaultLanguages | = | [] |
Language module implementors should do something like:
Linguistics::DefaultLanguages.push( :ja ) # or whatever so that direct requiring of a language module sets the default. |
|
DefaultExtClasses | = | [String, Numeric, Array] | The list of Classes to add linguistic behaviours to. | |
LanguageCodes | = | {} | Hash of ISO639 2- and 3-letter language codes |
Extend the specified target object with one or more language proxy methods, each of which provides access to one or more linguistic methods for that language.
Install a regular proxy method in the given klass that will delegate calls to missing method to the languageProxy for the given language.
Make an languageProxy class that encapsulates all of the inflect operations using the given language module.
Add linguistics functions for the specified languages to Ruby‘s core classes. The interface to all linguistic functions for a given language is through a method which is the same the language‘s international 2- or 3-letter code (ISO 639). You can also specify a Hash of configuration options which control which classes are extended: