MeCab
|
#include <mecab.h>
Public Member Functions | |
virtual bool | parse (Lattice *lattice) const =0 |
Parse lattice object. More... | |
virtual const char * | parse (const char *str)=0 |
Parse given sentence and return parsed result as string. More... | |
virtual const Node * | parseToNode (const char *str)=0 |
Parse given sentence and return Node object. More... | |
virtual const char * | parseNBest (size_t N, const char *str)=0 |
Parse given sentence and obtain N-best results as a string format. More... | |
virtual bool | parseNBestInit (const char *str)=0 |
Initialize N-best enumeration with a sentence. More... | |
virtual const Node * | nextNode ()=0 |
Return next-best parsed result. More... | |
virtual const char * | next ()=0 |
Return next-best parsed result. More... | |
virtual const char * | formatNode (const Node *node)=0 |
Return formatted node object. More... | |
virtual const char * | parse (const char *str, size_t len, char *ostr, size_t olen)=0 |
The same as parse() method, but input length and output buffer are passed. More... | |
virtual const char * | parse (const char *str, size_t len)=0 |
The same as parse() method, but input length can be passed. More... | |
virtual const Node * | parseToNode (const char *str, size_t len)=0 |
The same as parseToNode(), but input lenth can be passed. More... | |
virtual const char * | parseNBest (size_t N, const char *str, size_t len)=0 |
The same as parseNBest(), but input length can be passed. More... | |
virtual bool | parseNBestInit (const char *str, size_t len)=0 |
The same as parseNBestInit(), but input length can be passed. More... | |
virtual const char * | next (char *ostr, size_t olen)=0 |
The same as next(), but output buffer can be passed. More... | |
virtual const char * | parseNBest (size_t N, const char *str, size_t len, char *ostr, size_t olen)=0 |
The same as parseNBest(), but input length and output buffer can be passed. More... | |
virtual const char * | formatNode (const Node *node, char *ostr, size_t olen)=0 |
The same as formatNode(), but output buffer can be passed. More... | |
virtual void | set_request_type (int request_type)=0 |
Set request type. More... | |
virtual int | request_type () const =0 |
Return the current request type. More... | |
virtual bool | partial () const =0 |
Return true if partial parsing mode is on. More... | |
virtual void | set_partial (bool partial)=0 |
set partial parsing mode. More... | |
virtual int | lattice_level () const =0 |
Return lattice level. More... | |
virtual void | set_lattice_level (int level)=0 |
Set lattice level. More... | |
virtual bool | all_morphs () const =0 |
Return true if all morphs output mode is on. More... | |
virtual void | set_all_morphs (bool all_morphs)=0 |
set all-morphs output mode. More... | |
virtual void | set_theta (float theta)=0 |
Set temparature parameter theta. More... | |
virtual float | theta () const =0 |
Return temparature parameter theta. More... | |
virtual const DictionaryInfo * | dictionary_info () const =0 |
Return DictionaryInfo linked list. More... | |
virtual const char * | what () const =0 |
Return error string. More... | |
virtual | ~Tagger () |
Static Public Member Functions | |
static bool | parse (const Model &model, Lattice *lattice) |
Handy static method. More... | |
static Tagger * | create (int argc, char **argv) |
Factory method to create a new Tagger with a specified main's argc/argv-style parameters. More... | |
static Tagger * | create (const char *arg) |
Factory method to create a new Tagger with a string parameter representation, i.e., "-d /user/local/mecab/dic/ipadic -Ochasen". More... | |
static const char * | version () |
Return a version string. More... | |
Tagger class.
|
inlinevirtual |
|
pure virtual |
Return true if all morphs output mode is on.
This method is DEPRECATED. Use Lattice::has_request_type(MECAB_ALL_MORPHS).
|
static |
Factory method to create a new Tagger 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.
arg | single string representation of the argment. |
|
static |
Factory method to create a new Tagger 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.
argc | number of parameters |
argv | parameter list |
|
pure virtual |
Return DictionaryInfo linked list.
|
pure virtual |
Return formatted node object.
The format is specified with –unk-format, –bos-format, –eos-format, and –eon-format respectively. You should not delete the returned string. The returned buffer is overwritten when parse method is called again. This method is NOT thread safe. This method is DEPRECATED. Use Lattice class.
node | node object. |
|
pure virtual |
The same as formatNode(), but output buffer can be passed.
Return NULL if more than |olen| buffer is required to store output string.
node | node object |
ostr | output buffer |
olen | output buffer length |
|
pure virtual |
Return lattice level.
This method is DEPRECATED. Use Lattice::*_request_type()
|
pure virtual |
Return next-best parsed result.
You must call parseNBestInit() in advance. Return NULL if no more reuslt is available. This method is NOT thread safe. This method is DEPRECATED. Use Lattice class.
|
pure virtual |
The same as next(), but output buffer can be passed.
Return NULL if more than |olen| buffer is required to store output string.
ostr | output buffer |
olen | output buffer length |
|
pure virtual |
Return next-best parsed result.
You must call parseNBestInit() in advance. Return NULL if no more reuslt is available. This method is NOT thread safe. This method is DEPRECATED. Use Lattice class.
|
pure virtual |
Parse given sentence and return parsed result as string.
You should not delete the returned string. The returned buffer is overwritten when parse method is called again. This method is NOT thread safe.
str | sentence |
|
pure virtual |
The same as parse() method, but input length can be passed.
str | sentence |
len | sentence length |
|
pure virtual |
The same as parse() method, but input length and output buffer are passed.
Return parsed result as string. The result pointer is the same as |ostr|. Return NULL, if parsed result string cannot be stored within |olen| bytes.
str | sentence |
len | sentence length |
ostr | output buffer |
olen | output buffer length |
Handy static method.
Return true if lattice is parsed successfully. This function is equivalent to { Tagger *tagger = model.createModel(); const bool result = tagger->parse(lattice); delete tagger; return result; }
|
pure virtual |
|
pure virtual |
Parse given sentence and obtain N-best results as a string format.
Currently, N must be 1 <= N <= 512 due to the limitation of the buffer size. You should not delete the returned string. The returned buffer is overwritten when parse method is called again. This method is DEPRECATED. Use Lattice class.
N | how many results you want to obtain |
str | sentence |
|
pure virtual |
The same as parseNBest(), but input length can be passed.
N | how many results you want to obtain |
str | sentence |
len | sentence length |
|
pure virtual |
The same as parseNBest(), but input length and output buffer can be passed.
Return NULL if more than |olen| buffer is required to store output string.
N | how many results you want to obtain |
str | input sentence |
len | input sentence length |
ostr | output buffer |
olen | output buffer length |
|
pure virtual |
Initialize N-best enumeration with a sentence.
Return true if initialization finishes successfully. N-best result is obtained by calling next() or nextNode() in sequence. This method is NOT thread safe. This method is DEPRECATED. Use Lattice class.
str | sentence |
|
pure virtual |
The same as parseNBestInit(), but input length can be passed.
str | sentence |
len | sentence length |
|
pure virtual |
Parse given sentence and return Node object.
You should not delete the returned node object. The returned buffer is overwritten when parse method is called again. You can traverse all nodes via Node::next member. This method is NOT thread safe.
str | sentence |
|
pure virtual |
The same as parseToNode(), but input lenth can be passed.
str | sentence |
len | sentence length |
|
pure virtual |
Return true if partial parsing mode is on.
This method is DEPRECATED. Use Lattice::has_request_type(MECAB_PARTIAL).
|
pure virtual |
|
pure virtual |
set all-morphs output mode.
This method is DEPRECATED. Use Lattice::add_request_type(MECAB_ALL_MORPHS) or Lattice::remove_request_type(MECAB_ALL_MORPHS)
all_morphs |
|
pure virtual |
Set lattice level.
This method is DEPRECATED. Use Lattice::*_request_type()
level | lattice level |
|
pure virtual |
set partial parsing mode.
This method is DEPRECATED. Use Lattice::add_request_type(MECAB_PARTIAL) or Lattice::remove_request_type(MECAB_PARTIAL)
partial | partial mode |
|
pure virtual |
Set request type.
This method is DEPRECATED. Use Lattice::set_request_type(MECAB_PARTIAL).
request_type | new request type assigned |
|
pure virtual |
Set temparature parameter theta.
theta | temparature parameter. |
|
pure virtual |
Return temparature parameter theta.
|
static |
Return a version string.
|
pure virtual |
Return error string.