Beispiel #1
0
	def __str__(self):
		o = []
		i = ["I think this problem is about"]
		thought_any = False

		multiple_contexts = len(self.contexts) > 1
		for x in [self.preops, self.contexts, self.operators, self.actions,
					self.units, self.subordinates]:
			f = list_format(x)
			if f is not None:
				thought_any = True
				i.append(f)

		if len(self.queries) == 1:
			i.append("and asks a single question")
		elif len(self.queries) > 1:
			i.append("and asks multiple questions")
		else:
			i.append("however, I don't know what it wants for an answer")

		o.append("## Problem inference")
		if thought_any:
			o.append("    " + " ".join(i) + ".")
		else:
			o.append("    I have literally no idea what's going on here.")

		o.append("\n## Parsed problem")
		output_tuples(self.sentences, o, self.longest_phrase, self.problem.brain)

		return "\n".join(o)
Beispiel #2
0
	def __str__(self):
		o = []

		o.append("# Zoidberg Solution")

		if self.file_name:
			o.append("File: {0}".format(self.file_name))

		o.append("\n## The problem")
		o.append("    " + "\n    ".join(self.text.split("\n")))

		o.append("## Digested problem")
		output_tuples(self.sentence_tags, o, self.longest_word, self.brain)

		if self.inference is not None:
			o.append(str(self.inference))

		if self.question is not None:
			o.append(str(self.question))

		if self.solution is not None:
			o.append(str(self.solution))

		return "\n".join(o)
Beispiel #3
0
    def __str__(self):
        o = []

        o.append("# Zoidberg Solution")

        if self.file_name:
            o.append("File: {0}".format(self.file_name))

        o.append("\n## The problem")
        o.append("    " + "\n    ".join(self.text.split("\n")))

        o.append("## Digested problem")
        output_tuples(self.sentence_tags, o, self.longest_word, self.brain)

        if self.inference is not None:
            o.append(str(self.inference))

        if self.question is not None:
            o.append(str(self.question))

        if self.solution is not None:
            o.append(str(self.solution))

        return "\n".join(o)