Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A port of rails' inflector to common lisp
tree: 887e2871a6

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
tests
LICENSE
README.md
inflector.lisp
utils.lisp

README.md

Vana Inflector

A common lisp library to easily pluralize and singularize English words.

This is a support package for the Vana web framework, and is a port of the same from Rails' ActiveSupport module.

Installation

(ql:quickload 'vana-inflector)

Usage

Basic Usage, plural-of and singular-of:

(use-package :vana-inflector)
> (plural-of "octopus") 
"octopi"
> (plural-of "datum")
"data"
> (singular-of "children")
"child"
> (singular-of "cats")
"cat"
> (singular-of "data")
"datum"

Basic Usage, pluralize:

(use-package :vana-inflector)
> (pluralize 2 "octopus")
"octopi"
> (pluralize 1 "octopus")
"octopus"

Use irregular to add an irregular:

> (singular-of "feet")
"feet"
> (irregular "foot" "feet")
> (singular-of "feet")
"foot"
> (plural-of "foot")
"feet"

Use uncountable to add an uncountable:

> (plural-of "advice")
"advices"
> (singular-of "advice")
"advice"
> (singular-of "advices")
"advice"
> (uncountable "advice")
> (plural-of "advice")
"advice"

TODO

  • Expand the default lookup lists? Possible (but probably negligible) performance tradeoff for completeness
  • Add methods to transfer between CamelCase, whatJavaScriptDoes, this_underscore_style, and-lisp-style

License

Released under the MIT license, please see LICENSE for more details

Thanks

  • Xach - For quicklisp, really made getting back into CL much easier.
  • Siebel - For PCL, which has been a great reference.
Something went wrong with that request. Please try again.