clausewitz-spelling 0.2.3 → 0.2.4
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 +1 -1
- data/exe/clausewitz-spellcheck +4 -0
- data/lib/clausewitz/spelling/checker.rb +3 -1
- data/lib/clausewitz/spelling/results.rb +2 -1
- data/lib/clausewitz/spelling/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 72934fe1a38a001b59b01610c918b4d1fc721b1bad7c93d88b98e29de27c5afa
|
|
4
|
+
data.tar.gz: 58a8843c180c16feb72ffa296063d0f102c91f453334783370fe0c179b8d24fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e63d6154357dc6b659189f5b0af701933e5cffb7f80d18f57d66726d3bd5c939d808f186184cff799c129aaaa014b820af5fa6aecac1da8636b6a7e9b89dea48
|
|
7
|
+
data.tar.gz: e13bc6151cc4e6f7a025a36d6ed0c766b075ffd66f4bab4e4adc97f3ae73c352b5c6d7357dd0227dd249f8eb7f61d7dd41dfbf8770b561a517ff3822f26a145f
|
data/Gemfile.lock
CHANGED
data/exe/clausewitz-spellcheck
CHANGED
|
@@ -18,6 +18,9 @@ class Main
|
|
|
18
18
|
opt :suggestion_count,
|
|
19
19
|
"How many suggestions to display",
|
|
20
20
|
type: :int
|
|
21
|
+
opt :verbose,
|
|
22
|
+
"Whether to display additional output while running",
|
|
23
|
+
default: false
|
|
21
24
|
Clausewitz::Localisation::LANG_MAP.each do |_, config|
|
|
22
25
|
opt "#{config.name}_dialect".to_sym,
|
|
23
26
|
"Select dialect for #{config.name.capitalize}",
|
|
@@ -39,6 +42,7 @@ class Main
|
|
|
39
42
|
checker_opts[:custom_dicts] = opts[:custom_dicts]
|
|
40
43
|
checker_opts[:dialect_map] = dialect_map
|
|
41
44
|
checker_opts[:suggestion_count] = opts[:suggestion_count]
|
|
45
|
+
checker_opts[:verbose] = opts[:verbose]
|
|
42
46
|
|
|
43
47
|
[checker_opts, args]
|
|
44
48
|
end
|
|
@@ -19,6 +19,7 @@ module Clausewitz; module Spelling
|
|
|
19
19
|
@custom_dicts = opts[:custom_dicts] || []
|
|
20
20
|
@dialect_map = opts[:dialect_map] || {}
|
|
21
21
|
@suggestion_count = opts[:suggestion_count] || DEFAULT_SUGGESTION_COUNT
|
|
22
|
+
@verbose = opts[:verbose]
|
|
22
23
|
|
|
23
24
|
load_dictionaries!
|
|
24
25
|
end
|
|
@@ -47,6 +48,7 @@ module Clausewitz; module Spelling
|
|
|
47
48
|
end
|
|
48
49
|
|
|
49
50
|
def check_file(filepath)
|
|
51
|
+
puts "Checking file '#{filepath}'..." if @verbose
|
|
50
52
|
results = []
|
|
51
53
|
begin
|
|
52
54
|
filepath = Pathname.new(filepath)
|
|
@@ -102,6 +104,7 @@ module Clausewitz; module Spelling
|
|
|
102
104
|
|
|
103
105
|
# Remove other localisation bits we don't care about.
|
|
104
106
|
entry.gsub!(/§(%|\*|=|\d|W|G|R|B|Y|b|M|g|T|l|H|\+|-|!)/, '')
|
|
107
|
+
entry.gsub!(/£\w+/, '')
|
|
105
108
|
|
|
106
109
|
## We should also remove punctuation that is never part of words, like
|
|
107
110
|
## exclamation points, commas, semi-colons, and question marks.
|
|
@@ -154,7 +157,6 @@ module Clausewitz; module Spelling
|
|
|
154
157
|
return if is_plural_number?(word)
|
|
155
158
|
return if is_ordinal?(word)
|
|
156
159
|
return if is_percentage?(word)
|
|
157
|
-
return if is_icon?(word)
|
|
158
160
|
return if is_initial?(word)
|
|
159
161
|
return if is_psalm?(word)
|
|
160
162
|
return if is_tag?(word)
|
|
@@ -198,7 +198,8 @@ module Clausewitz; module Spelling
|
|
|
198
198
|
spacer = ' ' * indent
|
|
199
199
|
secondspacer = ' ' * (indent + 2)
|
|
200
200
|
"#{spacer}#{@filepath} could not be parsed\n".red +
|
|
201
|
-
"#{secondspacer}#{@error.message}".red
|
|
201
|
+
"#{secondspacer}#{@error.message}\n".red +
|
|
202
|
+
"Make sure every entry has exactly two spaces in front of it.".red
|
|
202
203
|
end
|
|
203
204
|
end
|
|
204
205
|
end; end # Clausewitz::Spelling
|
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.2.
|
|
4
|
+
version: 0.2.4
|
|
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-06-
|
|
11
|
+
date: 2019-06-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|