Home | History | Annotate | Download | only in core

Lines Matching refs:traverseSession

46  * TODO: Stop detecting continuous suggestion. Start using traverseSession instead.
48 void Suggest::getSuggestions(ProximityInfo *pInfo, void *traverseSession,
55 DicTraverseSession *tSession = static_cast<DicTraverseSession *>(traverseSession);
81 void Suggest::initializeSearch(DicTraverseSession *traverseSession) const {
82 if (!traverseSession->getProximityInfoState(0)->isUsed()) {
86 if (traverseSession->getInputSize() > MIN_CONTINUOUS_SUGGESTION_INPUT_SIZE
87 && traverseSession->isContinuousSuggestionPossible()) {
89 traverseSession->getDicTraverseCache()->continueSearch();
92 traverseSession->resetCache(TRAVERSAL->getMaxCacheSize(traverseSession->getInputSize(),
93 traverseSession->getSuggestOptions()->weightForLocale()),
97 DicNodeUtils::initAsRoot(traverseSession->getDictionaryStructurePolicy(),
98 traverseSession->getPrevWordIds(), &rootNode);
99 traverseSession->getDicTraverseCache()->copyPushActive(&rootNode);
107 void Suggest::expandCurrentDicNodes(DicTraverseSession *traverseSession) const {
108 const int inputSize = traverseSession->getInputSize();
113 const bool shouldDepthLevelCache = TRAVERSAL->shouldDepthLevelCache(traverseSession);
115 traverseSession->getDicTraverseCache()->updateLastCachedInputIndex();
121 while (traverseSession->getDicTraverseCache()->activeSize() > 0) {
123 traverseSession->getDicTraverseCache()->popActive(&dicNode);
130 TRAVERSAL->canDoLookAheadCorrection(traverseSession, &dicNode);
132 && traverseSession->getDicTraverseCache()->
137 TRAVERSAL->shouldNodeLevelCache(traverseSession, &dicNode);
142 traverseSession->getDicTraverseCache()->copyPushContinue(&dicNode);
148 processDicNodeAsDigraph(traverseSession, &dicNode);
154 processDicNodeAsTransposition(traverseSession, &dicNode);
155 processDicNodeAsInsertion(traverseSession, &dicNode);
163 if (TRAVERSAL->isSpaceSubstitutionTerminal(traverseSession, &dicNode)) {
164 createNextWordDicNode(traverseSession, &dicNode, true /* spaceSubstitution */);
168 &dicNode, traverseSession->getDictionaryStructurePolicy(), &childDicNodes);
175 processDicNodeAsMatch(traverseSession, childDicNode);
179 traverseSession->getDictionaryStructurePolicy()
184 processDicNodeAsDigraph(traverseSession, &correctionDicNode);
186 if (TRAVERSAL->isOmission(traverseSession, &dicNode, childDicNode,
191 processDicNodeAsOmission(traverseSession, &correctionDicNode);
194 traverseSession, &dicNode, childDicNode);
199 processDicNodeAsMatch(traverseSession, childDicNode);
203 processDicNodeAsAdditionalProximityChar(traverseSession, &dicNode,
209 processDicNodeAsSubstitution(traverseSession, &dicNode, childDicNode);
223 traverseSession->getDicTraverseCache()->copyPushNextActive(&dicNode);
230 DicTraverseSession *traverseSession, DicNode *dicNode) const {
246 && dicNode->getInputIndex(0) < traverseSession->getInputSize()) {
247 Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TERMINAL_INSERTION, traverseSession, 0,
248 &terminalDicNode, traverseSession->getMultiBigramMap());
250 Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TERMINAL, traverseSession, 0,
251 &terminalDicNode, traverseSession->getMultiBigramMap());
252 traverseSession->getDicTraverseCache()->copyPushTerminal(&terminalDicNode);
260 DicTraverseSession *traverseSession, DicNode *dicNode) const {
261 processTerminalDicNode(traverseSession, dicNode);
263 if (TRAVERSAL->isSpaceOmissionTerminal(traverseSession, dicNode)) {
264 createNextWordDicNode(traverseSession, dicNode, false /* spaceSubstitution */);
267 && dicNode->isCompletion(traverseSession->getInputSize()));
269 traverseSession->getDicTraverseCache()->copyPushNextActive(dicNode);
274 void Suggest::processDicNodeAsMatch(DicTraverseSession *traverseSession,
276 weightChildNode(traverseSession, childDicNode);
277 processExpandedDicNode(traverseSession, childDicNode);
280 void Suggest::processDicNodeAsAdditionalProximityChar(DicTraverseSession *traverseSession,
285 traverseSession, dicNode, childDicNode, 0 /* multiBigramMap */);
286 processExpandedDicNode(traverseSession, childDicNode);
289 void Suggest::processDicNodeAsSubstitution(DicTraverseSession *traverseSession,
291 Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_SUBSTITUTION, traverseSession,
293 processExpandedDicNode(traverseSession, childDicNode);
299 void Suggest::processDicNodeAsDigraph(DicTraverseSession *traverseSession,
301 weightChildNode(traverseSession, childDicNode);
303 processExpandedDicNode(traverseSession, childDicNode);
314 DicTraverseSession *traverseSession, DicNode *dicNode) const {
317 dicNode, traverseSession->getDictionaryStructurePolicy(), &childDicNodes);
323 Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_OMISSION, traverseSession,
325 weightChildNode(traverseSession, childDicNode);
326 if (!TRAVERSAL->isPossibleOmissionChildNode(traverseSession, dicNode, childDicNode)) {
329 processExpandedDicNode(traverseSession, childDicNode);
337 void Suggest::processDicNodeAsInsertion(DicTraverseSession *traverseSession,
341 DicNodeUtils::getAllChildDicNodes(dicNode, traverseSession
345 if (traverseSession->getProximityInfoState(0)->getPrimaryCodePointAt(pointIndex + 1)
350 Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_INSERTION, traverseSession,
352 processExpandedDicNode(traverseSession, childDicNode);
359 void Suggest::processDicNodeAsTransposition(DicTraverseSession *traverseSession,
364 DicNodeUtils::getAllChildDicNodes(dicNode, traverseSession->getDictionaryStructurePolicy(),
368 const ProximityType matchedId1 = traverseSession->getProximityInfoState(0)
377 traverseSession->getDictionaryStructurePolicy(), &childDicNodes2);
381 const ProximityType matchedId2 = traverseSession->getProximityInfoState(0)
388 traverseSession, childDicNodes1[i], childDicNode2, 0 /* multiBigramMap */);
389 processExpandedDicNode(traverseSession, childDicNode2);
398 void Suggest::weightChildNode(DicTraverseSession *traverseSession, DicNode *dicNode) const {
399 const int inputSize = traverseSession->getInputSize();
401 Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_COMPLETION, traverseSession,
404 Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_MATCH, traverseSession,
413 void Suggest::createNextWordDicNode(DicTraverseSession *traverseSession, DicNode *dicNode,
416 traverseSession->getDictionaryStructurePolicy()->getWordAttributesInContext(
418 traverseSession->getMultiBigramMap());
419 if (SuggestionsOutputUtils::shouldBlockWord(traverseSession->getSuggestOptions(),
431 traverseSession->getDictionaryStructurePolicy(), dicNode, &newDicNode);
434 Weighting::addCostAndForwardInputIndex(WEIGHTING, correctionType, traverseSession, dicNode,
435 &newDicNode, traverseSession->getMultiBigramMap());
441 traverseSession->getDicTraverseCache()->copyPushNextActive(&newDicNode);