Difference between revisions of "Template:Decliner"
From Jonathan Gardner's Latin Notebook
Line 39: | Line 39: | ||
function decline(noun, case_, number) { | function decline(noun, case_, number) { | ||
var m; | var m; | ||
− | noun = noun.replace(/ | + | noun = noun.replace(/^\s+|\s+$/g, ''); |
if (!noun) { | if (!noun) { | ||
Line 45: | Line 45: | ||
} | } | ||
− | if (m = / | + | if (m = /^(.*)(a|am|ae|as|arum|is)$/.exec(noun)) { |
return m[1]+{ | return m[1]+{ | ||
singular: { | singular: { |
Revision as of 15:39, 23 February 2012