Next / Previous / Contents / Shipman's homepage

6.7. Txny.abbrToEng()

First we normalize the argument using Section 11.6, “fixAbbr(): Standardize a bird code”. The corresponding element of self.__abbrEng may have underbars in it, but in the returned English name, they are filtered out. Conversion from "G[, S]" form is handled by Section 11.5, “engDeComma(): Normalize an English name”.

xnomo3.py
# - - -   T x n y . a b b r T o E n g   - - -

    def abbrToEng ( self, abbr ):
        """Lookup the English name corresponding to abbr.
        """
        #-- 1 --
        # [ if abbr, normalized, is a key in self.__abbrEng ->
        #     rawEng  :=  the corresponding raw English name
        #   else -> raise KeyError ]
        rawEng = self.abbrToRawEng(abbr)

        #-- 2 --
        # [ return rawEng, de-commafied, with any underbars removed ]
        return abbrMod.engDeComma(rawEng).replace('_', '')