class_docstr: Uses an ExpansionModel to expand the set of query terms based on the top
  N result documents.
code: def add_text(self, string):
      # Unfortunately since field.index() yields bytes texts, and we want
      # unicode, we end up encoding and decoding unnecessarily.
      #
      # TODO: Find a way around this
  
      field = self.ixreader.schema[self.fieldname]
      from_bytes = field.from_bytes
      self.add(
          (from_bytes(text), weight)
          for text, _, weight, _ in field.index(string)
      )
  
imports: from __future__ import division
  import random
  from collections import defaultdict
  from math import log
  from whoosh.compat import xrange, iteritems
label_desc: Use image node_id 4 for calling the Expander obj's underlying member method code with example usage: obj.add_text(string) without return types