Next / Previous / Contents / Shipman's homepage

6.9. Txny.abbrToHtml()

xnomo3.py
# - - -   T x n y . a b b r T o H t m l

    def abbrToHtml(self, abbr, cssClass=None):
        '''Convert English name to HTML
        '''

Bird codes are standardized by Section 11.6, “fixAbbr(): Standardize a bird code”.

xnomo3.py
        #-- 1 --
        # [ if abbr, standardized, is a key in self.__rawEng ->
        #     rawEng  :=  the related value
        #   else -> raise KeyError ]
        rawEng = self.abbrToRawEng(abbr)

Normalization of the name is done by Section 11.5, “engDeComma(): Normalize an English name”. See also Section 10.1, “htmlify(): Mark up text for HTML”.

xnomo3.py
        #-- 2 --
        # [ if cssClass is None ->
        #     return rawEng, normalized, as HTML, with italics marked
        #     up using an 'i' element
        #   else ->
        #     return rawEng, normalized, as HTML, with italics marked
        #     up using a 'span' element with class=(cssClass) ]
        return htmlify(abbrMod.engDeComma(rawEng), cssClass)