Table of Contents

Class: Pluralizer ./src/peak/util/Pluralizer.py

Convert an identifier to plural form

Instances of Pluralizer can be called on identifier strings to convert them to plural form, using either a mapping object lookup or a set of regular expression replacement rules. Non-alphabetic suffixes are left untouched, and an attempt is made to match the capitalization of the original string. Thus the string "__harmony__" would be pluralized to "__harmonies__", and "PARENTHESIS_27" would become "PARENTHESES_27".

Methods   
__call__
__init__
lookup
upperize
  __call__ 
__call__ ( self,  s )

Pluralize by looking up in mapping or applying regex rules

  __init__ 
__init__ (
        self,
        pluralsFile=None,
        customMapping=None,
        **kw,
        )

  lookup 
lookup ( self,  s )

Look up identifier in mapping object, trying alternative forms

  upperize 
upperize (
        self,
        s,
        new,
        )

Try to capitalize new to match capitalization of s


Table of Contents

This document was automatically generated on Mon Nov 11 01:11:04 2024 by HappyDoc version 2.1