41 const string& preceding_text);
44 const string& preceding_text,
46 double cutoff_threshold);
48 template <
class TranslatorT>
52 TranslatorT* translator) {
53 if (!translator->contextual_suggestions() || !grammar_) {
56 auto preceding_text = translator->GetPrecedingText(start);
57 if (preceding_text.empty()) {
65 template <
class Strategy>
68 const string& preceding_text);
std::shared_ptr< T > an
Definition common.h:60
map< int, map< int, DictEntryList > > WordGraph
Definition poet.h:20
std::unique_ptr< T > the
Definition common.h:58
an< T > New(Args &&... args)
Definition common.h:77
Definition config_component.h:21
static bool CompareWeight(const Line &one, const Line &other)
Definition poet.cc:88
an< Sentence > MakeSentence(const WordGraph &graph, size_t total_length, const string &preceding_text)
Definition poet.cc:246
an< Translation > ContextualWeighted(an< Translation > translation, const string &input, size_t start, TranslatorT *translator)
Definition poet.h:49
static bool LeftAssociateCompare(const Line &one, const Line &other)
Definition poet.cc:93
function< bool(const Line &, const Line &)> Compare
Definition poet.h:29
Poet(const Language *language, Config *config, Compare compare=CompareWeight)
Definition poet.cc:81
deque< an< Sentence > > MakeSentences(const WordGraph &graph, size_t total_length, const string &preceding_text, size_t count, double cutoff_threshold)
Definition poet.cc:258