Lines Matching refs:search
142 * @param strsrch string search data
284 * @param strsrch string search data
356 * @param strsrch string search data
536 * consideration. Forwards search will take the end accents into consideration
537 * for the default shift values and the backwards search will take the prefix
567 * @param strsrch string search data
576 UBreakIterator *breakiterator = strsrch->search->internalBreakIter;
598 * @param strsrch string search data
607 UBreakIterator *breakiterator = strsrch->search->breakIter;
628 const UChar *text = strsrch->search->text +
692 * Gets the next base character offset depending on the string search pattern
694 * @param strsrch string search data
696 * to search for.
704 int32_t textlength = strsrch->search->textLength;
708 const UChar *text = strsrch->search->text;
722 * @param text strsrch string search data
723 * @param textoffset start text position to do search
763 * @param strsrch string search data
769 strsrch->search->matchedIndex = USEARCH_DONE;
770 strsrch->search->matchedLength = 0;
771 if (strsrch->search->isForwardSearching) {
772 setColEIterOffset(strsrch->textIter, strsrch->search->textLength);
820 * @param strsrch string search data
837 const UChar *text = strsrch->search->text + start;
912 * @param strsrch string search data
951 // accent = (getFCD(strsrch->search->text, &temp,
952 // strsrch->search->textLength)
957 UBool accent = getFCD(strsrch->search->text, &temp,
958 strsrch->search->textLength) > 0xFF;
967 U16_BACK_1(strsrch->search->text, 0, temp);
968 if (getFCD(strsrch->search->text, &temp,
969 strsrch->search->textLength) & LAST_BYTE_MASK_) {
993 * @param strsrch string search data
1004 const UChar *text = strsrch->search->text;
1006 int32_t textlength = strsrch->search->textLength;
1067 * @param strsrch string search data
1085 UnicodeString(FALSE, strsrch->search->text + start, end - start), t2, status);
1095 * @param strsrch string search data
1105 int32_t lastmatchindex = strsrch->search->matchedIndex;
1110 if (strsrch->search->isForwardSearching) {
1116 if (!result && !strsrch->search->isOverlap) {
1117 if (strsrch->search->isForwardSearching) {
1118 result = start < lastmatchindex + strsrch->search->matchedLength;
1153 * @param strsrch string search data
1166 int32_t textlength = strsrch->search->textLength;
1169 const UChar *text = strsrch->search->text;
1177 // excess prefix characters has been included in the potential search
1240 * @param strsrch string search data
1243 * search offset.
1270 //Add breakiterator boundary check for primary strength search.
1271 if (!strsrch->search->breakIter && strsrch->strength == UCOL_PRIMARY) {
1276 strsrch->search->matchedIndex = start;
1277 strsrch->search->matchedLength = *textoffset - start;
1398 * pattern in string search data
1399 * @param strsrch string search data
1436 * @param strsrch string search match
1449 const UChar *text = strsrch->search->text;
1450 int32_t textlength = strsrch->search->textLength;
1495 strsrch->search->text + offset,
1544 * @param strsrch string search data
1568 * @param strsrch string search data
1579 const UChar *text = strsrch->search->text;
1701 * @param strsrch string search data
1712 const UChar *text = strsrch->search->text;
1734 // offset to the last base character in substring to search
1774 * Gets the previous base character offset depending on the string search
1776 * @param strsrch string search data
1786 const UChar *text = strsrch->search->text;
1788 if (getFCD(text, &offset, strsrch->search->textLength) >>
1803 * @param strsrch string search data
1816 int32_t textlength = strsrch->search->textLength;
1819 const UChar *text = strsrch->search->text;
1850 int32_t textlength = strsrch->search->textLength;
1900 * @param strsrch string search data
1903 * search offset.
1919 strsrch->search->matchedIndex = getPreviousUStringSearchBaseOffset(
1922 strsrch->search->matchedLength = *textoffset -
1923 strsrch->search->matchedIndex;
1939 *textoffset = getNextBaseOffset(strsrch->search->text, *textoffset,
1940 strsrch->search->textLength);
1944 strsrch->search->matchedIndex = start;
1945 strsrch->search->matchedLength = *textoffset - start;
1955 * @param text strsrch string search data
1956 * @param textoffset start text position to do search
1968 if (strsrch->search->isOverlap) {
1969 if (textoffset != strsrch->search->textLength) {
2001 * @param strsrch string search data
2013 int32_t textlength = strsrch->search->textLength;
2016 const UChar *text = strsrch->search->text;
2083 * @param strsrch string search data
2089 * search offset.
2113 *textoffset = getPreviousBaseOffset(strsrch->search->text,
2118 //Add breakiterator boundary check for primary strength search.
2119 if (!strsrch->search->breakIter && strsrch->strength == UCOL_PRIMARY) {
2123 strsrch->search->matchedIndex = *textoffset;
2124 strsrch->search->matchedLength = end - *textoffset;
2140 * @param strsrch string search match
2153 const UChar *text = strsrch->search->text;
2157 if (!(getFCD(text, &tempend, strsrch->search->textLength) &
2162 end = getNextBaseOffset(text, end, strsrch->search->textLength);
2197 strsrch->search->text + start,
2228 * @param strsrch string search data
2239 const UChar *text = strsrch->search->text;
2252 strsrch->search->textLength);
2364 * @param strsrch string search data
2375 const UChar *text = strsrch->search->text;
2377 int32_t textlength = strsrch->search->textLength;
2397 // offset to the last base character in substring to search
2441 * @param strsrch string search data
2453 int32_t textlength = strsrch->search->textLength;
2456 const UChar *text = strsrch->search->text;
2538 * @param strsrch string search data
2541 * search offset.
2557 strsrch->search->matchedIndex = *textoffset;
2558 strsrch->search->matchedLength =
2578 *textoffset = getPreviousBaseOffset(strsrch->search->text,
2583 strsrch->search->matchedIndex = *textoffset;
2584 strsrch->search->matchedLength = end - *textoffset;
2654 // string search does not really work when numeric collation is turned on
2699 result->search = (USearch *)uprv_malloc(sizeof(USearch));
2700 if (result->search == NULL) {
2706 result->search->text = text;
2707 result->search->textLength = textlength;
2714 result->search->breakIter = breakiter;
2716 result->search->internalBreakIter = ubrk_open(UBRK_CHARACTER, ucol_getLocaleByType(result->collator, ULOC_VALID_LOCALE, status), text, textlength, status);
2723 result->search->matchedLength = 0;
2724 result->search->matchedIndex = USEARCH_DONE;
2734 result->search->isOverlap = FALSE;
2735 result->search->isCanonicalMatch = FALSE;
2736 result->search->elementComparisonType = 0;
2737 result->search->isForwardSearching = TRUE;
2738 result->search->reset = TRUE;
2774 if (strsrch->search->internalBreakIter) {
2775 ubrk_close(strsrch->search->internalBreakIter);
2779 uprv_free(strsrch->search);
2809 if (isOutOfBounds(strsrch->search->textLength, position)) {
2815 strsrch->search->matchedIndex = USEARCH_DONE;
2816 strsrch->search->matchedLength = 0;
2817 strsrch->search->reset = FALSE;
2825 if (isOutOfBounds(strsrch->search->textLength, result)) {
2842 strsrch->search->isOverlap = (value == USEARCH_ON ? TRUE : FALSE);
2845 strsrch->search->isCanonicalMatch = (value == USEARCH_ON ? TRUE :
2850 strsrch->search->elementComparisonType = (int16_t)value;
2852 strsrch->search->elementComparisonType = 0;
2872 return (strsrch->search->isOverlap == TRUE ? USEARCH_ON :
2875 return (strsrch->search->isCanonicalMatch == TRUE ? USEARCH_ON :
2879 int16_t value = strsrch->search->elementComparisonType;
2899 return strsrch->search->matchedIndex;
2917 int32_t copylength = strsrch->search->matchedLength;
2918 int32_t copyindex = strsrch->search->matchedIndex;
2928 uprv_memcpy(result, strsrch->search->text + copyindex,
2932 strsrch->search->matchedLength, status);
2939 return strsrch->search->matchedLength;
2951 strsrch->search->breakIter = breakiter;
2953 ubrk_setText(breakiter, strsrch->search->text,
2954 strsrch->search->textLength, status);
2963 return strsrch->search->breakIter;
2984 strsrch->search->text = text;
2985 strsrch->search->textLength = textlength;
2987 strsrch->search->matchedIndex = USEARCH_DONE;
2988 strsrch->search->matchedLength = 0;
2989 strsrch->search->reset = TRUE;
2991 if (strsrch->search->breakIter != NULL) {
2992 ubrk_setText(strsrch->search->breakIter, text,
2995 ubrk_setText(strsrch->search->internalBreakIter, text, textlength, status);
3005 *length = strsrch->search->textLength;
3006 return strsrch->search->text;
3035 ubrk_close(strsrch->search->internalBreakIter);
3036 strsrch->search->internalBreakIter = ubrk_open(UBRK_CHARACTER, ucol_getLocaleByType(collator, ULOC_VALID_LOCALE, status),
3037 strsrch->search->text, strsrch->search->textLength, status);
3046 strsrch->search->text,
3047 strsrch->search->textLength,
3114 strsrch->search->isForwardSearching = TRUE;
3128 strsrch->search->isForwardSearching = TRUE;
3142 strsrch->search->isForwardSearching = FALSE;
3143 usearch_setOffset(strsrch, strsrch->search->textLength, status);
3156 strsrch->search->isForwardSearching = FALSE;
3170 * string to continue the search in. Imagine when we are in the middle of the
3195 USearch *search = strsrch->search;
3196 search->reset = FALSE;
3197 int32_t textlength = search->textLength;
3198 if (search->isForwardSearching) {
3201 || (!search->isOverlap &&
3203 (search->matchedIndex != USEARCH_DONE &&
3204 offset + search->matchedLength >= textlength)))) {
3211 (! search->isOverlap &&
3212 (search->matchedIndex != USEARCH_DONE &&
3213 offset + search->matchedLength > textlength))) {
3226 search->isForwardSearching = TRUE;
3227 if (search->matchedIndex != USEARCH_DONE) {
3230 return search->matchedIndex;
3236 if (search->matchedIndex == USEARCH_DONE) {
3237 search->matchedIndex = offset;
3240 U16_FWD_1(search->text, search->matchedIndex, textlength);
3243 search->matchedLength = 0;
3244 setColEIterOffset(strsrch->textIter, search->matchedIndex);
3246 if (search->matchedIndex == textlength) {
3247 search->matchedIndex = USEARCH_DONE;
3251 if (search->matchedLength > 0) {
3253 if (search->isOverlap) {
3258 offset + search->matchedLength, status);
3264 // note search->matchedIndex will always be set to something
3266 search->matchedIndex = offset - 1;
3269 if (search->isCanonicalMatch) {
3283 if (search->matchedIndex == USEARCH_DONE) {
3284 ucol_setOffset(strsrch->textIter, search->textLength, status);
3286 ucol_setOffset(strsrch->textIter, search->matchedIndex, status);
3290 return search->matchedIndex;
3301 USearch *search = strsrch->search;
3302 if (search->reset) {
3303 offset = search->textLength;
3304 search->isForwardSearching = FALSE;
3305 search->reset = FALSE;
3312 int32_t matchedindex = search->matchedIndex;
3313 if (search->isForwardSearching == TRUE) {
3319 search->isForwardSearching = FALSE;
3327 (!search->isOverlap &&
3337 // linear search will do the right thing
3347 search->matchedIndex =
3349 if (search->matchedIndex == 0) {
3354 U16_BACK_1(search->text, 0, search->matchedIndex);
3355 setColEIterOffset(strsrch->textIter, search->matchedIndex);
3357 search->matchedLength = 0;
3361 if (strsrch->search->isCanonicalMatch) {
3376 return search->matchedIndex;
3388 string search, hence all attributes in the collator should
3429 ucol_setText(strsrch->textIter, strsrch->search->text,
3430 strsrch->search->textLength,
3432 strsrch->search->matchedLength = 0;
3433 strsrch->search->matchedIndex = USEARCH_DONE;
3434 strsrch->search->isOverlap = FALSE;
3435 strsrch->search->isCanonicalMatch = FALSE;
3436 strsrch->search->elementComparisonType = 0;
3437 strsrch->search->isForwardSearching = TRUE;
3438 strsrch->search->reset = TRUE;
3460 // Some typical max values to make buffer size more reasonable for asymmetric search.
3487 if (ss->search->elementComparisonType != 0) {
3623 const UChar *text = strsrch->search->text;
3624 int32_t textLen = strsrch->search->textLength;
3660 UBreakIterator *breakiterator = strsrch->search->breakIter;
3663 breakiterator = strsrch->search->internalBreakIter;
3685 const UChar *text = strsrch->search->text;
3686 int32_t textLen = strsrch->search->textLength;
3711 UBreakIterator *breakiterator = strsrch->search->breakIter;
3714 breakiterator = strsrch->search->internalBreakIter;
3728 UBreakIterator *breakiterator = strsrch->search->breakIter;
3814 UChar32 codePointAt(const USearch &search, int32_t index) {
3815 if (index < search.textLength) {
3817 U16_NEXT(search.text, index, search.textLength, c);
3823 UChar32 codePointBefore(const USearch &search, int32_t index) {
3826 U16_PREV(search.text, 0, index, c);
3844 // TODO: reject search patterns beginning with a combining char.
3861 startIdx > strsrch->search->textLength ||
3924 UCompareCEsResult ceMatch = compareCE64s(targetCEI->ce, patCE, strsrch->search->elementComparisonType);
3971 if (strsrch->search->elementComparisonType == 0) {
3989 UCompareCEsResult ceMatch = compareCE64s(nextCEI->ce, patCE, strsrch->search->elementComparisonType);
4028 // conditions are met; this is needed to make prefix search work properly in
4039 if (strsrch->search->text != NULL && strsrch->search->textLength > maxLimit) {
4041 strsrch->search->breakIter == NULL &&
4044 (strsrch->nfd->hasBoundaryBefore(codePointAt(*strsrch->search, maxLimit)) ||
4045 strsrch->nfd->hasBoundaryAfter(codePointBefore(*strsrch->search, maxLimit)));
4144 // TODO: reject search patterns beginning with a combining char.
4161 startIdx > strsrch->search->textLength ||
4183 if (startIdx < strsrch->search->textLength) {
4184 UBreakIterator *bi = strsrch->search->internalBreakIter;
4239 UCompareCEsResult ceMatch = compareCE64s(targetCEI->ce, patCE, strsrch->search->elementComparisonType);
4311 // conditions are met; this is needed to make prefix search work properly in
4322 if (strsrch->search->text != NULL && strsrch->search->textLength > maxLimit) {
4324 strsrch->search->breakIter == NULL &&
4327 (strsrch->nfd->hasBoundaryBefore(codePointAt(*strsrch->search, maxLimit)) ||
4328 strsrch->nfd->hasBoundaryAfter(codePointBefore(*strsrch->search, maxLimit)));
4428 int32_t textlength = strsrch->search->textLength;
4449 // for example: search for pattern A in text \u00C0
4511 setColEIterOffset(coleiter, strsrch->search->matchedIndex);
4523 strsrch->search->matchedIndex = start;
4524 strsrch->search->matchedLength = end - start;
4542 int32_t textlength = strsrch->search->textLength;
4565 // for example: search for pattern A in text \u00C0
4626 setColEIterOffset(coleiter, strsrch->search->matchedIndex);
4638 strsrch->search->matchedIndex = start;
4639 strsrch->search->matchedLength = end - start;
4664 if (strsrch->search->matchedIndex != USEARCH_DONE) {
4665 textoffset = strsrch->search->matchedIndex;
4683 // characters. for example: search for pattern \u0300 in text
4752 if (strsrch->search->isOverlap) {
4753 if (strsrch->search->matchedIndex != USEARCH_DONE) {
4754 textOffset = strsrch->search->matchedIndex + strsrch->search->matchedLength - 1;
4783 strsrch->search->matchedIndex = start;
4784 strsrch->search->matchedLength = end - start;
4812 if (strsrch->search->matchedIndex != USEARCH_DONE) {
4813 textoffset = strsrch->search->matchedIndex;
4831 // characters. for example: search for pattern \u0300 in text
4905 if (strsrch->search->isOverlap) {
4906 if (strsrch->search->matchedIndex != USEARCH_DONE) {
4907 textOffset = strsrch->search->matchedIndex + strsrch->search->matchedLength - 1;
4936 strsrch->search->matchedIndex = start;
4937 strsrch->search->matchedLength = end - start;