regex = / s$/ # test: anything ending with "s"
singular = [ "car" ,
"boat" ,
"man" ,
"woman" ,
"omen" ,
"bus" ,
"cactus" ,
"spy" ,
"pie" ,
"louse" ,
"mouse" ,
"amice" ,
"goose" ,
"creese" ,
"person" ,
"child" ,
"siren" ,
"ox" ,
"foot" ,
"tooth" ,
"formula" ,
"minx" ,
"sphinx" ,
"wife" ,
"knife" ,
"ion" ,
"criterion" ,
"jinni" ,
"zero" ,
"hero" ]
plural = [ "cars" ,
"boats" ,
"men" ,
"women" ,
"omens" ,
"buses" ,
"cacti" ,
"spies" ,
"pies" ,
"lice" ,
"mice" ,
"amices" ,
"geese" ,
"creeses" ,
"people" ,
"children" ,
"sirens" ,
"oxen" ,
"feet" ,
"teeth" ,
"formulae" ,
"minxes" ,
"sphinges" ,
"wives" ,
"knives" ,
"ions" ,
"criteria" ,
"jinn" ,
"zeros" ,
"heroes" ]
singular.zip ( plural) { | s,p |
puts " #{s=~regex ? " X" : " "} #{s.ljust(9)} #{p=~regex ? " X" : " "} " + p
}
# match_singular = singular.select { |word| word =~ regex }
# puts "MATCHED #{match_singular.size}/#{singular.size} singular nouns:"
# puts match_singular
# puts
# match_plural = plural.select { |word| word =~ regex }
# puts "MATCHED #{match_plural.size}/#{plural.size} plural nouns:"
# puts match_plural
cmVnZXggPSAvcyQvICAjIHRlc3Q6IGFueXRoaW5nIGVuZGluZyB3aXRoICJzIgoKc2luZ3VsYXIgPSBbICJjYXIiLAogICAgICAgICAgICAgImJvYXQiLAogICAgICAgICAgICAgIm1hbiIsCiAgICAgICAgICAgICAid29tYW4iLAogICAgICAgICAgICAgIm9tZW4iLAogICAgICAgICAgICAgImJ1cyIsCiAgICAgICAgICAgICAiY2FjdHVzIiwKICAgICAgICAgICAgICJzcHkiLAogICAgICAgICAgICAgInBpZSIsCiAgICAgICAgICAgICAibG91c2UiLAogICAgICAgICAgICAgIm1vdXNlIiwKICAgICAgICAgICAgICJhbWljZSIsCiAgICAgICAgICAgICAiZ29vc2UiLAogICAgICAgICAgICAgImNyZWVzZSIsCiAgICAgICAgICAgICAicGVyc29uIiwKICAgICAgICAgICAgICJjaGlsZCIsCiAgICAgICAgICAgICAic2lyZW4iLAogICAgICAgICAgICAgIm94IiwKICAgICAgICAgICAgICJmb290IiwKICAgICAgICAgICAgICJ0b290aCIsCiAgICAgICAgICAgICAiZm9ybXVsYSIsCiAgICAgICAgICAgICAibWlueCIsCiAgICAgICAgICAgICAic3BoaW54IiwKICAgICAgICAgICAgICJ3aWZlIiwKICAgICAgICAgICAgICJrbmlmZSIsCiAgICAgICAgICAgICAiaW9uIiwKICAgICAgICAgICAgICJjcml0ZXJpb24iLAogICAgICAgICAgICAgImppbm5pIiwKICAgICAgICAgICAgICJ6ZXJvIiwKICAgICAgICAgICAgICJoZXJvIiBdCgpwbHVyYWwgPSBbICJjYXJzIiwKICAgICAgICAgICAiYm9hdHMiLAogICAgICAgICAgICJtZW4iLAogICAgICAgICAgICJ3b21lbiIsCiAgICAgICAgICAgIm9tZW5zIiwKICAgICAgICAgICAiYnVzZXMiLAogICAgICAgICAgICJjYWN0aSIsCiAgICAgICAgICAgInNwaWVzIiwKICAgICAgICAgICAicGllcyIsCiAgICAgICAgICAgImxpY2UiLAogICAgICAgICAgICJtaWNlIiwKICAgICAgICAgICAiYW1pY2VzIiwKICAgICAgICAgICAiZ2Vlc2UiLAogICAgICAgICAgICJjcmVlc2VzIiwKICAgICAgICAgICAicGVvcGxlIiwKICAgICAgICAgICAiY2hpbGRyZW4iLAogICAgICAgICAgICJzaXJlbnMiLAogICAgICAgICAgICJveGVuIiwKICAgICAgICAgICAiZmVldCIsCiAgICAgICAgICAgInRlZXRoIiwKICAgICAgICAgICAiZm9ybXVsYWUiLAogICAgICAgICAgICJtaW54ZXMiLAogICAgICAgICAgICJzcGhpbmdlcyIsCiAgICAgICAgICAgIndpdmVzIiwKICAgICAgICAgICAia25pdmVzIiwKICAgICAgICAgICAiaW9ucyIsCiAgICAgICAgICAgImNyaXRlcmlhIiwKICAgICAgICAgICAiamlubiIsCiAgICAgICAgICAgInplcm9zIiwKICAgICAgICAgICAiaGVyb2VzIiBdIAoKc2luZ3VsYXIuemlwKHBsdXJhbCkgeyB8cyxwfAogIHB1dHMgIiAje3M9fnJlZ2V4ID8gIlgiIDogIiAifSAje3MubGp1c3QoOSl9ICAgI3twPX5yZWdleCA/ICJYIiA6ICIgIn0gIitwCn0KCgojIG1hdGNoX3Npbmd1bGFyID0gc2luZ3VsYXIuc2VsZWN0IHsgfHdvcmR8IHdvcmQgPX4gcmVnZXggfQojIHB1dHMgIk1BVENIRUQgI3ttYXRjaF9zaW5ndWxhci5zaXplfS8je3Npbmd1bGFyLnNpemV9IHNpbmd1bGFyIG5vdW5zOiIKIyBwdXRzIG1hdGNoX3Npbmd1bGFyCiMgcHV0cwojIG1hdGNoX3BsdXJhbCA9IHBsdXJhbC5zZWxlY3QgeyB8d29yZHwgd29yZCA9fiByZWdleCB9CiMgcHV0cyAiTUFUQ0hFRCAje21hdGNoX3BsdXJhbC5zaXplfS8je3BsdXJhbC5zaXplfSBwbHVyYWwgbm91bnM6IgojIHB1dHMgbWF0Y2hfcGx1cmFsCg==