diff --git a/lib/services/dictionary_service.dart b/lib/services/dictionary_service.dart index 84e66a2..560eaa1 100644 --- a/lib/services/dictionary_service.dart +++ b/lib/services/dictionary_service.dart @@ -537,7 +537,9 @@ class DictionaryService { Future> getProperNounByJapaneseTextToken( JapaneseTextToken token, ) async { - if (token.base.contains(constants.kanjiRegExp)) { + if (_kanaKit.isKana(token.base)) { + return _database.properNounsDao.getByReading(token.base); + } else { final results = await _database.properNounsDao.getByWritingAndReading( token.base, _kanaKit.toHiragana(token.baseReading), @@ -548,8 +550,6 @@ class DictionaryService { } else { return results; } - } else { - return _database.properNounsDao.getByReading(token.base); } } diff --git a/lib/ui/views/text_analysis/text_analysis_viewmodel.dart b/lib/ui/views/text_analysis/text_analysis_viewmodel.dart index cc4358c..66cfc47 100644 --- a/lib/ui/views/text_analysis/text_analysis_viewmodel.dart +++ b/lib/ui/views/text_analysis/text_analysis_viewmodel.dart @@ -67,6 +67,8 @@ class TextAnalysisViewModel extends FutureViewModel { if (_sharedPreferencesService.getProperNounsEnabled()) { token.associatedDictionaryItems = await _dictionaryService.getProperNounByJapaneseTextToken(token); + } else { + token.associatedDictionaryItems = []; } } else { token.associatedDictionaryItems =