jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
Public Types | Public Member Functions | Private Attributes | List of all members
jubatus::core::fv_converter::string_feature_factory Class Reference

#include <string_feature_factory.hpp>

Collaboration diagram for jubatus::core::fv_converter::string_feature_factory:
Collaboration graph

Public Types

typedef jubatus::util::lang::function< string_feature *(const std::string &, const param_t &)> create_function
 

Public Member Functions

jubatus::util::lang::shared_ptr< string_featurecreate (const std::string &name, const param_t &params) const
 
 string_feature_factory ()
 
 string_feature_factory (const create_function &ext)
 

Private Attributes

create_function ext_
 

Detailed Description

Definition at line 31 of file string_feature_factory.hpp.

Member Typedef Documentation

typedef jubatus::util::lang::function< string_feature*(const std::string&, const param_t&)> jubatus::core::fv_converter::string_feature_factory::create_function

Definition at line 34 of file string_feature_factory.hpp.

Constructor & Destructor Documentation

jubatus::core::fv_converter::string_feature_factory::string_feature_factory ( )
inline

Definition at line 36 of file string_feature_factory.hpp.

36  {
37  }
jubatus::core::fv_converter::string_feature_factory::string_feature_factory ( const create_function ext)
inlineexplicit

Definition at line 39 of file string_feature_factory.hpp.

Member Function Documentation

shared_ptr< string_feature > jubatus::core::fv_converter::string_feature_factory::create ( const std::string &  name,
const param_t params 
) const

Definition at line 82 of file string_feature_factory.cpp.

References ext_, and JUBATUS_EXCEPTION.

84  {
85  string_feature* p;
86  if (name == "ngram") {
87  return create_character_ngram(params);
88  } else if (name == "regexp") {
89  return create_regexp(params);
90  } else if (ext_ && (p = ext_(name, params))) {
91  return shared_ptr<string_feature>(p);
92  } else {
93  throw JUBATUS_EXCEPTION(
94  converter_exception(std::string("unknown splitter name: ") + name));
95  }
96 }
#define JUBATUS_EXCEPTION(e)
Definition: exception.hpp:79

Member Data Documentation

create_function jubatus::core::fv_converter::string_feature_factory::ext_
private

Definition at line 46 of file string_feature_factory.hpp.

Referenced by create().


The documentation for this class was generated from the following files: