From 1111210047f3ca62a2fec5d0ca20bce5cad25f12 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 14 Dec 2017 13:57:53 -0800 Subject: Updating some more stuff. --- lib/plurals.nom | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'lib/plurals.nom') diff --git a/lib/plurals.nom b/lib/plurals.nom index a1c293f..85938e9 100644 --- a/lib/plurals.nom +++ b/lib/plurals.nom @@ -4,19 +4,19 @@ require "lib/secrets.nom" # Plurals with secrets: lua do> ".." - |local endings = setmetatable({x="es",c="es",s="es"}, {__index=function() return "s"; end}); - |secrets.plurals = setmetatable({}, {__index=function(self,key) - | return key..endings[key:sub(-1)]; - |end}); - |secrets.singulars = setmetatable({}, {__index=function(self,key) - | if key:sub(-2) == "es" and rawget(endings, key:sub(-3,-3)) then return key:sub(1,-3); end - | if key:sub(-1) == "s" then return key:sub(1,-2); end - | return key; - |end}); - |secrets.canonicals = setmetatable({}, {__index=function(self,key) - | if key:sub(-1) == "s" then return secrets.singulars[key]; end - | return key; - |end}); + local endings = setmetatable({x="es",c="es",s="es"}, {__index=function() return "s"; end}); + secrets.plurals = setmetatable({}, {__index=function(self,key) + return key..endings[key:sub(-1)]; + end}); + secrets.singulars = setmetatable({}, {__index=function(self,key) + if key:sub(-2) == "es" and rawget(endings, key:sub(-3,-3)) then return key:sub(1,-3); end + if key:sub(-1) == "s" then return key:sub(1,-2); end + return key; + end}); + secrets.canonicals = setmetatable({}, {__index=function(self,key) + if key:sub(-1) == "s" then return secrets.singulars[key]; end + return key; + end}); rule [the plural of %singular is %plural] =: (secret %plurals)->%singular = %plural -- cgit v1.2.3