tonality_analyser 0.0.1 → 0.0.2

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.
@@ -64,11 +64,11 @@ module TonalityAnalyser
64
64
  neg_proba = analysis(text, :neg)
65
65
  pos_proba >= neg_proba ? :pos : :neg
66
66
  end
67
- def load_traning_corpus!
68
- TONALITIES.each { |tonality| load_traning_corpus_for(tonality) }
67
+ def load_traning_corpus!(dir)
68
+ TONALITIES.each { |tonality| load_traning_corpus_for(dir, tonality) }
69
69
  end
70
- def load_traning_corpus_for(tonality)
71
- File.open("./training/#{tonality}.txt", 'r') do |f|
70
+ def load_traning_corpus_for(dir, tonality)
71
+ File.open("#{dir}/#{tonality}.txt", 'r') do |f|
72
72
  f.each_line { |line| train(line, tonality) }
73
73
  f.close
74
74
  end
@@ -1,3 +1,3 @@
1
1
  module TonalityAnalyser
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -5,7 +5,7 @@ describe TonalityAnalyser::Engine do
5
5
  # Woouuu Wouuuu les test de la mort :)
6
6
  it 'propose tonality' do
7
7
  e = TonalityAnalyser::Engine.new
8
- e.load_traning_corpus!
8
+ e.load_traning_corpus!('training')
9
9
  e.compute_probabilities!
10
10
  e.tonality('This').should == :neg
11
11
  e.tonality('Unacceptable') == :neg
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tonality_analyser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: