Lines Matching refs:search
456 if (strsrch->search->breakIter != nullptr) { in getBreakIterator()
457 return strsrch->search->breakIter; in getBreakIterator()
460 if (strsrch->search->internalBreakIter != nullptr) { in getBreakIterator()
461 return strsrch->search->internalBreakIter; in getBreakIterator()
465 strsrch->search->internalBreakIter = ubrk_open(UBRK_CHARACTER, in getBreakIterator()
467 strsrch->search->text, strsrch->search->textLength, &status); in getBreakIterator()
469 return strsrch->search->internalBreakIter; in getBreakIterator()
485 strsrch->search->matchedIndex = USEARCH_DONE; in setMatchNotFound()
486 strsrch->search->matchedLength = 0; in setMatchNotFound()
487 if (strsrch->search->isForwardSearching) { in setMatchNotFound()
488 setColEIterOffset(strsrch->textIter, strsrch->search->textLength, localStatus); in setMatchNotFound()
532 UnicodeString(false, strsrch->search->text + start, end - start), t2, status); in checkIdentical()
649 result->search = (USearch *)uprv_malloc(sizeof(USearch)); in usearch_openFromCollator()
650 if (result->search == nullptr) { in usearch_openFromCollator()
656 result->search->text = text; in usearch_openFromCollator()
657 result->search->textLength = textlength; in usearch_openFromCollator()
664 result->search->breakIter = breakiter; in usearch_openFromCollator()
666 result->search->internalBreakIter = nullptr; // Lazily created. in usearch_openFromCollator()
673 result->search->matchedLength = 0; in usearch_openFromCollator()
674 result->search->matchedIndex = USEARCH_DONE; in usearch_openFromCollator()
684 result->search->isOverlap = false; in usearch_openFromCollator()
685 result->search->isCanonicalMatch = false; in usearch_openFromCollator()
686 result->search->elementComparisonType = 0; in usearch_openFromCollator()
687 result->search->isForwardSearching = true; in usearch_openFromCollator()
688 result->search->reset = true; in usearch_openFromCollator()
724 if (strsrch->search->internalBreakIter != nullptr) { in usearch_close()
725 ubrk_close(strsrch->search->internalBreakIter); in usearch_close()
729 uprv_free(strsrch->search); in usearch_close()
759 if (isOutOfBounds(strsrch->search->textLength, position)) { in usearch_setOffset()
765 strsrch->search->matchedIndex = USEARCH_DONE; in usearch_setOffset()
766 strsrch->search->matchedLength = 0; in usearch_setOffset()
767 strsrch->search->reset = false; in usearch_setOffset()
775 if (isOutOfBounds(strsrch->search->textLength, result)) { in usearch_getOffset()
792 strsrch->search->isOverlap = (value == USEARCH_ON ? true : false); in usearch_setAttribute()
795 strsrch->search->isCanonicalMatch = (value == USEARCH_ON ? true : in usearch_setAttribute()
800 strsrch->search->elementComparisonType = (int16_t)value; in usearch_setAttribute()
802 strsrch->search->elementComparisonType = 0; in usearch_setAttribute()
822 return (strsrch->search->isOverlap == true ? USEARCH_ON : in usearch_getAttribute()
825 return (strsrch->search->isCanonicalMatch == true ? USEARCH_ON : in usearch_getAttribute()
829 int16_t value = strsrch->search->elementComparisonType; in usearch_getAttribute()
849 return strsrch->search->matchedIndex; in usearch_getMatchedStart()
867 int32_t copylength = strsrch->search->matchedLength; in usearch_getMatchedText()
868 int32_t copyindex = strsrch->search->matchedIndex; in usearch_getMatchedText()
878 uprv_memcpy(result, strsrch->search->text + copyindex, in usearch_getMatchedText()
882 strsrch->search->matchedLength, status); in usearch_getMatchedText()
889 return strsrch->search->matchedLength; in usearch_getMatchedLength()
901 strsrch->search->breakIter = breakiter; in usearch_setBreakIterator()
903 ubrk_setText(breakiter, strsrch->search->text, in usearch_setBreakIterator()
904 strsrch->search->textLength, status); in usearch_setBreakIterator()
913 return strsrch->search->breakIter; in usearch_getBreakIterator()
934 strsrch->search->text = text; in usearch_setText()
935 strsrch->search->textLength = textlength; in usearch_setText()
937 strsrch->search->matchedIndex = USEARCH_DONE; in usearch_setText()
938 strsrch->search->matchedLength = 0; in usearch_setText()
939 strsrch->search->reset = true; in usearch_setText()
941 if (strsrch->search->breakIter != nullptr) { in usearch_setText()
942 ubrk_setText(strsrch->search->breakIter, text, in usearch_setText()
945 if (strsrch->search->internalBreakIter != nullptr) { in usearch_setText()
946 ubrk_setText(strsrch->search->internalBreakIter, text, textlength, status); in usearch_setText()
957 *length = strsrch->search->textLength; in usearch_getText()
958 return strsrch->search->text; in usearch_getText()
987 if (strsrch->search->internalBreakIter != nullptr) { in usearch_setCollator()
988 ubrk_close(strsrch->search->internalBreakIter); in usearch_setCollator()
989 strsrch->search->internalBreakIter = nullptr; // Lazily created. in usearch_setCollator()
999 strsrch->search->text, in usearch_setCollator()
1000 strsrch->search->textLength, in usearch_setCollator()
1067 strsrch->search->isForwardSearching = true; in usearch_first()
1081 strsrch->search->isForwardSearching = true; in usearch_following()
1095 strsrch->search->isForwardSearching = false; in usearch_last()
1096 usearch_setOffset(strsrch, strsrch->search->textLength, status); in usearch_last()
1109 strsrch->search->isForwardSearching = false; in usearch_preceding()
1148 USearch *search = strsrch->search; in usearch_next() local
1149 search->reset = false; in usearch_next()
1150 int32_t textlength = search->textLength; in usearch_next()
1151 if (search->isForwardSearching) { in usearch_next()
1153 (! search->isOverlap && in usearch_next()
1154 (search->matchedIndex != USEARCH_DONE && in usearch_next()
1155 offset + search->matchedLength > textlength))) { in usearch_next()
1167 search->isForwardSearching = true; in usearch_next()
1168 if (search->matchedIndex != USEARCH_DONE) { in usearch_next()
1171 return search->matchedIndex; in usearch_next()
1177 if (search->matchedIndex == USEARCH_DONE) { in usearch_next()
1178 search->matchedIndex = offset; in usearch_next()
1181 U16_FWD_1(search->text, search->matchedIndex, textlength); in usearch_next()
1184 search->matchedLength = 0; in usearch_next()
1185 setColEIterOffset(strsrch->textIter, search->matchedIndex, *status); in usearch_next()
1187 if (search->matchedIndex == textlength) { in usearch_next()
1188 search->matchedIndex = USEARCH_DONE; in usearch_next()
1192 if (search->matchedLength > 0) { in usearch_next()
1194 if (search->isOverlap) { in usearch_next()
1199 offset + search->matchedLength, status); in usearch_next()
1207 search->matchedIndex = offset - 1; in usearch_next()
1210 if (search->isCanonicalMatch) { in usearch_next()
1223 if (search->matchedIndex == USEARCH_DONE) { in usearch_next()
1224 ucol_setOffset(strsrch->textIter, search->textLength, status); in usearch_next()
1226 ucol_setOffset(strsrch->textIter, search->matchedIndex, status); in usearch_next()
1229 return search->matchedIndex; in usearch_next()
1240 USearch *search = strsrch->search; in usearch_previous() local
1241 if (search->reset) { in usearch_previous()
1242 offset = search->textLength; in usearch_previous()
1243 search->isForwardSearching = false; in usearch_previous()
1244 search->reset = false; in usearch_previous()
1251 int32_t matchedindex = search->matchedIndex; in usearch_previous()
1252 if (search->isForwardSearching == true) { in usearch_previous()
1258 search->isForwardSearching = false; in usearch_previous()
1275 search->matchedIndex = in usearch_previous()
1277 if (search->matchedIndex == 0) { in usearch_previous()
1282 U16_BACK_1(search->text, 0, search->matchedIndex); in usearch_previous()
1283 setColEIterOffset(strsrch->textIter, search->matchedIndex, *status); in usearch_previous()
1285 search->matchedLength = 0; in usearch_previous()
1289 if (strsrch->search->isCanonicalMatch) { in usearch_previous()
1304 return search->matchedIndex; in usearch_previous()
1357 ucol_setText(strsrch->textIter, strsrch->search->text, in usearch_reset()
1358 strsrch->search->textLength, in usearch_reset()
1360 strsrch->search->matchedLength = 0; in usearch_reset()
1361 strsrch->search->matchedIndex = USEARCH_DONE; in usearch_reset()
1362 strsrch->search->isOverlap = false; in usearch_reset()
1363 strsrch->search->isCanonicalMatch = false; in usearch_reset()
1364 strsrch->search->elementComparisonType = 0; in usearch_reset()
1365 strsrch->search->isForwardSearching = true; in usearch_reset()
1366 strsrch->search->reset = true; in usearch_reset()
1415 if (ss->search->elementComparisonType != 0) { in CEIBuffer()
1562 const UChar *text = strsrch->search->text; in nextBoundaryAfter()
1563 int32_t textLen = strsrch->search->textLength; in nextBoundaryAfter()
1622 const UChar *text = strsrch->search->text; in isBreakBoundary()
1623 int32_t textLen = strsrch->search->textLength; in isBreakBoundary()
1749 UChar32 codePointAt(const USearch &search, int32_t index) { in codePointAt() argument
1750 if (index < search.textLength) { in codePointAt()
1752 U16_NEXT(search.text, index, search.textLength, c); in codePointAt()
1758 UChar32 codePointBefore(const USearch &search, int32_t index) { in codePointBefore() argument
1761 U16_PREV(search.text, 0, index, c); in codePointBefore()
1796 startIdx > strsrch->search->textLength || in usearch_search()
1864 …UCompareCEsResult ceMatch = compareCE64s(targetCEI->ce, patCE, strsrch->search->elementComparisonT… in usearch_search()
1911 if (strsrch->search->elementComparisonType == 0) { in usearch_search()
1929 …UCompareCEsResult ceMatch = compareCE64s(nextCEI->ce, patCE, strsrch->search->elementComparisonTyp… in usearch_search()
1982 if (strsrch->search->text != nullptr && strsrch->search->textLength > maxLimit) { in usearch_search()
1984 strsrch->search->breakIter == nullptr && in usearch_search()
1987 (strsrch->nfd->hasBoundaryBefore(codePointAt(*strsrch->search, maxLimit)) || in usearch_search()
1988 … strsrch->nfd->hasBoundaryAfter(codePointBefore(*strsrch->search, maxLimit))); in usearch_search()
2116 startIdx > strsrch->search->textLength || in usearch_searchBackwards()
2138 if (startIdx < strsrch->search->textLength) { in usearch_searchBackwards()
2201 …UCompareCEsResult ceMatch = compareCE64s(targetCEI->ce, patCE, strsrch->search->elementComparisonT… in usearch_searchBackwards()
2287 if (strsrch->search->text != nullptr && strsrch->search->textLength > maxLimit) { in usearch_searchBackwards()
2289 strsrch->search->breakIter == nullptr && in usearch_searchBackwards()
2292 (strsrch->nfd->hasBoundaryBefore(codePointAt(*strsrch->search, maxLimit)) || in usearch_searchBackwards()
2293 … strsrch->nfd->hasBoundaryAfter(codePointBefore(*strsrch->search, maxLimit))); in usearch_searchBackwards()
2404 strsrch->search->matchedIndex = start; in usearch_handleNextExact()
2405 strsrch->search->matchedLength = end - start; in usearch_handleNextExact()
2425 strsrch->search->matchedIndex = start; in usearch_handleNextCanonical()
2426 strsrch->search->matchedLength = end - start; in usearch_handleNextCanonical()
2443 if (strsrch->search->isOverlap) { in usearch_handlePreviousExact()
2444 if (strsrch->search->matchedIndex != USEARCH_DONE) { in usearch_handlePreviousExact()
2445 textOffset = strsrch->search->matchedIndex + strsrch->search->matchedLength - 1; in usearch_handlePreviousExact()
2474 strsrch->search->matchedIndex = start; in usearch_handlePreviousExact()
2475 strsrch->search->matchedLength = end - start; in usearch_handlePreviousExact()
2493 if (strsrch->search->isOverlap) { in usearch_handlePreviousCanonical()
2494 if (strsrch->search->matchedIndex != USEARCH_DONE) { in usearch_handlePreviousCanonical()
2495 textOffset = strsrch->search->matchedIndex + strsrch->search->matchedLength - 1; in usearch_handlePreviousCanonical()
2524 strsrch->search->matchedIndex = start; in usearch_handlePreviousCanonical()
2525 strsrch->search->matchedLength = end - start; in usearch_handlePreviousCanonical()