+struct icu_tokenizer *icu_tokenizer_clone(struct icu_tokenizer *old)
+{
+ int32_t bufferSize = U_BRK_SAFECLONE_BUFFERSIZE;
+ UErrorCode status = U_ZERO_ERROR;
+ struct icu_tokenizer * tokenizer
+ = (struct icu_tokenizer *) xmalloc(sizeof(struct icu_tokenizer));
+
+ assert(old);
+ icu_tokenizer_reset(tokenizer, old->action);
+ assert(old->bi);
+ tokenizer->bi = ubrk_safeClone(old->bi, NULL, &bufferSize, &status);
+ if (U_SUCCESS(status))
+ return tokenizer;
+ return tokenizer;
+}
+
+struct icu_tokenizer *icu_tokenizer_create(const char *locale, char action,
+ UErrorCode *status)
+{
+ struct icu_tokenizer *tokenizer
+ = (struct icu_tokenizer *) xmalloc(sizeof(struct icu_tokenizer));
+
+ icu_tokenizer_reset(tokenizer, action);