Next / Previous / Contents / Shipman's homepage

6.14. UniData._readChars(): Process character data

unidata.py
# - - -   U n i D a t a . _ r e a d C h a r s

    def _readChars(self, root):
        '''Set up ._cpMap.

          [ self._cpMap  :=  as invariant from root ]
        '''
        #-- 1
        self._cpMap = {}

From the schema file, charlist.rnc:

charlist = element charlist {character*}

The processing for one character is done in Section 6.15, “UniData._readOneChar(): Extract the data for one code point”.

unidata.py
        #-- 2
        # [ charListNode  :=  CHARLIST_N child of root ]
        charListNode = root.find(CHARLIST_N)

        #-- 3
        # [ self._cpMap  +:=  entries whose keys are the characters
        #       described by CHARACTER_N children of charListNode,
        #       and each related value is a UniChar instance
        #       representing data from those children ]
        for charNode in charListNode.findall(CHARACTER_N):
            self._readOneChar(charNode)