class_docstr: A storage class for representing alignment between two sequences, s1, s2.
  In general, an alignment is a set of tuples of the form (i, j, ...)
  representing an alignment between the i-th element of s1 and the
  j-th element of s2.  Tuples are extensible (they might contain
  additional data, such as a boolean to indicate sure vs possible alignments).
  
      >>> from nltk.translate import Alignment
      >>> a = Alignment([(0, 0), (0, 1), (1, 2), (2, 2)])
      >>> a.invert()
      Alignment([(0, 0), (1, 0), (2, 1), (2, 2)])
      >>> print(a.invert())
      0-0 1-0 2-1 2-2
      >>> a[0]
      [(0, 1), (0, 0)]
      >>> a.invert()[2]
      [(2, 1), (2, 2)]
      >>> b = Alignment([(0, 0), (0, 1)])
      >>> b.issubset(a)
      True
      >>> c = Alignment.fromstring('0-0 0-1')
      >>> b == c
      True
class_docstr_tok: ["A","storage","class","for","representing","alignment","between","two","sequences",",","s1",",","s2",".","In","general",",","an","alignment","is","a","set","of","tuples","of","the","form","(","i",",","j",",","...",")","representing","an","alignment","between","the","i-th","element","of","s1","and","the","j-th","element","of","s2",".","Tuples","are","extensible","(","they","might","contain","additional","data",",","such","as","a","boolean","to","indicate","sure","vs","possible","alignments",")",".",">",">",">","from","nltk.translate","import","Alignment",">",">",">","a","=","Alignment","(","[","(","0",",","0",")",",","(","0",",","1",")",",","(","1",",","2",")",",","(","2",",","2",")","]",")",">",">",">","a.invert","(",")","Alignment","(","[","(","0",",","0",")",",","(","1",",","0",")",",","(","2",",","1",")",",","(","2",",","2",")","]",")",">",">",">","print","(","a.invert","(",")",")","0-0","1-0","2-1","2-2",">",">",">","a","[","0","]","[","(","0",",","1",")",",","(","0",",","0",")","]",">",">",">","a.invert","(",")","[","2","]","[","(","2",",","1",")",",","(","2",",","2",")","]",">",">",">","b","=","Alignment","(","[","(","0",",","0",")",",","(","0",",","1",")","]",")",">",">",">","b.issubset","(","a",")","True",">",">",">","c","=","Alignment.fromstring","(","'","0-0","0-1","'",")",">",">",">","b","==","c","True"]
docstr: Build a list self._index such that self._index[i] is a list
  of the alignments originating from word i.
docstr_tok: ["Build","a","list","self._index","such","that","self._index","[","i","]","is","a","list","of","the","alignments","originating","from","word","i","."]
code: def _build_index(self):
      """
      Build a list self._index such that self._index[i] is a list
      of the alignments originating from word i.
      """
      self._index = [[] for _ in range(self._len + 1)]
      for p in self:
          self._index[p[0]].append(p)
  
imports: import subprocess
  from collections import namedtuple
label_desc: Use image node_id 8 for calling the Alignment obj's underlying member method code with example usage: obj._build_index() without return types