shared_ptr<string_feature> string_feature_factory::create(
    const std::string& name,
    const param_t& params) const {
  string_feature* p;
  if (name == "ngram") {
    return create_character_ngram(params);
  } else if (name == "regexp") {
    return create_regexp(params);
  } else if (ext_ && (p = ext_(name, params))) {
    return shared_ptr<string_feature>(p);
  } else {
    throw JUBATUS_EXCEPTION(
        converter_exception(std::string("unknown splitter name: ") + name));
  }
}
shared_ptr<num_filter> num_filter_factory::create(
    const std::string& name,
    const param_t& params) const {
  num_filter* p;
  if (name == "add") {
    return create_add_filter(params);
  } else if (name == "linear_normalization") {
    return create_linear_normalization_filter(params);
  } else if (name == "gaussian_normalization") {
    return create_gaussian_normalization_filter(params);
  } else if (name == "sigmoid_normalization") {
    return create_sigmoid_normalization_filter(params);
  } else if (ext_ && (p = ext_(name, params))) {
    return shared_ptr<num_filter>(p);
  } else {
    throw JUBATUS_EXCEPTION(
        converter_exception("unknonw num filter name: " + name));
  }
}