Esempio n. 1
0
    def __str__(self):
        res = pprint(" ".join(self.prep), PREPOSITION)

        if self.gn:
            for s in self.gn:
                res += pprint(str(s).replace("\n", "\n\t"), INDIRECT_OBJECT)

        return res
Esempio n. 2
0
    def __str__(self):
        res = pprint(" ".join(self.prep), PREPOSITION)

        if self.gn:
            for s in self.gn:
                res += pprint(str(s).replace("\n", "\n\t"), INDIRECT_OBJECT)

        return res
Esempio n. 3
0
    def __str__(self):
        res = level_marker() + pprint(self.data_type, SENTENCE_TYPE)
        res += pprint(self.aim, SENTENCE_AIM)  # 'aim' may be None

        if self.sn:
            sn = ""
            for s in self.sn:
                sn = str(s).replace("\n", "\n\t") + "\n"
                res += pprint(sn, SUBJECT)
        if self.sv:
            for s in self.sv:
                res += str(s).replace("\n", "\n\t") + "\n"

        #res += "This sentence is " + ("fully resolved." if self.resolved() else "not fully resolved.")

        if self.isvalid():
            res = pprint(res, SENTENCE)
        else:
            res = pprint(res, AGRAMMATICAL_SENTENCE)
        return res
Esempio n. 4
0
    def __str__(self):
        res = level_marker() + pprint(self.data_type, SENTENCE_TYPE)
        res += pprint(self.aim, SENTENCE_AIM) # 'aim' may be None

        if self.sn:
            sn = ""
            for s in self.sn:
                sn = str(s).replace("\n", "\n\t") + "\n"
                res += pprint(sn, SUBJECT)
        if self.sv:
            for s in self.sv:
                res += str(s).replace("\n", "\n\t") + "\n"

        #res += "This sentence is " + ("fully resolved." if self.resolved() else "not fully resolved.")

        if self.isvalid():
            res = pprint(res, SENTENCE)
        else:
            res = pprint(res, AGRAMMATICAL_SENTENCE)
        return res
Esempio n. 5
0
    def __str__(self):
        res = pprint(" ".join(self.vrb_main), VERB) + pprint(
            self.vrb_tense, TENSE)
        if self.advrb:
            res += pprint(" ".join(self.advrb), ADVERBIAL)
        if self.vrb_adv:
            res += pprint(" ".join(self.vrb_adv), VERBAL_ADVERBIAL)

        if self.d_obj:
            for cmpl in self.d_obj:
                res += '\t' + pprint(
                    str(cmpl).replace("\n", "\n\t"), DIRECT_OBJECT) + "\n"

        if self.i_cmpl:
            for cmpl in self.i_cmpl:
                res += '\t' + str(cmpl).replace("\n", "\n\t") + "\n"

        if self.vrb_sub_sentence:
            for vrb_sub_s in self.vrb_sub_sentence:
                res += '\t' + pprint(
                    str(vrb_sub_s).replace("\n", "\n\t"), SUB_SENTENCE) + "\n"

        if self.sv_sec:
            for vrb_sec_s in self.sv_sec:
                res += '\t' + pprint(
                    str(vrb_sec_s).replace("\n", "\n\t"),
                    SECONDARY_VERBAL_GROUP) + "\n"

        res = pprint(
            res,
            AFFIRMATIVE if self.state == VerbalGroup.affirmative else NEGATIVE)
        res = pprint(res, RESOLVED) if self.resolved() else pprint(
            res, NOT_RESOLVED)

        return pprint(res, VERBAL_GROUP)
Esempio n. 6
0
    def __str__(self):

        res = level_marker()

        if self._conjunction != 'AND':
            res += pprint(self._conjunction, CONJUNCTION)

        if self._quantifier != 'ONE':
            res += pprint(self._quantifier, QUANTIFIER)

        if self._resolved:
            res += pprint(self.id, ID)
            res = pprint(res, RESOLVED)

        else:

            if self.det:
                res += pprint(" ".join(self.det), DETERMINER)

            for k in self.adj:
                if k[1]:
                    res += pprint(" ".join(k[1]), ADJECTIVE_QUALIFIER)
                res += pprint(k[0], ADJECTIVE)

            if self.noun:
                res += pprint(", ".join(self.noun), NOUN)

            if self.noun_cmpl:
                for s in self.noun_cmpl:
                    res += pprint(str(s).replace("\n", "\n\t"), NOUN_CMPLT)

            if self.relative:
                for rel in self.relative:
                    res += pprint(str(rel).replace("\n", "\n\t"), RELATIVE_GRP)

        return pprint(res, NOMINAL_GROUP)
Esempio n. 7
0
    def __str__(self):
        res = pprint(" ".join(self.vrb_main), VERB) + pprint(self.vrb_tense, TENSE)
        if self.advrb:
            res += pprint(" ".join(self.advrb), ADVERBIAL)
        if self.vrb_adv:
            res += pprint(" ".join(self.vrb_adv), VERBAL_ADVERBIAL)

        if self.d_obj:
            for cmpl in self.d_obj:
                res += '\t' + pprint(str(cmpl).replace("\n", "\n\t"), DIRECT_OBJECT) + "\n"

        if self.i_cmpl:
            for cmpl in self.i_cmpl:
                res += '\t' + str(cmpl).replace("\n", "\n\t") + "\n"

        if self.vrb_sub_sentence:
            for vrb_sub_s in self.vrb_sub_sentence:
                res += '\t' + pprint(str(vrb_sub_s).replace("\n", "\n\t"), SUB_SENTENCE) + "\n"

        if self.sv_sec:
            for vrb_sec_s in self.sv_sec:
                res += '\t' + pprint(str(vrb_sec_s).replace("\n", "\n\t"), SECONDARY_VERBAL_GROUP) + "\n"

        res = pprint(res, AFFIRMATIVE if self.state == VerbalGroup.affirmative else NEGATIVE)
        res = pprint(res, RESOLVED) if self.resolved() else pprint(res, NOT_RESOLVED)

        return pprint(res, VERBAL_GROUP)
Esempio n. 8
0
    def __str__(self):

        res = level_marker()

        if self._conjunction != 'AND':
            res += pprint(self._conjunction, CONJUNCTION)

        if self._quantifier != 'ONE':
            res += pprint(self._quantifier, QUANTIFIER)

        if self._resolved:
            res += pprint(self.id, ID)
            res = pprint(res, RESOLVED)

        else:


            if self.det:
                res += pprint(" ".join(self.det), DETERMINER)

            for k in self.adj:
                if k[1]:
                    res += pprint(" ".join(k[1]), ADJECTIVE_QUALIFIER)
                res += pprint(k[0], ADJECTIVE)

            if self.noun:
                res += pprint(", ".join(self.noun), NOUN)

            if self.noun_cmpl:
                for s in self.noun_cmpl:
                    res += pprint(str(s).replace("\n", "\n\t"), NOUN_CMPLT)

            if self.relative:
                for rel in self.relative:
                    res += pprint(str(rel).replace("\n", "\n\t"), RELATIVE_GRP)

        return pprint(res, NOMINAL_GROUP)