Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 32.387.646 Times

Lingua::EN::Inflect 1.89

  Date Added: November 23, 2010  |  Visits: 764


Report Broken Link
Printer Friendly Version

Product Homepage
Download (89 downloads)

Lingua::EN::Inflect is a Perl module that can convert singular to plural. Select "a" or "an". SYNOPSIS use Lingua::EN::Inflect qw ( PL PL_N PL_V PL_ADJ NO NUM PL_eq PL_N_eq PL_V_eq PL_ADJ_eq A AN PART_PRES ORD NUMWORDS inflect classical def_noun def_verb def_adj def_a def_an ); # UNCONDITIONALLY FORM THE PLURAL print "The plural of ", $word, " is ", PL($word), "n"; # CONDITIONALLY FORM THE PLURAL print "I saw $cat_count ", PL("cat",$cat_count), "n"; # FORM PLURALS FOR SPECIFIC PARTS OF SPEECH print PL_N("I",$N1), PL_V("saw",$N1), PL_ADJ("my",$N2), PL_N("saw",$N2), "n"; # DEAL WITH "0/1/N" -> "no/1/N" TRANSLATION: print "There ", PL_V("was",$errors), NO(" error",$errors), "n"; # USE DEFAULT COUNTS: print NUM($N1,""), PL("I"), PL_V(" saw"), NUM($N2), PL_N(" saw"); print "There ", NUM($errors,), PL_V("was"), NO(" error"), "n"; # COMPARE TWO WORDS "NUMBER-INSENSITIVELY": print "samen" if PL_eq($word1, $word2); print "same nounn" if PL_eq_N($word1, $word2); print "same verbn" if PL_eq_V($word1, $word2); print "same adj.n" if PL_eq_ADJ($word1, $word2); # ADD CORRECT "a" OR "an" FOR A GIVEN WORD: print "Did you want ", A($thing), " or ", AN($idea), "n"; # CONVERT NUMERALS INTO ORDINALS (i.e. 1->1st, 2->2nd, 3->3rd, etc.) print "It was", ORD($position), " from the leftn"; # CONVERT NUMERALS TO WORDS (i.e. 1->"one", 101->"one hundred and one", etc.) # IN A SCALAR CONTEXT: GET BACK A SINGLE STRING... $words = NUMWORDS(1234); # "one thousand, two hundred and thirty-four" $words = NUMWORDS(ORD(1234)); # "one thousand, two hundred and thirty-fourth" # IN A LIST CONTEXT: GET BACK A LIST OF STRINGSi, ONE FOR EACH "CHUNK"... @words = NUMWORDS(1234); # ("one thousand","two hundred and thirty-four") # OPTIONAL PARAMETERS CHANGE TRANSLATION: $words = NUMWORDS(12345, group=>1); # "one, two, three, four, five" $words = NUMWORDS(12345, group=>2); # "twelve, thirty-four, five" $words = NUMWORDS(12345, group=>3); # "one twenty-three, forty-five" $words = NUMWORDS(1234, and=>); # "one thousand, two hundred thirty-four" $words = NUMWORDS(1234, and=>, plus); # "one thousand, two hundred, plus thirty-four" $words = NUMWORDS(555_1202, group=>1, zero=>oh); # "five, five, five, one, two, oh, two" $words = NUMWORDS(555_1202, group=>1, one=>unity); # "five, five, five, unity, two, oh, two" $words = NUMWORDS(123.456, group=>1, decimal=>mark); # "one two three mark four five six" # REQUIRE "CLASSICAL" PLURALS (EG: "focus"->"foci", "cherub"->"cherubim") classical; # USE ALL CLASSICAL PLURALS classical 1; # USE ALL CLASSICAL PLURALS classical 0; # USE ALL MODERN PLURALS (DEFAULT) classical zero; # "no error" INSTEAD OF "no errors" classical zero=>1; # "no error" INSTEAD OF "no errors" classical zero=>0; # "no errors" INSTEAD OF "no error" classical herd; # "2 buffalo" INSTEAD OF "2 buffalos" classical herd=>1; # "2 buffalo" INSTEAD OF "2 buffalos" classical herd=>0; # "2 buffalos" INSTEAD OF "2 buffalo" classical persons; # "2 chairpersons" INSTEAD OF "2 chairpeople" classical persons=>1; # "2 chairpersons" INSTEAD OF "2 chairpeople" classical persons=>0; # "2 chairpeople" INSTEAD OF "2 chairpersons" classical ancient; # "2 formulae" INSTEAD OF "2 formulas" classical ancient=>1; # "2 formulae" INSTEAD OF "2 formulas" classical ancient=>0; # "2 formulas" INSTEAD OF "2 formulae" # INTERPOLATE "PL()", "PL_N()", "PL_V()", "PL_ADJ()", A()", "AN()" # "NUM()" AND "ORD()" WITHIN STRINGS: print inflect("The plural of $word is PL($word)n"); print inflect("I saw $cat_count PL("cat",$cat_count)n"); print inflect("PL(I,$N1) PL_V(saw,$N1) PL(a,$N2) PL_N(saw,$N2)"); print inflect("NUM($N1,)PL(I) PL_V(saw) NUM($N2,)PL(a) PL_N(saw)"); print inflect("I saw NUM($cat_count) PL("cat")nNUM()"); print inflect("There PL_V(was,$errors) NO(error,$errors)n"); print inflect("There NUM($errors,) PL_V(was) NO(error)n"; print inflect("Did you want A($thing) or AN($idea)n"); print inflect("It was ORD($position) from the leftn"); # ADD USER-DEFINED INFLECTIONS (OVERRIDING INBUILT RULES): def_noun "VAX" => "VAXen"; # SINGULAR => PLURAL def_verb "will" => "shall", # 1ST PERSON SINGULAR => PLURAL "will" => "will", # 2ND PERSON SINGULAR => PLURAL "will" => "will", # 3RD PERSON SINGULAR => PLURAL def_adj "hir" => "their", # SINGULAR => PLURAL def_a "h" # "AY HALWAYS SEZ HAITCH!" def_an "horrendous.*" # "AN HORRENDOUS AFFECTATION" The exportable subroutines of Lingua::EN::Inflect provide plural inflections, "a"/"an" selection for English words, and manipulation of numbers as words 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. Pronunciation-based "a"/"an" selection is provided for all English words, and most initialisms. It is also possible to inflect numerals (1,2,3) to ordinals (1st, 2nd, 3rd) and to english words ("one", "two", "three). In generating these inflections, Lingua::EN::Inflect follows the Oxford English Dictionary and the guidelines in Fowlers Modern English Usage, preferring the former where the two disagree. The module is built around standard British spelling, but is designed to cope with common American variants as well. Slang, jargon, and other English dialects are not explicitly catered for. Where two or more inflected forms exist for a single word (typically a "classical" form and a "modern" form), Lingua::EN::Inflect prefers the more common form (typically the "modern" one), unless "classical" processing has been specified (see "MODERN VS CLASSICAL INFLECTIONS")..

