libime
Public Member Functions | List of all members
libime::PinyinPrediction Class Reference

This is a prediction class that allows to predict against both model and pinyin dictionary. More...

#include <libime/pinyin/pinyinprediction.h>

Inheritance diagram for libime::PinyinPrediction:
Inheritance graph
[legend]
Collaboration diagram for libime::PinyinPrediction:
Collaboration graph
[legend]

Public Member Functions

void setPinyinDictionary (const PinyinDictionary *dict)
 Set the pinyin dictionary used for prediction.
 
std::vector< std::pair< std::string, PinyinPredictionSource > > predict (const State &state, const std::vector< std::string > &sentence, std::string_view lastEncodedPinyin, size_t maxSize=0)
 Predict from model and pinyin dictionary for the last sentnce being type.
 
std::vector< std::pair< std::string, PinyinPredictionSource > > predict (const State &state, const std::vector< libime::HistoryBigram::WordWithCode > &sentence, size_t maxSize=0)
 Predict from model and pinyin dictionary for the last sentnce being type. More...
 
std::vector< std::string > predict (const std::vector< std::string > &sentence={}, size_t maxSize=0)
 Same as the Prediction::predict with the same signature.
 
- Public Member Functions inherited from libime::Prediction
void setUserLanguageModel (const UserLanguageModel *lm)
 
void setLanguageModel (const LanguageModel *model)
 
const LanguageModelmodel () const
 
void setHistoryBigram (const HistoryBigram *bigram)
 
const HistoryBigramhistoryBigram () const
 
std::vector< std::string > predict (const State &state, const std::vector< std::string > &sentence={}, size_t maxSize=0)
 
std::vector< std::string > predict (const std::vector< std::string > &sentence={}, size_t maxSize=0)
 
std::vector< std::pair< std::string, float > > predictWithScore (const State &state, const std::vector< std::string > &sentence, size_t maxSize)
 

Detailed Description

This is a prediction class that allows to predict against both model and pinyin dictionary.

Definition at line 32 of file pinyinprediction.h.

Member Function Documentation

◆ predict()

std::vector< std::pair< std::string, PinyinPredictionSource > > libime::PinyinPrediction::predict ( const State &  state,
const std::vector< libime::HistoryBigram::WordWithCode > &  sentence,
size_t  maxSize = 0 
)

Predict from model and pinyin dictionary for the last sentnce being type.

Since
1.1.14

Definition at line 144 of file pinyinprediction.cpp.


The documentation for this class was generated from the following files: