Created
November 14, 2010 23:12
-
-
Save sgrove/676202 to your computer and use it in GitHub Desktop.
:vana-inflector interface for adding rules/exceptions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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