lib/search: document public search functions
This commit is contained in:
@@ -12,18 +12,27 @@ class JaDBConnection {
|
||||
|
||||
const JaDBConnection(this._connection);
|
||||
|
||||
/// Search for a kanji in the database.
|
||||
Future<KanjiSearchResult?> searchKanji(String kanji) =>
|
||||
searchKanjiWithDbConnection(this._connection, kanji);
|
||||
|
||||
/// Search for a word in the database.
|
||||
Future<List<WordSearchResult>?> searchWord(String word) =>
|
||||
searchWordWithDbConnection(this._connection, word);
|
||||
|
||||
/// Search for a word in the database, and return the count of results.
|
||||
Future<int?> searchWordCount(String word) =>
|
||||
searchWordCountWithDbConnection(this._connection, word);
|
||||
|
||||
/// Given a list of radicals, search which kanji contains all
|
||||
/// of the radicals, find their other radicals, and return those.
|
||||
/// This is used to figure out which remaining combinations of radicals
|
||||
/// the user can search for without getting zero results.
|
||||
Future<List<String>> searchRemainingRadicals(List<String> radicals) =>
|
||||
searchRemainingRadicalsWithDbConnection(this._connection, radicals);
|
||||
|
||||
/// Given a list of radicals, search which kanji contains all
|
||||
/// of the radicals, and return those.
|
||||
Future<List<String>> searchKanjiByRadicals(List<String> radicals) =>
|
||||
searchKanjiByRadicalsWithDbConnection(this._connection, radicals);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,6 @@ import 'package:sqflite_common/sqlite_api.dart';
|
||||
|
||||
// TODO: validate that the list of radicals all are valid radicals
|
||||
|
||||
/// Given a list of radicals, search which kanji contains all
|
||||
/// of the radicals, find their other radicals, and return those.
|
||||
/// This is used to figure out which remaining combinations of radicals
|
||||
/// the user can search for without getting zero results.
|
||||
Future<List<String>> searchRemainingRadicalsWithDbConnection(
|
||||
DatabaseExecutor connection,
|
||||
List<String> radicals,
|
||||
@@ -34,8 +30,6 @@ Future<List<String>> searchRemainingRadicalsWithDbConnection(
|
||||
return remainingRadicals;
|
||||
}
|
||||
|
||||
/// Given a list of radicals, search which kanji contains all
|
||||
/// of the radicals, and return those.
|
||||
Future<List<String>> searchKanjiByRadicalsWithDbConnection(
|
||||
DatabaseExecutor connection,
|
||||
List<String> radicals,
|
||||
|
||||
Reference in New Issue
Block a user