mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
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
|