convert Id to token accounting for command and type tokens
(self, Id, type_token=False)
| 405 | return tokenization |
| 406 | |
| 407 | def IdToToken(self, Id, type_token=False): |
| 408 | """convert Id to token accounting for command and type tokens""" |
| 409 | if isinstance(Id, (TypeToken, CommandToken)): |
| 410 | return Id.token |
| 411 | if type_token: |
| 412 | return self.type_id_map[Id].token |
| 413 | if Id < self.num_command_tokens: |
| 414 | return self.command_id_map[Id].token |
| 415 | return self.text_tokenizer.IdToToken(Id - self.num_command_tokens) |
| 416 | |
| 417 | def TokenToId(self, token, type_token=False): |
| 418 | """convert token to Id accounting for command and type tokens""" |
no outgoing calls
no test coverage detected