Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/moses
diff options
context:
space:
mode:
authorEva Hasler <evahasler@gmail.com>2012-03-30 01:01:17 +0400
committerEva Hasler <evahasler@gmail.com>2012-03-30 01:01:17 +0400
commit0a537a9f58b27d43098095531820db0c7a6c0a2a (patch)
treecae09c0c1ed1b589173bc757ac47824f6b96417e /moses
parent03d3cb6a7a4b2bbe29a898a32578266d50368a36 (diff)
print feature counts to file
Diffstat (limited to 'moses')
-rw-r--r--moses/src/FeatureVector.cpp4
-rw-r--r--moses/src/FeatureVector.h2
-rw-r--r--moses/src/ScoreComponentCollection.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/moses/src/FeatureVector.cpp b/moses/src/FeatureVector.cpp
index 638690fa9..40ea8419c 100644
--- a/moses/src/FeatureVector.cpp
+++ b/moses/src/FeatureVector.cpp
@@ -323,9 +323,9 @@ namespace Moses {
FName::incrementId((i->first).name());
}
- void FVector::printSparseFeatureCounts() {
+ void FVector::printSparseFeatureCounts(std::ofstream& out) {
for (const_iterator i = cbegin(); i != cend(); ++i)
- std::cerr << (i->first).name() << ": " << FName::getIdCount((i->first).name()) << std::endl;
+ out << (i->first).name() << ": " << FName::getIdCount((i->first).name()) << std::endl;
}
size_t FVector::pruneSparseFeatures(size_t threshold) {
diff --git a/moses/src/FeatureVector.h b/moses/src/FeatureVector.h
index 38e23b9c6..6dd6d6d27 100644
--- a/moses/src/FeatureVector.h
+++ b/moses/src/FeatureVector.h
@@ -202,7 +202,7 @@ namespace Moses {
void sparsePlusEquals(const FVector& rhs);
void incrementSparseFeatures();
- void printSparseFeatureCounts();
+ void printSparseFeatureCounts(std::ofstream& out);
size_t pruneSparseFeatures(size_t threshold);
size_t pruneZeroWeightFeatures();
diff --git a/moses/src/ScoreComponentCollection.h b/moses/src/ScoreComponentCollection.h
index 3c2186d90..61a02c51f 100644
--- a/moses/src/ScoreComponentCollection.h
+++ b/moses/src/ScoreComponentCollection.h
@@ -365,7 +365,7 @@ public:
void Save(std::ostream&) const;
void IncrementSparseFeatures() { m_scores.incrementSparseFeatures(); }
- void PrintSparseFeatureCounts() { m_scores.printSparseFeatureCounts(); }
+ void PrintSparseFeatureCounts(std::ofstream& out) { m_scores.printSparseFeatureCounts(out); }
size_t PruneSparseFeatures(size_t threshold) { return m_scores.pruneSparseFeatures(threshold); }
size_t PruneZeroWeightFeatures() { return m_scores.pruneZeroWeightFeatures(); }