def check_sv(self, m, ms, mv): if exists(lambda w: w.processed, m.getseq()): return try: ms.prop.unify(mv.prop) except UnificationError: self.observer(GrammarVerbAgreementError(ms, mv)) for w in m.getseq(): w.processed = True return
def act_ng_plural(self, m): if exists(lambda w: w.processed, m.getseq()): return (mdet, mnoun) = (m.subseq[0], m.subseq[1]) if mdet.subseq[0].repseq: self.inherit_prop(m, mdet.subseq[0].repseq[0]) # inherit <det_pos> else: self.inherit_prop(m) m.prop["determiner"] = True if mdet.subseq[1].repseq: if self.check_ng(m, mdet, mnoun, mdet.subseq[1].repseq[0].prop["plural"]): return self.check_ng(m, mdet, mnoun, True) return
def act_ng_single(self, m): if exists(lambda w: w.processed, m.getseq()): return (mdet, mnoun) = (m.subseq[0], m.subseq[1]) if mdet.subseq[0].repseq: self.inherit_prop(m, mdet.subseq[0].repseq[0]) # inherit <det_pos> else: self.inherit_prop(m) w = mnoun.subseq[1].submatch.item if ispos(w, "NNR") or w.is_sent: m.prop["determiner"] = True if mdet.subseq[1].repseq: if self.check_ng(m, mdet, mnoun, mdet.subseq[1].repseq[0].prop["plural"]): return self.check_ng(m, mdet, mnoun, False) return