The cl-inflector Reference Manual

This is the cl-inflector Reference Manual, version 0.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 17:03:53 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-inflector

Functions to pluralize and singularize english and portuguese languages words

License

MIT

Version

0.2

Dependencies
  • cl-ppcre (system).
  • alexandria (system).
Source

cl-inflector.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 cl-inflector/cl-inflector.asd

Source

cl-inflector.asd.

Parent Component

cl-inflector (system).

ASDF Systems

cl-inflector.

Packages

cl-inflector.system.


3.1.2 cl-inflector/langs.lisp

Source

cl-inflector.asd.

Parent Component

cl-inflector (system).

Packages

cl-inflector.langs.

Public Interface
Internals

3.1.3 cl-inflector/inflector.lisp

Source

cl-inflector.asd.

Parent Component

cl-inflector (system).

Packages

cl-inflector.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 cl-inflector

Package with function to pluralize/singularize words.

Source

inflector.lisp.

Nickname

inflector

Use List
  • cl-ppcre.
  • common-lisp.
Public Interface
Internals

4.2 cl-inflector.langs

Package with the language class and its methods and a few functions to handle the language class.

Source

langs.lisp.

Use List

common-lisp.

Public Interface
Internals

4.3 cl-inflector.system

Source

cl-inflector.asd.

Use List
  • asdf/interface.
  • common-lisp.

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *current-language*

Current language used. Defaults to en_US.

Package

cl-inflector.langs.

Source

langs.lisp.


5.1.2 Ordinary functions

Function: available-languages ()

Returns the name of all available languages.

Package

cl-inflector.langs.

Source

langs.lisp.

Function: current-language ()

Returns the current language object.

Package

cl-inflector.langs.

Source

langs.lisp.

Function: current-language-name ()

Returns the name of the current language.

Package

cl-inflector.langs.

Source

langs.lisp.

Function: irregular (singular plural)

Adds a irregular single-plural set to the irregular list

Package

cl-inflector.

Source

inflector.lisp.

Function: irregular? (word)

Tests if a given ‘word’ is irregular, plural or singular.

Package

cl-inflector.

Source

inflector.lisp.

Function: plural-of (word)

Returns the plural of a word if it’s singular, or itself if already plural

Package

cl-inflector.

Source

inflector.lisp.

Function: pluralize (count word &optional plural)

If ‘count’ is greater than 1, returns the ‘plural’ arg if provided, otherwise pluralizes the given ‘word’.

Package

cl-inflector.

Source

inflector.lisp.

Function: set-language! (lang &optional clone?)

Sets the current language, if clone? then set to a copy of the current language this is useful - eg in testing or creating custom dictionaries.

Package

cl-inflector.langs.

Source

langs.lisp.

Function: singular-of (word)

Returns the singular of a word if it’s singular, or itself if already singular

Package

cl-inflector.

Source

inflector.lisp.

Function: symbol-plural-of (word &key package)

Creates a symbol with the plural version of the given ‘word’.

Package

cl-inflector.

Source

inflector.lisp.

Function: symbol-singular-of (word &key package)

Creates a symbol with the singular version of the given ‘word’.

Package

cl-inflector.

Source

inflector.lisp.

Function: uncountable (word)

Notifies the inflector that a word is uncountable.

Package

cl-inflector.

Source

inflector.lisp.

Function: uncountable? (word)

Checks whether a given ‘word’ is uncountable.

Package

cl-inflector.

Source

inflector.lisp.


5.1.3 Generic functions

Generic Reader: irregulars (object)
Generic Writer: (setf irregulars) (object)
Package

cl-inflector.langs.

Methods
Reader Method: irregulars ((language language))
Writer Method: (setf irregulars) ((language language))

Alist with irregular words pairs.

Source

langs.lisp.

Target Slot

irregulars.

Generic Reader: plurals (object)
Generic Writer: (setf plurals) (object)
Package

cl-inflector.langs.

Methods
Reader Method: plurals ((language language))
Writer Method: (setf plurals) ((language language))

Alist with (singular-matching-regex plural-equiv).

Source

langs.lisp.

Target Slot

plurals.

Generic Reader: singulars (object)
Generic Writer: (setf singulars) (object)
Package

cl-inflector.langs.

Methods
Reader Method: singulars ((language language))
Writer Method: (setf singulars) ((language language))

Alist with (plural-matching-regex singular-equiv).

Source

langs.lisp.

Target Slot

singulars.

Generic Reader: uncountables (object)
Generic Writer: (setf uncountables) (object)
Package

cl-inflector.langs.

Methods
Reader Method: uncountables ((language language))
Writer Method: (setf uncountables) ((language language))

List with uncountable words.

Source

langs.lisp.

Target Slot

uncountables.


5.1.4 Classes

Class: language

Language object to hold all lists with regexps, irregulars and uncountable words.

Package

cl-inflector.langs.

Source

langs.lisp.

Direct methods
Direct slots
Slot: name

Name of the language as a keyword.

Initargs

:name

Readers

name.

Writers

(setf name).

Slot: plurals

Alist with (singular-matching-regex plural-equiv).

Initargs

:plurals

Readers

plurals.

Writers

(setf plurals).

Slot: singulars

Alist with (plural-matching-regex singular-equiv).

Initargs

:singulars

Readers

singulars.

Writers

