name-tamer 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/name-tamer.rb +6 -5
- data/lib/name-tamer/version.rb +1 -1
- data/lib/string_extras.rb +1 -1
- data/spec/name_tamer_spec.rb +15 -3
- 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: 2706fda214e230fdf9bda63cc4424842183672e3
|
4
|
+
data.tar.gz: 89f191da4268cfbca81674335e3dfe5abec626a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc8d7e0474059fe5e3680cc720655c303628fbb1ea25fe638e2e630582374720dd867b1b149c18990503d2c7e3d68ead42b896f41331c2fc650f13287146e438
|
7
|
+
data.tar.gz: 16e081e040d86117620e5a1760e8cf49328264adf9488ab29f3f8649d4e732247f30b4ed430005bd5ba51063ce03d196728e9323e0b1b300912dd32993282de8
|
data/Gemfile.lock
CHANGED
data/lib/name-tamer.rb
CHANGED
@@ -241,10 +241,11 @@ class NameTamer
|
|
241
241
|
end
|
242
242
|
|
243
243
|
def standardize_words
|
244
|
-
@simple_name.gsub!(/ *& */, ' and ')
|
245
|
-
@simple_name.gsub!(/ *\+ */, ' plus ')
|
246
|
-
@simple_name.gsub!(/\bintl\b/i, 'International')
|
247
|
-
@simple_name.gsub!(/[
|
244
|
+
@simple_name.gsub!(/ *& */, ' and ') # replace ampersand characters with ' and '
|
245
|
+
@simple_name.gsub!(/ *\+ */, ' plus ') # replace plus signs with ' plus '
|
246
|
+
@simple_name.gsub!(/\bintl\b/i, 'International') # replace 'intl' with 'International'
|
247
|
+
@simple_name.gsub!(/[־‐‑‒–—―−﹘﹣-]/, SLUG_DELIMITER) # Replace Unicode dashes with ASCII hyphen
|
248
|
+
@simple_name.strip_unwanted!(/["“”™℠®©℗]/) # remove quotes and commercial decoration
|
248
249
|
end
|
249
250
|
|
250
251
|
#--------------------------------------------------------
|
@@ -364,7 +365,7 @@ class NameTamer
|
|
364
365
|
new_string
|
365
366
|
.whitespace_to!(sep)
|
366
367
|
.invalid_chars_to!(sep)
|
367
|
-
.
|
368
|
+
.strip_unwanted!(filter)
|
368
369
|
.fix_separators!(sep)
|
369
370
|
.approximate_latin_chars!
|
370
371
|
|
data/lib/name-tamer/version.rb
CHANGED
data/lib/string_extras.rb
CHANGED
data/spec/name_tamer_spec.rb
CHANGED
@@ -133,8 +133,8 @@ describe NameTamer do
|
|
133
133
|
{ n: 'โชติวัน วัฒนลาภ', t: :organization, nn: 'โชติวัน วัฒนลาภ', sn: 'โชติวัน วัฒนลาภ', s: 'โชติวัน-วัฒนลาภ' },
|
134
134
|
{ n: '張 續寶', t: :organization, nn: '張 續寶', sn: '張 續寶', s: '張-續寶' },
|
135
135
|
{ n: 'Юрий Гайдук', t: :organization, nn: 'Юрий Гайдук', sn: 'Юрий Гайдук', s: 'Юрий-Гайдук' },
|
136
|
-
{ n: '☣ ©Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣', t: :organization, nn: '☣ ©Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣', sn: '☣
|
137
|
-
s: '
|
136
|
+
{ n: '☣ ©Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣', t: :organization, nn: '☣ ©Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣', sn: '☣ Ʀѱ∏†ʘ Σɏ§†℈Ϻ ☣',
|
137
|
+
s: '☣-Ʀѱ∏†ʘ-Σɏ§†℈Ϻ-☣' },
|
138
138
|
{ n: '♠ KlasikB0i ♠', t: :organization, nn: '♠ KlasikB0i ♠', sn: '♠ KlasikB0i ♠', s: '♠-klasikb0i-♠' },
|
139
139
|
{ n: '* Shorusan *', t: :organization, nn: '* Shorusan *', sn: '* Shorusan *', s: 'shorusan' },
|
140
140
|
{ n: '项目谷', t: :organization, nn: '项目谷', sn: '项目谷', s: '项目谷' },
|
@@ -169,7 +169,19 @@ describe NameTamer do
|
|
169
169
|
{ n: 'John Smith M.A. (Oxon)', t: :person, nn: 'John Smith', sn: 'John Smith', s: 'john-smith' },
|
170
170
|
{ n: 'I B M', t: :organization, nn: 'Ibm', sn: 'Ibm', s: 'ibm' },
|
171
171
|
{ n: 'I-B-M', t: :organization, nn: 'I-B-M', sn: 'I-B-M', s: 'i-b-m' },
|
172
|
-
{ n: 'I.B.M.', t: :organization, nn: 'I.B.M.', sn: 'IBM', s: 'ibm' }
|
172
|
+
{ n: 'I.B.M.', t: :organization, nn: 'I.B.M.', sn: 'IBM', s: 'ibm' },
|
173
|
+
{ n: 'Unusuals — the ad industry network', t: :organization,
|
174
|
+
nn: 'Unusuals — the ad industry network',
|
175
|
+
sn: 'Unusuals - the ad industry network',
|
176
|
+
s: 'unusuals-the-ad-industry-network'
|
177
|
+
},
|
178
|
+
{
|
179
|
+
n: 'Scout® Loyalty Optimizer',
|
180
|
+
t: :organization,
|
181
|
+
nn: 'Scout® Loyalty Optimizer',
|
182
|
+
sn: 'Scout Loyalty Optimizer',
|
183
|
+
s: 'scout-loyalty-optimizer'
|
184
|
+
}
|
173
185
|
]
|
174
186
|
end
|
175
187
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: name-tamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xenapto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|