clausewitz-spelling 0.1.11 → 0.1.12
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/lib/clausewitz/spelling/checker.rb +9 -2
- data/lib/clausewitz/spelling/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0564ca99b4065d79b5902280d97b454f48882bf
|
4
|
+
data.tar.gz: e574cd3c5a648bf68436640c8866ff064c9cafb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ff64ee86d2c5d3d103ab34ab9a89ff7754a7972ef7a83e99fd59f9a0d186a549f80d94d0f555967b1625b5978a8fd15bfcd4c32740f76d7c9fc51028778e9dd
|
7
|
+
data.tar.gz: 7f5d69f5243b58683edb87ff950148e30f7d6d07fd9c06b8ccd359287405d1791adb83f0bb680ef5f1c7c1d5ab6bb9b5fcc4d5b066b23c35d311167524366ea0
|
data/Gemfile.lock
CHANGED
@@ -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
|
@@ -88,7 +88,9 @@ module Clausewitz; module Spelling
|
|
88
88
|
words.map! do |word|
|
89
89
|
if word.end_with?('...')
|
90
90
|
word.sub(/\.\.\.$/, '')
|
91
|
-
elsif word =~
|
91
|
+
elsif word =~ /[[:alpha:]]\.$/ && word.chars.count('.') == 1
|
92
|
+
word.sub(/\.$/, '')
|
93
|
+
elsif word =~ /\d\.$/ && word.chars.count('.') == 2
|
92
94
|
word.sub(/\.$/, '')
|
93
95
|
elsif word =~ /,$/
|
94
96
|
word.sub(/,$/, '')
|
@@ -106,6 +108,7 @@ module Clausewitz; module Spelling
|
|
106
108
|
return if is_ordinal?(word)
|
107
109
|
return if is_percentage?(word)
|
108
110
|
return if is_icon?(word)
|
111
|
+
return if is_define?(word)
|
109
112
|
return if wordlist.include?(word)
|
110
113
|
|
111
114
|
if !checker.correct?(word)
|
@@ -136,6 +139,10 @@ module Clausewitz; module Spelling
|
|
136
139
|
word =~ /^£\w+/
|
137
140
|
end
|
138
141
|
|
142
|
+
def is_define?(word)
|
143
|
+
word =~ /^\$\w+\$/
|
144
|
+
end
|
145
|
+
|
139
146
|
def is_number?(word)
|
140
147
|
Float(word) != nil rescue false
|
141
148
|
end
|