def to_predicate(self, return_ref_predicate=False):
    """Similar to the parent's function but allow returning ref predicate."""
    assert len(self.variables) == 1
    target_predicate = {"noun": "", "size": "", "color": ""}
    ref_predicate = {"noun": "", "size": "", "color": "", "location": ""}
    target_terms, ref_terms = self.split_terms_on_location()
    for term in target_terms:
      term.to_predicate(target_predicate)
    for term in ref_terms:
      term.to_predicate(ref_predicate)
    object_str = ""
    if target_predicate["color"]:
      object_str += " " + target_predicate["color"]
    object_str += " " + target_predicate["noun"]
    object_str = object_str.strip()
    if return_ref_predicate:
      return object_str, target_predicate, ref_predicate
    else:
      return object_str, target_predicate
Similar to the parent's function but allow returning ref predicate.
language/gscan/data/grammar.py