def restore_entities(funql, mention_map):
  """Restore entities in funql."""
  for mention_mark, identifier in mention_map.items():
    funql = funql.replace(mention_mark, "%s" % identifier)
  return funql