wordID_t Vocab::GetWordID(const std::string& word_str) { FactorList factors; factors.push_back(0); Word word; word.CreateFromString(Input, factors, word_str, false); return GetWordID(word); }
// get wordID_t index for word represented as string wordID_t Vocab::GetWordID(const std::string& word_str, const FactorDirection& direction, const FactorList& factors, bool isNonTerminal) { // get id for factored string Word word; word.CreateFromString( direction, factors, word_str, isNonTerminal); return GetWordID( word); }
//--------------------------------------------------------------------------- // 単語ID取得 // 戻り値 : 1オリジン、見つからなければ0を返す TWordID TNS_KawariDictionary::GetWordID(const string& word) const { TKawariCode_base *code=StringToCode(word); TWordID id=GetWordID(code); delete code; return(id); }