- case yaz_snowball: {
- int length;
- struct icu_buf_utf8 *utf8_buf = icu_buf_utf8_create(0);
- icu_utf16_to_utf8(utf8_buf, src, status);
- if (*status == U_ZERO_ERROR) {
- const char *sb_symbol = sb_stemmer_stem(stemmer->sb_stemmer, icu_buf_utf8_to_cstr(utf8_buf), length);
- if (sb_symbol == 0) {
- icu_buf_utf16_copy(dst, src);
- }
- else {
- icu_utf16_from_utf8_cstr(dst, sb_symbol, status);
+ case yaz_snowball: {
+ struct icu_buf_utf8 *utf8_buf = icu_buf_utf8_create(0);
+ icu_utf16_to_utf8(utf8_buf, src, status);
+ if (*status == U_ZERO_ERROR) {
+ const sb_symbol *cstr = (const sb_symbol*) icu_buf_utf8_to_cstr(utf8_buf);
+ const sb_symbol *sb_symbol = sb_stemmer_stem(stemmer->sb_stemmer, cstr, utf8_buf->utf8_len);
+ if (sb_symbol == 0) {
+ icu_buf_utf16_copy(dst, src);
+ }
+ else {
+
+ const char *cstr2 = (const char *) sb_symbol;
+ icu_utf16_from_utf8_cstr(dst, cstr2 , status);
+#if 0
+ yaz_log(YLOG_DEBUG, "stemming %s to %s ", cstr, cstr2);
+#endif
+ }