textstat 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/lib/dictionaries/ca.txt +2488 -0
- data/lib/dictionaries/cs.txt +2500 -0
- data/lib/{easy_words.txt → dictionaries/en_us.txt} +0 -0
- data/lib/dictionaries/nl.txt +2550 -0
- data/lib/textstat/version.rb +1 -1
- data/lib/textstat.rb +2 -2
- metadata +7 -4
data/lib/textstat/version.rb
CHANGED
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(
|
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.
|
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-
|
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/
|
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/
|
119
|
+
- lib/dictionaries/en_us.txt
|