Lines Matching refs:pWord
187 amatch_word *pWord; /* Points to the object being stored in the tree */ member
526 amatch_avl *pWord; /* amatch_word objects keyed by zWord */ member
945 amatch_word *pWord, *pNextWord; in amatchClearCursor() local
946 for(pWord=pCur->pAllWords; pWord; pWord=pNextWord){ in amatchClearCursor()
947 pNextWord = pWord->pNext; in amatchClearCursor()
948 sqlite3_free(pWord); in amatchClearCursor()
957 pCur->pWord = 0; in amatchClearCursor()
996 static void amatchWriteCost(amatch_word *pWord){ in amatchWriteCost() argument
997 amatchEncodeInt(pWord->rCost, pWord->zCost); in amatchWriteCost()
998 amatchEncodeInt(pWord->iSeq, pWord->zCost+4); in amatchWriteCost()
999 pWord->zCost[8] = 0; in amatchWriteCost()
1029 amatch_word *pWord; in amatchAddWord() local
1052 pNode = amatchAvlSearch(pCur->pWord, pCur->zBuf); in amatchAddWord()
1054 pWord = pNode->pWord; in amatchAddWord()
1055 if( pWord->rCost>rCost ){ in amatchAddWord()
1058 pWord->zWord+2, pWord->nMatch, pCur->zInput, pCur->zInput, in amatchAddWord()
1059 pWord->rCost, pWord->zWord, pWord->zCost); in amatchAddWord()
1061 amatchAvlRemove(&pCur->pCost, &pWord->sCost); in amatchAddWord()
1062 pWord->rCost = rCost; in amatchAddWord()
1063 amatchWriteCost(pWord); in amatchAddWord()
1066 pWord->rCost, pWord->zWord, pWord->zCost); in amatchAddWord()
1068 pOther = amatchAvlInsert(&pCur->pCost, &pWord->sCost); in amatchAddWord()
1073 pWord = sqlite3_malloc64( sizeof(*pWord) + nBase + nTail - 1 ); in amatchAddWord()
1074 if( pWord==0 ) return; in amatchAddWord()
1075 memset(pWord, 0, sizeof(*pWord)); in amatchAddWord()
1076 pWord->rCost = rCost; in amatchAddWord()
1077 pWord->iSeq = pCur->nWord++; in amatchAddWord()
1078 amatchWriteCost(pWord); in amatchAddWord()
1079 pWord->nMatch = (short)nMatch; in amatchAddWord()
1080 pWord->pNext = pCur->pAllWords; in amatchAddWord()
1081 pCur->pAllWords = pWord; in amatchAddWord()
1082 pWord->sCost.zKey = pWord->zCost; in amatchAddWord()
1083 pWord->sCost.pWord = pWord; in amatchAddWord()
1084 pOther = amatchAvlInsert(&pCur->pCost, &pWord->sCost); in amatchAddWord()
1086 pWord->sWord.zKey = pWord->zWord; in amatchAddWord()
1087 pWord->sWord.pWord = pWord; in amatchAddWord()
1088 amatchStrcpy(pWord->zWord, pCur->zBuf); in amatchAddWord()
1089 pOther = amatchAvlInsert(&pCur->pWord, &pWord->sWord); in amatchAddWord()
1092 printf("INSERT [%s][%.*s^%s] %d (\"%s\" \"%s\")\n", pWord->zWord+2, in amatchAddWord()
1093 pWord->nMatch, pCur->zInput, pCur->zInput+pWord->nMatch, rCost, in amatchAddWord()
1094 pWord->zWord, pWord->zCost); in amatchAddWord()
1104 amatch_word *pWord = 0; in amatchNext() local
1147 pWord = 0; in amatchNext()
1150 pWord = pNode->pWord; in amatchNext()
1151 amatchAvlRemove(&pCur->pCost, &pWord->sCost); in amatchNext()
1155 pWord->zWord+2, pWord->nMatch, pCur->zInput, pCur->zInput+pWord->nMatch, in amatchNext()
1156 pWord->rCost, pWord->zWord, pWord->zCost); in amatchNext()
1158 nWord = (int)strlen(pWord->zWord+2); in amatchNext()
1164 amatchStrcpy(zBuf, pWord->zWord+2); in amatchNext()
1166 zNextIn[0] = pCur->zInput[pWord->nMatch]; in amatchNext()
1168 for(i=1; i<=4 && (pCur->zInput[pWord->nMatch+i]&0xc0)==0x80; i++){ in amatchNext()
1169 zNextIn[i] = pCur->zInput[pWord->nMatch+i]; in amatchNext()
1185 amatchAddWord(pCur, pWord->rCost, pWord->nMatch+nNextIn, zBuf, ""); in amatchNext()
1215 amatchAddWord(pCur, pWord->rCost+p->rIns, pWord->nMatch, in amatchNext()
1219 amatchAddWord(pCur, pWord->rCost+p->rSub, pWord->nMatch+nNextIn, in amatchNext()
1229 amatchAddWord(pCur, pWord->rCost+p->rDel, pWord->nMatch+nNextIn, in amatchNext()
1235 if( strncmp(pRule->zFrom, pCur->zInput+pWord->nMatch, pRule->nFrom)==0 ){ in amatchNext()
1236 amatchAddWord(pCur, pWord->rCost+pRule->rCost, in amatchNext()
1237 pWord->nMatch+pRule->nFrom, pWord->zWord+2, pRule->zTo); in amatchNext()
1241 pCur->pCurrent = pWord; in amatchNext()