class_docstr: Main data class: encapsulate list of utterances, mentions and speakers
  Process utterances to extract mentions and pre-compute mentions features
docstr: Add utterances to the utterance list and build mention list for these utterances
  
  Arg:
      utterances : iterator or list of string corresponding to successive utterances
      utterances_speaker : iterator or list of speaker id for each utterance.
          If not provided, assume two speakers speaking alternatively.
          if utterances and utterances_speaker are not of the same length padded with None
      speakers_names : dictionnary of list of acceptable speaker names for each speaker id
  Return:
      List of indexes of added utterances in the docs
docstr_tok: ["Add","utterances","to","the","utterance","list","and","build","mention","list","for","these","utterances","Arg",":","utterances",":","iterator","or","list","of","string","corresponding","to","successive","utterances","utterances_speaker",":","iterator","or","list","of","speaker","id","for","each","utterance",".","If","not","provided",",","assume","two","speakers","speaking","alternatively",".","if","utterances","and","utterances_speaker","are","not","of","the","same","length","padded","with","None","speakers_names",":","dictionnary","of","list","of","acceptable","speaker","names","for","each","speaker","id","Return",":","List","of","indexes","of","added","utterances","in","the","docs"]
code: def add_utterances(
      self, utterances, utterances_speaker=None, speakers_names=None
  ):
      """
      Add utterances to the utterance list and build mention list for these utterances
  
      Arg:
          utterances : iterator or list of string corresponding to successive utterances
          utterances_speaker : iterator or list of speaker id for each utterance.
              If not provided, assume two speakers speaking alternatively.
              if utterances and utterances_speaker are not of the same length padded with None
          speakers_names : dictionnary of list of acceptable speaker names for each speaker id
      Return:
          List of indexes of added utterances in the docs
      """
      if self.debug:
          print("Adding utterances", utterances)
      if isinstance(utterances, string_types):
          utterances = [utterances]
      if utterances_speaker is None:
          if self.debug:
              print("No utterance speaker indication")
          a = -1
          if self.utterances_speaker and isinstance(
              self.utterances_speaker[-1].speaker_id, integer_types
          ):
              a = self.utterances_speaker[-1].speaker_id
          utterances_speaker = (
              (i + a + 1) % 2 for i in range(len(utterances))
          )
      utterances_index = []
      utt_start = len(self.utterances)
      docs = list(self.nlp.pipe(utterances))
      m_spans = list(
          extract_mentions_spans(doc, blacklist=self.blacklist)
          for doc in docs
      )
      for utt_index, (doc, m_spans, speaker_id) in enumerate(
          zip_longest(docs, m_spans, utterances_speaker)
      ):
          if speaker_id not in self.speakers:
              speaker_name = (
                  speakers_names.get(speaker_id, None)
                  if speakers_names
                  else None
              )
              self.speakers[speaker_id] = Speaker(
                  speaker_id, speaker_name
              )
          self._process_mentions(
              m_spans,
              utt_start + utt_index,
              self.n_sents,
              self.speakers[speaker_id],
          )
          utterances_index.append(utt_start + utt_index)
          self.utterances.append(doc)
          self.utterances_speaker.append(self.speakers[speaker_id])
          self.n_sents += len(list(doc.sents))
  
      self.set_mentions_features()
      self.last_utterances_loaded = utterances_index
  
imports: import re
  import io
  from six import string_types, integer_types
  from spacy.tokens import Span, Token
  from neuralcoref.train.compat import unicode_
  from neuralcoref.train.utils import encode_distance, parallel_process
  import spacy
  import numpy
label_desc: Use image node_id 8 for calling the Document obj's underlying member method code with example usage: obj.add_utterances(utterances, utterances_speaker, speakers_names) without return types