Example #1
0
 std::vector<std::string> english::get_word_transcription(const item& word) const
 {
   std::vector<std::string> transcription;
   const std::string& name=word.get("name").as<std::string>();
   std::vector<utf8::uint32_t> chars(str::utf8_string_begin(name),str::utf8_string_end(name));
   if(word.has_feature("lseq"))
     lseq_fst.translate(chars.begin(),chars.end(),std::back_inserter(transcription));
   else
     {
       if(!cmulex_fst.translate(chars.begin(),chars.end(),std::back_inserter(transcription)))
         cmulex_lts.apply(chars.begin(),chars.end(),std::back_inserter(transcription));
     }
   return transcription;
 }
Example #2
0
 word_event(const item& token)
 {
   text_start=token.get("position").as<std::size_t>();
   text_length=token.get("length").as<std::size_t>();
 }