def __getitem__(self, tokens):
if not isinstance(tokens, (list, tuple)):<EOL><INDENT>return self._token_to_char_indices(tokens)<EOL><DEDENT>else:<EOL><INDENT>return [self._token_to_char_indices(token) for token in tokens]<EOL><DEDENT>
Looks up indices of text tokens according to the vocabulary.

        Parameters
        ----------
        tokens : str or list of strs
            A source token or tokens to be converted.

        Returns
        -------
        int or list of ints
            A list of char indices or a list of list of char indices according to the vocabulary.