def METHOD_NAME(self, token, type_token=False):
    """convert sentencpiece token to Id"""
    if isinstance(token, (CommandToken)):
        return token.Id
    try:
        return self._vocab[token]
    except KeyError:
        return self._vocab[token.strip()]