clausewitz-spelling 0.2.2 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 00a5131036915bc1f11b89178c61fc59953e283c4a2722d5e0c8eb312e7a73b2
4
- data.tar.gz: 9594c8512f0c75f09692239b532858856753d54dbba5234a6242a6c27c50896c
3
+ metadata.gz: cc8fdce4a42ffacd2b315b506c48e4d10cab6fedc33727c14acfa21f53222fd5
4
+ data.tar.gz: a3b5b208d6707d52e364c7afea4d430a11cb3e0740db23e27a5df7cf4c7beff9
5
5
  SHA512:
6
- metadata.gz: be377da8d5d82fbb647e47e1203599bee8ad0f32b287c54154a9b8af1edd6d69762b949f5c021368b9ba6cfa9019d5a99694dacfe7a4ddd4c7284c812c82935b
7
- data.tar.gz: 47a1a2d0bf69408344f88abcbf44d86a877e388737987e038925c4dc63fc11303ffc1cbc38b70e7cf874fa07f26dc07e9c63e2a4d2b88357ea528603805c7978
6
+ metadata.gz: 75931cc9b6f7b80b5b82605aa5126e64ece40f3a9b65dad26fa6da81b20f189c2ee4f8b11ba7dbb76fc81c836e8ec61e619382a2385c465df224dbc74e23a001
7
+ data.tar.gz: 8a4467800b1ca58653a3b9bded35813f6d47d2d25ec55bf5352c59a41f6d2967798d9331af924a8cd2fb9b85963d71f974c864c1e3dee93c29d04ab44199482b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clausewitz-spelling (0.2.2)
4
+ clausewitz-spelling (0.2.3)
5
5
  colorize
6
6
  damerau-levenshtein
7
7
  ffi-hunspell-wtchappell
@@ -80,7 +80,11 @@ module Clausewitz
80
80
  end
81
81
 
82
82
  def self.smudge_key(line)
83
- line.sub(/\:([0-9]+) /, '!!!\1: ')
83
+ if line =~ / \w+\:([0-9]+) \"/
84
+ line.sub(/\:([0-9]+) /, '!!!\1: ')
85
+ else
86
+ line
87
+ end
84
88
  end
85
89
 
86
90
  def self.validate_localisation!(contents)
@@ -138,6 +138,8 @@ module Clausewitz; module Spelling
138
138
  words.map! do |word|
139
139
  if word =~ /[[:alpha:]]\.$/ && word.chars.count('.') == 1
140
140
  word.sub(/\.$/, '')
141
+ elsif word =~ /:$/
142
+ word.sub(/:$/, '')
141
143
  else
142
144
  word
143
145
  end
@@ -155,6 +157,7 @@ module Clausewitz; module Spelling
155
157
  return if is_icon?(word)
156
158
  return if is_initial?(word)
157
159
  return if is_psalm?(word)
160
+ return if is_tag?(word)
158
161
 
159
162
  lang_dict = @loaded_dicts[lc.name]
160
163
  if !lang_dict.check?(word)
@@ -192,6 +195,10 @@ module Clausewitz; module Spelling
192
195
  word =~ /%(-|\+)?[0-9]+(\.[0-9]+)?/
193
196
  end
194
197
 
198
+ def is_tag?(word)
199
+ word =~ /@\w\w\w/
200
+ end
201
+
195
202
  def language_config(language_name)
196
203
  language_name = "l_#{language_name}" if language_name !~ /^l_/
197
204
  lang_config = Localisation::LANG_MAP.find do |config_key, _|
@@ -1,5 +1,5 @@
1
1
  module Clausewitz
2
2
  module Spelling
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clausewitz-spelling
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Chappell