Browse Source

print space instead of tab

Summary: This diff reverts some of the recent changes that printed a tab in front of vectors instead of a single space.

Reviewed By: EdouardGrave

Differential Revision: D4991760

fbshipit-source-id: a81b479f4e946a92071faa44ebe98b2abda6d5c6
Christian Puhrsch 8 năm trước cách đây
mục cha
commit
a9d7c2c639
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      src/fasttext.cc

+ 4 - 4
src/fasttext.cc

@@ -344,11 +344,11 @@ void FastText::predict(std::istream& in, int32_t k, bool print_prob) {
     }
     for (auto it = predictions.cbegin(); it != predictions.cend(); it++) {
       if (it != predictions.cbegin()) {
-        std::cout << "\t";
+        std::cout << " ";
       }
       std::cout << it->second;
       if (print_prob) {
-        std::cout << "\t" << exp(it->first);
+        std::cout << " " << exp(it->first);
       }
     }
     std::cout << std::endl;
@@ -360,7 +360,7 @@ void FastText::wordVectors() {
   Vector vec(args_->dim);
   while (std::cin >> word) {
     getVector(vec, word);
-    std::cout << word << "\t" << vec << std::endl;
+    std::cout << word << " " << vec << std::endl;
   }
 }
 
@@ -394,7 +394,7 @@ void FastText::ngramVectors(std::string word) {
     if (ngrams[i] >= 0) {
       vec.addRow(*input_, ngrams[i]);
     }
-    std::cout << substrings[i] << "\t" << vec << std::endl;
+    std::cout << substrings[i] << " " << vec << std::endl;
   }
 }