We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents be95c7f + d605417 commit 1f13c41Copy full SHA for 1f13c41
lib/classifier-reborn/lsi/content_node.rb
@@ -45,8 +45,13 @@ def raw_vector_with( word_list )
45
46
# Perform the scaling transform and force floating point arithmetic
47
total_words = vec.sum.to_f
48
+ total_unique_words = 0
49
- total_unique_words = vec.count{|word| word != 0}
50
+ if $GSL
51
+ vec.each { |word| total_unique_words += 1 if word != 0 }
52
+ else
53
+ total_unique_words = vec.count{ |word| word != 0 }
54
+ end
55
56
# Perform first-order association transform if this vector has more
57
# then one word in it.
0 commit comments