def __init__(self, blockName, schemeName, data, swapTable=None):
self.block = characterBlocks[blockName]<EOL>self.name = schemeName<EOL>for equiv, unicodeHexValue in data.items():<EOL><INDENT>self[equiv] = self.block[chr(unicodeHexValue)]<EOL>self[equiv].addEquivalent(self.name, equiv)<EOL><DEDENT>self._longestEntry = max([len(e) for e in data.keys()])<EOL>if self._longestEntry > <NUM_LIT:1>:<EOL><INDENT>self._parseTree = {}<EOL>self._parsedata = list(data.keys())<EOL>self._parsedata.sort()<EOL>self._setupParseTree(<NUM_LIT:0>, len(data) - <NUM_LIT:1>, <NUM_LIT:0>, self._parseTree)<EOL><DEDENT>if swapTable is not None:<EOL><INDENT>if not isinstance(swapTable, dict): raise (TypeError)<EOL><DEDENT>self.swapTable = swapTable<EOL>self._register()<EOL>
Set up a transliteration scheme.

        Keyword arguments:
        blockName -- a string containg the name of the character block this 
                     transliteration scheme is used for, 
                     e.g. 'CYRILLIC', 'DEVANAGARI'.
        schemeName -- the name of the transliteration scheme. 
                      Must be unique.
        data -- a dict containing the data for the transliteration scheme. 
                Keys are transliterated Unicode characters or strings.
                Values are integers corresponding to Unicode code points.
                For examples, see the data for the built-in transliteration
                schemes.
        swapTable -- a dict (default None) containing any non-standard
                     letter combinations used in the transliteration scheme
                     that we want to pre-process away before transliterating.
                     See the ITRANS data for examples.

        Raises:
        KeyError: unknown block name.
        TypeError: swapTable is not a dict