Package pyxmpp :: Module xmppstringprep :: Class LookupTable

[hide private]

# Class LookupTable

source code

Class for looking up RFC 3454 tables using a dictionary and/or list of ranges.

Instance Methods | [hide private]

__init__(self, singles, ranges) Initialize LookupTable object. | source code

lookup(self, c) Do Unicode character lookup. | source code

Method Details | [hide private]

### __init__(self, singles, ranges)
(Constructor)

source code

Initialize LookupTable object.

Parameters:
  - `singles` - dictionary mapping Unicode characters into other Unicode characters.
  - `ranges` - list of `((start,end),value)` tuples mapping codes in range (start,end) to the value.

### lookup(self, c)

source code

Do Unicode character lookup.

Parameters:
  - `c` - Unicode character to look up.
Returns:
  the mapped value.