Requirements: No special requirements
Platforms: Linux
Keyword: Classical En Instead Of Num Numwords One One Thousand Perl Module Pl Plural Print Singular Two Hundred Words
Users rating: 0/10

License: Freeware Size: 40.96 KB
More Reviews or Write Review

Security Tools  -  Authen::OTP 1.0.0
Authen::OTP is a One Time Password perl module implementing RFC 2289. It goes beyond computing the nth OTP. It helps admins maintain users OTP passwords, authenticates users, updates their current states, provides the challenges, etc. It can...
17.41 KB  
Network & Internet  -  PloneMinimalProduct 2.0Beta1
PloneMinimalProduct provides a skeleton one can use to create new types (instead of starting "from scratch"). There is a script called (working with Bash) that will do this job for you. Example usage:: $ tar xzf...
58.37 KB  
Multimedia & Graphics  -  fftrans 0.0.1
fftrans is a modification of the "Quick and Dirty Transcoder" script to use ffmpeg instead of gstreamer. Very quick-and-dirty, only usable for transcoding files for transfer to media devices, but as far as I know the only way one can transcode...
10.24 KB  
Libraries  -  Mail::Message::Head::Complete 2.069
Mail::Message::Head::Complete is a Perl module with the header of one message. INHERITANCE Mail::Message::Head::Complete is a Mail::Message::Head is a Mail::Reporter Mail::Message::Head::Complete is extended by...
583.68 KB  
Libraries  -  Java::Build 0.05
Java::Build is a family of modules which you can use instead of Ant. SYNOPSIS use Java::Build::JVM; # access to the javac compiler in one jvm use Java::Build::Tasks; # some helpful methods similar to Ant tasks my $source_files =...
30.72 KB  
E-Mail Tools  -  QmailLDAP/Controls 20060403b
QmailLDAP/Controls stores control information for Qmail in an LDAP database instead of files. QmailLDAP/Controls program requires the Qmail-LDAP patch. The main reason for this patch was having a centralised configuration of qmail. My point was...
38.91 KB  
Libraries  -  XML::Generator::DOM 0.99
XML::Generator::DOM is an XML::Generator subclass for producing DOM trees instead of strings. SYNOPSIS use XML::Generator::DOM; my $dg = XML::Generator::DOM->new(); my $doc = $dg->xml($dg->xmlcmnt("Test document."), $dg->foo({baz => bam},...
21.5 KB  
Libraries  -  List::Part 0.03
List::Part is a Perl module that allows you to partition one array into several. SYNOPSIS use List::Part; ($good, $bad)=part { !/substring/ } @array; #store arrayrefs into $good and $bad (*good, *bad)=part { !/substring/ } @array; #store...
4.1 KB  
Libraries  -  Java::Build::Tasks 0.05
Java::Build::Tasks is a Perl module that collects common Java build tasks in one place: jar, jarsigner, etc. SYNOPSIS use Java::Build::Tasks; set_logger($log_object); copy_file(source, dest); copy_file(list, of, sources, dest);...
30.72 KB  
Libraries  -  Convert::Cyrillic 1.05
Convert::Cyrillic is a Perl module with routines for converting from one cyrillic charset to another. SYNOPSIS use Convert::Cyrillic; $src = koi8; $dst = win; $SrcBuf = text in koi8 here; $DstBuf = Convert::Cyrillic::cstocs ($Src, $Dst,...
24.58 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 3.15.3
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB