MeCab
|
#include <mecab.h>
Public Member Functions | |
virtual void | clear ()=0 |
Clear all internal lattice data. More... | |
virtual bool | is_available () const =0 |
Return true if result object is available. More... | |
virtual Node * | bos_node () const =0 |
Return bos (begin of sentence) node. More... | |
virtual Node * | eos_node () const =0 |
Return eos (end of sentence) node. More... | |
virtual Node ** | begin_nodes () const =0 |
This method is used internally. More... | |
virtual Node ** | end_nodes () const =0 |
This method is used internally. More... | |
virtual Node * | end_nodes (size_t pos) const =0 |
Return node linked list ending at |pos|. More... | |
virtual Node * | begin_nodes (size_t pos) const =0 |
Return node linked list starting at |pos|. More... | |
virtual const char * | sentence () const =0 |
Return sentence. More... | |
virtual void | set_sentence (const char *sentence)=0 |
Set sentence. More... | |
virtual void | set_sentence (const char *sentence, size_t len)=0 |
Set sentence. More... | |
virtual size_t | size () const =0 |
Return sentence size. More... | |
virtual void | set_Z (double Z)=0 |
Set normalization factor of CRF. More... | |
virtual double | Z () const =0 |
return normalization factor of CRF. More... | |
virtual void | set_theta (float theta)=0 |
Set temparature parameter theta. More... | |
virtual float | theta () const =0 |
Return temparature parameter theta. More... | |
virtual bool | next ()=0 |
Obtain next-best result. More... | |
virtual int | request_type () const =0 |
Return the current request type. More... | |
virtual bool | has_request_type (int request_type) const =0 |
Return true if the object has a specified request type. More... | |
virtual void | set_request_type (int request_type)=0 |
Set request type. More... | |
virtual void | add_request_type (int request_type)=0 |
Add request type. More... | |
virtual void | remove_request_type (int request_type)=0 |
Remove request type. More... | |
virtual Allocator< Node, Path > * | allocator () const =0 |
This method is used internally. More... | |
virtual Node * | newNode ()=0 |
Return new node. More... | |
virtual const char * | toString ()=0 |
Return string representation of the lattice. More... | |
virtual const char * | toString (const Node *node)=0 |
Return string representation of the node. More... | |
virtual const char * | enumNBestAsString (size_t N)=0 |
Return string representation of the N-best results. More... | |
virtual const char * | toString (char *buf, size_t size)=0 |
Return string representation of the lattice. More... | |
virtual const char * | toString (const Node *node, char *buf, size_t size)=0 |
Return string representation of the node. More... | |
virtual const char * | enumNBestAsString (size_t N, char *buf, size_t size)=0 |
Return string representation of the N-best result. More... | |
virtual bool | has_constraint () const =0 |
Returns true if any parsing constraint is set. More... | |
virtual int | boundary_constraint (size_t pos) const =0 |
Returns the boundary constraint at the position. More... | |
virtual const char * | feature_constraint (size_t pos) const =0 |
Returns the token constraint at the position. More... | |
virtual void | set_boundary_constraint (size_t pos, int boundary_constraint_type)=0 |
Set parsing constraint for partial parsing mode. More... | |
virtual void | set_feature_constraint (size_t begin_pos, size_t end_pos, const char *feature)=0 |
Set parsing constraint for partial parsing mode. More... | |
virtual void | set_result (const char *result)=0 |
Set golden parsing results for unittesting. More... | |
virtual const char * | what () const =0 |
Return error string. More... | |
virtual void | set_what (const char *str)=0 |
Set error string. More... | |
virtual | ~Lattice () |
Static Public Member Functions | |
static Lattice * | create () |
Create new Lattice object. More... | |
Lattice class.
|
inlinevirtual |
|
pure virtual |
Add request type.
request_type | new request type added |
This method is used internally.
|
pure virtual |
This method is used internally.
|
pure virtual |
Return node linked list starting at |pos|.
You can obtain all nodes via "for (const Node *node = lattice->begin_nodes(pos); node; node = node->bnext) {}"
pos | position of nodes. 0 <= pos < size() |
|
pure virtual |
Return bos (begin of sentence) node.
You can obtain all nodes via "for (const Node *node = lattice->bos_node(); node; node = node->next) {}"
|
pure virtual |
Returns the boundary constraint at the position.
pos | the position of constraint |
|
pure virtual |
Clear all internal lattice data.
|
static |
|
pure virtual |
This method is used internally.
|
pure virtual |
Return node linked list ending at |pos|.
You can obtain all nodes via "for (const Node *node = lattice->end_nodes(pos); node; node = node->enext) {}"
pos | position of nodes. 0 <= pos < size() |
|
pure virtual |
Return string representation of the N-best results.
Returned object is managed by this instance. When clear/set_sentence() method is called, the returned buffer is initialized.
N | how many results you want to obtain |
|
pure virtual |
Return string representation of the N-best result.
Result is saved in the specified.
N | how many results you want to obtain |
buf | output buffer |
size | output buffer size |
|
pure virtual |
Return eos (end of sentence) node.
|
pure virtual |
Returns the token constraint at the position.
pos | the beginning position of constraint. |
|
pure virtual |
Returns true if any parsing constraint is set.
|
pure virtual |
Return true if the object has a specified request type.
|
pure virtual |
Return true if result object is available.
|
pure virtual |
|
pure virtual |
Obtain next-best result.
The internal linked list structure is updated. You should set MECAB_NBEST reques_type in advance. Return false if no more results are available or request_type is invalid.
|
pure virtual |
Remove request type.
request_type | new request type removed |
|
pure virtual |
Return the current request type.
|
pure virtual |
Return sentence.
If MECAB_NBEST or MECAB_PARTIAL mode is off, the returned poiner is the same as the one set by set_sentence().
|
pure virtual |
Set parsing constraint for partial parsing mode.
pos | the position of the boundary |
boundary_constraint_type | the type of boundary |
|
pure virtual |
Set parsing constraint for partial parsing mode.
begin_pos | the starting position of the constrained token. |
end_pos | the the ending position of the constrained token. |
feature | the feature of the constrained token. |
|
pure virtual |
Set request type.
request_type | new request type assigned |
|
pure virtual |
Set golden parsing results for unittesting.
result | the parsing result written in the standard mecab output. |
|
pure virtual |
Set sentence.
This method does not take the ownership of the object.
sentence | sentence |
|
pure virtual |
Set sentence.
This method does not take the ownership of the object.
sentence | sentence |
len | length of the sentence |
|
pure virtual |
Set temparature parameter theta.
theta | temparature parameter. |
|
pure virtual |
Set error string.
given string is copied to the internal buffer.
str | new error string |
|
pure virtual |
Set normalization factor of CRF.
Z | new normalization factor. |
|
pure virtual |
Return sentence size.
|
pure virtual |
Return temparature parameter theta.
|
pure virtual |
Return string representation of the lattice.
Returned object is managed by this instance. When clear/set_sentence() method is called, the returned buffer is initialized.
|
pure virtual |
Return string representation of the lattice.
Result is saved in the specified buffer.
buf | output buffer |
size | output buffer size |
|
pure virtual |
Return string representation of the node.
Returned object is managed by this instance. When clear/set_sentence() method is called, the returned buffer is initialized.
node | node object |
|
pure virtual |
Return string representation of the node.
Result is saved in the specified buffer.
node | node object |
buf | output buffer |
size | output buffer size |
|
pure virtual |
Return error string.
|
pure virtual |
return normalization factor of CRF.