MeCab
Public Member Functions | Static Public Member Functions | List of all members
MeCab::Model Class Referenceabstract

Model class. More...

#include <mecab.h>

Public Member Functions

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

Static Public Member Functions

static const char * version ()
 Return a version string. More...
 
static Modelcreate (int argc, char **argv)
 Factory method to create a new Model with a specified main's argc/argv-style parameters. More...
 
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". More...
 

Detailed Description

Model class.

Constructor & Destructor Documentation

◆ ~Model()

virtual MeCab::Model::~Model ( )
inlinevirtual

Member Function Documentation

◆ create() [1/2]

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.

◆ create() [2/2]

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

◆ createLattice()

virtual Lattice* MeCab::Model::createLattice ( ) const
pure virtual

Create a new Lattice object.

Returns
new Lattice object

◆ createTagger()

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

◆ dictionary_info()

virtual const DictionaryInfo* MeCab::Model::dictionary_info ( ) const
pure virtual

Return DictionaryInfo linked list.

Returns
DictionaryInfo linked list

◆ lookup()

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.

◆ swap()

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 explicitly before swapping model object.

Returns
boolean
Parameters
modelnew model which is going to be swapped with the current model.

◆ transition_cost()

virtual int MeCab::Model::transition_cost ( unsigned short  rcAttr,
unsigned short  lcAttr 
) const
pure virtual

Return transition cost from rcAttr to lcAttr.

Returns
transition cost

◆ version()

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: