fBayes 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
data/fBayes.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fBayes"
8
- s.version = "0.3.0"
8
+ s.version = "0.4.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"]
@@ -1,7 +1,5 @@
1
- require 'classifier'
2
-
3
1
  puts "*" * 100
4
- puts "InternalTurnk CLASSIFIER:"
2
+ puts "InternalTurnk CLASSIFIER: SUCKS"
5
3
  puts "*" * 100
6
4
 
7
5
 
@@ -12,11 +10,25 @@ class InternalTurnk
12
10
  def initialize
13
11
  @classifier = Classifier::Bayes.new
14
12
  @home_dir = FBayesDir.internal_turnk_data
13
+ puts @home_dir.inspect
14
+
15
15
  add_categories
16
16
  train
17
- puts @home_dir.inspect
17
+ end
18
+
19
+ def c(word)
20
+ @classifier.classify(word)
21
+ end
22
+
23
+ def d(word)
24
+ @classifier.classifications(word)
18
25
  end
19
26
 
27
+ private
28
+
29
+ def categories_path
30
+
31
+ end
20
32
 
21
33
  def add_categories
22
34
  categories_path = Dir[ @home_dir + "*"]
@@ -43,13 +55,4 @@ class InternalTurnk
43
55
  puts "TOTAL SIZE: #{total_size}"
44
56
  end
45
57
 
46
- def c(word)
47
- @classifier.classify(word)
48
- end
49
-
50
- def d(word)
51
- @classifier.classifications(word)
52
- end
53
58
  end
54
-
55
- @it_classifier = InternalTurnk.new
data/lib/fBayes.rb CHANGED
@@ -1,9 +1,9 @@
1
-
1
+ require 'classifier'
2
2
 
3
3
  module FBayesDir
4
4
  def self.root
5
5
  #Gem::Specification.find_by_name("fBayes").gem_dir + "/lib/data/"
6
- Dir.pwd + "/lib/data/"
6
+ File.dirname(__FILE__) + "/data"
7
7
  end
8
8
 
9
9
  def self.cdc_data
@@ -19,5 +19,5 @@ module FBayesDir
19
19
  end
20
20
  end
21
21
 
22
-
22
+ require_relative './data/internalTurnk/classifier'
23
23
  require_relative './global_classifier'
@@ -1,45 +0,0 @@
1
-
2
-
3
- require_relative './data/cdc/classifier'
4
- require_relative './data/sr24/classifier'
5
- require_relative './data/internalTurnk/classifier'
6
-
7
-
8
- puts "*" * 100
9
-
10
- puts "Clasifier Object: @sr24_classifier"
11
- puts "Classifier Object: @cdc_classifier"
12
- puts "Classifier Object: @it_classifier"
13
-
14
-
15
-
16
-
17
-
18
- class GlobalClassifier
19
-
20
- attr_accessor :classifiers
21
-
22
- def initialize(classifiers)
23
- @classifiers = classifiers
24
- end
25
-
26
- def c(w)
27
- @classifiers.each do |classifier|
28
- puts "*" * 100
29
- puts classifier.class
30
- puts classifier.classify w
31
- puts classifier.classifications w
32
- puts "*" * 100
33
- end
34
- nil
35
- end
36
-
37
- end
38
-
39
-
40
- #
41
- # THE BEST CLASSIFIER IS THE SR24
42
- #
43
- puts "@g as a global object classifier"
44
- @g = GlobalClassifier.new([@sr24_classifier, @cdc_classifier])
45
-
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.3.0
4
+ version: 0.4.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: 435159813483436129
202
+ hash: 3460053945659930154
203
203
  required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  none: false
205
205
  requirements: