Home | History | Annotate | Download | only in core

Lines Matching refs:traverseSession

43  * TODO: Stop detecting continuous suggestion. Start using traverseSession instead.
45 void Suggest::getSuggestions(ProximityInfo *pInfo, void *traverseSession,
52 DicTraverseSession *tSession = static_cast<DicTraverseSession *>(traverseSession);
79 void Suggest::initializeSearch(DicTraverseSession *traverseSession) const {
80 if (!traverseSession->getProximityInfoState(0)->isUsed()) {
84 if (traverseSession->getInputSize() > MIN_CONTINUOUS_SUGGESTION_INPUT_SIZE
85 && traverseSession->isContinuousSuggestionPossible()) {
87 traverseSession->getDicTraverseCache()->continueSearch();
90 traverseSession->resetCache(TRAVERSAL->getMaxCacheSize(traverseSession->getInputSize()),
94 DicNodeUtils::initAsRoot(traverseSession->getDictionaryStructurePolicy(),
95 traverseSession->getPrevWordsPtNodePos(), &rootNode);
96 traverseSession->getDicTraverseCache()->copyPushActive(&rootNode);
104 void Suggest::expandCurrentDicNodes(DicTraverseSession *traverseSession) const {
105 const int inputSize = traverseSession->getInputSize();
110 const bool shouldDepthLevelCache = TRAVERSAL->shouldDepthLevelCache(traverseSession);
112 traverseSession->getDicTraverseCache()->updateLastCachedInputIndex();
118 while (traverseSession->getDicTraverseCache()->activeSize() > 0) {
120 traverseSession->getDicTraverseCache()->popActive(&dicNode);
127 TRAVERSAL->canDoLookAheadCorrection(traverseSession, &dicNode);
129 && traverseSession->getDicTraverseCache()->
134 TRAVERSAL->shouldNodeLevelCache(traverseSession, &dicNode);
139 traverseSession->getDicTraverseCache()->copyPushContinue(&dicNode);
145 processDicNodeAsDigraph(traverseSession, &dicNode);
151 processDicNodeAsTransposition(traverseSession, &dicNode);
152 processDicNodeAsInsertion(traverseSession, &dicNode);
161 && TRAVERSAL->isSpaceSubstitutionTerminal(traverseSession, &dicNode)) {
162 createNextWordDicNode(traverseSession, &dicNode, true /* spaceSubstitution */);
166 &dicNode, traverseSession->getDictionaryStructurePolicy(), &childDicNodes);
173 processDicNodeAsMatch(traverseSession, childDicNode);
177 traverseSession->getDictionaryStructurePolicy()
182 processDicNodeAsDigraph(traverseSession, &correctionDicNode);
184 if (TRAVERSAL->isOmission(traverseSession, &dicNode, childDicNode,
189 processDicNodeAsOmission(traverseSession, &correctionDicNode);
192 traverseSession, &dicNode, childDicNode);
197 processDicNodeAsMatch(traverseSession, childDicNode);
201 processDicNodeAsAdditionalProximityChar(traverseSession, &dicNode,
207 processDicNodeAsSubstitution(traverseSession, &dicNode, childDicNode);
221 traverseSession->getDicTraverseCache()->copyPushNextActive(&dicNode);
228 DicTraverseSession *traverseSession, DicNode *dicNode) const {
244 && dicNode->getInputIndex(0) < traverseSession->getInputSize()) {
245 Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TERMINAL_INSERTION, traverseSession, 0,
246 &terminalDicNode, traverseSession->getMultiBigramMap());
248 Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_TERMINAL, traverseSession, 0,
249 &terminalDicNode, traverseSession->getMultiBigramMap());
250 traverseSession->getDicTraverseCache()->copyPushTerminal(&terminalDicNode);
258 DicTraverseSession *traverseSession, DicNode *dicNode) const {
259 processTerminalDicNode(traverseSession, dicNode);
261 if (TRAVERSAL->isSpaceOmissionTerminal(traverseSession, dicNode)) {
262 createNextWordDicNode(traverseSession, dicNode, false /* spaceSubstitution */);
265 && dicNode->isCompletion(traverseSession->getInputSize()));
267 traverseSession->getDicTraverseCache()->copyPushNextActive(dicNode);
272 void Suggest::processDicNodeAsMatch(DicTraverseSession *traverseSession,
274 weightChildNode(traverseSession, childDicNode);
275 processExpandedDicNode(traverseSession, childDicNode);
278 void Suggest::processDicNodeAsAdditionalProximityChar(DicTraverseSession *traverseSession,
283 traverseSession, dicNode, childDicNode, 0 /* multiBigramMap */);
284 weightChildNode(traverseSession, childDicNode);
285 processExpandedDicNode(traverseSession, childDicNode);
288 void Suggest::processDicNodeAsSubstitution(DicTraverseSession *traverseSession,
290 Weighting::addCostAndForwardInputIndex(WEIGHTING, CT_SUBSTITUTION, traverseSession,
292 weightChildNode(traverseSession, childDicNode);
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->getDictionaryStructurePolicy(),
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,
422 traverseSession->getDictionaryStructurePolicy(), dicNode, &newDicNode);
425 Weighting::addCostAndForwardInputIndex(WEIGHTING, correctionType, traverseSession, dicNode,
426 &newDicNode, traverseSession->getMultiBigramMap());
432 traverseSession->getDicTraverseCache()->copyPushNextActive(&newDicNode);