A set of possible values for a character, described as a collection of
intervals. Each interval is [a, b] (ie a <= x <= b, where x is a character
code). We use open bounds to avoid having to specify an "out of range"
value, making it easier to work with a variety of alphabets.
The intervals are stored in a list, ordered by a, joining overlapping
intervals as necessary.
|
|
__init__(self,
intervals,
alphabet)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
append(self,
interval)
Add an interval to the range. |
source code
|
|
|
|
__build_index(self)
Pre-construct the index used for bisection. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
len(self)
The number of intervals in the range. |
source code
|
|
|
|
|
|
|
|
|
|
__contains__(self,
c)
Does the value lie within the intervals? |
source code
|
|
|
|
|
|
|
|
|
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__,
__sizeof__,
__subclasshook__
|