lib/fasttext/vectorizer.rb in fasttext-0.1.0 vs lib/fasttext/vectorizer.rb in fasttext-0.1.1
- old
+ new
@@ -45,10 +45,10 @@
if x.is_a?(String)
x
else
tempfile = Tempfile.new("fasttext")
x.each do |xi|
- tempfile.write(xi)
+ tempfile.write(xi.gsub("\n", " ")) # replace newlines in document
tempfile.write("\n")
end
tempfile.close
tempfile.path
end