clausewitz-spelling 0.1.15 → 0.1.16
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/Gemfile.lock +2 -2
- data/lib/clausewitz/spelling/checker.rb +5 -4
- data/lib/clausewitz/spelling/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1929f3ff6bf94eaccc2d2e084bc8ddfb52cd3cd
|
4
|
+
data.tar.gz: 1e117b63b0e90bdb6bedb8d3d4e4286787829f04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 994b5c039f5be4b29420ea440cc8ed48f89e05f8cd0afb4794837335a245f6eb77e96bc4e7f53d1801fd6c6d6ca20a79b270577451766448d096444402dd722e
|
7
|
+
data.tar.gz: 1a56c0ca573791d2b9bb9d8edade88ca087fd49607d58c63f7f593c307b82a073fd6231638fa6eb3103388b7c4d83142bafcf51721c92a200a645a6bd735a3f1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
clausewitz-spelling (0.1.
|
4
|
+
clausewitz-spelling (0.1.16)
|
5
5
|
colorize
|
6
6
|
damerau-levenshtein
|
7
7
|
ffi-aspell
|
@@ -14,7 +14,7 @@ GEM
|
|
14
14
|
colorize (0.8.1)
|
15
15
|
damerau-levenshtein (1.3.1)
|
16
16
|
diff-lcs (1.3)
|
17
|
-
ffi (1.
|
17
|
+
ffi (1.10.0)
|
18
18
|
ffi-aspell (1.1.0)
|
19
19
|
ffi
|
20
20
|
method_source (0.9.2)
|
@@ -78,7 +78,7 @@ module Clausewitz; module Spelling
|
|
78
78
|
# We should also remove punctuation that is never part of words, like
|
79
79
|
# exclamation points, commas, semi-colons, and question marks.
|
80
80
|
# We should be using proper apostrophes for possessives in our loc.
|
81
|
-
entry.gsub!(/(!|;|\?|
|
81
|
+
entry.gsub!(/(!|;|\?|"|“|”|…|:|\(|\))/, '')
|
82
82
|
|
83
83
|
# If a word has one full stop at the end with no other full stops
|
84
84
|
# elsewhere in the word, it's probably an acronym or initialism like
|
@@ -86,14 +86,15 @@ module Clausewitz; module Spelling
|
|
86
86
|
# the end of a sentence and can be ignored.
|
87
87
|
words = entry.split(/\s|—/)
|
88
88
|
words.map! do |word|
|
89
|
+
word.sub!(/^'/, '')
|
90
|
+
word.sub!(/'?,?'?$/, '')
|
91
|
+
|
89
92
|
if word.end_with?('...')
|
90
93
|
word.sub(/\.\.\.$/, '')
|
91
94
|
elsif word =~ /[[:alpha:]]\.$/ && word.chars.count('.') == 1
|
92
95
|
word.sub(/\.$/, '')
|
93
96
|
elsif word =~ /\d\.$/ && word.chars.count('.') <= 2
|
94
97
|
word.sub(/\.$/, '')
|
95
|
-
elsif word =~ /,$/
|
96
|
-
word.sub(/,$/, '')
|
97
98
|
else
|
98
99
|
word
|
99
100
|
end
|
@@ -163,7 +164,7 @@ module Clausewitz; module Spelling
|
|
163
164
|
dir = Dir.mktmpdir("custom-wordlist-#{lang}-")
|
164
165
|
output = File.join(dir, "#{lang}-custom.wlst")
|
165
166
|
cmd = %W[
|
166
|
-
aspell --lang
|
167
|
+
aspell --lang=#{lang} --encoding=UTF-8 create master #{output}
|
167
168
|
]
|
168
169
|
value = nil
|
169
170
|
Open3.popen3(*cmd) do |stdin, stdout, stderr, wait_thr|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clausewitz-spelling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will Chappell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|