root/trunk/README

Revision 99, 5.4 kB (checked in by deveiant, 3 months ago)

Converted to a new build system.

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author URL Id
Line 
1
2= Linguistics
3
4== Authors
5
6* Michael Granger <ged@FaerieMUD.org>
7* Martin Chase <stillflame@FaerieMUD.org>
8
9
10== Requirements
11
12* Ruby >= 1.8.6
13
14
15== Optional
16
17* Ruby-WordNet (>= 0.0.5) - adds integration for the Ruby binding for the
18  WordNet® lexical refrence system.
19
20  URL: http://deveiate.org/projects/Ruby-WordNet
21
22* LinkParser (>= 1.0.2) - adds integration for the Ruby Link Grammar Parser by
23  Martin Chase.
24
25  URL: http://dev.faeriemud.org/~stillflame/linkparse.html
26  Download: http://www.faeriemud.org/code/Ruby-LinkParser-0.0.4.tgz
27
28
29== General Information
30
31Linguistics is a framework for building linguistic utilities for Ruby objects
32in any language. It includes a generic language-independant front end, a
33module for mapping language codes into language names, and a module which
34contains various English-language utilities.
35
36
37=== Method Interface
38
39The Linguistics module comes with a language-independant mechanism for
40extending core Ruby classes with linguistic methods.
41
42It consists of three parts: a core linguistics module which contains the
43class-extension framework for languages, a generic inflector class that serves
44as a delegator for linguistic methods on Ruby objects, and one or more
45language-specific modules which contain the actual linguistic functions.
46
47The module works by adding a single instance method for each language named
48after the language's two-letter code (or three-letter code, if no two-letter
49code is defined by ISO639) to various Ruby classes. This allows many
50language-specific methods to be added to objects without cluttering up the
51interface or risking collision between them, albeit at the cost of three or four
52more characters per method invocation.
53
54If you don't like extending core Ruby classes, the language modules should
55also allow you to use them as a function library as well.
56
57For example, the English-language module contains a #plural function which can
58be accessed via a method on a core class:
59
60  Linguistics::use( :en )
61  "goose".en.plural
62  # => "geese"
63 
64or via the Linguistics::EN::plural function directly:
65
66  include Linguistics::EN
67  plural( "goose" )
68  # => "geese"
69
70The class-extension mechanism actually uses the functional interface behind
71the scenes.
72
73A new feature with the 0.02 release: You can now omit the language-code method
74for unambiguous methods by calling Linguistics::use with the +:installProxy+
75configuration key, with the language code of the language module whose methods
76you wish to be available. For example, instead of having to call:
77
78  "goose".en.plural
79
80from the example above, you can now do this:
81
82  Lingusitics::use( :en, :installProxy => :en )
83  "goose".plural
84  # => "geese"
85
86More about how this works in the documentation for Linguistics::use.
87
88
89==== Adding Language Modules
90
91To add a new language to the framework, create a file named the same as the
92ISO639 2- or 3-letter language code for the language you're adding. It must be
93placed under lib/linguistics/ to be recognized by the linguistics module, but
94you can also just require it yourself prior to calling Linguistics::use().
95This file should define a module under Linguistics that is an all-caps version
96of the code used in the filename. Any methods you wish to be exposed to users
97should be declared as module functions (ie., using Module#module_function).
98
99You may also wish to add your module to the list of default languages by
100adding the appropriate symbol to the Linguistics::DefaultLanguages array.
101
102For example, to create a Portuguese-language module, create a file called
103'lib/linguistics/pt.rb' which contains the following:
104
105  module Linguistics
106    module PT
107      Linguistics::DefaultLanguages << :pt
108
109      module_function
110      <language methods here>
111    end
112  end
113
114See the English language module (lib/linguistics/en.rb) for an example.
115
116
117=== English Language Module
118
119See the README.english file for a synopsis.
120
121The English-language module currently contains linguistic functions ported
122from a few excellent Perl modules:
123
124  Lingua::EN::Inflect
125  Lingua::Conjunction
126  Lingua::EN::Infinitive
127
128See the lib/linguistics/en.rb file for specific attributions.
129
130New with version 0.02: integration with the Ruby WordNet® and LinkParser
131modules (which must be installed separately).
132
133
134== To Do
135 
136* I am planning on improving the results from the infinitive functions, which
137  currently return useful results only part of the time. Investigations into
138  additional stemming functions and some other strategies are ongoing.
139
140* Martin Chase <stillflame at FaerieMUD dot org> is working on an integration
141  module for his excellent work on a Ruby interface to the CMU Link Grammar
142  (an english-sentence parser). This will make writing fairly accurate natural
143  language parsers in Ruby much easier.
144
145* Suggestions (and patches) for any of these items or additional features are
146  welcomed.
147
148
149
150== Legal
151
152This module is Open Source Software which is Copyright (c) 2003 by The
153FaerieMUD Consortium. All rights reserved.
154
155You may use, modify, and/or redistribute this software under the terms of the
156Perl Artistic License, a copy of which should have been included in this
157distribution (See the file Artistic). If it was not, a copy of it may be
158obtained from http://language.perl.com/misc/Artistic.html or
159http://www.faeriemud.org/artistic.html).
160
161THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
162WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
163MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
164
165
166 $Id$
167
Note: See TracBrowser for help on using the browser.