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 ? USEARCH_ON : USEARCH_OFF); in usearch_getAttribute()
824 return (strsrch->search->isCanonicalMatch ? USEARCH_ON : USEARCH_OFF); in usearch_getAttribute()
827 int16_t value = strsrch->search->elementComparisonType; in usearch_getAttribute()
847 return strsrch->search->matchedIndex; in usearch_getMatchedStart()
865 int32_t copylength = strsrch->search->matchedLength; in usearch_getMatchedText()
866 int32_t copyindex = strsrch->search->matchedIndex; in usearch_getMatchedText()
876 uprv_memcpy(result, strsrch->search->text + copyindex, in usearch_getMatchedText()
880 strsrch->search->matchedLength, status); in usearch_getMatchedText()
887 return strsrch->search->matchedLength; in usearch_getMatchedLength()
899 strsrch->search->breakIter = breakiter; in usearch_setBreakIterator()
901 ubrk_setText(breakiter, strsrch->search->text, in usearch_setBreakIterator()
902 strsrch->search->textLength, status); in usearch_setBreakIterator()
911 return strsrch->search->breakIter; in usearch_getBreakIterator()
932 strsrch->search->text = text; in usearch_setText()
933 strsrch->search->textLength = textlength; in usearch_setText()
935 strsrch->search->matchedIndex = USEARCH_DONE; in usearch_setText()
936 strsrch->search->matchedLength = 0; in usearch_setText()
937 strsrch->search->reset = true; in usearch_setText()
939 if (strsrch->search->breakIter != nullptr) { in usearch_setText()
940 ubrk_setText(strsrch->search->breakIter, text, in usearch_setText()
943 if (strsrch->search->internalBreakIter != nullptr) { in usearch_setText()
944 ubrk_setText(strsrch->search->internalBreakIter, text, textlength, status); in usearch_setText()
955 *length = strsrch->search->textLength; in usearch_getText()
956 return strsrch->search->text; in usearch_getText()
985 if (strsrch->search->internalBreakIter != nullptr) { in usearch_setCollator()
986 ubrk_close(strsrch->search->internalBreakIter); in usearch_setCollator()
987 strsrch->search->internalBreakIter = nullptr; // Lazily created. in usearch_setCollator()
997 strsrch->search->text, in usearch_setCollator()
998 strsrch->search->textLength, in usearch_setCollator()
1065 strsrch->search->isForwardSearching = true; in usearch_first()
1079 strsrch->search->isForwardSearching = true; in usearch_following()
1093 strsrch->search->isForwardSearching = false; in usearch_last()
1094 usearch_setOffset(strsrch, strsrch->search->textLength, status); in usearch_last()
1107 strsrch->search->isForwardSearching = false; in usearch_preceding()
1146 USearch *search = strsrch->search; in usearch_next() local
1147 search->reset = false; in usearch_next()
1148 int32_t textlength = search->textLength; in usearch_next()
1149 if (search->isForwardSearching) { in usearch_next()
1151 (! search->isOverlap && in usearch_next()
1152 (search->matchedIndex != USEARCH_DONE && in usearch_next()
1153 offset + search->matchedLength > textlength))) { in usearch_next()
1165 search->isForwardSearching = true; in usearch_next()
1166 if (search->matchedIndex != USEARCH_DONE) { in usearch_next()
1169 return search->matchedIndex; in usearch_next()
1175 if (search->matchedIndex == USEARCH_DONE) { in usearch_next()
1176 search->matchedIndex = offset; in usearch_next()
1179 U16_FWD_1(search->text, search->matchedIndex, textlength); in usearch_next()
1182 search->matchedLength = 0; in usearch_next()
1183 setColEIterOffset(strsrch->textIter, search->matchedIndex, *status); in usearch_next()
1185 if (search->matchedIndex == textlength) { in usearch_next()
1186 search->matchedIndex = USEARCH_DONE; in usearch_next()
1190 if (search->matchedLength > 0) { in usearch_next()
1192 if (search->isOverlap) { in usearch_next()
1197 offset + search->matchedLength, status); in usearch_next()
1205 search->matchedIndex = offset - 1; in usearch_next()
1208 if (search->isCanonicalMatch) { in usearch_next()
1221 if (search->matchedIndex == USEARCH_DONE) { in usearch_next()
1222 ucol_setOffset(strsrch->textIter, search->textLength, status); in usearch_next()
1224 ucol_setOffset(strsrch->textIter, search->matchedIndex, status); in usearch_next()
1227 return search->matchedIndex; in usearch_next()
1238 USearch *search = strsrch->search; in usearch_previous() local
1239 if (search->reset) { in usearch_previous()
1240 offset = search->textLength; in usearch_previous()
1241 search->isForwardSearching = false; in usearch_previous()
1242 search->reset = false; in usearch_previous()
1249 int32_t matchedindex = search->matchedIndex; in usearch_previous()
1250 if (search->isForwardSearching) { in usearch_previous()
1256 search->isForwardSearching = false; in usearch_previous()
1273 search->matchedIndex = in usearch_previous()
1275 if (search->matchedIndex == 0) { in usearch_previous()
1280 U16_BACK_1(search->text, 0, search->matchedIndex); in usearch_previous()
1281 setColEIterOffset(strsrch->textIter, search->matchedIndex, *status); in usearch_previous()
1283 search->matchedLength = 0; in usearch_previous()
1287 if (strsrch->search->isCanonicalMatch) { in usearch_previous()
1302 return search->matchedIndex; in usearch_previous()
1355 ucol_setText(strsrch->textIter, strsrch->search->text, in usearch_reset()
1356 strsrch->search->textLength, in usearch_reset()
1358 strsrch->search->matchedLength = 0; in usearch_reset()
1359 strsrch->search->matchedIndex = USEARCH_DONE; in usearch_reset()
1360 strsrch->search->isOverlap = false; in usearch_reset()
1361 strsrch->search->isCanonicalMatch = false; in usearch_reset()
1362 strsrch->search->elementComparisonType = 0; in usearch_reset()
1363 strsrch->search->isForwardSearching = true; in usearch_reset()
1364 strsrch->search->reset = true; in usearch_reset()
1413 if (ss->search->elementComparisonType != 0) { in CEIBuffer()
1560 const char16_t *text = strsrch->search->text; in nextBoundaryAfter()
1561 int32_t textLen = strsrch->search->textLength; in nextBoundaryAfter()
1620 const char16_t *text = strsrch->search->text; in isBreakBoundary()
1621 int32_t textLen = strsrch->search->textLength; in isBreakBoundary()
1747 UChar32 codePointAt(const USearch &search, int32_t index) { in codePointAt() argument
1748 if (index < search.textLength) { in codePointAt()
1750 U16_NEXT(search.text, index, search.textLength, c); in codePointAt()
1756 UChar32 codePointBefore(const USearch &search, int32_t index) { in codePointBefore() argument
1759 U16_PREV(search.text, 0, index, c); in codePointBefore()
1794 startIdx > strsrch->search->textLength || in usearch_search()
1862 …UCompareCEsResult ceMatch = compareCE64s(targetCEI->ce, patCE, strsrch->search->elementComparisonT… in usearch_search()
1909 if (strsrch->search->elementComparisonType == 0) { in usearch_search()
1927 …UCompareCEsResult ceMatch = compareCE64s(nextCEI->ce, patCE, strsrch->search->elementComparisonTyp… in usearch_search()
1980 if (strsrch->search->text != nullptr && strsrch->search->textLength > maxLimit) { in usearch_search()
1982 strsrch->search->breakIter == nullptr && in usearch_search()
1985 (strsrch->nfd->hasBoundaryBefore(codePointAt(*strsrch->search, maxLimit)) || in usearch_search()
1986 … strsrch->nfd->hasBoundaryAfter(codePointBefore(*strsrch->search, maxLimit))); in usearch_search()
2114 startIdx > strsrch->search->textLength || in usearch_searchBackwards()
2136 if (startIdx < strsrch->search->textLength) { in usearch_searchBackwards()
2199 …UCompareCEsResult ceMatch = compareCE64s(targetCEI->ce, patCE, strsrch->search->elementComparisonT… in usearch_searchBackwards()
2285 if (strsrch->search->text != nullptr && strsrch->search->textLength > maxLimit) { in usearch_searchBackwards()
2287 strsrch->search->breakIter == nullptr && in usearch_searchBackwards()
2290 (strsrch->nfd->hasBoundaryBefore(codePointAt(*strsrch->search, maxLimit)) || in usearch_searchBackwards()
2291 … strsrch->nfd->hasBoundaryAfter(codePointBefore(*strsrch->search, maxLimit))); in usearch_searchBackwards()
2402 strsrch->search->matchedIndex = start; in usearch_handleNextExact()
2403 strsrch->search->matchedLength = end - start; in usearch_handleNextExact()
2423 strsrch->search->matchedIndex = start; in usearch_handleNextCanonical()
2424 strsrch->search->matchedLength = end - start; in usearch_handleNextCanonical()
2441 if (strsrch->search->isOverlap) { in usearch_handlePreviousExact()
2442 if (strsrch->search->matchedIndex != USEARCH_DONE) { in usearch_handlePreviousExact()
2443 textOffset = strsrch->search->matchedIndex + strsrch->search->matchedLength - 1; in usearch_handlePreviousExact()
2472 strsrch->search->matchedIndex = start; in usearch_handlePreviousExact()
2473 strsrch->search->matchedLength = end - start; in usearch_handlePreviousExact()
2491 if (strsrch->search->isOverlap) { in usearch_handlePreviousCanonical()
2492 if (strsrch->search->matchedIndex != USEARCH_DONE) { in usearch_handlePreviousCanonical()
2493 textOffset = strsrch->search->matchedIndex + strsrch->search->matchedLength - 1; in usearch_handlePreviousCanonical()
2522 strsrch->search->matchedIndex = start; in usearch_handlePreviousCanonical()
2523 strsrch->search->matchedLength = end - start; in usearch_handlePreviousCanonical()