magic_cloud
magic_cloud copied to clipboard
Error while not weighting words.
When we provide equal weights for every word we get such an error:
ruby -I lib wordcloud.rb
/home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:132:in `to_i': NaN (FloatDomainError)
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:132:in `block in make_scaler'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:32:in `block in draw'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:28:in `each'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:28:in `each_with_index'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:28:in `each'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:28:in `map'
from /home/arbox/work_space/magic_cloud/lib/magic_cloud/cloud.rb:28:in `draw'
from wordcloud.rb:21:in `<main>'
I didn't investigate the algorithm in cloud.rb:132
((ssize - smin).to_f * koeff + FONT_MIN).to_i
+1
I have the same issue.