/* * call-seq: * HyphenFilter.new(token_stream) -> token_stream * * Create an HyphenFilter which filters hyphenated words. The way it works is * by adding both the word concatenated into a single word and split into * multiple words. ie "e-mail" becomes "email" and "e mail". This way a * search for "e-mail", "email" and "mail" will all match. This filter is * used by default by the StandardAnalyzer. */ static VALUE frb_hyphen_filter_init(VALUE self, VALUE rsub_ts) { TokenStream *ts = frb_get_cwrapped_rts(rsub_ts); ts = hyphen_filter_new(ts); object_add(&(TkFilt(ts)->sub_ts), rsub_ts); Frt_Wrap_Struct(self, &frb_tf_mark, &frb_tf_free, ts); object_add(ts, self); return self; }