diff options
author | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-10 02:05:00 +0300 |
---|---|---|
committer | Ulrich Germann <Ulrich.Germann@gmail.com> | 2015-12-10 02:05:00 +0300 |
commit | 240b88c6834c9c94e8a6448a34dc4ad33bdf3fbd (patch) | |
tree | e9f43dba3717e8a430557c16a1d6543a13628ddf /moses/BaseManager.cpp | |
parent | ad5e27ae56298564dfd73637c160a682b5f5f028 (diff) |
Passing around AllOptions or references thereto everywhere,
strong them locally where appropriate, so that compontents can
become independent of StaticData once instantiated.
Diffstat (limited to 'moses/BaseManager.cpp')
-rw-r--r-- | moses/BaseManager.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/moses/BaseManager.cpp b/moses/BaseManager.cpp index 9806efd39..b4fdee865 100644 --- a/moses/BaseManager.cpp +++ b/moses/BaseManager.cpp @@ -98,10 +98,10 @@ void BaseManager:: OutputSurface(std::ostream &out, Phrase const& phrase) const { - std::vector<FactorType> const& factor_order = options().output.factor_order; + std::vector<FactorType> const& factor_order = options()->output.factor_order; - bool markUnknown = options().unk.mark; - std::string const& fd = options().output.FactorDelimiter; + bool markUnknown = options()->unk.mark; + std::string const& fd = options()->output.FactorDelimiter; size_t size = phrase.GetSize(); for (size_t pos = 0 ; pos < size ; pos++) { @@ -110,7 +110,7 @@ OutputSurface(std::ostream &out, Phrase const& phrase) const const Word &word = phrase.GetWord(pos); if(markUnknown && word.IsOOV()) { - out << options().unk.prefix; + out << options()->unk.prefix; } out << *factor; @@ -122,7 +122,7 @@ OutputSurface(std::ostream &out, Phrase const& phrase) const } if(markUnknown && word.IsOOV()) { - out << options().unk.suffix; + out << options()->unk.suffix; } out << " "; @@ -147,7 +147,7 @@ void BaseManager::WriteApplicationContext(std::ostream &out, } } -AllOptions const& +AllOptions::ptr const& BaseManager:: options() const { |