JuliaText / TextAnalysis.jl

Julia package for text analysis
Other
374 stars 96 forks source link

fixes corner case for 0 words in doc for tf_idf computation #44

Closed abieler closed 7 years ago

abieler commented 8 years ago

fixes corner case for tf_idf() calculation when document contains 0 words.

This (=zero words in doc) happens to me quite frequently when processing scanned pdf files and something goes wrong with the scan quality.

aviks commented 7 years ago

Thanks. Will it be possible to write a test for this case, to ensure it does not break in the future?

abieler commented 7 years ago

yes. will do.

abieler commented 7 years ago

added test. weirdly enough (or not?) isnan() does not seem to work for sparse matrices? So the error only gets caught in the dense matrix case.

aviks commented 7 years ago

Thanks. Test failure on nightly is due to the SSL error. Merging.