Skip to content

Commit

Permalink
responded to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thorunna committed Oct 25, 2023
1 parent d045890 commit c61c137
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/reynir_correct/pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,7 @@ def né(self, match: SimpleTree) -> None:
)

def agreement_conj(self, match: SimpleTree) -> None:
"""A verb, whose subject precedes a conjunction, is not in agreement with the subject. E.g. 'Bílarnir eru léttari og gæti verið hraðari.'"""
vp = match.first_match("VP > (so_ft|so_et)")
if vp is None:
return
Expand Down Expand Up @@ -1738,6 +1739,7 @@ def agreement_conj(self, match: SimpleTree) -> None:
)

def agreement_subpost_sing(self, match: SimpleTree) -> None:
"""A plural verb which precedes its subject is not in agreement with the subject, which is singular. E.g. 'Í skrúðgöngunni eru fólk klætt...'"""
vp = match.first_match("VP > (so_ft)")
if vp is None:
return
Expand Down Expand Up @@ -1768,11 +1770,13 @@ def agreement_subpost_sing(self, match: SimpleTree) -> None:
)

def agreement_concord(self, match: SimpleTree) -> None:
"""A pronoun is not in agreement with the following noun, e.g. 'Við kaupum ákveðin hluti'"""
np = match.first_match("NP")
# if vp is None: return
assert np is not None
if np is None:
return
fn = np.first_match("fn")
assert fn is not None
if fn is None:
return
no = np.first_match("no")
start, end = np.span
suggest = self.get_wordform(fn.lemma, fn.cat, no.lemma, no.cat)
Expand Down

0 comments on commit c61c137

Please sign in to comment.