Lines Matching defs:strsrch
254 UBool StringSearchTest::assertEqualWithStringSearch(StringSearch *strsrch,
263 strsrch->setAttribute(USEARCH_ELEMENT_COMPARISON, search->elemCompare, status);
269 if (strsrch->getMatchedStart() != USEARCH_DONE ||
270 strsrch->getMatchedLength() != 0) {
277 strsrch->next(status);
278 if (matchindex != strsrch->getMatchedStart() ||
279 matchlength != strsrch->getMatchedLength()) {
280 char *str = toCharString(strsrch->getText());
282 str = toCharString(strsrch->getPattern());
285 strsrch->getMatchedStart(), strsrch->getMatchedLength(),
291 strsrch->getMatchedText(matchtext);
294 strsrch->getText().compareBetween(matchindex,
303 strsrch->next(status);
304 if (strsrch->getMatchedStart() != USEARCH_DONE ||
305 strsrch->getMatchedLength() != 0) {
306 char *str = toCharString(strsrch->getText());
308 str = toCharString(strsrch->getPattern());
311 strsrch->getMatchedStart(), strsrch->getMatchedLength());
320 strsrch->previous(status);
321 if (matchindex != strsrch->getMatchedStart() ||
322 matchlength != strsrch->getMatchedLength()) {
323 char *str = toCharString(strsrch->getText());
325 str = toCharString(strsrch->getPattern());
328 strsrch->getMatchedStart(), strsrch->getMatchedLength(),
333 strsrch->getMatchedText(matchtext);
336 strsrch->getText().compareBetween(matchindex,
346 strsrch->previous(status);
347 if (strsrch->getMatchedStart() != USEARCH_DONE ||
348 strsrch->getMatchedLength() != 0) {
349 char *str = toCharString(strsrch->getText());
351 str = toCharString(strsrch->getPattern());
354 strsrch->getMatchedStart(), strsrch->getMatchedLength());
359 UBool isOverlap = (strsrch->getAttribute(USEARCH_OVERLAP) == USEARCH_ON);
367 strsrch->following(nextStart, status);
370 if (strsrch->getMatchedStart() != USEARCH_DONE ||
371 strsrch->getMatchedLength() != 0) {
372 char *str = toCharString(strsrch->getText());
374 str = toCharString(strsrch->getPattern());
378 strsrch->getMatchedStart(), strsrch->getMatchedLength());
386 if (strsrch->getMatchedStart() != matchindex
387 || strsrch->getMatchedLength() != matchlength
389 char *str = toCharString(strsrch->getText());
391 str = toCharString(strsrch->getPattern());
395 strsrch->getMatchedStart(), strsrch->getMatchedLength(),
400 if (isOverlap || strsrch->getMatchedLength() == 0) {
401 nextStart = strsrch->getMatchedStart() + 1;
403 nextStart = strsrch->getMatchedStart() + strsrch->getMatchedLength();
415 nextStart = strsrch->getText().length();
418 strsrch->preceding(nextStart, status);
421 if (strsrch->getMatchedStart() != USEARCH_DONE || strsrch->getMatchedLength() != 0) {
422 char *str = toCharString(strsrch->getText());
424 str = toCharString(strsrch->getPattern());
428 strsrch->getMatchedStart(),
429 strsrch->getMatchedLength());
438 if (strsrch->getMatchedStart() != matchindex
439 || strsrch->getMatchedLength() != matchlength
441 char *str = toCharString(strsrch->getText());
443 str = toCharString(strsrch->getPattern());
447 strsrch->getMatchedStart(), strsrch->getMatchedLength(),
456 strsrch->setAttribute(USEARCH_ELEMENT_COMPARISON, USEARCH_STANDARD_ELEMENT_COMPARISON, status);
466 StringSearch *strsrch, *strsrch2;
487 strsrch = new StringSearch(pattern, text, (RuleBasedCollator *)collator,
494 if (!assertEqualWithStringSearch(strsrch, search)) {
496 strsrch;
501 strsrch2 = strsrch->clone();
502 if( strsrch2 == strsrch || *strsrch2 != *strsrch ||
507 delete strsrch;
514 delete strsrch;
523 StringSearch *strsrch;
547 strsrch = new StringSearch(pattern, text, (RuleBasedCollator *)collator,
549 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
556 if (!assertEqualWithStringSearch(strsrch, search)) {
564 delete strsrch;
576 StringSearch *strsrch;
599 strsrch = new StringSearch(pattern, text, (RuleBasedCollator *)collator,
601 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, canonical, status);
602 strsrch->setAttribute(USEARCH_OVERLAP, overlap, status);
609 if (!assertEqualWithStringSearch(strsrch, search)) {
611 delete strsrch;
615 delete strsrch;
879 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
885 strsrch->setBreakIterator(NULL, status);
886 if (U_FAILURE(status) || strsrch->getBreakIterator() != NULL) {
890 strsrch->setBreakIterator(m_en_characterbreaker_, status);
892 strsrch->getBreakIterator() != m_en_characterbreaker_) {
896 strsrch->setBreakIterator(m_en_wordbreaker_, status);
898 strsrch->getBreakIterator() != m_en_wordbreaker_) {
902 delete strsrch;
910 StringSearch *strsrch;
921 strsrch = new StringSearch(pattern, text, collator, breaker, status);
923 strsrch->getBreakIterator() != breaker) {
925 if (strsrch != NULL) {
926 delete strsrch;
929 if (!assertEqualWithStringSearch(strsrch, search)) {
931 delete strsrch;
938 strsrch->setBreakIterator(breaker, status);
940 strsrch->getBreakIterator() != breaker) {
942 delete strsrch;
944 strsrch->reset();
945 if (!assertEqualWithStringSearch(strsrch, search)) {
948 delete strsrch;
1013 StringSearch *strsrch = new StringSearch(pattern, text,
1017 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_ON, status);
1019 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_ON) {
1022 if (!assertEqualWithStringSearch(strsrch, search)) {
1023 delete strsrch;
1028 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_OFF, status);
1030 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_OFF) {
1033 strsrch->reset();
1034 if (!assertEqualWithStringSearch(strsrch, search)) {
1035 delete strsrch;
1040 delete strsrch;
1056 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
1060 delete strsrch;
1063 if (!assertEqualWithStringSearch(strsrch, &COLLATOR[0])) {
1064 delete strsrch;
1076 delete strsrch;
1081 strsrch->setCollator(tailored, status);
1082 if (U_FAILURE(status) || (*strsrch->getCollator()) != (*tailored)) {
1084 delete strsrch;
1087 strsrch->reset();
1088 if (!assertEqualWithStringSearch(strsrch, &COLLATOR[1])) {
1089 delete strsrch;
1094 strsrch->setCollator(m_en_us_, status);
1095 strsrch->reset();
1096 if (U_FAILURE(status) || (*strsrch->getCollator()) != (*m_en_us_)) {
1098 delete strsrch;
1101 if (!assertEqualWithStringSearch(strsrch, &COLLATOR[0])) {
1104 delete strsrch;
1122 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
1128 if (strsrch != NULL) {
1129 delete strsrch;
1133 if (strsrch->getPattern() != pattern) {
1136 if (!assertEqualWithStringSearch(strsrch, &PATTERN[0])) {
1138 if (strsrch != NULL) {
1139 delete strsrch;
1146 strsrch->setPattern(pattern, status);
1147 if (pattern != strsrch->getPattern()) {
1150 if (strsrch != NULL) {
1151 delete strsrch;
1155 strsrch->reset();
1159 if (!assertEqualWithStringSearch(strsrch, &PATTERN[1])) {
1161 if (strsrch != NULL) {
1162 delete strsrch;
1169 strsrch->setPattern(pattern, status);
1170 if (pattern != strsrch->getPattern()) {
1173 if (strsrch != NULL) {
1174 delete strsrch;
1178 strsrch->reset();
1182 if (!assertEqualWithStringSearch(strsrch, &PATTERN[0])) {
1184 if (strsrch != NULL) {
1185 delete strsrch;
1195 strsrch->setPattern(pattern, status);
1200 if (strsrch != NULL) {
1201 delete strsrch;
1216 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
1222 if (text != strsrch->getText()) {
1225 if (!assertEqualWithStringSearch(strsrch, &TEXT[0])) {
1226 delete strsrch;
1232 strsrch->setText(text, status);
1233 if (text != strsrch->getText()) {
1235 delete strsrch;
1241 if (!assertEqualWithStringSearch(strsrch, &TEXT[1])) {
1242 delete strsrch;
1249 strsrch->setText(chariter, status);
1250 if (text != strsrch->getText()) {
1252 delete strsrch;
1258 if (!assertEqualWithStringSearch(strsrch, &TEXT[0])) {
1261 delete strsrch;
1281 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_,
1284 strsrch->setOffset(-1, status);
1288 strsrch->setOffset(128, status);
1302 strsrch->setText(text, status);
1303 strsrch->setPattern(pattern, status);
1304 strsrch->getCollator()->setStrength(getECollationStrength(
1306 strsrch->reset();
1312 strsrch->next(status);
1313 if (matchindex != strsrch->getMatchedStart() ||
1314 matchlength != strsrch->getMatchedLength()) {
1315 char *str = toCharString(strsrch->getText());
1317 str = toCharString(strsrch->getPattern());
1320 strsrch->getMatchedStart(),
1321 strsrch->getMatchedLength());
1327 strsrch->setOffset(search.offset[count + 1] + 1, status);
1328 if (strsrch->getOffset() != search.offset[count + 1] + 1) {
1336 strsrch->next(status);
1337 if (strsrch->getMatchedStart() != USEARCH_DONE) {
1338 char *str = toCharString(strsrch->getText());
1340 str = toCharString(strsrch->getPattern());
1343 strsrch->getMatchedStart(),
1344 strsrch->getMatchedLength());
1348 strsrch->getCollator()->setStrength(getECollationStrength(
1350 delete strsrch;
1358 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
1365 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_DEFAULT, status);
1367 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_OFF) {
1370 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_ON, status);
1372 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_ON) {
1375 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_OFF, status);
1377 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_OFF) {
1380 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_ATTRIBUTE_VALUE_COUNT,
1386 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_DEFAULT, status);
1388 strsrch->getAttribute(USEARCH_CANONICAL_MATCH) != USEARCH_OFF) {
1391 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
1393 strsrch->getAttribute(USEARCH_CANONICAL_MATCH) != USEARCH_ON) {
1396 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_OFF, status);
1398 strsrch->getAttribute(USEARCH_CANONICAL_MATCH) != USEARCH_OFF) {
1401 strsrch->setAttribute(USEARCH_CANONICAL_MATCH,
1407 strsrch->setAttribute(USEARCH_ATTRIBUTE_COUNT, USEARCH_DEFAULT, status);
1412 delete strsrch;
1427 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
1431 if (strsrch != NULL) {
1432 delete strsrch;
1442 strsrch->next(status);
1443 if (matchindex != strsrch->getMatchedStart() ||
1444 matchlength != strsrch->getMatchedLength()) {
1445 char *str = toCharString(strsrch->getText());
1447 str = toCharString(strsrch->getPattern());
1449 errln("Error match found at %d %d", strsrch->getMatchedStart(),
1450 strsrch->getMatchedLength());
1456 strsrch->getMatchedText(matchtext);
1463 strsrch->next(status);
1464 if (strsrch->getMatchedStart() != USEARCH_DONE ||
1465 strsrch->getMatchedLength() != 0) {
1469 strsrch->getMatchedText(matchtext);
1473 delete strsrch;
1490 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_,
1494 if (strsrch != NULL) {
1495 delete strsrch;
1505 if (strsrch->first(status) != search.offset[0] || U_FAILURE(status)) {
1508 if (strsrch->last(status) != search.offset[size -1] ||
1516 if (strsrch->following(search.offset[index + 2] - 1, status)
1523 if (strsrch->preceding(search.offset[index + 1] +
1534 if (strsrch->following(text.length(), status) != USEARCH_DONE) {
1537 if (strsrch->preceding(0, status) != USEARCH_DONE) {
1541 delete strsrch;
1550 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
1554 if (strsrch != NULL) {
1555 delete strsrch;
1559 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_ON, status);
1560 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
1561 strsrch->setOffset(9, status);
1566 strsrch->reset();
1567 if (strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_OFF ||
1568 strsrch->getAttribute(USEARCH_CANONICAL_MATCH) != USEARCH_OFF ||
1569 strsrch->getOffset() != 0 || strsrch->getMatchedLength() != 0 ||
1570 strsrch->getMatchedStart() != USEARCH_DONE) {
1573 strsrch->previous(status);
1574 if (strsrch->getMatchedStart() != 7 ||
1575 strsrch->getMatchedLength() != 1) {
1579 delete strsrch;
1608 StringSearch *strsrch = new StringSearch(pattern, text, collator, NULL,
1620 strsrch->setText(text, status);
1621 strsrch->setPattern(pattern, status);
1622 if (!assertEqualWithStringSearch(strsrch, &CONTRACTION[count])) {
1627 delete strsrch;
1648 StringSearch *strsrch = new StringSearch(pattern, text, collator, NULL,
1661 strsrch->setText(text, status);
1662 strsrch->setPattern(pattern, status);
1663 if (!assertEqualWithStringSearch(strsrch, &IGNORABLE[count])) {
1668 delete strsrch;
1678 StringSearch *strsrch = NULL;
1689 strsrch = new StringSearch(pattern, text, coll, getBreakIterator(search->breaker), status);
1698 strsrch->setText(text, status);
1699 strsrch->setPattern(pattern, status);
1700 if (!assertEqualWithStringSearch(strsrch, search)) {
1704 delete strsrch;
1767 StringSearch *strsrch = new StringSearch(pattern, text, collator,
1773 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
1775 strsrch->getBreakIterator() != breaker) {
1777 delete strsrch;
1780 if (!assertEqualWithStringSearch(strsrch, search)) {
1782 delete strsrch;
1791 breaker->setText(strsrch->getText());
1792 strsrch->setBreakIterator(breaker, status);
1793 if (U_FAILURE(status) || strsrch->getBreakIterator() != breaker) {
1795 delete strsrch;
1798 strsrch->reset();
1799 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
1800 if (!assertEqualWithStringSearch(strsrch, search)) {
1804 delete strsrch;
1870 StringSearch *strsrch = new StringSearch(pattern, text, collator,
1872 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
1873 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_ON, status);
1875 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_ON) {
1878 if (!assertEqualWithStringSearch(strsrch, search)) {
1879 delete strsrch;
1883 strsrch->setAttribute(USEARCH_OVERLAP, USEARCH_OFF, status);
1885 strsrch->getAttribute(USEARCH_OVERLAP) != USEARCH_OFF) {
1888 strsrch->reset();
1889 if (!assertEqualWithStringSearch(strsrch, search)) {
1890 delete strsrch;
1895 delete strsrch;
1911 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_,
1913 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
1917 if (!assertEqualWithStringSearch(strsrch, &COLLATORCANONICAL[0])) {
1918 delete strsrch;
1933 strsrch->setCollator(tailored, status);
1934 if (U_FAILURE(status) || *(strsrch->getCollator()) != *tailored) {
1937 strsrch->reset();
1938 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
1939 if (!assertEqualWithStringSearch(strsrch, &COLLATORCANONICAL[1])) {
1940 delete strsrch;
1948 strsrch->setCollator(m_en_us_, status);
1949 strsrch->reset();
1950 if (U_FAILURE(status) || *(strsrch->getCollator()) != *m_en_us_) {
1953 if (!assertEqualWithStringSearch(strsrch, &COLLATORCANONICAL[0])) {
1955 delete strsrch;
1977 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
1979 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
1984 if (pattern != strsrch->getPattern()) {
1987 if (!assertEqualWithStringSearch(strsrch, &PATTERNCANONICAL[0])) {
1993 strsrch->setPattern(pattern, status);
1994 if (pattern != strsrch->getPattern()) {
1998 strsrch->reset();
1999 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
2003 if (!assertEqualWithStringSearch(strsrch, &PATTERNCANONICAL[1])) {
2009 strsrch->setPattern(pattern, status);
2010 if (pattern != strsrch->getPattern()) {
2014 strsrch->reset();
2015 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
2019 if (!assertEqualWithStringSearch(strsrch, &PATTERNCANONICAL[0])) {
2024 if (strsrch != NULL) {
2025 delete strsrch;
2040 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
2042 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
2048 if (text != strsrch->getText()) {
2051 if (!assertEqualWithStringSearch(strsrch, &TEXTCANONICAL[0])) {
2057 strsrch->setText(text, status);
2058 if (text != strsrch->getText()) {
2065 if (!assertEqualWithStringSearch(strsrch, &TEXTCANONICAL[1])) {
2071 strsrch->setText(text, status);
2072 if (text != strsrch->getText()) {
2079 if (!assertEqualWithStringSearch(strsrch, &TEXTCANONICAL[0])) {
2083 if (strsrch != NULL) {
2084 delete strsrch;
2106 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
2108 Collator *collator = strsrch->getCollator();
2112 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
2114 strsrch->setOffset(-1, status);
2118 strsrch->setOffset(128, status);
2137 strsrch->setText(text, status);
2139 strsrch->setPattern(pattern, status);
2145 strsrch->next(status);
2146 if (matchindex != strsrch->getMatchedStart() ||
2147 matchlength != strsrch->getMatchedLength()) {
2148 char *str = toCharString(strsrch->getText());
2150 str = toCharString(strsrch->getPattern());
2153 strsrch->getMatchedStart(),
2154 strsrch->getMatchedLength());
2160 strsrch->setOffset(search.offset[count + 1] + 1, status);
2161 if (strsrch->getOffset() != search.offset[count + 1] + 1) {
2169 strsrch->next(status);
2170 if (strsrch->getMatchedStart() != USEARCH_DONE) {
2171 char *str = toCharString(strsrch->getText());
2173 str = toCharString(strsrch->getPattern());
2175 errln("Error match found at %d %d", strsrch->getMatchedStart(),
2176 strsrch->getMatchedLength());
2183 delete strsrch;
2213 StringSearch *strsrch = new StringSearch(pattern, text, collator, NULL,
2215 strsrch->setAttribute(USEARCH_CANONICAL_MATCH, USEARCH_ON, status);
2226 strsrch->setText(text, status);
2227 strsrch->setPattern(pattern, status);
2228 if (!assertEqualWithStringSearch(strsrch,
2234 delete strsrch;
2247 StringSearch *strsrch = new StringSearch(pattern, text, m_en_us_, NULL,
2249 id = *((char *)strsrch->getDynamicClassID());
2253 delete strsrch;