code: def word2array(ft_names, word):
      
      vdict = {'+': 1, '-': -1, '0': 0}
  
      def seg2col(seg):
          seg = dict([(k, v) for (v, k) in seg])
          return [vdict[seg[ft]] for ft in ft_names]
      return numpy.array([seg2col(s) for s in word], order='F')
docs: Converts `word` [[(value, feature),...],...] to a NumPy array
  
      Given a word consisting of lists of lists/sets of (value, feature) tuples,
      return a NumPy array where each row is a segment and each column is a
      feature.
  
      Args:
          ft_names (list): list of feature names (as strings) in order; this
                           argument controls what features are included in the
                           array that is output and their order vis-a-vis the
                           columns of the array
          word (list): list of lists of feature tuples (output by
                       FeatureTable.word_fts)
  
      Returns:
          ndarray: array in which each row is a segment and each column
                           is a feature