fBayes 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.DS_Store CHANGED
Binary file
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.0
1
+ 0.9.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fBayes"
8
- s.version = "0.8.0"
8
+ s.version = "0.9.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ivan Acosta-Rubio"]
Binary file
@@ -18,13 +18,15 @@ class InternalTurnk
18
18
 
19
19
  def c(word)
20
20
  result = sorted_classification(word)
21
- value_of_classification = result.last
22
- category_of_classification = result.first
21
+ value_of_classification = result.first.last
22
+ category_of_classification = result.first.first
23
23
 
24
- if value_of_classification <= value_of_missing_info
25
- return "Unknown"
26
- else
24
+ if value_of_classification >= value_of_missing_info
25
+ return category_of_classification
26
+ elsif (result[0].last - result[1].last) >= 0.5
27
27
  return category_of_classification
28
+ else
29
+ return "Unknown"
28
30
  end
29
31
  end
30
32
 
@@ -39,7 +41,7 @@ class InternalTurnk
39
41
  end
40
42
 
41
43
  def sorted_classification(word)
42
- @classifier.classifications(word).sort_by { |_key, value| value }.reverse.first
44
+ @classifier.classifications(word).sort_by { |_key, value| value }.reverse
43
45
  end
44
46
 
45
47
  def categories_path
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fBayes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -199,7 +199,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
199
  version: '0'
200
200
  segments:
201
201
  - 0
202
- hash: -1228854482676680342
202
+ hash: 375197087193189777
203
203
  required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  none: false
205
205
  requirements: