X-Git-Url: http://gitweb.fperrin.net/?p=DictionaryPC.git;a=blobdiff_plain;f=src%2Fcom%2Fhughes%2Fandroid%2Fdictionary%2Fengine%2FDictionaryTest.java;h=c3f4c4ee45f9696763f755b92683c2cd041f5423;hp=f766e0ab50ace5d74ece89b47618f6dbb2fbaa72;hb=253466ba45a33fcc3ba3a399cfa2f243392db0b0;hpb=6e6661c2989066377a6a6693dafc0d65bfea4b82 diff --git a/src/com/hughes/android/dictionary/engine/DictionaryTest.java b/src/com/hughes/android/dictionary/engine/DictionaryTest.java index f766e0a..c3f4c4e 100644 --- a/src/com/hughes/android/dictionary/engine/DictionaryTest.java +++ b/src/com/hughes/android/dictionary/engine/DictionaryTest.java @@ -178,16 +178,32 @@ public class DictionaryTest extends TestCase { } public void testMultiSearchBig() throws IOException { - final RandomAccessFile raf = new RandomAccessFile(OUTPUTS + "EN-IT_enwiktionary.quickdic", "r"); + final RandomAccessFile raf = new RandomAccessFile(OUTPUTS + "DE-EN_chemnitz_enwiktionary.quickdic", "r"); final Dictionary dict = new Dictionary(raf); - final Index enIndex = dict.indices.get(0); + final Index enIndex = dict.indices.get(1); { - final List rows = enIndex.multiWordSearch(Arrays.asList("space", "station"), new AtomicBoolean(false)); + final List rows = enIndex.multiWordSearch(Arrays.asList("train", "station"), new AtomicBoolean(false)); System.out.println(CollectionUtil.join(rows, "\n ")); assertTrue(rows.toString(), rows.size() > 0); + assertEquals("Bahnhof {{de-noun|g=m|genitive=Bahnhofs|genitive2=Bahnhofes|plural=Bahnhöfe}}\ttrain station", rows.get(0).toString()); } - + + { + final List rows = enIndex.multiWordSearch(Arrays.asList("a", "train", "station"), new AtomicBoolean(false)); + System.out.println(CollectionUtil.join(rows, "\n ")); + assertTrue(rows.toString(), rows.size() > 0); + assertEquals("Bahnhofsuhr {{de-noun|g=f|plural=Bahnhofsuhren}}\tstation clock (at a train station)", rows.get(0).toString()); + } + + { + final List rows = enIndex.multiWordSearch(Arrays.asList("a", "station"), new AtomicBoolean(false)); + // TODO: bug, "a" isn't in stoplist for now... + System.out.println(CollectionUtil.join(rows, "\n ")); + assertTrue(rows.toString(), rows.size() == 0); + //assertEquals("Bahnhofsuhr {{de-noun|g=f|plural=Bahnhofsuhren}}\tstation clock (at a train station)", rows.get(0).toString()); + } + raf.close(); }