Actually add shortcut targets to the suggestions (A4)

Change-Id: Ia6f551d36b2897863e7faf5143bc319522b0668e
main
Jean Chalard 2011-12-26 17:18:09 +09:00
parent 69f94e1983
commit b0c49b7684
1 changed files with 9 additions and 2 deletions

View File

@ -337,8 +337,15 @@ inline void UnigramDictionary::onTerminal(const int freq,
} }
TerminalAttributes::ShortcutIterator iterator = terminalAttributes.getShortcutIterator(); TerminalAttributes::ShortcutIterator iterator = terminalAttributes.getShortcutIterator();
while (iterator.hasNextShortcutTarget()) { while (iterator.hasNextShortcutTarget()) {
// TODO: add the shortcut to the list of suggestions using the // TODO: addWord only supports weak ordering, meaning we have no means to control the
// iterator.getNextShortcutTarget(int, uint16_t*) method // order of the shortcuts relative to one another or to the word. We need to either
// modulate the frequency of each shortcut according to its own shortcut frequency or
// to make the queue so that the insert order is protected inside the queue for words
// with the same score.
uint16_t shortcutTarget[MAX_WORD_LENGTH_INTERNAL];
const int shortcutTargetStringLength = iterator.getNextShortcutTarget(
MAX_WORD_LENGTH_INTERNAL, shortcutTarget);
addWord(shortcutTarget, shortcutTargetStringLength, finalFreq, queue);
} }
} }
} }