| 1 | package Lingua::EN::VarCon; | ||
| 2 | |||
| 3 | =pod | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Lingua::EN::VarCon - Provides access to the VarCon (Variant Conversion Info) | ||
| 8 | |||
| 9 | =head1 DESCRIPTION | ||
| 10 | |||
| 11 | VarCon is a data set provided as part of the Word List project. | ||
| 12 | |||
| 13 | It contains a number of lists and tables of words that can be used to help | ||
| 14 | automatically convert the English language between the differing spellings | ||
| 15 | of it's local dialects (American, British, Canadian). | ||
| 16 | |||
| 17 | In an age where Spanish application translations are common, but finding | ||
| 18 | a British, Canadian or Australian translation (as used by FAR more people | ||
| 19 | than American English) can be almost impossible, and when "English" on the | ||
| 20 | internet is increasingly seeming to be "American", it is hoped that by | ||
| 21 | providing access to the raw data in a variety of different ways (optimised | ||
| 22 | for different application types with different load profiles) it will | ||
| 23 | encourage developers to integrate support for automated dialect | ||
| 24 | translation into internationalisation toolkits, and thus into many | ||
| 25 | applications. | ||
| 26 | |||
| 27 | =head1 METHODS | ||
| 28 | |||
| 29 | For this initial release, only methods to locate the files are provided. | ||
| 30 | |||
| 31 | Additional access methods will be provided later, or on request. | ||
| 32 | |||
| 33 | =cut | ||
| 34 | |||
| 35 | 2 | ▶ | use 5.005; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 36 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 37 | 2 | ▶ | use File::ShareDir (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 38 | |||
| 39 | 2 | ▶ | use vars qw{$VERSION}; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 40 | 2 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 41 | 2 | $VERSION = '1.00'; | |
| 42 | } | ||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | ##################################################################### | ||
| 49 | # File Methods | ||
| 50 | |||
| 51 | =pod | ||
| 52 | |||
| 53 | =head2 abbc_file | ||
| 54 | |||
| 55 | The C<abbc_file> method returns the location of the F<abbc.tab> file from | ||
| 56 | the VarCon data set. | ||
| 57 | |||
| 58 | =cut | ||
| 59 | |||
| 60 | 1 | ▶ | sub abbc_file { |
|
Subroutine
abbc_file: called CC=1 SCAR=0.0
Pod
documented
| |||
| 61 | 1 | File::ShareDir::module_file(__PACKAGE__, 'abbc.tab'); | |
| 62 | } | ||
| 63 | |||
| 64 | =pod | ||
| 65 | |||
| 66 | =head2 also_file | ||
| 67 | |||
| 68 | The C<also_file> method returns the location of the F<variant-also.tab> | ||
| 69 | file from the VarCon data set. | ||
| 70 | |||
| 71 | =cut | ||
| 72 | |||
| 73 | 1 | ▶ | sub also_file { |
|
Subroutine
also_file: called CC=1 SCAR=0.0
Pod
documented
| |||
| 74 | 1 | File::ShareDir::module_file(__PACKAGE__, 'variant-also.tab'); | |
| 75 | } | ||
| 76 | |||
| 77 | =pod | ||
| 78 | |||
| 79 | =head2 infl_file | ||
| 80 | |||
| 81 | The C<infl_file> method returns the location of the F<variant-infl.tab> | ||
| 82 | file from the VarCon data set. | ||
| 83 | |||
| 84 | =cut | ||
| 85 | |||
| 86 | 1 | ▶ | sub infl_file { |
|
Subroutine
infl_file: called CC=1 SCAR=0.0
Pod
documented
| |||
| 87 | 1 | File::ShareDir::module_file(__PACKAGE__, 'variant-infl.tab'); | |
| 88 | } | ||
| 89 | |||
| 90 | =pod | ||
| 91 | |||
| 92 | =head2 wroot_file | ||
| 93 | |||
| 94 | The C<infl_file> method returns the location of the F<variant-wroot.tab> | ||
| 95 | file from the VarCon data set. | ||
| 96 | |||
| 97 | =cut | ||
| 98 | |||
| 99 | 1 | ▶ | sub wroot_file { |
|
Subroutine
wroot_file: called CC=1 SCAR=0.0
Pod
documented
| |||
| 100 | 1 | File::ShareDir::module_file(__PACKAGE__, 'variant-wroot.tab'); | |
| 101 | } | ||
| 102 | |||
| 103 | =pod | ||
| 104 | |||
| 105 | =head2 voc_file | ||
| 106 | |||
| 107 | The C<voc_file> method returns the location of the F<voc.tab> | ||
| 108 | file from the VarCon data set. | ||
| 109 | |||
| 110 | =cut | ||
| 111 | |||
| 112 | 1 | ▶ | sub voc_file { |
|
Subroutine
voc_file: called CC=1 SCAR=0.0
Pod
documented
| |||
| 113 | 1 | File::ShareDir::module_file(__PACKAGE__, 'voc.tab'); | |
| 114 | } | ||
| 115 | |||
| 116 | 2 | 1; | |
| 117 | |||
| 118 | =pod | ||
| 119 | |||
| 120 | =head1 TO DO | ||
| 121 | |||
| 122 | - Split out into smaller language-specific files | ||
| 123 | |||
| 124 | - Access in the form of a memory hash (optimised per language?) | ||
| 125 | |||
| 126 | - Access in the form of a Berkely DB | ||
| 127 | |||
| 128 | - Access in the form of a SQLite database (maybe overkill) | ||
| 129 | |||
| 130 | =head1 SUPPORT | ||
| 131 | |||
| 132 | Perl bugs should always be submitted via the CPAN bug tracker | ||
| 133 | |||
| 134 | L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-UserConfig> | ||
| 135 | |||
| 136 | Bugs in the word lists should be reported via the feature request | ||
| 137 | tracker on the SourceForge site of the Word Lists project. | ||
| 138 | |||
| 139 | L<http://sourceforge.net/tracker/?atid=360079&group_id=10079&func=browse> | ||
| 140 | |||
| 141 | For other issues, contact the maintainer | ||
| 142 | |||
| 143 | =head1 AUTHOR | ||
| 144 | |||
| 145 | Adam Kennedy E<lt>cpan@ali.asE<gt>, L<http://ali.as/> | ||
| 146 | |||
| 147 | =head1 SEE ALSO | ||
| 148 | |||
| 149 | L<File::ShareDir>, L<http://wordlist.sourceforge.net/> | ||
| 150 | |||
| 151 | =head1 COPYRIGHT | ||
| 152 | |||
| 153 | Copyright for this distribution is a little more involved than most. | ||
| 154 | |||
| 155 | =head2 The Lingua::EN::VarCon Module | ||
| 156 | |||
| 157 | Copyright (c) 2006 Adam Kennedy. All rights reserved. | ||
| 158 | |||
| 159 | This program is free software; you can redistribute | ||
| 160 | it and/or modify it under the same terms as Perl itself. | ||
| 161 | |||
| 162 | The full text of the license can be found in the | ||
| 163 | LICENSE file included with this module. | ||
| 164 | |||
| 165 | =head2 The VarCon Data Sets | ||
| 166 | |||
| 167 | Copyright 2000-2004 by Kevin Atkinson | ||
| 168 | |||
| 169 | Permission to use, copy, modify, distribute and sell this array, the | ||
| 170 | associated software, and its documentation for any purpose is hereby | ||
| 171 | granted without fee, provided that the above copyright notice appears | ||
| 172 | in all copies and that both that copyright notice and this permission | ||
| 173 | notice appear in supporting documentation. Kevin Atkinson makes no | ||
| 174 | representations about the suitability of this array for any | ||
| 175 | purpose. It is provided "as is" without express or implied warranty. | ||
| 176 | |||
| 177 | =head2 Original Ispell Data Sets | ||
| 178 | |||
| 179 | The original words lists come from the Ispell distribution: | ||
| 180 | |||
| 181 | Copyright 1993, Geoff Kuenning, Granada Hills, CA | ||
| 182 | All rights reserved. | ||
| 183 | |||
| 184 | Redistribution and use in source and binary forms, with or without | ||
| 185 | modification, are permitted provided that the following conditions | ||
| 186 | are met: | ||
| 187 | |||
| 188 | 1. Redistributions of source code must retain the above copyright | ||
| 189 | notice, this list of conditions and the following disclaimer. | ||
| 190 | 2. Redistributions in binary form must reproduce the above copyright | ||
| 191 | notice, this list of conditions and the following disclaimer in the | ||
| 192 | documentation and/or other materials provided with the distribution. | ||
| 193 | 3. All modifications to the source code must be clearly marked as | ||
| 194 | such. Binary redistributions based on modified source code | ||
| 195 | must be clearly marked as modified versions in the documentation | ||
| 196 | and/or other materials provided with the distribution. | ||
| 197 | (clause 4 removed with permission from Geoff Kuenning) | ||
| 198 | 5. The name of Geoff Kuenning may not be used to endorse or promote | ||
| 199 | products derived from this software without specific prior | ||
| 200 | written permission. | ||
| 201 | |||
| 202 | THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND | ||
| 203 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 204 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 205 | ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE | ||
| 206 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 207 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 208 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 209 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 210 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 211 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 212 | SUCH DAMAGE. | ||
| 213 | |||
| 214 | =cut | ||