mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-07 12:10:36 +03:00
8987fed667
- Add Vocabulary factory and the unit test. - Remove Scorer::ClearVocabulary().
22 lines
383 B
C++
22 lines
383 B
C++
#include "Vocabulary.h"
|
|
#include "Singleton.h"
|
|
|
|
namespace mert {
|
|
namespace {
|
|
Vocabulary* g_vocab = NULL;
|
|
} // namespace
|
|
|
|
Vocabulary* VocabularyFactory::GetVocabulary() {
|
|
if (g_vocab == NULL) {
|
|
return Singleton<Vocabulary>::GetInstance();
|
|
} else {
|
|
return g_vocab;
|
|
}
|
|
}
|
|
|
|
void VocabularyFactory::SetVocabulary(Vocabulary* vocab) {
|
|
g_vocab = vocab;
|
|
}
|
|
|
|
} // namespace mert
|