Files
tilde-projects/Code/irc/inflect.pyc
T

622 lines
83 KiB
Plaintext
Raw Normal View History

2015-01-02 16:59:08 +00:00
ó
»ÓÑ[cÂ@sdZddlmZmZmZmZmZddlmZddlm Z
2015-01-02 16:59:08 +00:00
ddlm Z de
fd„ƒYZde
fd „ƒYZd
e
fd „ƒYZd e
fd
„ƒYZde
fd„ƒYZde
fd„ƒYZde
fd„ƒYZdZdZdZdZdeeeefZeZd„Zd„Zddd„Zd„Ze d„Z!idd6d d!6d"d#6d$d%6d&d'6d(d)6d*d+6d,d-6Z"id.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d?6d@dA6dBdC6dDdE6dFdG6dHdI6dJdK6dLdM6dNdO6dPdQ6dRdS6dTdU6dVdW6dXdY6dZd[6d\d]6d^d_6d`da6dbdc6ddde6dfdg6dhdi6djdk6Z#e#j$e"ƒidldm6dndo6dpdq6drds6Z%idtdu6Z&e'ge#j(ƒD]\Z)Z*e*e)f^q˃Z+e,e+j-ƒƒZ-xOe-D]GZ)dve)kre)jdvƒ\Z.Z/e+e)e+e.<e+e/<e+e)=qqWe'ge%j(ƒD]\Z)Z*e*e)f^q`ƒZ0e'ge&j(ƒD]\Z)Z*e*e)f^q‘ƒZ1e,e1j-ƒƒZ-xOe-D]GZ)dve)krËe)jdvƒ\Z.Z/e1e)e1e.<e1e/<e1e)=qËqËWdZ2ee2ƒZ3dZ4ee4ƒZ5dzd{d|d}d~gZ6dgZ7ed€e6ge7D]Z8d�e8^qhƒZ9e6e7Z:e!e:d‚ddƒeƒ\Z;Z<Z=dZ>e!e>dœd�ƒ\Z?Z@ZAZBdZCe!eCd¢dƒ\ZEZFZGZHd ZIe!eId¢dƒ\ZJZKZLZMd
ZNe!eNdµdƒ\ZOZPZQZRd ZSe!eSd¿dƒ\ZTZUZVZWd ZXe!eXd¿dƒ\ZYZZZ[Z\d
Z]e!e]dçdƒ\Z^Z_Z`ZadZbe!ebdçdƒ\ZcZdZeZfdZgeegƒZhdZie!eid¿dƒ\ZjZkZlZmdZne!end¿dƒ\ZoZpZqZrddd d
d d d
dgZseesƒZtegesD]Z8de8d ^q[ƒZuedesƒZvewdƒZxewd„exDƒƒZydddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd€d�d‚dƒd„d…d†d‡dˆd‰dŠd‹dŒd�dŽd�d�d‘d’d“d”d•d–d—d˜d™dšd›dœd�dždŸd d¡d¢d£d¤d¥d¦d§d¨d©dªd«d¬d­d®d¯d°d±d²d³d´dµd¶d·d¸d¹dºd»d¼d½d¾d¿dÀdÁdÂdÃdÄdÅdÆdÇdÈdÉdÊdËdÌdÍdÎdÏdÐdÑdÒdÓdÔdÕdÖd×dØgÂesZzeezƒZ{egezD]Z8dÙe8^q ƒZ|dZ}e!e}dÝdƒ\Z~ZZ€Z�dZ‚e!e‚dádƒ\ZƒZ„Z…Z†dZ‡e!e‡dádƒ\ZˆZ‰ZŠZ‹dZŒe!eŒdádƒ\Z�ZŽZ�Z�dZ‘e!e‘dádƒ\Z’Z“Z”Z•dZ–e!e–dçdƒ\Z—Z˜Z™ZšdZ›e!e›dódƒ\ZœZ�ZžZŸdôjƒZ dõjƒZ¡e!e dÝddƒeƒ\Z¢Z£Z¤e!e¡dÝddƒeƒ\Z¥Z¦Z§död÷dødùdúdûdüdýdþdÿd(dddddddddd d
d d d
ddddddddddg#Z¨ddgZ©e¨ge©D]Z8d�e8^q ZªdZ«d6d7d+d8d9d:d;d<d=d>d?d@dBdAdBdCdDdEdFge¨Z¬dGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^gZ­d_d`dadbdcdddedfdgg e©Z®ee®ƒZ¯dhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd€d�d‚dƒd„d d…d†g e6Z°d‡dˆge7Z±ee±ƒZ²ge°D]Z8d‰e8^qo Z³ge±D]Z8d‰e8^qŒ Z´ee´ƒZµdŠgZ¶edvj·e°ge±D]Z8d�e8^qÊ e¶ƒƒZ¸dZ¹dZºdZ»dZ¼dZ½d Z¾d!Z¿d"ZÀd#ZÁd$ZÂd%ZÃd&ZÄd'ZÅd(ZÆd)ZÇd*ZÈedvj·e¸geªe,e"j-ƒƒdèdédêgƒƒZÉidëgdì6dígdî6ZÊxEe,eÊj-ƒƒD]1Z)eedvj·eÊe)ƒƒdïe)ƒeÊe)<q±
Wdðdvj·e,eÊj˃ƒƒdñZÌd+ZÍd2jƒZÎeÎd3d4d5gZÏeeσZÐedvj·eσƒZÑd6eÑd7ZÒewd8d9d:d;d<d=gƒZÓid>dç6d?d@6dAdA6dBdC6dDdE6dFdG6dDdH6dFdI6dDdJ6dFdK6dDdD6dFdL6dMdN6dOdO6dPdQ6dPdR6dPdS6dPdP6ZÔiZÕe'geÔj(ƒD]\Z)Z*e*e)f^qƒeÕdT<dUeÕdTd><i dˆdV6d?d@6dAdA6dBdC6dWdX6dFdG6dWdY6dFdI6dWdJ6dFdK6dWdW6dFdL6ZÖedvj·e,eÖj-ƒƒƒƒZ×ee,eÖj-ƒƒƒZØe'geÖj(ƒD]\Z)Z*e*e)f^qëƒeÕdZ<x¾d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIfD]\\ZÙZÚZÛZÜyeÜeÕeÙeÚeÛ<WqqeÝk
rÌieÕeÙeÚ<eÜeÕeÙeÚeÛ<qqXqqWedvj·e,eÕdZj-ƒƒƒƒZÞee,eÕdZj-ƒƒƒZßdc„Zài ddde6dddd6dddf6dgdh6dgdg6dgdh6didi6didi6didj6dkdk6dkdk6dkd¢6Zái3dldl6dldl6dldm6dndn6dndn6dndo6dpdp6dpdp6dpdp6dqdq6dqdq6dqdq6drdr6drdr6drds6dtdt6dtdt6dtdu6dvdv6dvdv6dvdw6dxdx6dxdx6dxdy6dzdz6dzdz6dzd{6d|d|6d|d|6d|d}6d~d~6d~d~6d~d6d€d€6d€d€6d€d�6d‚d‚6d‚d‚6d‚dƒ6d„d„6d„d„6d„d…6d†d†6d†d†6d†d‡6dˆdˆ6dˆdˆ6dˆd‰6dŠdŠ6dŠdŠ6dŠd‹6Zâedvj·e,eâj-ƒƒƒƒZãdJZäedvj·dKƒƒZådLZædMZçd ZèdNZédOZêid«d¿6d«d¥6d¬d©6d­dª6Zëedvj·e,eëj-ƒƒƒƒZìid®d¯6d°d°6d±dS6d±dX6d±dR6d±d±6Zíedvj·e,eíj-ƒƒƒƒZîd²Zïd³Zðedvj·dPƒƒZñedvj·dQƒƒZòedvj·dRƒƒZóedvj·dSƒƒZôi
d¿d6dÀd�6dÁd6dÂdÃ6d¿d6d¿dÄ6d¿dÅ6d¿dÆ6d¿dÇ6d¿dÈ6d¿dÉ6d¿dÊ6d¿dË6Zõe'dÌdÍd¦dÎdÏdÐdÑdÒdÓdÔdÕdÖd×dØdÙdÚƒZödvj·e,eöj-ƒƒƒZ÷dd¦dÏdÑdÛdÓdÜdÝdÕd×g
ZødÞdßdÙdàdádâdãdädådæg
Zùdddçdèdédêdëdìdídîg
Zúdïdðdñdòdódôdõdöd÷dødùdúg Zûe'dûed×edüedýe dþedÿeƒZüe'd„e,eüj-ƒƒDƒƒZýe'd„e,eüj-ƒƒDƒƒZþddTd„ƒYZÿdS(Us.
inflect.py: correctly generate plurals, ordinals, indefinite articles;
convert numbers to words
Copyright (C) 2010 Paul Dyson
Based upon the Perl module Lingua::EN::Inflect by Damian Conway.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
The original Perl module Lingua::EN::Inflect by Damian Conway is
available from http://search.cpan.org/~dconway/
This module can be downloaded at http://pypi.python.org/pypi/inflect
methods:
classical inflect
plural plural_noun plural_verb plural_adj singular_noun no num a an
compare compare_nouns compare_verbs compare_adjs
present_participle
ordinal
number_to_words
join
defnoun defverb defadj defa defan
INFLECTIONS: classical inflect
plural plural_noun plural_verb plural_adj singular_noun compare
no num a an present_participle
PLURALS: classical inflect
plural plural_noun plural_verb plural_adj singular_noun no num
compare compare_nouns compare_verbs compare_adjs
COMPARISONS: classical
compare compare_nouns compare_verbs compare_adjs
ARTICLES: classical inflect num a an
NUMERICAL: ordinal number_to_words
USER_DEFINED: defnoun defverb defadj defa defan
Exceptions:
UnknownClassicalModeError
BadNumValueError
BadChunkingOptionError
NumOutOfRangeError
BadUserDefinedPatternError
BadRcFileError
BadGenderError
iÿÿÿÿ(tmatchtsearchtsubnt
IGNORECASEtVERBOSE(tsplit(terror(tsubtUnknownClassicalModeErrorcBseZRS((t__name__t
__module__(((s!/home/krowbar/Code/irc/inflect.pyRFstBadNumValueErrorcBseZRS((R R
(((s!/home/krowbar/Code/irc/inflect.pyR JstBadChunkingOptionErrorcBseZRS((R R
(((s!/home/krowbar/Code/irc/inflect.pyR NstNumOutOfRangeErrorcBseZRS((R R
(((s!/home/krowbar/Code/irc/inflect.pyR
RstBadUserDefinedPatternErrorcBseZRS((R R
(((s!/home/krowbar/Code/irc/inflect.pyRVstBadRcFileErrorcBseZRS((R R
(((s!/home/krowbar/Code/irc/inflect.pyRZstBadGenderErrorcBseZRS((R R
(((s!/home/krowbar/Code/irc/inflect.pyR^siiits
%d.%d.%d%scCstr|GHndS(N(t STDOUT_ON(ttxt((s!/home/krowbar/Code/irc/inflect.pytprint3lscCsd|S(Ns(?:%s)((ts((s!/home/krowbar/Code/irc/inflect.pytencloseqscs#tdj‡fd†|DƒƒƒS(s/
join stem of each word in words into a string for regex
each word is truncated at cutpoint
cutpoint is usually negative indicating the number of letters to remove
from the end of each word
e.g.
joinstem(-2, ["ephemeris", "iris", ".*itis"]) returns
(?:ephemer|ir|.*it)
t|c3s|]}|ˆ VqdS(N((t.0tw(tcutpoint(s!/home/krowbar/Code/irc/inflect.pys <genexpr>�s(Rtjoin(Rtwords((Rs!/home/krowbar/Code/irc/inflect.pytjoinstemus cCsZi}xM|D]E}t|ƒ|kr;tƒ|t|ƒ<n|t|ƒj|ƒq
W|S(sÜ
take a list of words and return a dict of sets sorted by word length
e.g.
ret[3]=set(['ant', 'cat', 'dog', 'pig'])
ret[4]=set(['frog', 'goat'])
ret[5]=set(['horse'])
ret[8]=set(['elephant'])
(tlentsettadd(RtretR((s!/home/krowbar/Code/irc/inflect.pytbysize„s 
c Cs…|dk r| }ng|D]}|| |^q}t|ƒ}t|ƒ}|rtt||ƒ}||||fS|||fSdS(sŠ
given a list of singular words: lst
an ending to append to make the plural: plending
the number of characters to remove from the singular before appending plending: siendingsize
a flag whether to create a joinstem: dojoinstem
return:
a list of pluralised words: si_list (called si because this is what you need to
look for to make the singular)
the pluralised words as a dict of sets sorted by word length: si_bysize
the singular words as a dict of sets sorted by word length: pl_bysize
if dojoinstem is True: a regular expression that matches any of the stems: stem
N(tNoneR"R( tlsttplendingt siendingsizet
2015-01-02 16:59:08 +00:00
dojoinstemRtsi_listt pl_bysizet si_bysizetstem((s!/home/krowbar/Code/irc/inflect.pytmake_pl_si_lists•s 
!  scorpuses|corporatcorpuss opuses|operatopustgeneratgenustmythoitmythoss
penises|penestpenisttestesttestissatlases|atlantestatlastyesestyestchildrentchildsbrothers|brethrentbrothertloavestloafs hoofs|hoovesthoofs beefs|beevestbeefsthiefs|thievestthieftmoniestmoneyt mongoosestmongoosetoxentoxs cows|kinetcowtgraffititgraffitosoctopuses|octopodestoctopuss genies|geniitgeniesganglions|gangliatganglionttrilbysttrilbys turfs|turvestturftnuminatnumentatmastatmansocciputs|occipitatocciputt sabretoothst
sabretootht sabertoothst
sabertoothtlowlifestlowlifet flatfootstflatfoott tenderfootst
tenderfoottromaniestromanytjerriestjerrytmariestmaryttalousesttalousetblousestblousetromatromtcarminatcarmentRomaniestRomanytJerrystJerrytMarystMarytRomatRomsprima donnas|prime donnes prima donnaRtquartzttopaztsnoozet ephemeristiristclitorist chrysalist
epididymistitisiþÿÿÿs.*%stidesR'tanathematbemat carcinomatcharismatdiplomatdogmatdramatedematenematenigmatlemmatlymphomatmagmatmelismatmiasmatoedematsarcomatschematsomatstigmatstomattraumatgummatpragmatataitalumnatalgatvertebratpersonatetamoebatantennatformulat hyperbolatmedusatnebulatparabolatabscissathydratnovatlacunatauroratumbratfloratfaunatstamentforamentlumentinat bacteriumtagendumt desideratumterratumtstratumtdatumtovumtextremumt candelabrumtatmaximumtminimumtmomentumtoptimumtquantumtcraniumt
curriculumtdictumtphylumtaquariumt
compendiumtemporiumtenconiumt gymnasiumt
honorariumt interregnumtlustrumt
memorandumt
millenniumtrostrumtspectrumtspeculumtstadiumt trapeziumt ultimatumtmediumtvacuumtvelumt
consortiumt arboretumtalumnustalveolustbacillustbronchustlocustnucleuststimulustmeniscust sarcophagustitfocustradiustgeniustincubustsuccubustnimbustfungust nucleoluststylusttorust umbilicustuterust hippopotamustcactuststatust apparatust
prospectustsinusthiatustimpetustplexust criteriont
periheliontapheliont
phenomenont prolegomenontnoumenontorganont asyndetont
hyperbatontoxymorontsolotsopranotbassotaltot contraltottempotpianotvirtuosos%sitadotISOtNATOtNCOtNGOtotoccs|]}d|VqdS(s%ssN((RR((s!/home/krowbar/Code/irc/inflect.pys <genexpr>)st
aficionadotaggrotalbinotallegrotammot Antananarivot archipelagot armadillotautotavocadotBamakot BarquisimetotbimbotbingotBirotbolerotBolzanotbongotBototburrotCairotcantot
cappuccinotcasinotcellotChicagotChimangotcilantrotcochitotcocotColombotColoradotcommandot
concertinotcontangotcredot crescendotcyanotdemotdittotDracotdynamotembryot EsperantotespressoteurotfalsettotFarotfiascotFilipinotflamencotfuriosot
generalissimotGestapotghettotgigolotgizmot
Greensborotgringot GuaiaberotguanotgumbotgyrothairdothippotIdahotimpetigotinfernotinfot
intermezzot
intertrigotIquicotjumbotjuntotKakapotkilot KinkimavotKokakotKosovotLesothotliberotlibidotlibrettotlidotLilotlimbotlimotlinenotlingotlinotlivedotlocotlogotlumbagotmachotmacrotmafiosotmagnetot magnificotMajurotMalabot manifestotMaputot MaracaibotmedicotmemotmetrotMexicotmicrotMilanotMonacotmonot
MontenegrotMoroccotMuqdishotmyotneutrinotNingbotoctavotoreganotOrinocotOrlandotOslotpantot
ParamaribotParduscotpedalotphototpimentotpintotplecotPlutotpogotpolotponchos
Porto-NovotPortotprotpsychotpueblotquartotQuitotrhinotrisottotrococotrondot
SacramentotsaddotsagotsalvotSantiagotSapporotSarajevot
scherzandotscherzotsilotsiroccotsombrerotstaccatotsternotstuccotstylotsumotTaikottechnotterrazzottestudottimpanottirottobaccotTogotTokyottorerotTorinotTorontottorsottremolottypottyrotufotUNESCOtvaquerot
vermicellotversotvibratot violoncellotVirgotweirdotWHOtWTOt Yamoussoukrosyo-yotzerotZibos%sstczechteunuchtstomachRtcodextmurextsilexticestradixthelixtvortextvertextcortextlatextpontifextapextindextsimplextappendixtafrittafreettefreettgoytseraphtcherubtimsq
ataman caiman cayman ceriman
desman dolman farman harman hetman
human leman ottoman shaman talisman
s™
Alabaman Bahaman Burman German
Hiroshiman Liman Nakayaman Norman Oklahoman
Panaman Roman Selman Sonaman Tacoman Yakiman
Yokohaman Yuman
tbreechestbritchestpajamastpyjamastclipperstgallowsthijinkst headquarterstplierstscissorstherpestpincerstshearst proceedingsttrouserstcantustcoitustnexust contretempstcorpstdebristsiemenstmumpstdiabetest
jackanapestseriestspeciest
subspeciestrabiestchassistinningstnewstmewsthaggistoistmeaslest
wildebeesttswinetelandtbisontbuffalotelkt
rhinocerostzucchinitcariboutdacetgrouses guinea fowls guinea-fowlthaddockthakethalibuttherringtmackereltpickereltpiketroetseedtshadtsnipettealtturbots
water fowls
water-fowlttunatsalmonttrouttbreamssea-bassssea basstcarptcodtfloundertwhitingtmoosetdjinntsamurit offspringtpencetquidthertzt
PortuguesetAmoyesetBorghesetCongoesetFaroeset
FoochowesetGenevesetGenoeset
Gilberteset Hottentoteset
KiplingesetKongoesetLucchesetMalteset
NankingesetNiaseset Pekingeset Piedmonteset Pistoieset
SarawakesetShaveset
Vermonteset
WenchowesetYengeesetfishtdeertsheeptnesetresetlesetmesetpoxtcraftt acropolistaegistaliastasbestostbathostbiast
bronchitistbursitistcaddistcannabistcanvastchaostcosmostdaist digitalist epidermistethosteyastgastglottisthubristibistlenstmantistmarquist
metropolistpathostpelvistpolist sassafrasttrellistsstuss%sess [A-Z].*estBolshoistHanoist BetelgeusestDusestMeusest Syracusest Toulousestabusest applausestcarousestcausest chartreusestclausestcontusestdousestexcusestfusestgrousest hypotenusest masseusest
menopausestmisusestmusestoverusestpausestperusestprofusestreclusestreusestrusestsousestspousestsuffusest
transfusestusestAddiestAggiestAlliestAmiestAngiestAnniest AnnmariestArchiestArtiestAussiestBarbiestBarriestBasiestBenniestBerniestBertiestBessiestBettiestBilliestBlondiestBobbiestBonniestBowiestBrandiestBriestBrowniestCalliest CarnegiestCarriestCassiestCharliestCheriest ChristiestConniestCuriestDanniestDebbiestDixiestDolliestDonniest DrambuiestEddiestEffiestElliestElsiestEriestErniestEssiestEugeniestFanniestFlossiestFrankiestFreddiest
GillespiestGoldiestGraciestGuthriestHalliestHattiestHettiestHolliestJackiestJamiestJaniestJanniestJeaniestJeanniestJenniestJessiestJimmiestJodiestJohniestJohnniestJosiestJuliest KalgoorliestKathiestKatiestKelliestKewpiestKristiestLaramiestLassiestLauriestLesliestLessiestLilliestLizziestLonniestLoriestLorriestLottiestLouiest
MackenziestMaggiestMaisiestMamiestMarciestMargiestMariest MarjoriestMattiest McKenziestMelaniestMickiestMilliestMinniestMolliestMountiestNanniestNataliestNelliestNettiestOlliestOzziestPearliest
PottawatomiestReggiestRichiestRickiestRobbiestRonniestRosaliest
RosemariestRosiestRoxiestRushdiestRuthiestSadiestSalliestSammiestScottiest SelassiestSherriestSophiestStaciest Stefaniest
StephaniestSteviestSusiestSylviestTammiestTerriestTessiestTommiestTraciestTrekkiestValariestValeriest ValkyriestVickiestVirgiestWilliestWinniestWyliestYorkiestaeriestbaggiestbeliestbiggiestbirdiestbogiestbonniestboogiestbookiest bourgeoisiestbrowniestbudgiestcaddiestcaloriest camaraderiest cockamamiestcolliestcookiestcooliestcootiestcoteriestcrappiestcuriestcutesiestdogiesteyrietflooziestfootsiestfreebiestgeniestgoaliestgroupiesthiest jalousiestjunkiestkiddiestladdiestlassiestliest lingeriestmagpiest
menageriestmommiestmoviestnecktiestnewbiestnightiestoldiest organdiestoverliestpiestpinkiestpixiestpotpiestprairiestquickiestreveriestrookiest rotisseriestsoftiestsortieststymiestsweetiesttiest underliestuntiestveggiestviestyuppiestzombiestChloestCrusoestDefoestFaeroestIvanhoestJoestMcEnroestMoestMonroestNoestPoestRoscoestTahoest TippecanoestZoestaloestbackhoestcanoestdoestfloestfoesthoest
mistletoestoboestpekoestroestsloestthroesttiptoesttoestwoestquartzesttopazestbuzzestfizzestfrizzestrazzest AndromachestApachestBlanchest Comanchest
NietzschestPorschestRochestachest
avalanchest backachest
bellyachestcachestclochestcrechestdouchestearachestfichest headachest
heartachest microfichestnichest pastichestpsychestquichest stomachachest
toothachestannexestaxestdeluxestpickaxestHessestJessest LaroussestMatissestbouillabaissest crevassest
demitassestimpassestmoussestpossestClivest
Palmolivest interweavestweavestolivestbivalvest dissolvestresolvestsalvesttwelvestvalvess (.*[csx])iss(.*)cepss[A-Z].*ss1(?!major|lieutenant|brigadier|adjutant|.*star)\S+tgeneraltcourttmartials(?=(?:-|\s+)%s)t(s)(.*)t
amanuensest
2015-01-02 16:59:08 +00:00
amniocentesestanalysest
antithesest
apotheosestarteriosclerosestatherosclerosest catalysest catharsestchassest cirrhosestcoccestcrisest diagnosestdialysestdieresest electrolysestemphasestexegesestgenesest halitosest
hydrolysesthypnosest
hypothesest
hysteresest
metamorphosest
2015-01-02 16:59:08 +00:00
metastasest misdiagnosestmitosest
mononucleosestnarcosestnecrosestnemesestneurosestoasestosmosest osteoporosest paralysest parenthesestparthenogenesest periphrasestphotosynthesest proboscest prognosest prophylaxest
prosthesestprecest psoriasestpsychoanalysest
psychokinesest psychosest sclerosest scoliosestsepsest silicosest symbiosestsynopsest synthesesttaxest telekinesestthesest
2015-01-02 16:59:08 +00:00
thrombosest tuberculosest
urinalysessï
2015-01-02 16:59:08 +00:00
about above across after among around at athwart before behind
below beneath beside besides between betwixt beyond but by
during except for from in into near of off on onto out over
2015-01-02 16:59:08 +00:00
since till to under until unto upon withtdetdutdas(.*?)((?:-|\s+)(?:s)(?:-|\s+))a(?:-|\s+)(.*)tneutertfemininet masculinesgender-neutralsfeminine or masculinesmasculine or femininetwet ourselvestmyselftyout
yourselvestyourselfttheytshet
themselvestherselfthethimselftittitselftthemselftourstminetyoursttheirsthersthistitstnomtItmetthemtherthimtaccs she or hes he or shesherself or himselfshimself or herselfs hers or hiss his or herss
her or hims
him or hercCsNyt||}Wntk
r(‚nXy ||SWntk
2015-01-02 16:59:08 +00:00
rI|SXdS(N(tsi_prontKeyErrort TypeError(tthecasetwordtgendertsing((s!/home/krowbar/Code/irc/inflect.pyt get_si_pronˆs
 
taretamtistweretwasthavethastdotacttactstblametblamestcantmusttflytfliestcopytcopiestdrinktdrinkstfighttfightstfiretfirestliketlikestlooktlookstmaketmakestreachtreachestruntrunstsinktsinkstsleeptsleepstviewtviewstdidthadtatetmadetputtspenttfoughttsanktgavetsoughttshalltcouldtoughttshouldtthoughttsawtbenttwilltmighttcuttshoest0tnotnilt1tantoneteachteverytthistthattsometthesetthosetourtmytyourttheirs}
2015-01-02 16:59:08 +00:00
(?! FJO | [HLMNS]Y. | RY[EO] | SQU
| ( F[LR]? | [HL] | MN? | N | RH? | S[CHKLMNPTVW]? | X(YL)?) [AEIOU])
[FHLMNRSX][A-Z]
2015-01-02 16:59:08 +00:00
s&y(b[lor]|cl[ea]|fere|gg|p[ios]|rou|tt)t unabombert unanimoustUSteulers hour(?!i)theirthonestshono[ur]tmpegs[aefhilmnorsx]-?ths[bcdgjkpqtuvwyz]-?thtthtsttndtrdiiiiii i i i
ttyttiethtfirstttwotsecondtthreetthirdtfivetfifthteightteighthtninetninthttwelvettwelfthtfourtsixtseventtenteleventthirteentfourteentfifteentsixteent seventeenteighteentnineteenttwentytthirtytfortytfiftytsixtytseventyteightytninetyt s thousands millions billions trillions quadrillions quintillions sextillions septillions
octillions
2015-01-02 16:59:08 +00:00
nonillions
decilliontalltherdtnamestpersonstancientccs|]}|tfVqdS(N(tTrue(Rtk((s!/home/krowbar/Code/irc/inflect.pys <genexpr>€sccs|]}|tfVqdS(N(tFalse(RRÄ((s!/home/krowbar/Code/irc/inflect.pys <genexpr>�stenginecBs&eZd„Zeddddddddd d
d d d
dddddddddddƒ Zd„Zd„Zd„Zd„Zd„Z d„Z
d„Z d „Z d!„Z
d"„Zeed#„Zd$„Zd%„Zd&„Zd'„Zd(„Zd)„Zd*„Zd+„Zd,„Zd-„Zd.„Zd/„Zd0„Zd1„Zd2„Zed3„Z ed4„Z!ed5„Z"ed6„Z#d7„Z$d8„Z%d9„Z&d:„Z'eed;„Z(d<„Z)d=„Z*d>„Z+d?„Z,ed@„Z-edA„Z.edB„Z/edC„Z0edD„Z1eedE„Z2dFdG„Z3e3Z4dH„Z5edI„Z6dJ„Z7dK„Z8dLdM„Z9dLdN„Z:dLdO„Z;dP„Z<dQ„Z=dR„Z>dS„Z?dT„Z@dU„ZAdV„ZBdW„ZCdX„ZDdY„ZEdZ„ZFd[„ZGeHdLd\d]d^d_d`eda„ZIeeJed]eJdb„ZKRS(ccCs[tjƒ|_d|_d|_g|_g|_g|_g|_ g|_
2015-01-02 16:59:08 +00:00
d|_ dS(NiR( t
def_classicalRQtclassical_dictR#tpersistent_countt
2015-01-02 16:59:08 +00:00
mill_counttpl_sb_user_definedtpl_v_user_definedtpl_adj_user_definedtsi_sb_user_definedtA_a_user_definedt thegender(tself((s!/home/krowbar/Code/irc/inflect.pyt__init__’s       tpltpluraltplnount plural_nountplverbt plural_verbtpladjt
plural_adjtsinount single_nountpresparttpresent_participletnumwordstnumber_to_wordstplequaltcomparet plnounequalt
compare_nounst plverbequalt
compare_verbst
pladjequalt compare_adjstwordlistRcCs=||jkr3td||j|fƒt‚nt‚dS(Ns%s() deprecated, use %s()(tdeprecated_methodsRtDeprecationWarningtAttributeError(RÑtmeth((s!/home/krowbar/Code/irc/inflect.pyt __getattr__­s cCsJ|j|ƒ|j|ƒ|jj||fƒ|jj||fƒdS(s=
Set the noun plural of singular to plural.
i(tcheckpattcheckpatpluralRËtextendRÎ(RÑtsingularRÔ((s!/home/krowbar/Code/irc/inflect.pytdefnoun³s


cCst|j|ƒ|j|ƒ|j|ƒ|j|ƒ|j|ƒ|j|ƒ|jj||||||fƒdS(s«
Set the verb plurals for s1, s2 and s3 to p1, p2 and p3 respectively.
Where 1, 2 and 3 represent the 1st, 2nd and 3rd person forms of the verb.
i(RïRðRÌRñ(RÑts1tp1ts2tp2ts3tp3((s!/home/krowbar/Code/irc/inflect.pytdefverb¾s
2015-01-02 16:59:08 +00:00





"cCs4|j|ƒ|j|ƒ|jj||fƒdS(sB
Set the adjective plural of singular to plural.
i(RïRðRÍRñ(RÑRòRÔ((s!/home/krowbar/Code/irc/inflect.pytdefadjÎs

2015-01-02 16:59:08 +00:00
cCs'|j|ƒ|jj|dfƒdS(sS
Define the indefinate article as 'a' for words matching pattern.
R¹i(RïRÏRñ(RÑtpattern((s!/home/krowbar/Code/irc/inflect.pytdefaØs
cCs'|j|ƒ|jj|dfƒdS(sT
Define the indefinate article as 'an' for words matching pattern.
R‚i(RïRÏRñ(RÑRü((s!/home/krowbar/Code/irc/inflect.pytdefanás
cCsM|dkrdSyt|dƒWn%tk
rHtd|ƒt‚nXdS(s5
check for errors in a regex pattern
2015-01-02 16:59:08 +00:00
NRs(
Bad user-defined singular pattern:
%s
2015-01-02 16:59:08 +00:00
(R#RtreerrorRR(RÑRü((s!/home/krowbar/Code/irc/inflect.pyRïês 
cCsdS(s=
check for errors in a regex replace pattern
2015-01-02 16:59:08 +00:00
N((RÑRü((s!/home/krowbar/Code/irc/inflect.pyRðöscCsŠxƒtt|ƒdddƒD]e}td|||tƒ}|r||ddkr[dStdd||dƒ}|j|ƒSqWdS(Niiþÿÿÿs^%s$is\$(\d+)s\\1(trangeRRRR#tresubtexpand(RÑR=RéRátmoRÓ((s!/home/krowbar/Code/irc/inflect.pytud_matchs#cKs®ttjƒƒ}|s+tjƒ|_dSd|kre|drStjƒ|_qetjƒ|_nxBt|jƒƒD].\}}||kr ||j|<qxt‚qxWdS(s³
turn classical mode on and off for various categories
2015-01-02 16:59:08 +00:00
turn on all classical modes:
classical()
classical(all=True)
2015-01-02 16:59:08 +00:00
turn on or off specific claassical modes:
e.g.
2015-01-02 16:59:08 +00:00
classical(herd=True)
classical(names=False)
2015-01-02 16:59:08 +00:00
By default all classical modes are off except names.
unknown value in args or key in kwargs rasies exception: UnknownClasicalModeError
2015-01-02 16:59:08 +00:00
NR¾( tlistRÇtkeyst
all_classicalRQRÈt no_classicaltitemsR(RÑtkwargstclassical_modeRÄtv((s!/home/krowbar/Code/irc/inflect.pyt classicals 
2015-01-02 16:59:08 +00:00
 cCse|dk rXyt|ƒ|_Wntk
r8t‚nX|dksK|rat|ƒSn d|_dS(sŒ
Set the number to be used in other method calls.
2015-01-02 16:59:08 +00:00
Returns count.
Set show to False to return '' instead.
2015-01-02 16:59:08 +00:00
RN(R#tintRÉt
ValueErrorR tstr(RÑtcounttshow((s!/home/krowbar/Code/irc/inflect.pytnum2s 

2015-01-02 16:59:08 +00:00

 cCs"|tkr||_nt‚dS(s“
set the gender for the singular of plural pronouns
can be one of:
'neuter' ('they' -> 'it')
'feminine' ('they' -> 'she')
'masculine' ('they' -> 'he')
'gender-neutral' ('they' -> 'they')
'feminine or masculine' ('they' -> 'she or he')
'masculine or feminine' ('they' -> 'he or she')
N(tsingular_pronoun_gendersRÐR(RÑR>((s!/home/krowbar/Code/irc/inflect.pyR>Fs  cCs"|j|jdƒ|jdƒƒS(sV
num but take a matchobject
use groups 1 and 2 in matchobject
ii(Rtgroup(RÑt matchobject((s!/home/krowbar/Code/irc/inflect.pytnummoWscCs"|j|jdƒ|jdƒƒS(sY
plural but take a matchobject
use groups 1 and 3 in matchobject
ii(RÔR(RÑR((s!/home/krowbar/Code/irc/inflect.pytplmo^scCs"|j|jdƒ|jdƒƒS(s^
plural_noun but take a matchobject
use groups 1 and 3 in matchobject
2015-01-02 16:59:08 +00:00
ii(RÖR(RÑR((s!/home/krowbar/Code/irc/inflect.pytplnounmoescCs"|j|jdƒ|jdƒƒS(s^
plural_verb but take a matchobject
use groups 1 and 3 in matchobject
ii(RØR(RÑR((s!/home/krowbar/Code/irc/inflect.pytplverbmolscCs"|j|jdƒ|jdƒƒS(s]
plural_adj but take a matchobject
2015-01-02 16:59:08 +00:00
use groups 1 and 3 in matchobject
ii(RÚR(RÑR((s!/home/krowbar/Code/irc/inflect.pytpladjmosscCs"|j|jdƒ|jdƒƒS(s`
singular_noun but take a matchobject
use groups 1 and 3 in matchobject
ii(t
singular_nounR(RÑR((s!/home/krowbar/Code/irc/inflect.pytsinounmozscCsM|jdƒdkr+|j|jdƒƒS|j|jdƒ|jdƒƒS(sT
A but take a matchobject
use groups 1 and 3 in matchobject
iiN(RR#R¹(RÑR((s!/home/krowbar/Code/irc/inflect.pytamo�scCs"|j|jdƒ|jdƒƒS(sU
2015-01-02 16:59:08 +00:00
NO but take a matchobject
use groups 1 and 3 in matchobject
ii(RR(RÑR((s!/home/krowbar/Code/irc/inflect.pytnomoŠscCs|j|jdƒƒS(sD
ordinal but take a matchobject
use group 1
i(tordinalR(RÑR((s!/home/krowbar/Code/irc/inflect.pyt ordinalmo‘scCs|j|jdƒƒS(sL
number_to_words but take a matchobject
use group 1
i(RàR(RÑR((s!/home/krowbar/Code/irc/inflect.pyt
numwordsmo˜scCs|j|jdƒƒS(sE
2015-01-02 16:59:08 +00:00
prespart but take a matchobject
use group 1
i(RÞR(RÑR((s!/home/krowbar/Code/irc/inflect.pyt
prespartmoŸscCsñ|j}td|ƒ}g}xº|D]²}td|j|ƒ\}}|sÊd}xu|rÆtd|j|ƒ\}}td|j|ƒ\}}||7}td|j|ƒ\}}||7}td|j|ƒ\}}||7}td|j|ƒ\}}||7}td |j |ƒ\}}||7}td
|j
|ƒ\}}||7}td |j |ƒ\}}||7}td |j |ƒ\}}||7}td
|j
|ƒ\}}||7}qUWn|j|ƒq%W||_dj|ƒS(s 
Perform inflections in a string.
2015-01-02 16:59:08 +00:00
e.g. inflect('The plural of cat is plural(cat)') returns
'The plural of cat is cats'
can use plural, plural_noun, plural_verb, plural_adj, singular_noun, a, an, no, ordinal,
number_to_words and prespart
s(num\([^)]*\))s%num\(\s*?(?:([^),]*)(?:,([^)]*))?)?\)iÿÿÿÿs/(?x)\bplural \( ([^),]*) (, ([^)]*) )? \) s2(?x)\bplural_noun \( ([^),]*) (, ([^)]*) )? \) s2(?x)\bplural_verb \( ([^),]*) (, ([^)]*) )? \) s/(?x)\bplural_adj \( ([^),]*) (, ([^)]*) )? \) s4(?x)\bsingular_noun \( ([^),]*) (, ([^)]*) )? \) s+(?x)\ban? \( ([^),]*) (, ([^)]*) )? \) s*(?x)\bno \( ([^),]*) (, ([^)]*) )? \) s.(?x)\bordinal \( ([^)]*) \) s0(?x)\bnumber_to_words \( ([^)]*) \) s2(?x)\bpresent_participle \( ([^)]*) \) R(RÉtsplitreRRRRRRRRRR!R"R#tappendR(RÑttexttsave_persistent_counttsectionst
inflectiontsectionRttotal((s!/home/krowbar/Code/irc/inflect.pytinflect¨sz 
 
2015-01-02 16:59:08 +00:00







 cCs�d|kr)|jdƒ|jd}n|dkr9|S||jƒkrU|jƒS|d|djƒkr‹d|djƒ|dfS|S(s5
FIX PEDANTRY AND CAPITALIZATION :-)
RR¾R3is%s%si(RRÈtupper(RÑtorigt inflected((s!/home/krowbar/Code/irc/inflect.pyt postprocess s  
2015-01-02 16:59:08 +00:00
cCsTtd|ƒ}y,|jdƒ|jdƒ|jdƒfSWntk
rOdSXdS(Ns\A(\s*)(.+?)(\s*)\ZiiiR(RRR(RRRì(RÑR&R((s!/home/krowbar/Code/irc/inflect.pytpartition_word s
,
cCsu|j|ƒ\}}}|s"|S|j||j||ƒp^|j||ƒp^|j||ƒƒ}d|||fS(sý
Return the plural of text.
If count supplied, then return text if count is one of:
1, a, an, one, each, every, this, that
otherwise return the plural.
Whitespace at the start and end is preserved.
2015-01-02 16:59:08 +00:00
s%s%s%s(R1R0t_pl_special_adjectivet_pl_special_verbt_plnoun(RÑR&RtpreR=tpostRÔ((s!/home/krowbar/Code/irc/inflect.pyRÔ9 s cCsQ|j|ƒ\}}}|s"|S|j||j||ƒƒ}d|||fS(s
Return the plural of text, where text is a noun.
If count supplied, then return text if count is one of:
1, a, an, one, each, every, this, that
otherwise return the plural.
Whitespace at the start and end is preserved.
s%s%s%s(R1R0R4(RÑR&RR5R=R6RÔ((s!/home/krowbar/Code/irc/inflect.pyRÖO s
2015-01-02 16:59:08 +00:00
cCsc|j|ƒ\}}}|s"|S|j||j||ƒpL|j||ƒƒ}d|||fS(s
Return the plural of text, where text is a verb.
If count supplied, then return text if count is one of:
1, a, an, one, each, every, this, that
otherwise return the plural.
Whitespace at the start and end is preserved.
s%s%s%s(R1R0R3t_pl_general_verb(RÑR&RR5R=R6RÔ((s!/home/krowbar/Code/irc/inflect.pyRØ` s 'cCsW|j|ƒ\}}}|s"|S|j||j||ƒp@|ƒ}d|||fS(s
Return the plural of text, where text is an adjective.
2015-01-02 16:59:08 +00:00
If count supplied, then return text if count is one of:
1, a, an, one, each, every, this, that
otherwise return the plural.
Whitespace at the start and end is preserved.
s%s%s%s(R1R0R2(RÑR&RR5R=R6RÔ((s!/home/krowbar/Code/irc/inflect.pyRÚt s
$cCsF|j|||jƒpE|j|||jƒpE|j|||jƒS(sG
compare word1 and word2 for equality regardless of plurality
2015-01-02 16:59:08 +00:00
return values:
eq - the strings are equal
p:s - word1 is the plural of word2
s:p - word2 is the plural of word1
2015-01-02 16:59:08 +00:00
p:p - word1 and word2 are two different plural forms of the one word
False - otherwise
(t_plequalRÖRØRÚ(RÑtword1tword2((s!/home/krowbar/Code/irc/inflect.pyRâ… s
cCs|j|||jƒS(sz
compare word1 and word2 for equality regardless of plurality
word1 and word2 are to be treated as nouns
return values:
eq - the strings are equal
p:s - word1 is the plural of word2
s:p - word2 is the plural of word1
p:p - word1 and word2 are two different plural forms of the one word
False - otherwise
(R8RÖ(RÑR9R:((s!/home/krowbar/Code/irc/inflect.pyRä— s
cCs|j|||jƒS(sz
compare word1 and word2 for equality regardless of plurality
word1 and word2 are to be treated as verbs
2015-01-02 16:59:08 +00:00
return values:
eq - the strings are equal
p:s - word1 is the plural of word2
s:p - word2 is the plural of word1
2015-01-02 16:59:08 +00:00
p:p - word1 and word2 are two different plural forms of the one word
False - otherwise
2015-01-02 16:59:08 +00:00
(R8RØ(RÑR9R:((s!/home/krowbar/Code/irc/inflect.pyRæ¦ s
cCs|j|||jƒS(s
compare word1 and word2 for equality regardless of plurality
word1 and word2 are to be treated as adjectives
return values:
eq - the strings are equal
p:s - word1 is the plural of word2
s:p - word2 is the plural of word1
p:p - word1 and word2 are two different plural forms of the one word
False - otherwise
(R8RÚ(RÑR9R:((s!/home/krowbar/Code/irc/inflect.pyRèµ s
c Cs…|j|ƒ\}}}|s"|S|j|d|d|ƒ}|tk r�|j||j|d|d|ƒƒ}d|||fStS(s<
Return the singular of text, where text is a plural noun.
If count supplied, then return the singular if count is one of:
1, a, an, one, each, every, this, that or if count is None
otherwise return text unchanged.
Whitespace at the start and end is preserved.
RR>s%s%s%s(R1t_sinounRÅR0( RÑR&RR>R5R=R6R?RÔ((s!/home/krowbar/Code/irc/inflect.pyRÄ s  !cCs,|jjƒ}tjƒ|_||kr.dS|||ƒkrDdS||ƒ|krZdStjƒ|_|||ƒkrdS||ƒ|kr•dS|jƒ|_||jksÂ||jkrñ|j||ƒrØdS|j||ƒrñdSn||jks||jkr(|j||ƒr(dSnt S(Nteqsp:sss:psp:p(
RÈRQRRRÔRÖt_pl_check_plurals_NRÚt_pl_check_plurals_adjRÅ(RÑR9R:RÓtclassval((s!/home/krowbar/Code/irc/inflect.pyR8Ú s. cCs*td|||||f|ƒr&tStS(Ns(%s)(%s\|\1%s|%s\|\1%s)(RRÃRÅ(RÑtpairtstemstend1tend2((s!/home/krowbar/Code/irc/inflect.pyt_pl_reg_pluralsô s"cCs:d||f}|ttjƒƒkr,tS|ttjƒƒkrHtS|ttjƒƒkrdtSxÏtddftddftddft dd ft
d
d ft d d
ft dd ft
dd
ftddftddftdd
ftddfddddfD]+\}}}|j||||ƒrtSqWtS( Ns%s|%stasR—RCR~RRœtensR¯tumsR¹R—RátonstostexesRÕtixesRçs.*eautxs.*ieus.*tritxestcess .{2,}[yia]ntges(s.*eauRRL(s.*ieuRRL(s.*triRMRN(s .{2,}[yia]nRMRO(Rtpl_sb_irregular_stvaluesRÃtpl_sb_irregulartpl_sb_irregular_capst
2015-01-02 16:59:08 +00:00
pl_sb_C_a_atatpl_sb_C_is_idest pl_sb_C_a_aetpl_sb_C_en_inat pl_sb_C_um_at pl_sb_C_us_it pl_sb_C_on_atpl_sb_C_o_i_stemstpl_sb_C_ex_icestpl_sb_C_ix_icest pl_sb_C_it
pl_sb_C_imRDRÅ(RÑR9R:R@RARBRC((s!/home/krowbar/Code/irc/inflect.pyR=ù s6            cCs‹|jdƒr"||jdƒ nd}|jdƒrJ||jdƒ nd}|r‡|r‡|j||ƒs€|j||ƒr‡tSntS(Ns'st'R(s'sR`(s'sR`(tendswithtrfindR=RÃRÅ(RÑR9R:tword1atword2a((s!/home/krowbar/Code/irc/inflect.pyR>
s((
cCsƒ|dkr'|jdk r'|j}n|dk ryt|ƒtksj|jdrpt|ƒjƒtkrpdnd}nd}|S(NRÍiiR(R#RÉRt pl_count_oneRÈtlowert
pl_count_zero(RÑR((s!/home/krowbar/Code/irc/inflect.pyt get_count7
s  
 cCsV |j|ƒ}|dkr|S|j||jƒ}|dk rD|S|dkrT|S|jƒ}|tkrp|S|tkr€|Sx/tjƒD]!\}}|| |kr�|Sq�W|j drÏ|t
krÏ|St dt |t
ƒ}|r,|jdƒdkr,d|j|jdƒdƒ|jdƒfSd|ksDd|krÎt dt|t
ƒ}|rÎ|jdƒdkrÎ|jd ƒdkrÎd
2015-01-02 16:59:08 +00:00
|j|jdƒdƒ|jdƒ|j|jd ƒƒfSn|jd ƒ}t|ƒd kr^xltdt|ƒdƒD]N} || tkr d j|| d |j|| ddƒg|| ƒSq Wn|jd ƒ}t|ƒd kr x‰tdt|ƒdƒD]k} || tkr™d j|| d |j|| ddƒd || d gƒd j|| dƒSq™Wnx•tjƒD]‡\}}|| |krxgtjƒD]V\}
} ||
| krB|jƒ||
|| gkr˜|| t|| SqBqBWqqWyt|jƒSWntk
rÈnXyt|jƒSWntk
rînX|jƒ} | d
2015-01-02 16:59:08 +00:00
}
|
jƒ}|
ttjƒƒkrLt|
ƒ}d|| t|
fS|ttjƒƒkr‡t|ƒ}d|| t|fSd j| dƒjƒttjƒƒkrõtd j| dƒƒ}d|| td j| dƒjƒfS|ddkr|d
dS|ddkrE|j dr6|dS|d dSn|ddkrÍx3t jƒD]%\}}|| |krb|dSqbWx3t!jƒD]%\}}|| |kr˜|dSq˜W|d dS|ddkré|d dS|ddkr|d dS|ddkr!|d d S|dd!kr=|d d"S|dd#krY|d d$S|d%krid&S|dd'kr}|S|dd(kr™|d d)S|dd_krµ|d d-SxÐd.t"ddfd/t#dd0fd/t$dd0fd1t%dd)fdt&dd2fd3t'dd)fd)t(dd4ffD]_\}}}}|d
|kr%x:|jƒD])\}}|| |krT|| |SqTWq%q%W|j d5ru |dd6kr±|d
d7S|dd`krÉ|d/S|ddakr÷t|ƒd=kr÷|d
d>Sx d3t)dd?fd/t*dd0fd/t+dd0fd1t,dd)fdt-dd2fdt.ddfd)t/dd4fd)t0dd@fdt1d
dAfdBt2d
d2fd3t3dd)ff D]_\}}}}|d
|kr£x:|jƒD])\}}|| |krÒ|| |SqÒWq£q£Wxlt4dd2ft5ddCffD]I\}}}x7|jƒD])\}}|| |krA || |SqA Wq% Wn|t6kr‰ |d-Sx3t7jƒD]%\}}|| |kr– |d-Sq– W|dd-krñ |dD|dDj8ƒkrñ |d-S|d
dEkrU
2015-01-02 16:59:08 +00:00
x3t9jƒD]%\}}|| |kr
|d-Sq
W|dd
!dEkrU
|dFSn|ddGkrž
x6t:jƒD]%\}}|| |krr
|dSqr
2015-01-02 16:59:08 +00:00
Wn|ddbks¾
|d
d/krÆ
|d-S|ddckrâ
|d
dOS|ddPkr |dd!dQkr |d
dOS|dddkr- |d dOS|ddUkrI |d
dOS|d
dVkrÔ |dd
!dWks~ t|ƒdkr† |dS|j dXrÈ |d
dVkrÈ |dD|dDj8ƒkrÈ |dSn|d
dS|t;krè |dSx3t<jƒD]%\}}|| |krõ |dSqõ W|ddekr6 |dS|d
dBkrN |d-Sd^|S(fNiRR¿s^(?:%s)$is%s%ss a s-a-is%s%s%sR½t-iÿÿÿÿiþÿÿÿiýÿÿÿtquytiesiúÿÿÿtpersonRÁRiüÿÿÿtopletmantmeniûÿÿÿtmousetmicetlousetlicetgoosetgeesettoothtteethtfoottfeettdietdicetcepstzoonR¹tcistsistxistesthRLRÕtmRátnRœRÂttrixRNteautieutynxtinxtanxiROR¯ttatdestoRçitztzestzetchtshtzzRstelftalftolftvesteaftdtnifetlifetwifetarftytaeiouRÀtaoteotiotootuos%ss(R~RR€(R†R‡(RˆR‰RŠ(schsshszzsss(R”R•R–(RšR›Rœ(R seosioR£R¤(=RhRRËR#Rftpl_sb_uninflected_completetpl_sb_uninflected_capstpl_sb_uninflected_bysizeR RÈtpl_sb_uninflected_herdRtpl_sb_postfix_adj_stemsRRR4tpl_sb_prep_dual_compoundRRRtpl_prep_list_daRtpl_pron_acc_keys_bysizetpl_prep_bysizet pl_pron_acct pl_pron_nomR:RRSRRRtpl_sb_irregular_compoundtpl_sb_U_man_mans_bysizetpl_sb_U_man_mans_caps_bysizetpl_sb_U_ch_chs_bysizetpl_sb_U_ex_ices_bysizetpl_sb_U_ix_ices_bysizetpl_sb_U_um_a_bysizetpl_sb_U_us_i_bysizetpl_sb_U_on_a_bysizetpl_sb_U_a_ae_bysizetpl_sb_C_en_ina_bysizetpl_sb_C_ex_ices_bysizetpl_sb_C_ix_ices_bysizetpl_sb_C_um_a_bysizetpl_sb_C_us_i_bysizetpl_sb_C_us_us_bysizetpl_sb_C_a_ae_bysizetpl_sb_C_a_ata_bysizetpl_sb_C_is_ides_bysizetpl_sb_C_o_i_bysizetpl_sb_C_on_a_bysizetpl_sb_C_i_bysizetpl_sb_C_im_bysizetpl_sb_singular_s_completetpl_sb_singular_s_bysizeR-tpl_sb_z_zes_bysizetpl_sb_ze_zes_bysizetpl_sb_U_o_os_completetpl_sb_U_o_os_bysize(RÑR=Rtvaluet lowerwordRÄR Rt
lowersplittnumwordtpktpvt wordsplittwordlastt
lowerwordlasttllentlastletR™tnumendR6((s!/home/krowbar/Code/irc/inflect.pyR4L
2015-01-02 16:59:08 +00:00
s|      ,0  9  . $

 
   + 
           %
2015-01-02 16:59:08 +00:00
 " %   *    #   %
*    cCs`|jdr)t|ƒjƒtkr)tS|j|ƒ}|dkrH|S|j||jƒ}|dk rm|S|jƒ}y|j ƒd}Wnt
2015-01-02 16:59:08 +00:00
k
r¡tSX|t t j
ƒƒkrÖdt ||t|ƒfS|tkræ|S|jdƒr1|d t t j
2015-01-02 16:59:08 +00:00
ƒƒkr1dt |d |t|ƒfS|jdƒrD|Stdt|ƒ}|ratStd |ƒrttS|d
kr„d S|d dks¤|ddkr¬|d S|ddkrÚt|ƒdkrÚ|d dS|tks|d tks|dtkr|d S|jdƒr7t|ƒdkr7|d Std|tƒ}|r\|jdƒStS(NRÍiis%s%ssn'tiýÿÿÿs%sn't%ss^(%s)$s\stquizzestquiziüÿÿÿtchestshestzzestssesRMiþÿÿÿRkiRžiûÿÿÿiÿÿÿÿtoess ^(.*[^s])s$(RÛRÜRÝRÞ(RÈRRfRgRÅRhRRÌR#Rt
IndexErrorRtplverb_irregular_presRRtplverb_irregular_non_presRaRtplverb_special_st pl_v_oes_oetpl_v_oes_oe_endings_size4tpl_v_oes_oe_endings_size5RR(RÑR=RRÍRÎt firstwordR((s!/home/krowbar/Code/irc/inflect.pyR3v s\%   
2015-01-02 16:59:08 +00:00
   "  !
cCs‰|j|ƒ}|dkr|Stdt|tƒ}|redt|jdƒjƒ|jdƒfStdt|tƒ}|r…|S|S(Nis^(%s)((\s.*)?)$s%s%si(RhRtplverb_ambiguous_pres_keysRtplverb_ambiguous_presRRftplverb_ambiguous_non_pres(RÑR=RR((s!/home/krowbar/Code/irc/inflect.pyR7Í s *cCs
|j|ƒ}|dkr|S|j||jƒ}|dk rD|Stdt|tƒ}|r{dt|jdƒj ƒStdt
|tƒ}|r²dt |jdƒj ƒStd|ƒ}|r |j |jdƒƒ}|ddkrõdnd}d||fSt
2015-01-02 16:59:08 +00:00
S( Nis^(%s)$s%ss ^(.*)'s?$iÿÿÿÿRRs%s'%s(RhRRÍR#Rtpl_adj_special_keysRtpl_adj_specialRRftpl_adj_poss_keyst pl_adj_possRÖRÅ(RÑR=RRÍRRÓt
trailing_s((s!/home/krowbar/Code/irc/inflect.pyR2ã s$  cCsé |j|ƒ}|dkr|Sy1|dkr:|j}n|tkrOt‚nWnttfk
rot‚nX|j||jƒ}|dk r•|S|dkr¥|S|j ƒ}|t
krÅ|d S|t krÕ|S|t krå|Sx/t
jƒD]!\}}|| |krò|SqòW|jdr4|tkr4|Stdt|tƒ}|r—|jdƒdkr—d|j|jdƒdd|ƒ|jdƒfS|jd ƒ} t| ƒd
kr-xrtdt| ƒdƒD]T}
| |
tkrÒd j| |
d |j| |
ddd|ƒg| |
ƒSqÒWn|jd ƒ} t| ƒd
kràx�tdt| ƒdƒD]q}
| |
tkrhd j| |
d |j| |
ddd|ƒd | |
d gƒd j| |
dƒSqhWnx�tjƒD]�\}}|| |kríxotjƒD]^\} } || | kr|jƒ|| || gkru|| td || |ƒSqqWqíqíWytd
|j ƒ|ƒSWntk
r­nXytd |j ƒ|ƒSWntk
rÛnX|jƒ}
|
d}|j ƒ}|tt j!ƒƒkr9t|ƒ}d|| t |fS|tt"j!ƒƒkrtt|ƒ}d|| t"|fSd j|
dƒj ƒtt#j!ƒƒkrâtd j|
2015-01-02 16:59:08 +00:00
dƒƒ}d|| t#d j|
dƒj ƒfS|ddkrþ|d dS|ddkr|d S|ddkr2|d dS|ddkr±x3t$jƒD]%\}}|| |krO|d SqOWx6t%jƒD]%\}}|| |kr…|d Sq…Wn|ddkrÍ|d dS|ddkré|d dS|ddkr|d dS|dd kr!|d d!S|dd"kr=|d d#S|dd$krY|d d%S|d&krid'S|dd(kr}|S|dd)kr™|d d*SxÐd+t&ddfd+t'dd,fd+t(dd-fd.t)dd/fd0t*dd1fd.t+dd*fd2t,ddffD]_\}}}}|d|kr x:|jƒD])\}}|| |kr8|| |Sq8Wq q W|jd3r |dd4kr•|d d5S|dd_kr­|d S|dd`krÛt|ƒd;krÛ|d d5Sx-d.t-dd<fd+t.dd,fd+t/dd-fd.t0dd/fd0t1dd1fd+t2ddfd2t3ddfd.t4ddfd+t5dd+fd0t6dd=fd.t7dd*fd>t8ddfd0t9ddff
D]_\}}}}|d|kr¥x:|jƒD])\}}|| |krÔ|| |SqÔWq¥q¥Wn|dd?ks3 |t:ks3 |t;kr; |d S|t<ksS |t=kr[ |d S|dd@ksƒ |t>ksƒ |t?kr‹ |d S|t@ks£ |tAkr« |d S|tBkr¿ |d Sx3tCjƒD]%\}}|| |krÌ |d SqÌ W|ddAkr'
2015-01-02 16:59:08 +00:00
|dB|dBjDƒkr'
|d S|tEkr;
|d S|tFkrO
|d S|ddCkrg
|d S|tGks
|tHkr‡
|d S|ddakrŸ
|d S|tIkr³
|d S|ddFkrË
|d S|tJksã
|tKkrë
|d S|ddGkr� |dd!dbkr |d dKS|dd!dLkrL |dd!dMkrL |d dKS|dd!dckrk |d dQS|dd!dRkr� |d dKSn|ddSkr t|ƒdkrÇ |ddTkrÇ |d S|jdUr |ddSkr |dB|dBjDƒkr |d Sq n|ddVkr( |d dS|ddWkr� |tLkrL |d Sx3tMjƒD]%\}}|| |krY |d SqY W|dddkr� |d Sn|dd]krµ |d S|tNkrÍ |d d^S|dd+krå |d StOS(eNiRiÿÿÿÿR¿s^(?:%s)$s%s%siR>R½iRiR8R2iþÿÿÿiûÿÿÿtquiesiýÿÿÿRžiùÿÿÿRÁiúÿÿÿtpeopleiüÿÿÿtrsontmansRoRnRqRpRsRrRuRtRwRvRyRxR{RzR|tzoatonRtextixR¹tumRáRtRœRÂttricesRLteauxtieuxtyngestingestangesitenR�RƒthousesR}tesesiRÝRÛRÜRMR—teltaltoltfteaR™tnitlitwitfetartysRŸRÀRkRItaosteostiostoostuosRßRC(RúRû(RüRýRþ(schessshes(selRR(RRR (R
RRRR(PRhR#RÐRRR;RàRRÎRftsi_sb_ois_oi_caseR¥R¦R§R RÈR¨RR©RRR;RRRR«Rtsi_pron_acc_keys_bysizeR­R@R:Rtsi_sb_irregular_capsRtsi_sb_irregulartsi_sb_irregular_compoundtsi_sb_U_man_mans_bysizetsi_sb_U_man_mans_caps_bysizetsi_sb_U_ch_chs_bysizetsi_sb_U_ex_ices_bysizetsi_sb_U_ix_ices_bysizetsi_sb_U_um_a_bysizetsi_sb_U_us_i_bysizetsi_sb_U_on_a_bysizetsi_sb_U_a_ae_bysizetsi_sb_C_en_ina_bysizetsi_sb_C_ex_ices_bysizetsi_sb_C_ix_ices_bysizetsi_sb_C_um_a_bysizetsi_sb_C_us_i_bysizeR¿tsi_sb_C_a_ae_bysizetsi_sb_C_a_ata_bysizetsi_sb_C_is_ides_bysizetsi_sb_C_o_i_bysizetsi_sb_C_on_a_bysizetsi_sb_C_im_bysizetsi_sb_C_i_bysizetsi_sb_uses_use_casetsi_sb_uses_usetsi_sb_ies_ie_caset si_sb_ies_ietsi_sb_oes_oe_caset si_sb_oes_oetsi_sb_sses_sse_casetsi_sb_sses_ssetsi_sb_singular_s_completetsi_sb_singular_s_bysizeR-t si_sb_z_zest
si_sb_zzes_zztsi_sb_ches_che_casetsi_sb_ches_chet si_sb_xes_xetsi_sb_ves_ve_caset si_sb_ves_vetsi_sb_U_o_os_completetsi_sb_U_o_os_bysizet si_sb_es_isRÅ(RÑR=RR>RÍRÎRÄR RRÏRÐRÑRÒRÓRÔRÕRÖR×R™RØR6((s!/home/krowbar/Code/irc/inflect.pyR; s¦    

      2  ?  4  !

 
   +           %
 " %      *    &  "
2015-01-02 16:59:08 +00:00
*      icCsvtd|tƒ}|rr|jdƒ}|s1|S|jdƒ}|jdƒ}|j||ƒ}d|||fSdS(s
Return the appropriate indefinite article followed by text.
The indefinite article is either 'a' or 'an'.
If count is not one, then return count followed by text
instead of 'a' or 'an'.
2015-01-02 16:59:08 +00:00
Whitespace at the start and end is preserved.
s\A(\s*)(?:an?\s+)?(.+?)(\s*)\Ziiis%s%s%sR(RRRt_indef_article(RÑR&RRR=R5R6tresult((s!/home/krowbar/Code/irc/inflect.pyR¹g
s cCsU|j|ƒ}|dkr)d||fS|j||jƒ}|dk rXd||fSxVdtdfdtdffD]4}t|d|tƒ}|ryd|d|fSqyWxOdtdfddfD]4}t|d|tƒ}|rËd|d|fSqËWxhd t dt
fd
dtfd dtffD]8}t|d||d ƒ}|r2d|d|fSq2Wtd
|tƒ}|rŽd|Sx[dddddddt dffD]4}t|d|tƒ}|r´d|d|fSq´Wtd|ƒ}|r d|Std|tƒ}|r)d|Stdt |tƒ}|rMd|Sd|S( Nis%s %ss^(%s)R¹R‚is^[aefhilmnorsx]$s^[bcdgjkpqtuvwyz]$s(%s)s^[aefhilmnorsx][.-]s
^[a-z][.-]is
^[^aeiouy]sa %ss^e[uw]s^onc?e\bs
^onetime\bs^uni([^nmd]|mo)s^u[bcfghjkqrst][aeiou]s^ukrs
^U[NK][AIEO]?s^[aeiou]san %s(s^[aefhilmnorsx]$san(s^[bcdgjkpqtuvwyz]$R¹(s^e[uw]R¹(s^onc?e\bR¹(s