1 // MeCab -- Yet Another Part-of-Speech and Morphological Analyzer
4 // Copyright(C) 2001-2006 Taku Kudo <taku@chasen.org>
5 // Copyright(C) 2004-2006 Nippon Telegraph and Telephone Corporation
6 #ifndef MECAB_VITERBI_H_
7 #define MECAB_VITERBI_H_
18 template <typename N, typename P> class Tokenizer;
22 bool open(const Param ¶m);
24 bool analyze(Lattice *lattice) const;
26 const Tokenizer<Node, Path> *tokenizer() const;
28 const Connector *connector() const;
30 const char *what() { return what_.str(); }
32 static bool buildResultForNBest(Lattice *lattice);
38 template <bool IsAllPath, bool IsPartial> bool viterbi(Lattice *lattice) const;
40 static bool forwardbackward(Lattice *lattice);
41 static bool initPartial(Lattice *lattice);
42 static bool initNBest(Lattice *lattice);
43 static bool buildBestLattice(Lattice *lattice);
44 static bool buildAllLattice(Lattice *lattice);
45 static bool buildAlternative(Lattice *lattice);
47 scoped_ptr<Tokenizer<Node, Path> > tokenizer_;
48 scoped_ptr<Connector> connector_;
53 #endif // MECAB_VITERBI_H_