Пример #1
0
	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);
  }
Пример #2
0
// 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);
}
Пример #3
0
//---------------------------------------------------------------------------
// 単語ID取得
// 戻り値 : 1オリジン、見つからなければ0を返す
TWordID TNS_KawariDictionary::GetWordID(const string& word) const
{
	TKawariCode_base *code=StringToCode(word);
	TWordID id=GetWordID(code);
	delete code;

	return(id);
}