(setf singulars).

Slot: uncountables

List with uncountable words.

Initargs

:uncountables

Readers

uncountables.

Writers

(setf uncountables).

Slot: irregulars

Alist with irregular words pairs.

Initargs

:irregulars

Readers

irregulars.

Writers

(setf irregulars).


5.2 Internals


5.2.1 Special variables

Special Variable: +en_us+

Adapted *cough*ripped*cough* from rails inflector.rb singular->plurals regular expressions

Package

cl-inflector.langs.

Source

langs.lisp.

Special Variable: +languages+

List of all available languages objects.

Package

cl-inflector.langs.

Source

langs.lisp.

Special Variable: +pt_br+
Package

cl-inflector.langs.

Source

langs.lisp.


5.2.2 Ordinary functions

Function: get-irregular-plural (singular)

Makes sure that a ‘singular’ word is on its plural form. If it is already plural, returns it. If it is not irregular, returns nil.

Package

cl-inflector.

Source

inflector.lisp.

Function: get-irregular-singular (plural)

Makes sure that a ‘plural’ word is on its singular form. If it is already singular, returns it. If it is not irregular, returns nil.

Package

cl-inflector.

Source

inflector.lisp.

Function: inflector-helper (word regexes)
Package

cl-inflector.

Source

inflector.lisp.

Function: irregular-plural? (word)

Tests if a given ‘word’ is an irregular word in its plural form.

Package

cl-inflector.

Source

inflector.lisp.

Function: irregular-singular? (word)

Tests if a given ‘word’ is an irregular word in its singular form.

Package

cl-inflector.

Source

inflector.lisp.

Function: 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

Package

cl-inflector.

Source

inflector.lisp.

Function: 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

Package

cl-inflector.

Source

inflector.lisp.


5.2.3 Generic functions

Generic Reader: name (object)
Generic Writer: (setf name) (object)
Package

cl-inflector.langs.

Methods
Reader Method: name ((language language))
Writer Method: (setf name) ((language language))

Name of the language as a keyword.

Source

langs.lisp.

Target Slot

name.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   F   G   I   M   N   P   S   U  
Index Entry  Section

(
(setf irregulars): Public generic functions
(setf irregulars): Public generic functions
(setf name): Private generic functions
(setf name): Private generic functions
(setf plurals): Public generic functions
(setf plurals): Public generic functions
(setf singulars): Public generic functions
(setf singulars): Public generic functions
(setf uncountables): Public generic functions
(setf uncountables): Public generic functions

A
available-languages: Public ordinary functions

C
current-language: Public ordinary functions
current-language-name: Public ordinary functions

F
Function, available-languages: Public ordinary functions
Function, current-language: Public ordinary functions
Function, current-language-name: Public ordinary functions
Function, get-irregular-plural: Private ordinary functions
Function, get-irregular-singular: Private ordinary functions
Function, inflector-helper: Private ordinary functions
Function, irregular: Public ordinary functions
Function, irregular-plural?: Private ordinary functions
Function, irregular-singular?: Private ordinary functions
Function, irregular?: Public ordinary functions
Function, plural: Private ordinary functions
Function, plural-of: Public ordinary functions
Function, pluralize: Public ordinary functions
Function, set-language!: Public ordinary functions
Function, singular: Private ordinary functions
Function, singular-of: Public ordinary functions
Function, symbol-plural-of: Public ordinary functions
Function, symbol-singular-of: Public ordinary functions
Function, uncountable: Public ordinary functions
Function, uncountable?: Public ordinary functions

G
Generic Function, (setf irregulars): Public generic functions
Generic Function, (setf name): Private generic functions
Generic Function, (setf plurals): Public generic functions
Generic Function, (setf singulars): Public generic functions
Generic Function, (setf uncountables): Public generic functions
Generic Function, irregulars: Public generic functions
Generic Function, name: Private generic functions
Generic Function, plurals: Public generic functions
Generic Function, singulars: Public generic functions
Generic Function, uncountables: Public generic functions
get-irregular-plural: Private ordinary functions
get-irregular-singular: Private ordinary functions

I
inflector-helper: Private ordinary functions
irregular: Public ordinary functions
irregular-plural?: Private ordinary functions
irregular-singular?: Private ordinary functions
irregular?: Public ordinary functions
irregulars: Public generic functions
irregulars: Public generic functions

M
Method, (setf irregulars): Public generic functions
Method, (setf name): Private generic functions
Method, (setf plurals): Public generic functions
Method, (setf singulars): Public generic functions
Method, (setf uncountables): Public generic functions
Method, irregulars: Public generic functions
Method, name: Private generic functions
Method, plurals: Public generic functions
Method, singulars: Public generic functions
Method, uncountables: Public generic functions

N
name: Private generic functions
name: Private generic functions

P
plural: Private ordinary functions
plural-of: Public ordinary functions
pluralize: Public ordinary functions
plurals: Public generic functions
plurals: Public generic functions

S
set-language!: Public ordinary functions
singular: Private ordinary functions
singular-of: Public ordinary functions
singulars: Public generic functions
singulars: Public generic functions
symbol-plural-of: Public ordinary functions
symbol-singular-of: Public ordinary functions

U
uncountable: Public ordinary functions
uncountable?: Public ordinary functions
uncountables: Public generic functions
uncountables: Public generic functions