def _index_special_tokens(self, unknown_token, special_tokens):
self._idx_to_token = [unknown_token] if unknown_token else []<EOL>if not special_tokens:<EOL><INDENT>self._reserved_tokens = None<EOL><DEDENT>else:<EOL><INDENT>self._reserved_tokens = special_tokens[:]<EOL>self._idx_to_token.extend(special_tokens)<EOL><DEDENT>if unknown_token:<EOL><INDENT>self._token_to_idx = DefaultLookupDict(C.UNK_IDX)<EOL><DEDENT>else:<EOL><INDENT>self._token_to_idx = {}<EOL><DEDENT>self._token_to_idx.update((token, idx) for idx, token in enumerate(self._idx_to_token))<EOL>
Indexes unknown and reserved tokens.