class_docstr: World representation for the WikitableQuestions domain.
  
  Parameters
  ----------
  table_graph : ``TableQuestionKnowledgeGraph``
      Context associated with this world.
class_docstr_tok: ["World","representation","for","the","WikitableQuestions","domain",".","Parameters","--","--","--","--","--","table_graph",":","``","TableQuestionKnowledgeGraph","``","Context","associated","with","this","world","."]
code: def __init__(self, table_graph):
      super(WikiTablesWorld, self).__init__(
          constant_type_prefixes={
              "part": types.PART_TYPE,
              "cell": types.CELL_TYPE,
              "num": types.NUMBER_TYPE,
          },
          global_type_signatures=types.COMMON_TYPE_SIGNATURE,
          global_name_mapping=types.COMMON_NAME_MAPPING,
          num_nested_lambdas=1,
      )
      self.table_graph = table_graph
  
      # For every new Sempre column name seen, we update this counter to map it to a new NLTK name.
      self._column_counter = 0
  
      # This adds all of the cell and column names to our local name mapping, including null
      # cells and columns and a few simple numbers, so we can get them as valid actions in the
      # parser.  The null cell and column are used to check against empty sets, e.g., for
      # questions like "Is there a team that won three times in a row?".
      for entity in table_graph.entities + [
          "fb:cell.null",
          "fb:row.row.null",
          "-1",
          "0",
          "1",
      ]:
          self._map_name(entity, keep_mapping=True)
  
      self._entity_set = set(table_graph.entities)
      self.terminal_productions = {}
      for entity in self._entity_set:
          mapped_name = self.local_name_mapping[entity]
          signature = self.local_type_signatures[mapped_name]
          self.terminal_productions[entity] = "{signature} -> {entity}"
  
      for predicate, mapped_name in list(
          self.global_name_mapping.items()
      ):
          if mapped_name in self.global_type_signatures:
              signature = self.global_type_signatures[mapped_name]
              self.terminal_productions[
                  predicate
              ] = "{signature} -> {predicate}"
  
file_path: magnitude/pymagnitude/third_party/allennlp/semparse/worlds/wikitables_world.py
imports: from __future__ import absolute_import
  import re
  from nltk.sem.logic import Type
  from allennlp.semparse.worlds.world import ParsingError, World
  from allennlp.semparse.type_declarations import wikitables_type_declaration
  from allennlp.semparse.contexts import TableQuestionKnowledgeGraph
label_desc: Use image node_id 1 to create a new WikiTablesWorld object from inherited base classes: World with example: obj = WikiTablesWorld(table_graph)