Skip to content

Commit

Permalink
fixed: entries with multiple accents overwriting accents
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainDario committed May 29, 2023
1 parent 1532546 commit 5c68048
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions database_builder/lib/src/accents/accents.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Future<void> addAccentsToDict(Isar dictIsar) async {
).convert(accentsFile);


List<JMdict> addedAccents = [];
KanaKit k = KanaKit(config:
KanaKitConfig(passRomaji: true, passKanji: true, upcaseKatakana: false)
);
Expand All @@ -48,10 +47,9 @@ Future<void> addAccentsToDict(Isar dictIsar) async {
attributes: row[2].toString().split(",")
);

addedAccents.add(match);
//dictIsar.writeTxnSync(() {
// dictIsar.jmdict.putSync(match);
//});
dictIsar.writeTxnSync(() {
dictIsar.jmdict.putSync(match);
});
}

if(matches.isEmpty){
Expand All @@ -61,7 +59,4 @@ Future<void> addAccentsToDict(Isar dictIsar) async {
i++;
}

dictIsar.writeTxnSync(() {
dictIsar.jmdict.putAllSync(addedAccents);
});
}

0 comments on commit 5c68048

Please sign in to comment.