clausewitz-spelling 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07f166ec066c41fe82fdd61014870b6638fa80d5
4
- data.tar.gz: 6c6d3ea774873bcddd50aa703f74fa801fb1af21
3
+ metadata.gz: c0564ca99b4065d79b5902280d97b454f48882bf
4
+ data.tar.gz: e574cd3c5a648bf68436640c8866ff064c9cafb1
5
5
  SHA512:
6
- metadata.gz: 386faf80d7f86c679b0628cde0e5bf35a89a3c4d4d68c50b6f2b5acd240e7ab0a3d95f7ff0b68e4b78b3508945d195e943836fd908e9919ee25e90570b9eec63
7
- data.tar.gz: 2e9b7dd0aecf752060593bccbb983d63163b95917e9834215d99ca971bfdc07bc89e01d4e20ddb9e4b1e492066a8378adfb4528b366eeb649d34e2c06504f7e3
6
+ metadata.gz: 8ff64ee86d2c5d3d103ab34ab9a89ff7754a7972ef7a83e99fd59f9a0d186a549f80d94d0f555967b1625b5978a8fd15bfcd4c32740f76d7c9fc51028778e9dd
7
+ data.tar.gz: 7f5d69f5243b58683edb87ff950148e30f7d6d07fd9c06b8ccd359287405d1791adb83f0bb680ef5f1c7c1d5ab6bb9b5fcc4d5b066b23c35d311167524366ea0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clausewitz-spelling (0.1.11)
4
+ clausewitz-spelling (0.1.12)
5
5
  colorize
6
6
  damerau-levenshtein
7
7
  ffi-aspell
@@ -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 =~ /\.$/ && word.chars.count('.') == 1
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
@@ -1,5 +1,5 @@
1
1
  module Clausewitz
2
2
  module Spelling
3
- VERSION = "0.1.11"
3
+ VERSION = "0.1.12"
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.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Chappell