diff options
-rw-r--r-- | moses/FeatureVector.cpp | 4 | ||||
-rw-r--r-- | moses/FeatureVector.h | 2 | ||||
-rw-r--r-- | moses/ScoreComponentCollection.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/moses/FeatureVector.cpp b/moses/FeatureVector.cpp index fd44b1002..ce4a043a6 100644 --- a/moses/FeatureVector.cpp +++ b/moses/FeatureVector.cpp @@ -214,10 +214,10 @@ void FVector::save(const string& filename) const out.close(); } -void FVector::write(ostream& out,const string& sep) const +void FVector::write(ostream& out,const string& sep, const string& linesep) const { for (const_iterator i = cbegin(); i != cend(); ++i) { - out << i->first << sep << i->second << endl; + out << i->first << sep << i->second << linesep; } } diff --git a/moses/FeatureVector.h b/moses/FeatureVector.h index e14006da7..fd5d3340c 100644 --- a/moses/FeatureVector.h +++ b/moses/FeatureVector.h @@ -167,7 +167,7 @@ public: /** Load from file - each line should be 'root[_name] value' */ bool load(const std::string& filename); void save(const std::string& filename) const; - void write(std::ostream& out, const std::string& sep=" ") const ; + void write(std::ostream& out, const std::string& sep=" ", const std::string& linesep="\n") const ; /** Element access */ ProxyFVector operator[](const FName& name); diff --git a/moses/ScoreComponentCollection.cpp b/moses/ScoreComponentCollection.cpp index d4df4742e..eedaa589e 100644 --- a/moses/ScoreComponentCollection.cpp +++ b/moses/ScoreComponentCollection.cpp @@ -203,7 +203,7 @@ void ScoreComponentCollection::Save(ostream& out, bool multiline) const } // write sparse features - m_scores.write(out,sep); + m_scores.write(out,sep,linesep); } void ScoreComponentCollection::Save(const string& filename) const |