macsami
Python Character Mapping Codec for macsami.
Codec
Bases: codecs.Codec
Implement the interface for stateless encoders/decoders.
Source code in /home/anders/projects/CorpusTools/corpustools/macsami.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
decode(instring, errors='strict')
Decode the object input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instring |
str
|
the string that should be decoded with this codec. |
required |
errors |
str
|
define the error handling to apply. One of 'strict', 'replace' or 'ignore'. |
'strict'
|
Returns:
Type | Description |
---|---|
tuple[bytes, int
|
a tuple of output object and length consumed |
Source code in /home/anders/projects/CorpusTools/corpustools/macsami.py
29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
encode(instring, errors='strict')
Encode the object input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instring |
str
|
the string that should be encoded with this codec. |
required |
errors |
str
|
define the error handling to apply. One of 'strict', 'replace', 'ignore', 'xmlcharrefreplace' or 'backslashreplace'. |
'strict'
|
Returns:
Type | Description |
---|---|
tuple[bytes, int
|
a tuple of output object and length consumed |
Source code in /home/anders/projects/CorpusTools/corpustools/macsami.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
IncrementalDecoder
Bases: codecs.IncrementalDecoder
Implement an IncrementalDecoder.
Source code in /home/anders/projects/CorpusTools/corpustools/macsami.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
decode(instring, final=False)
Decode input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instring |
str
|
the string that should be decoded with this codec. |
required |
Returns:
Type | Description |
---|---|
tuple[bytes, int
|
a tuple of output object and length consumed |
Source code in /home/anders/projects/CorpusTools/corpustools/macsami.py
63 64 65 66 67 68 69 70 71 72 73 |
|
IncrementalEncoder
Bases: codecs.IncrementalEncoder
Implement an IncrementalEncoder.
Source code in /home/anders/projects/CorpusTools/corpustools/macsami.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
encode(instring, final=False)
Encode input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instring |
str
|
the string that should be encoded with this codec. |
required |
Returns:
Type | Description |
---|---|
tuple[bytes, int
|
a tuple of output object and length consumed |
Source code in /home/anders/projects/CorpusTools/corpustools/macsami.py
47 48 49 50 51 52 53 54 55 56 57 |
|
getregentry()
Get the info for this encoding.
Source code in /home/anders/projects/CorpusTools/corpustools/macsami.py
79 80 81 82 83 84 85 86 87 88 89 |
|
lookup(encoding)
Lookup the name of the encoding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
encoding |
str
|
name of the encoding |
required |
Returns:
Type | Description |
---|---|
Codecs.CodecInfo | None
|
Codecs.CodecInfo if encoding is the name of the encoding of this file, None otherwise. |
Source code in /home/anders/projects/CorpusTools/corpustools/macsami.py
357 358 359 360 361 362 363 364 365 366 367 368 369 |
|