encode a byte string into alphabet indices
(self, x)
| 26 | return chr(self.chars[i]) |
| 27 | |
| 28 | def encode(self, x): |
| 29 | """ encode a byte string into alphabet indices """ |
| 30 | x = np.frombuffer(x, dtype=np.uint8) |
| 31 | x = self.encoding[x] |
| 32 | return x |
| 33 | |
| 34 | def decode(self, x): |
| 35 | """ decode index array, x, to byte string of this alphabet """ |
nothing calls this directly
no outgoing calls
no test coverage detected