Lines Matching refs:collator
60 log_err_status(*status, "Error opening collator\n");
157 * Getting the collator
159 static UCollator *getCollator(const char *collator)
161 if (collator == NULL) {
164 if (strcmp(collator, "fr") == 0) {
167 else if (strcmp(collator, "de") == 0) {
170 else if (strcmp(collator, "es") == 0) {
261 log_data_err("Opening collator failed.\n");
286 log_data_err("Opening collator failed.\n");
547 UCollator *collator = getCollator(search.collator);
555 ucol_setStrength(collator, search.strength);
556 strsrch = usearch_openFromCollator(pattern, -1, text, -1, collator,
564 ucol_setStrength(collator, UCOL_TERTIARY);
568 ucol_setStrength(collator, UCOL_TERTIARY);
578 UCollator *collator = getCollator(search.collator);
586 ucol_setStrength(collator, search.strength);
587 ucol_setAttribute(collator, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
588 strsrch = usearch_openFromCollator(pattern, -1, text, -1, collator,
599 ucol_setStrength(collator, UCOL_TERTIARY);
606 ucol_setAttribute(collator, UCOL_NORMALIZATION_MODE, UCOL_OFF, &status);
607 ucol_setStrength(collator, UCOL_TERTIARY);
619 UCollator *collator = getCollator(search.collator);
626 ucol_setStrength(collator, search.strength);
627 strsrch = usearch_openFromCollator(pattern, -1, text, -1, collator,
639 ucol_setStrength(collator, UCOL_TERTIARY);
643 ucol_setStrength(collator, UCOL_TERTIARY);
775 UCollator *collator = getCollator(search->collator);
780 ucol_setStrength(collator, search->strength);
782 strsrch = usearch_openFromCollator(pattern, -1, text, -1, collator,
792 ucol_setStrength(collator, UCOL_TERTIARY);
882 UCollator *collator = getCollator(search->collator);
888 strsrch = usearch_openFromCollator(pattern, -1, text, -1, collator,
926 /* test collator that thinks "o" and "p" are the same thing */
963 log_err("Expected NULL collator from NULL string search\n");
965 u_unescape(COLLATOR[0].text, text, 128);
966 u_unescape(COLLATOR[0].pattern, pattern, 32);
973 if (!assertEqualWithUStringSearch(strsrch, COLLATOR[0])) {
978 tailored = ucol_openRules(rules, -1, UCOL_ON, COLLATOR[1].strength,
981 log_err("Error opening rule based collator %s\n", u_errorName(status));
986 log_err("Error setting rule based collator\n");
989 if (!assertEqualWithUStringSearch(strsrch, COLLATOR[1])) {
996 log_err("Error setting rule based collator\n");
998 if (!assertEqualWithUStringSearch(strsrch, COLLATOR[0])) {
1655 UCollator *collator;
1664 collator = ucol_openRules(rules, u_strlen(rules), UCOL_ON,
1670 log_err("Error opening collator %s\n", u_errorName(status));
1673 strsrch = usearch_openFromCollator(pattern, 1, text, 1, collator, NULL,
1690 ucol_close(collator);
1698 UCollator *collator;
1708 collator = ucol_openRules(rules, u_strlen(rules), UCOL_ON,
1714 log_err("Error opening collator %s\n", u_errorName(status));
1717 strsrch = usearch_openFromCollator(pattern, 1, text, 1, collator, NULL,
1734 ucol_close(collator);
1758 if (search.collator != NULL) {
1759 coll = ucol_openFromShortString(search.collator, FALSE, NULL, &status);
1766 log_err("Error opening string search collator(\"%s\") %s\n", search.collator, u_errorName(status));
1772 log_err("Error setting string search collator %s\n", u_errorName(status));
1865 UCollator *collator = getCollator(search->collator);
1871 ucol_setStrength(collator, search->strength);
1873 strsrch = usearch_openFromCollator(pattern, -1, text, -1, collator,
1891 ucol_setStrength(collator, UCOL_TERTIARY);
1983 UCollator *collator = getCollator(search->collator);
1989 strsrch = usearch_openFromCollator(pattern, -1, text, -1, collator,
2029 /* test collator that thinks "o" and "p" are the same thing */
2067 log_err("Error opening rule based collator %s\n", u_errorName(status));
2072 log_err("Error setting rule based collator\n");
2086 log_err("Error setting rule based collator\n");
2269 UCollator *collator;
2282 collator = usearch_getCollator(strsrch);
2283 ucol_setAttribute(collator, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
2355 ucol_setAttribute(collator, UCOL_NORMALIZATION_MODE, UCOL_OFF, &status);
2383 UCollator *collator = NULL;
2392 collator = ucol_openRules(rules, u_strlen(rules), UCOL_ON,
2398 log_err("Error opening collator %s\n", u_errorName(status));
2401 strsrch = usearch_openFromCollator(pattern, 1, text, 1, collator, NULL,
2421 ucol_close(collator);
2445 log_err("Expected U_UNSUPPORTED_ERROR when trying to instantiate a search object from a CODAN collator, got %s instead\n", u_errorName(status));
2558 /* create a US-English collator */
2615 /* create a US-English collator */