MeCab
Public Member Functions | Static Public Member Functions
MeCab::Model Class Reference

Model class. More...

#include <mecab.h>

List of all members.

Public Member Functions

virtual const DictionaryInfodictionary_info () const =0
 Return DictionaryInfo linked list.
virtual int transition_cost (unsigned short rcAttr, unsigned short lcAttr) const =0
 Return transtion cost from rcAttr to lcAttr.
virtual Nodelookup (const char *begin, const char *end, Lattice *lattice) const =0
 perform common prefix search from the range [begin, end).
virtual TaggercreateTagger () const =0
 Create a new Tagger object.
virtual LatticecreateLattice () const =0
 Create a new Lattice object.
virtual bool swap (Model *model)=0
 Swap the instance with |model|.
virtual ~Model ()

Static Public Member Functions

static const char * version ()
 Return a version string.
static Modelcreate (int argc, char **argv)
 Factory method to create a new Model with a specified main's argc/argv-style parameters.
static Modelcreate (const char *arg)
 Factory method to create a new Model with a string parameter representation, i.e., "-d /user/local/mecab/dic/ipadic -Ochasen".

Detailed Description

Model class.


Constructor & Destructor Documentation

virtual MeCab::Model::~Model ( ) [inline, virtual]

Member Function Documentation

static Model* MeCab::Model::create ( int  argc,
char **  argv 
) [static]

Factory method to create a new Model with a specified main's argc/argv-style parameters.

Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the cause of the errors.

Returns:
new Model object
Parameters:
argcnumber of parameters
argvparameter list
static Model* MeCab::Model::create ( const char *  arg) [static]

Factory method to create a new Model with a string parameter representation, i.e., "-d /user/local/mecab/dic/ipadic -Ochasen".

Return NULL if new model cannot be initialized. Use MeCab::getLastError() to obtain the cause of the errors.

Returns:
new Model object
Parameters:
argsingle string representation of the argment.
virtual Lattice* MeCab::Model::createLattice ( ) const [pure virtual]

Create a new Lattice object.

Returns:
new Lattice object
virtual Tagger* MeCab::Model::createTagger ( ) const [pure virtual]

Create a new Tagger object.

All returned tagger object shares this model object as a parsing model. Never delete this model object before deleting tagger object.

Returns:
new Tagger object
virtual const DictionaryInfo* MeCab::Model::dictionary_info ( ) const [pure virtual]

Return DictionaryInfo linked list.

Returns:
DictionaryInfo linked list
virtual Node* MeCab::Model::lookup ( const char *  begin,
const char *  end,
Lattice lattice 
) const [pure virtual]

perform common prefix search from the range [begin, end).

|lattice| takes the ownership of return value.

Returns:
node linked list.
virtual bool MeCab::Model::swap ( Model model) [pure virtual]

Swap the instance with |model|.

The ownership of |model| always moves to this instance, meaning that passed |model| will no longer be accessible after calling this method. return true if new model is swapped successfully. This method is thread safe. All taggers created by Model::createTagger() method will also be updated asynchronously. No need to stop the parsing thread excplicitly before swapping model object.

Returns:
boolean
Parameters:
modelnew model which is going to be swapped with the current model.
virtual int MeCab::Model::transition_cost ( unsigned short  rcAttr,
unsigned short  lcAttr 
) const [pure virtual]

Return transtion cost from rcAttr to lcAttr.

Returns:
transtion cost
static const char* MeCab::Model::version ( ) [static]

Return a version string.

Returns:
version string

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