README
1NAME
2
3 Lingua::EN::Inflect::Phrase - Inflect short English Phrases
4
5SYNOPSIS
6
7 use Lingua::EN::Inflect::Phrase;
8 use Test::More tests => 2;
9
10 my $plural = Lingua::EN::Inflect::Phrase::to_PL('green egg and ham');
11
12 is $plural, 'green eggs and ham';
13
14 my $singular = Lingua::EN::Inflect::Phrase::to_S('green eggs and ham');
15
16 is $singular, 'green egg and ham';
17
18DESCRIPTION
19
20 Attempts to pluralize or singularize short English phrases.
21
22 Does not throw exceptions at present, if you attempt to pluralize an
23 already pluralized phrase, it will leave it unchanged (and vice versa.)
24
25 The behavior of this module is subject to change as I tweak the
26 heuristics, as some things get fixed others might regress. The
27 processing of natural language is a messy business.
28
29 If it doesn't work, please email or submit to RT the example you tried,
30 and I'll try to fix it.
31
32OPTIONS
33
34 By default, this module prefers to treat words as nouns (sometimes
35 words can be interpreted as a verb or a noun without context.) This is
36 better for things such as database table/column names, which is what
37 this module is primarily for.
38
39 This behavior can be switched with the variable $prefer_nouns. The
40 default is 1.
41
42 For example:
43
44 {
45 local $Lingua::EN::Inflect::Phrase::prefer_nouns = 0;
46 is Lingua::EN::Inflect::Phrase::to_S('sources split'), 'source splits';
47 }
48 {
49 local $Lingua::EN::Inflect::Phrase::prefer_nouns = 1;
50 is Lingua::EN::Inflect::Phrase::to_S('source splits'), 'source split';
51 }
52
53OPTIONAL EXPORTS
54
55 "to_PL", "to_S"
56
57SUBROUTINES
58
59 to_PL
60
61 Attempts to pluralizes a phrase unless already plural.
62
63 to_S
64
65 Attempts to singularize a phrase unless already singular.
66
67BUGS
68
69 Please report any bugs or feature requests to
70 bug-lingua-en-inflect-phrase at rt.cpan.org, or through the web
71 interface at
72 http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Lingua-EN-Inflect-Phrase.
73 I will be notified, and then you'll automatically be notified of
74 progress on your bug as I make changes.
75
76REPOSITORY
77
78 git clone git://github.com/rkitover/lingua-en-inflect-phrase.git lingua-en-inflect-phrase
79
80SEE ALSO
81
82 Lingua::EN::Inflect, Lingua::EN::Inflect::Number, Lingua::EN::Tagger
83
84AUTHOR
85
86 rkitover: Rafael Kitover <rkitover@cpan.org>
87
88CONTRIBUTORS
89
90 zakame: Zak B. Elep <zakame@zakame.net>
91
92LICENSE AND COPYRIGHT
93
94 Copyright (c) 2018 Rafael Kitover (rkitover@cpan.org).
95
96 This program is free software; you can redistribute it and/or modify it
97 under the terms of either: the GNU General Public License as published
98 by the Free Software Foundation; or the Artistic License.
99
100 See http://dev.perl.org/licenses/ for more information.
101
102