lux/lexer/mecab_ma.h

00001 #ifndef LUX_LEXER_MECABMA_H
00002 #define LUX_LEXER_MECABMA_H
00003 
00004 #include "term.h"
00005 #include "lux/scoped_ptr.h"
00006 #include <vector>
00007 #include <mecab.h>
00008 
00009 namespace Lux {
00010 
00011   typedef std::vector<Term> TokenContainer;
00012   typedef TokenContainer::iterator TCIterator;
00013 
00014   class LangUtil;
00015 
00016   class MecabMA {
00017 
00018   public:
00019     MecabMA();
00020     bool tokenize(const char *str);
00021     bool tokenize(const std::string &str);
00022     Term get_next_token();
00023     bool has_next();
00024     void init_iter();
00025     void clear();
00026   
00027   /* destructor must be called by a derived class */
00028   protected:
00029     ~MecabMA();
00030 
00031   private:
00032     TokenContainer tokens_;
00033     TCIterator tokens_iterator_;
00034     scoped_ptr<MeCab::Tagger> tagger_;
00035     scoped_ptr<Lux::LangUtil> lang_util_;
00036   };
00037 }
00038 
00039 #endif

Generated on Fri Feb 5 15:50:30 2010 for Lux by  doxygen 1.4.7