Exemplo n.º 1
0
void PhraseDictionaryMultiModelCounts::Load()
{
  SetFeaturesToApply();
  for(size_t i = 0; i < m_numModels; ++i) {

    // phrase table
    const string &ptName = m_pdStr[i];

    PhraseDictionary *pt;
    pt = FindPhraseDictionary(ptName);
    CHECK(pt);
    m_pd.push_back(pt);

    // reverse
    const string &target_table = m_targetTable[i];
    pt = FindPhraseDictionary(target_table);
    CHECK(pt);
    m_inverse_pd.push_back(pt);

    // lex
    string lex_e2f = m_lexE2FStr[i];
    string lex_f2e = m_lexF2EStr[i];
    lexicalTable* e2f = new lexicalTable;
    LoadLexicalTable(lex_e2f, e2f);
    lexicalTable* f2e = new lexicalTable;
    LoadLexicalTable(lex_f2e, f2e);

    m_lexTable_e2f.push_back(e2f);
    m_lexTable_f2e.push_back(f2e);

  }

}
void PhraseDictionaryMultiModel::Load()
{
  SetFeaturesToApply();

  for(size_t i = 0; i < m_numModels; ++i) {
    const string &ptName = m_pdStr[i];

    PhraseDictionary *pt = FindPhraseDictionary(ptName);
    UTIL_THROW_IF2(pt == NULL,
                   "Could not find component phrase table " << ptName);
    m_pd.push_back(pt);
  }
}