textstat 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  class TextStat
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/textstat.rb CHANGED
@@ -149,10 +149,10 @@ class TextStat
149
149
  return number / 2
150
150
  end
151
151
 
152
- def self.difficult_words(text)
152
+ def self.difficult_words(text, language = 'en_us')
153
153
  require 'set'
154
154
  easy_words = Set.new
155
- File.read('lib/easy_words.txt').each_line do |line|
155
+ File.read("lib/dictionaries/#{language}.txt").each_line do |line|
156
156
  easy_words << line.chop
157
157
  end
158
158
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: textstat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Polak
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-12 00:00:00.000000000 Z
11
+ date: 2018-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: text-hyphen
@@ -80,7 +80,10 @@ extensions: []
80
80
  extra_rdoc_files: []
81
81
  files:
82
82
  - lib/counter.rb
83
- - lib/easy_words.txt
83
+ - lib/dictionaries/ca.txt
84
+ - lib/dictionaries/cs.txt
85
+ - lib/dictionaries/en_us.txt
86
+ - lib/dictionaries/nl.txt
84
87
  - lib/textstat.rb
85
88
  - lib/textstat/version.rb
86
89
  - spec/textstat_spec.rb
@@ -113,4 +116,4 @@ summary: Ruby gem to calculate readability statistics of a text object - paragra
113
116
  sentences, articles
114
117
  test_files:
115
118
  - spec/textstat_spec.rb
116
- - lib/easy_words.txt
119
+ - lib/dictionaries/en_us.txt