class_docstr: Maps individual tokens to sequences of character ids, compatible with ELMo.
  To be consistent with previously trained models, we include it here as special of existing
  character indexers.
class_docstr_tok: ["Maps","individual","tokens","to","sequences","of","character","ids",",","compatible","with","ELMo",".","To","be","consistent","with","previously","trained","models",",","we","include","it","here","as","special","of","existing","character","indexers","."]
code: def convert_word_to_char_ids(word):
      if word == ELMoCharacterMapper.bos_token:
          char_ids = (
              ELMoCharacterMapper.beginning_of_sentence_characters
          )
      elif word == ELMoCharacterMapper.eos_token:
          char_ids = ELMoCharacterMapper.end_of_sentence_characters
      else:
          word_encoded = word.encode("utf-8", "ignore")[
              : (ELMoCharacterMapper.max_word_length - 2)
          ]
          char_ids = [
              ELMoCharacterMapper.padding_character
          ] * ELMoCharacterMapper.max_word_length
          char_ids[0] = ELMoCharacterMapper.beginning_of_word_character
          for k, chr_id in enumerate(word_encoded, start=1):
              if not (isinstance(chr_id, int)):
                  char_ids[k] = ord(chr_id)
              else:
                  char_ids[k] = chr_id
          char_ids[
              len(word_encoded) + 1
          ] = ELMoCharacterMapper.end_of_word_character
  
      # +1 one for masking
      return [c + 1 for c in char_ids]
  
file_path: magnitude/pymagnitude/third_party/allennlp/data/token_indexers/elmo_indexer.py
imports: from __future__ import absolute_import
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.util import pad_sequence_to_length
  from allennlp.data.tokenizers.token import Token
  from allennlp.data.token_indexers.token_indexer import TokenIndexer
  from allennlp.data.vocabulary import Vocabulary
label_desc: Use image node_id 1 for calling the ELMoCharacterMapper obj's underlying member method code with example usage: obj.convert_word_to_char_ids(word) and returns: unknown