Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Broken on 0.25.1 #3

Open
bararchy opened this issue Jul 1, 2018 · 0 comments
Open

Broken on 0.25.1 #3

bararchy opened this issue Jul 1, 2018 · 0 comments

Comments

@bararchy
Copy link

bararchy commented Jul 1, 2018

On Crystal 0.25.1 I get this error:

Error in line 20: instantiating 'Machine::Bayes::BayesClasifier#classify(String)'

in lib/machine/src/machine/bayes/bayes_classifier.cr:69: instantiating 'classify_with_score(String)'

        classify_with_score(text).keys.first
        ^~~~~~~~~~~~~~~~~~~

in lib/machine/src/machine/bayes/bayes_classifier.cr:65: instantiating 'classifications(String)'

        classifications(text).map { |k, v| {k => -v} }.sort_by { |a| a.values[0] }[0]
        ^~~~~~~~~~~~~~~

in lib/machine/src/machine/bayes/bayes_classifier.cr:51: instantiating 'Hash(String, Machine::Bayes::Category)#each()'

        @categories.each do |category_name, category|
                    ^~~~

in lib/machine/src/machine/bayes/bayes_classifier.cr:51: instantiating 'Hash(String, Machine::Bayes::Category)#each()'

        @categories.each do |category_name, category|
                    ^~~~

in lib/machine/src/machine/bayes/bayes_classifier.cr:58: undefined method 'key?' for Hash(String, Int32)

          s = @category_counts.key?(category_name) ? @category_counts[category_name] : 0.1
                               ^~~~

Rerun with --error-trace to show a complete error trace.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant