Package rxpy :: Package alphabet :: Module digits :: Class Digits
[hide private]
[frames] | no frames]

Class Digits

source code


Define character sets etc for lists of single digits.

See base class for full documentation.

Instance Methods [hide private]
 
__init__(self)
min and max define the range of values that char_to_code will map characters to (inclusive).
source code
 
code_to_char(self, code)
Convert a code - an integer value between min and max, that maps the alphabet to a contiguous set of integers - to a character in the alphabet.
source code
 
char_to_code(self, char)
Convert a character in the alphabet to a code - an integer value between min and max, that maps the alphabet to a contiguous set of integers.
source code
 
coerce(self, char)
Force a character in str, unicode, or the alphabet itself, to be a member of the alphabet.
source code
 
join(self, *strings)
Construct a word in the alphabet, given a list of words and/or characters.
source code
 
to_str(self, char)
Display the character.
source code

Inherited from base.BaseAlphabet: after, before, digit, space, unescape, unpack, word

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
min and max define the range of values that char_to_code will map characters to (inclusive).
Overrides: object.__init__
(inherited documentation)

code_to_char(self, code)

source code 
Convert a code - an integer value between min and max, that maps the alphabet to a contiguous set of integers - to a character in the alphabet.
Overrides: base.BaseAlphabet.code_to_char
(inherited documentation)

char_to_code(self, char)

source code 
Convert a character in the alphabet to a code - an integer value between min and max, that maps the alphabet to a contiguous set of integers.
Overrides: base.BaseAlphabet.char_to_code
(inherited documentation)

coerce(self, char)

source code 
Force a character in str, unicode, or the alphabet itself, to be a member of the alphabet.
Overrides: base.BaseAlphabet.coerce
(inherited documentation)

join(self, *strings)

source code 
Construct a word in the alphabet, given a list of words and/or characters.
Overrides: base.BaseAlphabet.join
(inherited documentation)

to_str(self, char)

source code 

Display the character.

Note - this is the basis of hash and equality for intervals, so must be unique, repeatable, etc.

Overrides: base.BaseAlphabet.to_str