+typedef int (*MTextWordsegFunc) (MText *mt, int pos, int *from, int *to);
+
+int
+mtext__word_segment (MText *mt, int pos, int *from, int *to)
+{
+ int c = mtext_ref_char (mt, pos);
+ MTextWordsegFunc func
+ = (MTextWordsegFunc) mchartable_lookup (wordseg_func_table, c);
+
+ if (func)
+ return (func) (mt, pos, from, to);
+ *from = *to = pos;
+ return -1;
+}
+
+