textstat 0.1.9 → 1.0.0
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/counter.rb +6 -6
- data/lib/dictionaries/da.txt +2000 -0
- data/lib/dictionaries/de.txt +2000 -0
- data/lib/dictionaries/en_uk.txt +2945 -0
- data/lib/dictionaries/es.txt +2000 -0
- data/lib/dictionaries/et.txt +2000 -0
- data/lib/dictionaries/fi.txt +2000 -0
- data/lib/dictionaries/fr.txt +2000 -0
- data/lib/dictionaries/hr.txt +1980 -0
- data/lib/dictionaries/hu.txt +2000 -0
- data/lib/dictionaries/id.txt +2000 -0
- data/lib/dictionaries/is.txt +2000 -0
- data/lib/dictionaries/it.txt +2000 -0
- data/lib/dictionaries/la.txt +2000 -0
- data/lib/dictionaries/no2.txt +2000 -0
- data/lib/dictionaries/pl.txt +2000 -0
- data/lib/dictionaries/pt.txt +2000 -0
- data/lib/dictionaries/ru.txt +2000 -0
- data/lib/dictionaries/sv.txt +2000 -0
- data/lib/textstat/basic_stats.rb +156 -0
- data/lib/textstat/dictionary_manager.rb +156 -0
- data/lib/textstat/main.rb +137 -0
- data/lib/textstat/readability_formulas.rb +363 -0
- data/lib/textstat/version.rb +21 -2
- data/lib/textstat.rb +36 -313
- metadata +217 -21
- data/spec/textstat_spec.rb +0 -197
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b31ddd58d5ce5aa900acc19b5e93427193db6f80ff7b4006393e2247426057e
|
4
|
+
data.tar.gz: 631647fb90e3c0f1f55e48ff1a9c12a617e9dae3bef19fd956cead2bac54af06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a89c77ea00c51a00649db231ef5e5cbe8f72a8e92734d80d61cc04956cea53a2cc293823babf5185b79c397ff53f2893857caf2bd331ec4ef8dfc23f00cde57
|
7
|
+
data.tar.gz: c4577aa1d7fbb45f1408b04241d02d4da9a434130e88d89535fda7c61c6a56c6715d69dcf1d2a8b50111e42459077012719fc5bcc092884e69a94b673508a140
|
data/lib/counter.rb
CHANGED
@@ -6,19 +6,19 @@ class Counter < Hash
|
|
6
6
|
other.each_char { |e| self[e] += 1 } if other.is_a? String
|
7
7
|
end
|
8
8
|
|
9
|
-
def +(
|
10
|
-
raise TypeError, "cannot add #{
|
9
|
+
def +(other)
|
10
|
+
raise TypeError, "cannot add #{other.class} to a Counter" unless other.is_a? Counter
|
11
11
|
|
12
12
|
result = Counter.new(self)
|
13
|
-
|
13
|
+
other.each { |k, v| result[k] += v }
|
14
14
|
result
|
15
15
|
end
|
16
16
|
|
17
|
-
def -(
|
18
|
-
raise TypeError, "cannot subtract #{
|
17
|
+
def -(other)
|
18
|
+
raise TypeError, "cannot subtract #{other.class} to a Counter" unless other.is_a? Counter
|
19
19
|
|
20
20
|
result = Counter.new(self)
|
21
|
-
|
21
|
+
other.each { |k, v| result[k] -= v }
|
22
22
|
result
|
23
23
|
end
|
24
24
|
|