Skip to content

Instantly share code, notes, and snippets.

@sgrove
Created November 14, 2010 23:12
Show Gist options
  • Select an option

  • Save sgrove/676202 to your computer and use it in GitHub Desktop.

Select an option

Save sgrove/676202 to your computer and use it in GitHub Desktop.
:vana-inflector interface for adding rules/exceptions
(defun uncountable (word)
"Notifies the inflector that a word is uncountable"
(push word *uncountables*))
(defun irregular (singular plural)
"Adds a irregular single-plural set to the irregular list"
(push (cons singular plural) *irregulars*))
(defun plural (rule replacement)
"Adds a plural rule, where RULE can be either a string or a regex, and REPLACEMENT can contain capture references defined in RULE"
(push (list rule replacement) *plurals*))
(defun singular (rule replacement)
"Adds a singular rule, where RULE can be either a string or a regex, and REPLACEMENT can contain capture references defined in RULE"
(push (list rule replacement) *singulars*))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment