コード例 #1
0
void IndexBuilderAppRunner::buildIndex()
{
    try
    {
        cout << _T("Begin build index, config file: ") << m_sConfFile << endl;
        TimeProbe p;
        p.start();
        ProgressObserverPtr pOb(new ConsoleProgressObserver(1000));
        FX_NS(collection)::Collection::buildIndex(m_sConfFile, pOb);
        p.stop();
        cout << _T("Build index success! finished in ") << p.elapsedSeconds() 
             << _T(" s.") << endl;
    }
    catch(const FirteXException& fe)
    {
        cout << _T("Build index FAILED: ") << fe.what() << endl;
    }
}
コード例 #2
0
void LexiconBuilderAppRunner::buildLexicon()
{
    try
    {
        cout << "Begin build lexicon, source file: " << m_sSourceFile << endl
             << ", target file: " << m_sTargetFile << endl;

        TimeProbe p;
        DoubleArrayTrie trie(100000);
        trie.buildFromFile(m_sSourceFile);
        trie.save(m_sTargetFile);

        cout << _T("Build lexicon success! finished in ") << p.elapsedSeconds()
             << _T(" s.") << endl;
    }
    catch(const FirteXException& fe)
    {
        cout << _T("Build lexicon FAILED: ") << fe.what() << endl;
    }
}