Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
166 lines (134 sloc) 11.4 KB
<!DOCTYPE html>
<html>
<head>
<title>default_inflections.coffee</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To &hellip;</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page_wrapper">
<div id="jump_page">
<a class="source" href="index.html">
index.coffee
</a>
<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>
</li>
</ul>
<ul class="sections">
<li id="title">
<div class="annotation">
<h1>default_inflections.coffee</h1>
</div>
</li>
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">&#182;</a>
</div>
<p>default inflections</p>
</div>
<div class="content"><div class='highlight'><pre>inflect = <span class="hljs-built_in">require</span>(<span class="hljs-string">'../inflect'</span>)
inflect.inflections (inflect) -&gt;
inflect.plural(<span class="hljs-regexp">/$/</span>, <span class="hljs-string">'s'</span>)
inflect.plural(<span class="hljs-regexp">/s$/i</span>, <span class="hljs-string">'s'</span>)
inflect.plural(<span class="hljs-regexp">/^(ax|test)is$/i</span>, <span class="hljs-string">'$1es'</span>)
inflect.plural(<span class="hljs-regexp">/(octop|vir)us$/i</span>, <span class="hljs-string">'$1i'</span>)
inflect.plural(<span class="hljs-regexp">/(octop|vir)i$/i</span>, <span class="hljs-string">'$1i'</span>)
inflect.plural(<span class="hljs-regexp">/(alias|status)$/i</span>, <span class="hljs-string">'$1es'</span>)
inflect.plural(<span class="hljs-regexp">/(bu)s$/i</span>, <span class="hljs-string">'$1ses'</span>)
inflect.plural(<span class="hljs-regexp">/(buffal|tomat)o$/i</span>, <span class="hljs-string">'$1oes'</span>)
inflect.plural(<span class="hljs-regexp">/([ti])um$/i</span>, <span class="hljs-string">'$1a'</span>)
inflect.plural(<span class="hljs-regexp">/([ti])a$/i</span>, <span class="hljs-string">'$1a'</span>)
inflect.plural(<span class="hljs-regexp">/sis$/i</span>, <span class="hljs-string">'ses'</span>)
inflect.plural(<span class="hljs-regexp">/(?:([^f])fe|([lr])f)$/i</span>, <span class="hljs-string">'$1$2ves'</span>)
inflect.plural(<span class="hljs-regexp">/(hive)$/i</span>, <span class="hljs-string">'$1s'</span>)
inflect.plural(<span class="hljs-regexp">/([^aeiouy]|qu)y$/i</span>, <span class="hljs-string">'$1ies'</span>)
inflect.plural(<span class="hljs-regexp">/(x|ch|ss|sh)$/i</span>, <span class="hljs-string">'$1es'</span>)
inflect.plural(<span class="hljs-regexp">/(matr|vert|ind)(?:ix|ex)$/i</span>, <span class="hljs-string">'$1ices'</span>)
inflect.plural(<span class="hljs-regexp">/^([m|l])ouse$/i</span>, <span class="hljs-string">'$1ice'</span>)
inflect.plural(<span class="hljs-regexp">/^([m|l])ice$/i</span>, <span class="hljs-string">'$1ice'</span>)
inflect.plural(<span class="hljs-regexp">/^(ox)$/i</span>, <span class="hljs-string">'$1en'</span>)
inflect.plural(<span class="hljs-regexp">/^(oxen)$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.plural(<span class="hljs-regexp">/(quiz)$/i</span>, <span class="hljs-string">'$1zes'</span>)
inflect.singular(<span class="hljs-regexp">/s$/i</span>, <span class="hljs-string">''</span>)
inflect.singular(<span class="hljs-regexp">/(ss)$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.singular(<span class="hljs-regexp">/(n)ews$/i</span>, <span class="hljs-string">'$1ews'</span>)
inflect.singular(<span class="hljs-regexp">/([ti])a$/i</span>, <span class="hljs-string">'$1um'</span>)
inflect.singular(<span class="hljs-regexp">/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i</span>, <span class="hljs-string">'$1sis'</span>)
inflect.singular(<span class="hljs-regexp">/(^analy)(sis|ses)$/i</span>, <span class="hljs-string">'$1sis'</span>)
inflect.singular(<span class="hljs-regexp">/([^f])ves$/i</span>, <span class="hljs-string">'$1fe'</span>)
inflect.singular(<span class="hljs-regexp">/(hive)s$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.singular(<span class="hljs-regexp">/(tive)s$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.singular(<span class="hljs-regexp">/([lr])ves$/i</span>, <span class="hljs-string">'$1f'</span>)
inflect.singular(<span class="hljs-regexp">/([^aeiouy]|qu)ies$/i</span>, <span class="hljs-string">'$1y'</span>)
inflect.singular(<span class="hljs-regexp">/(s)eries$/i</span>, <span class="hljs-string">'$1eries'</span>)
inflect.singular(<span class="hljs-regexp">/(m)ovies$/i</span>, <span class="hljs-string">'$1ovie'</span>)
inflect.singular(<span class="hljs-regexp">/(x|ch|ss|sh)es$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.singular(<span class="hljs-regexp">/^([m|l])ice$/i</span>, <span class="hljs-string">'$1ouse'</span>)
inflect.singular(<span class="hljs-regexp">/(bus)(es)?$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.singular(<span class="hljs-regexp">/(o)es$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.singular(<span class="hljs-regexp">/(shoe)s$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.singular(<span class="hljs-regexp">/(cris|test)(is|es)$/i</span>, <span class="hljs-string">'$1is'</span>)
inflect.singular(<span class="hljs-regexp">/^(a)x[ie]s$/i</span>, <span class="hljs-string">'$1xis'</span>)
inflect.singular(<span class="hljs-regexp">/(octop|vir)(us|i)$/i</span>, <span class="hljs-string">'$1us'</span>)
inflect.singular(<span class="hljs-regexp">/(alias|status)(es)?$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.singular(<span class="hljs-regexp">/^(ox)en/i</span>, <span class="hljs-string">'$1'</span>)
inflect.singular(<span class="hljs-regexp">/(vert|ind)ices$/i</span>, <span class="hljs-string">'$1ex'</span>)
inflect.singular(<span class="hljs-regexp">/(matr)ices$/i</span>, <span class="hljs-string">'$1ix'</span>)
inflect.singular(<span class="hljs-regexp">/(quiz)zes$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.singular(<span class="hljs-regexp">/(database)s$/i</span>, <span class="hljs-string">'$1'</span>)
inflect.irregular(<span class="hljs-string">'person'</span>, <span class="hljs-string">'people'</span>)
inflect.irregular(<span class="hljs-string">'man'</span>, <span class="hljs-string">'men'</span>)
inflect.irregular(<span class="hljs-string">'child'</span>, <span class="hljs-string">'children'</span>)
inflect.irregular(<span class="hljs-string">'move'</span>, <span class="hljs-string">'moves'</span>)
inflect.irregular(<span class="hljs-string">'she'</span>, <span class="hljs-string">'they'</span>)
inflect.irregular(<span class="hljs-string">'he'</span>, <span class="hljs-string">'they'</span>)
inflect.irregular(<span class="hljs-string">'myself'</span>, <span class="hljs-string">'ourselves'</span>)
inflect.irregular(<span class="hljs-string">'yourself'</span>, <span class="hljs-string">'ourselves'</span>)
inflect.irregular(<span class="hljs-string">'himself'</span>, <span class="hljs-string">'themselves'</span>)
inflect.irregular(<span class="hljs-string">'herself'</span>, <span class="hljs-string">'themselves'</span>)
inflect.irregular(<span class="hljs-string">'themself'</span>, <span class="hljs-string">'themselves'</span>)
inflect.irregular(<span class="hljs-string">'mine'</span>, <span class="hljs-string">'ours'</span>)
inflect.irregular(<span class="hljs-string">'hers'</span>, <span class="hljs-string">'theirs'</span>)
inflect.irregular(<span class="hljs-string">'his'</span>, <span class="hljs-string">'theirs'</span>)
inflect.irregular(<span class="hljs-string">'its'</span>, <span class="hljs-string">'theirs'</span>)
inflect.irregular(<span class="hljs-string">'theirs'</span>, <span class="hljs-string">'theirs'</span>)
inflect.irregular(<span class="hljs-string">'sex'</span>, <span class="hljs-string">'sexes'</span>)
inflect.irregular(<span class="hljs-string">'zombie'</span>, <span class="hljs-string">'zombies'</span>)
inflect.uncountable(<span class="hljs-string">'advice'</span>, <span class="hljs-string">'energy'</span>, <span class="hljs-string">'excretion'</span>, <span class="hljs-string">'digestion'</span>, <span class="hljs-string">'cooperation'</span>, <span class="hljs-string">'health'</span>, <span class="hljs-string">'justice'</span>, <span class="hljs-string">'jeans'</span>, <span class="hljs-string">'police'</span>)
inflect.uncountable(<span class="hljs-string">'labour'</span>, <span class="hljs-string">'machinery'</span>, <span class="hljs-string">'equipment'</span>, <span class="hljs-string">'information'</span>, <span class="hljs-string">'pollution'</span>, <span class="hljs-string">'sewage'</span>, <span class="hljs-string">'paper'</span>, <span class="hljs-string">'money'</span>)
inflect.uncountable(<span class="hljs-string">'species'</span>, <span class="hljs-string">'series'</span>, <span class="hljs-string">'rain'</span>, <span class="hljs-string">'rice'</span>, <span class="hljs-string">'fish'</span>, <span class="hljs-string">'sheep'</span>, <span class="hljs-string">'moose'</span>, <span class="hljs-string">'deer'</span>, <span class="hljs-string">'bison'</span>, <span class="hljs-string">'proceedings'</span>)
inflect.uncountable(<span class="hljs-string">'shears'</span>, <span class="hljs-string">'pincers'</span>, <span class="hljs-string">'breeches'</span>, <span class="hljs-string">'hijinks'</span>, <span class="hljs-string">'clippers'</span>, <span class="hljs-string">'chassis'</span>, <span class="hljs-string">'innings'</span>, <span class="hljs-string">'elk'</span>)
inflect.uncountable(<span class="hljs-string">'rhinoceros'</span>, <span class="hljs-string">'swine'</span>, <span class="hljs-string">'you'</span>, <span class="hljs-string">'news'</span>)</pre></div></div>
</li>
</ul>
</div>
</body>
</html>