mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
beautify
This commit is contained in:
parent
d7ab163b0e
commit
116f1dcd41
@ -13,14 +13,14 @@ InputPath::InputPath(const Phrase &phrase, const WordsRange &range, const InputP
|
||||
,m_range(range)
|
||||
,m_inputScore(inputScore)
|
||||
{
|
||||
FactorType factorType = StaticData::Instance().GetPlaceholderFactor();
|
||||
if (factorType != NOT_FOUND) {
|
||||
for (size_t pos = 0; pos < m_phrase.GetSize(); ++pos) {
|
||||
if (m_phrase.GetFactor(pos, factorType)) {
|
||||
m_placeholders.push_back(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
FactorType factorType = StaticData::Instance().GetPlaceholderFactor();
|
||||
if (factorType != NOT_FOUND) {
|
||||
for (size_t pos = 0; pos < m_phrase.GetSize(); ++pos) {
|
||||
if (m_phrase.GetFactor(pos, factorType)) {
|
||||
m_placeholders.push_back(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InputPath::~InputPath()
|
||||
@ -31,8 +31,8 @@ InputPath::~InputPath()
|
||||
// the phrase dictionary owns the target phrases so they should be doing the deleting
|
||||
std::vector<TargetPhraseCollection>::iterator iter;
|
||||
for (iter = m_copiedSet.begin(); iter != m_copiedSet.end(); ++iter) {
|
||||
TargetPhraseCollection &coll = *iter;
|
||||
coll.Detach();
|
||||
TargetPhraseCollection &coll = *iter;
|
||||
coll.Detach();
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,8 +57,9 @@ const void *InputPath::GetPtNode(const PhraseDictionary &phraseDictionary) const
|
||||
}
|
||||
|
||||
void InputPath::SetTargetPhrases(const PhraseDictionary &phraseDictionary
|
||||
, const TargetPhraseCollection *targetPhrases
|
||||
, const void *ptNode) {
|
||||
, const TargetPhraseCollection *targetPhrases
|
||||
, const void *ptNode)
|
||||
{
|
||||
std::pair<const TargetPhraseCollection*, const void*> value(targetPhrases, ptNode);
|
||||
m_targetPhrases[&phraseDictionary] = value;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ void TargetPhraseCollection::Sort(bool adhereTableLimit, size_t tableLimit)
|
||||
|
||||
void TargetPhraseCollection::Add(const TargetPhraseCollection ©)
|
||||
{
|
||||
std::copy(copy.begin(), copy.end(), std::inserter(m_collection, m_collection.end()));
|
||||
std::copy(copy.begin(), copy.end(), std::inserter(m_collection, m_collection.end()));
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream &out, const TargetPhraseCollection &obj)
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
}
|
||||
|
||||
~TargetPhraseCollection() {
|
||||
Remove();
|
||||
Remove();
|
||||
}
|
||||
|
||||
const std::vector<TargetPhrase*> &GetCollection() const {
|
||||
|
Loading…
Reference in New Issue
Block a user