Handle standalone past verbs tagged as participles
Verify syntax DAG / verify (push) Successful in 30s
Verify syntax DAG / verify (pull_request) Successful in 20s

This commit is contained in:
2026-11-04 16:40:13 +08:00
parent eb5c156104
commit 688613878f
+5 -1
View File
@@ -80,6 +80,10 @@ class Encoder:
clauses = []
proposals = []
for sentence in doc.sents:
content = [token.i for token in sentence if not token.is_space]
if not content:
continue
sentence = doc[content[0]:content[-1] + 1]
match = self._causal_marker(sentence)
if match is None:
continue
@@ -112,7 +116,7 @@ class Encoder:
or not marker.i < verb.i < end
or sentence.root.pos_ != "VERB"
or verb.pos_ != "VERB"
or sentence.root.tag_ != "VBD"
or sentence.root.tag_ not in {"VBD", "VBN"}
or verb.tag_ != "VBD"
or any(token.is_punct or token.is_space for token in sentence[:-1])
or any(token.dep_ in {"neg", "aux", "conj"} for token in sentence)