Commit ad4d611c authored by Julien Lepiller's avatar Julien Lepiller

Search for kanji and reading together

parent f80ec628
......@@ -332,9 +332,15 @@ public class JMDict extends Dictionary {
logHuffman(readingHuffman, new ArrayList<Boolean>());
// Search in Japanese, by kanji and reading
ArrayList<Integer> results = searchTrie(file, kanjiTriePos, search);
if(results == null || results.isEmpty())
results = searchTrie(file, readingTriePos, search);
ArrayList<Integer> readingResults = searchTrie(file, readingTriePos, search);
if(results != null && readingResults != null)
results.addAll(readingResults);
else if (results == null)
results = readingResults;
// Search in other language, by meaning
if(results == null || results.isEmpty())
results = searchTrie(file, meaningTriePos, search);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment