class_docstr: String with various indexes.
docstr: Initializer.
  
  Args:
      raw_string: string with raw text in it
      bow: if True, a char is the same everywhere in the text - i.e. we
           will index multiple occurrences of the same character. If False,
           order matters, so that the same word will have different ids
           according to position.
      mask_string: If not None, replace characters with this if bow=False
          if None, default value is chr(0)
code: def __init__(self, raw_string, bow=True, mask_string=None):
      """Initializer.
  
      Args:
          raw_string: string with raw text in it
          bow: if True, a char is the same everywhere in the text - i.e. we
               will index multiple occurrences of the same character. If False,
               order matters, so that the same word will have different ids
               according to position.
          mask_string: If not None, replace characters with this if bow=False
              if None, default value is chr(0)
      """
      self.raw = raw_string
      self.as_list = list(self.raw)
      self.as_np = np.array(self.as_list)
      self.mask_string = chr(0) if mask_string is None else mask_string
      self.string_start = np.arange(len(self.raw))
      vocab = {}
      self.inverse_vocab = []
      self.positions = []
      self.bow = bow
      non_vocab = set()
      for i, char in enumerate(self.as_np):
          if char in non_vocab:
              continue
          if bow:
              if char not in vocab:
                  vocab[char] = len(vocab)
                  self.inverse_vocab.append(char)
                  self.positions.append([])
              idx_char = vocab[char]
              self.positions[idx_char].append(i)
          else:
              self.inverse_vocab.append(char)
              self.positions.append(i)
      if not bow:
          self.positions = np.array(self.positions)
  
imports: from functools import partial
  import itertools
  import json
  import re
  import numpy
  import scipy
  import sklearn
  from sklearn.utils import check_random_state
  from .None import explanation
  from .None import lime_base
label_desc: Use image node_id 1 to create a new IndexedCharacters object from inherited base classes: object with example: obj = IndexedCharacters(raw_string, bow, mask_string)