findSepVerbs function
Finds all separated (trennbar) verbs in a token list.
Implementation
List<SepVerb> findSepVerbs(List<UDToken> tokens) {
final result = <SepVerb>[];
for (final t in tokens) {
final dep = t.deprel.toLowerCase();
if (!dep.contains('prt') && dep != 'svp') continue;
if (t.upos == 'VERB' || t.upos == 'AUX') continue;
final head = tokens.where((h) => h.id == t.head).firstOrNull;
if (head == null || head.upos != 'VERB') continue;
result.add(SepVerb(
fullLemma: t.form.toLowerCase() + head.lemma,
verbForm: head.form,
particle: t.form,
));
}
return result;
}