Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

78 lines (73 sloc) 20.995 kB
<!DOCTYPE html> <html> <head> <title>default_inflections.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="default_inflections.html"> default_inflections.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="inflections.html"> inflections.coffee </a> <a class="source" href="methods.html"> methods.coffee </a> <a class="source" href="number_extensions.html"> number_extensions.coffee </a> <a class="source" href="string_extensions.html"> string_extensions.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> default_inflections.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>default inflections</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">inflect = </span><span class="nx">require</span><span class="p">(</span><span class="s">&#39;../inflect&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">inflections</span> <span class="nf">(inflect) -&gt;</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/$/</span><span class="p">,</span> <span class="s">&#39;s&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/s$/i</span><span class="p">,</span> <span class="s">&#39;s&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(ax|test)is$/i</span><span class="p">,</span> <span class="s">&#39;$1es&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(octop|vir)us$/i</span><span class="p">,</span> <span class="s">&#39;$1i&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(octop|vir)i$/i</span><span class="p">,</span> <span class="s">&#39;$1i&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(alias|status)$/i</span><span class="p">,</span> <span class="s">&#39;$1es&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(bu)s$/i</span><span class="p">,</span> <span class="s">&#39;$1ses&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(buffal|tomat)o$/i</span><span class="p">,</span> <span class="s">&#39;$1oes&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/([ti])um$/i</span><span class="p">,</span> <span class="s">&#39;$1a&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/([ti])a$/i</span><span class="p">,</span> <span class="s">&#39;$1a&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/sis$/i</span><span class="p">,</span> <span class="s">&#39;ses&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(?:([^f])fe|([lr])f)$/i</span><span class="p">,</span> <span class="s">&#39;$1$2ves&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(hive)$/i</span><span class="p">,</span> <span class="s">&#39;$1s&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/([^aeiouy]|qu)y$/i</span><span class="p">,</span> <span class="s">&#39;$1ies&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(x|ch|ss|sh)$/i</span><span class="p">,</span> <span class="s">&#39;$1es&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(matr|vert|ind)(?:ix|ex)$/i</span><span class="p">,</span> <span class="s">&#39;$1ices&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/([m|l])ouse$/i</span><span class="p">,</span> <span class="s">&#39;$1ice&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/([m|l])ice$/i</span><span class="p">,</span> <span class="s">&#39;$1ice&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/^(ox)$/i</span><span class="p">,</span> <span class="s">&#39;$1en&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/^(oxen)$/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">plural</span><span class="p">(</span><span class="sr">/(quiz)$/i</span><span class="p">,</span> <span class="s">&#39;$1zes&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/s$/i</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(n)ews$/i</span><span class="p">,</span> <span class="s">&#39;$1ews&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/([ti])a$/i</span><span class="p">,</span> <span class="s">&#39;$1um&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i</span><span class="p">,</span> <span class="s">&#39;$1$2sis&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(^analy)ses$/i</span><span class="p">,</span> <span class="s">&#39;$1sis&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/([^f])ves$/i</span><span class="p">,</span> <span class="s">&#39;$1fe&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(hive)s$/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(tive)s$/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/([lr])ves$/i</span><span class="p">,</span> <span class="s">&#39;$1f&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/([^aeiouy]|qu)ies$/i</span><span class="p">,</span> <span class="s">&#39;$1y&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(s)eries$/i</span><span class="p">,</span> <span class="s">&#39;$1eries&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(m)ovies$/i</span><span class="p">,</span> <span class="s">&#39;$1ovie&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(x|ch|ss|sh)es$/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/([m|l])ice$/i</span><span class="p">,</span> <span class="s">&#39;$1ouse&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(bus)es$/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(o)es$/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(shoe)s$/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(cris|ax|test)es$/i</span><span class="p">,</span> <span class="s">&#39;$1is&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(octop|vir)i$/i</span><span class="p">,</span> <span class="s">&#39;$1us&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(alias|status)es$/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/^(ox)en/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(vert|ind)ices$/i</span><span class="p">,</span> <span class="s">&#39;$1ex&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(matr)ices$/i</span><span class="p">,</span> <span class="s">&#39;$1ix&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(quiz)zes$/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">singular</span><span class="p">(</span><span class="sr">/(database)s$/i</span><span class="p">,</span> <span class="s">&#39;$1&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;person&#39;</span><span class="p">,</span> <span class="s">&#39;people&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;man&#39;</span><span class="p">,</span> <span class="s">&#39;men&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;child&#39;</span><span class="p">,</span> <span class="s">&#39;children&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;move&#39;</span><span class="p">,</span> <span class="s">&#39;moves&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;she&#39;</span><span class="p">,</span> <span class="s">&#39;they&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;he&#39;</span><span class="p">,</span> <span class="s">&#39;they&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;myself&#39;</span><span class="p">,</span> <span class="s">&#39;ourselves&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;yourself&#39;</span><span class="p">,</span> <span class="s">&#39;ourselves&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;himself&#39;</span><span class="p">,</span> <span class="s">&#39;themselves&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;herself&#39;</span><span class="p">,</span> <span class="s">&#39;themselves&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;themself&#39;</span><span class="p">,</span> <span class="s">&#39;themselves&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;mine&#39;</span><span class="p">,</span> <span class="s">&#39;ours&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;hers&#39;</span><span class="p">,</span> <span class="s">&#39;theirs&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;his&#39;</span><span class="p">,</span> <span class="s">&#39;theirs&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;its&#39;</span><span class="p">,</span> <span class="s">&#39;theirs&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;theirs&#39;</span><span class="p">,</span> <span class="s">&#39;theirs&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;sex&#39;</span><span class="p">,</span> <span class="s">&#39;sexes&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;cow&#39;</span><span class="p">,</span> <span class="s">&#39;kine&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">irregular</span><span class="p">(</span><span class="s">&#39;zombie&#39;</span><span class="p">,</span> <span class="s">&#39;zombies&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">uncountable</span><span class="p">(</span><span class="s">&#39;advice&#39;</span><span class="p">,</span> <span class="s">&#39;energy&#39;</span><span class="p">,</span> <span class="s">&#39;excretion&#39;</span><span class="p">,</span> <span class="s">&#39;digestion&#39;</span><span class="p">,</span> <span class="s">&#39;cooperation&#39;</span><span class="p">,</span> <span class="s">&#39;health&#39;</span><span class="p">,</span> <span class="s">&#39;justice&#39;</span><span class="p">,</span> <span class="s">&#39;jeans&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">uncountable</span><span class="p">(</span><span class="s">&#39;labour&#39;</span><span class="p">,</span> <span class="s">&#39;machinery&#39;</span><span class="p">,</span> <span class="s">&#39;equipment&#39;</span><span class="p">,</span> <span class="s">&#39;information&#39;</span><span class="p">,</span> <span class="s">&#39;pollution&#39;</span><span class="p">,</span> <span class="s">&#39;sewage&#39;</span><span class="p">,</span> <span class="s">&#39;paper&#39;</span><span class="p">,</span> <span class="s">&#39;money&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">uncountable</span><span class="p">(</span><span class="s">&#39;species&#39;</span><span class="p">,</span> <span class="s">&#39;series&#39;</span><span class="p">,</span> <span class="s">&#39;rain&#39;</span><span class="p">,</span> <span class="s">&#39;rice&#39;</span><span class="p">,</span> <span class="s">&#39;fish&#39;</span><span class="p">,</span> <span class="s">&#39;sheep&#39;</span><span class="p">,</span> <span class="s">&#39;moose&#39;</span><span class="p">,</span> <span class="s">&#39;deer&#39;</span><span class="p">,</span> <span class="s">&#39;bison&#39;</span><span class="p">,</span> <span class="s">&#39;proceedings&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">uncountable</span><span class="p">(</span><span class="s">&#39;shears&#39;</span><span class="p">,</span> <span class="s">&#39;pincers&#39;</span><span class="p">,</span> <span class="s">&#39;breeches&#39;</span><span class="p">,</span> <span class="s">&#39;hijinks&#39;</span><span class="p">,</span> <span class="s">&#39;clippers&#39;</span><span class="p">,</span> <span class="s">&#39;chassis&#39;</span><span class="p">,</span> <span class="s">&#39;innings&#39;</span><span class="p">,</span> <span class="s">&#39;elk&#39;</span><span class="p">)</span>
<span class="nx">inflect</span><span class="p">.</span><span class="nx">uncountable</span><span class="p">(</span><span class="s">&#39;rhinoceros&#39;</span><span class="p">,</span> <span class="s">&#39;swine&#39;</span><span class="p">,</span> <span class="s">&#39;you&#39;</span><span class="p">,</span> <span class="s">&#39;news&#39;</span><span class="p">)</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
Jump to Line
Something went wrong with that request. Please try again.