Skip to content

Error while not weighting words. #11

@arbox

Description

@arbox

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions