summaryrefslogtreecommitdiff
path: root/utils/weights.cc
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2012-04-23 21:44:02 +0200
committerPatrick Simianer <p@simianer.de>2012-04-23 21:44:02 +0200
commit2f427278616cbe3fa6f56d6b97c40b3894dbd950 (patch)
tree6998435e4677437c474cf0f835ce9f72d70d3945 /utils/weights.cc
parent6d0d0eb6bbfaee6b6998659a55e2195977ccd217 (diff)
parent217c4aaeba1c9f19b3420b526235bffd86c7a92b (diff)
Merge remote-tracking branch 'upstream/master'
Conflicts: Makefile.am configure.ac
Diffstat (limited to 'utils/weights.cc')
-rw-r--r--utils/weights.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils/weights.cc b/utils/weights.cc
index ac407dfb..39c18474 100644
--- a/utils/weights.cc
+++ b/utils/weights.cc
@@ -144,8 +144,10 @@ void Weights::ShowLargestFeatures(const vector<weight_t>& w) {
vector<int> fnums(w.size());
for (int i = 0; i < w.size(); ++i)
fnums[i] = i;
+ int nf = FD::NumFeats();
+ if (nf > 10) nf = 10;
vector<int>::iterator mid = fnums.begin();
- mid += (w.size() > 10 ? 10 : w.size());
+ mid += nf;
partial_sort(fnums.begin(), mid, fnums.end(), FComp(w));
cerr << "TOP FEATURES:";
for (vector<int>::iterator i = fnums.begin(); i != mid; ++i) {