fix(curator): contractions are words of their own
Wiktionary tags a contraction as an abbreviation and an alternative of its first word (im: in + dem), so German's im, zum and ins, which every subtitle has, were neither entries nor found as forms. A contraction is now an entry of its own, as text writes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
2c4d760eac
commit
8f4131a138
1 changed files with 22 additions and 7 deletions
|
|
@ -140,6 +140,8 @@ void main() {
|
|||
(essen['textKeys']! as List).cast<String>(),
|
||||
containsAll(['isst', 'aß', 'gegessen']),
|
||||
);
|
||||
// A contraction is a word of its own: im, of in and dem.
|
||||
expect(ids, contains('im/contraction'));
|
||||
// Typed with `ss`.
|
||||
expect(
|
||||
(entryOf('wiktionary-de-en.jsonl.gz', 'Straße/noun')['looseKeys']!
|
||||
|
|
@ -246,8 +248,14 @@ void main() {
|
|||
for (final line in linesOf('wiktionary-de-en.jsonl.gz').skip(1))
|
||||
(line['headword'], line['rank']! as int, line['labels']),
|
||||
]..sort((a, b) => a.$2.compareTo(b.$2));
|
||||
expect(ranked.first.$1, 'Haus');
|
||||
expect(ranked.first.$3, ['common']);
|
||||
expect(
|
||||
[
|
||||
for (final (word, _, _) in ranked)
|
||||
if (['im', 'Haus', 'Straße'].contains(word)) word,
|
||||
],
|
||||
['im', 'Haus', 'Straße'],
|
||||
);
|
||||
expect(ranked.firstWhere((each) => each.$1 == 'Haus').$3, ['common']);
|
||||
});
|
||||
|
||||
group('folding', () {
|
||||
|
|
|
|||
Loading…
Reference in a new issue