artemo 3.0.9 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0046d11340a03a34dff1723d4fcfb9cf71c1ef9d
4
- data.tar.gz: ec42221460e22e6da26ab00d534d703edcd1dfaa
3
+ metadata.gz: 9a686dd76c1e61363a848ae50eefa557ce1d4502
4
+ data.tar.gz: 014dcdff4c77ed8f1a2c9852f551bdb4f6930332
5
5
  SHA512:
6
- metadata.gz: 68711b83f05e5e9626a07e922df481d6900a86a3d825d3ec8a05d4d8d3cb581c854fc14a756872f671d728c9d712957637b0fb62f605355e3f01223c20c2845f
7
- data.tar.gz: cd6bc2ab606fc8168396bd4b71b6147ff71009210a31e2b22aec6ee220dcdab59922e27e660b0da061cab27cb7cfe0155db6d7bb0e730cbac3f32db657dc3303
6
+ metadata.gz: '09d2687bfdb76b96f11480ad916cdf1e99e5980ed5a689785e7d4691de868d883e52ed8387fbf3a5456665d1c2f7f4812e8725de0d76ddb1b93fa860daec3265'
7
+ data.tar.gz: 31e1170ec5c9c88240b0866261ab90f8b8a30584d30e0bd1e7c537785456a505ec457dbffac3db9ac118799ea811e9b7273b424f1458cff6667db1d5988a502d
data/.DS_Store CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -32,4 +32,7 @@ Version 3.0.8
32
32
  Better gem description.
33
33
 
34
34
  Version 3.0.9
35
- More rspec tests.
35
+ More rspec tests.
36
+
37
+ Version 3.1.0
38
+ Add exception support when file is empty or have not enough keywords to analysis.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- artemo (3.0.9)
4
+ artemo (3.1.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -49,3 +49,8 @@ Version 3.0.8
49
49
  Version 3.0.9
50
50
 
51
51
  * More rspec tests.
52
+
53
+ Version 3.1.0
54
+
55
+ * Add exception support when file is empty or have not enough keywords to analysis.
56
+
data/bin/artemo CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/local/bin/env ruby
2
2
 
3
3
  require 'artemo'
4
- puts ArtEmo.call(ARGV[0])
4
+ ArtEmo.call(ARGV[0])
@@ -1,3 +1,3 @@
1
1
  module ArtEmo
2
- VERSION = "3.0.9"
2
+ VERSION = "3.1.0"
3
3
  end
data/lib/artemo.rb CHANGED
@@ -15,10 +15,14 @@ class ArtEmo
15
15
  def self.call(text_file)
16
16
  keywords = Keywords.call
17
17
  text = Loader.call(text_file)
18
- if !text.nil?
19
- basic = BasicEmotions.call(keywords, text)
20
- complex = ComplexEmotions.call(basic)
21
- Result.call(complex)
18
+ unless text.nil?
19
+ begin
20
+ basic = BasicEmotions.call(keywords, text)
21
+ complex = ComplexEmotions.call(basic)
22
+ Result.call(complex)
23
+ rescue
24
+ {"aggressiveness"=>0, "anxiety"=>0, "awe"=>0, "contempt"=>0, "curiosity"=>0, "cynicism"=>0, "delight"=>0, "despair"=>0, "disappointment"=>0, "dominance"=>0, "envy"=>0, "fatalism"=>0, "guilt"=>0, "love"=>0, "morbidness"=>0, "optimism"=>0, "outrage"=>0, "pessimism"=>0, "pride"=>0, "remorse"=>0, "revulsion"=>0, "sentimentality"=>0, "shame"=>0, "submission"=>0}
25
+ end
22
26
  end
23
27
  end
24
28
  end
@@ -26,5 +30,5 @@ end
26
30
  if ARGV.first.nil?
27
31
  puts "artemo [your text file]"
28
32
  else
29
- ArtEmo.call(ARGV.first)
33
+ puts ArtEmo.call(ARGV.first)
30
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artemo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.9
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Łukasz Fuszara