classifier_atsukamoto 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/classifier/bayes.rb +1 -1
- data/lib/classifier/redis_store.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 452019d1cd647e13fa5ab4e6261d9006cca02309
|
4
|
+
data.tar.gz: 5649fd1a98255cfc62bfefa1e502453d6ef21477
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42818ec633de20053f7da225ead0de061d8d499ce15d3afa40c59e85daf9a304fe8576724d074a20fb26f0802e7b58262d472967f3025ce9ff39588819e99af8
|
7
|
+
data.tar.gz: 9604c52186837f59d5d81c843cdfe6676ac5f93d3adbf1daa064f4847b8e967df0a33850e43b21e8161003df59158cfa56061261bed9d68a55336adfd31461be
|
data/lib/classifier/bayes.rb
CHANGED
@@ -83,7 +83,7 @@ class Bayes
|
|
83
83
|
def classifications(text)
|
84
84
|
score = Hash.new
|
85
85
|
# actual categories saved in the beggining but each do |category|
|
86
|
-
@categories.
|
86
|
+
@categories.each do |category, category_words|
|
87
87
|
score[category.to_s] = 0
|
88
88
|
|
89
89
|
# total = category_words.values.inject(0) {|sum, element| sum+element}
|
@@ -111,7 +111,7 @@ module Classifier
|
|
111
111
|
|
112
112
|
def get_by_wild_keys(category)
|
113
113
|
wildlings = []
|
114
|
-
$redis.keys("#{escape_category(category)}:*").each do |key|
|
114
|
+
$redis.keys("#{escape_lang}:#{escape_category(category)}:*").each do |key|
|
115
115
|
wildlings << get_by_key(key).to_i
|
116
116
|
end
|
117
117
|
wildlings
|