namae 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/features/examples.feature +2 -0
- data/lib/namae/parser.rb +5 -1
- data/lib/namae/parser.y +5 -1
- data/lib/namae/version.rb +2 -2
- data/namae.gemspec +3 -3
- data/spec/namae/parser_spec.rb +1 -1
- 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: 4d9f2056c44415634fdd0b968119872820548867
|
4
|
+
data.tar.gz: 25b9ca58158c63a0e12b0dca520f709ca5f97e4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0f4bf53e0aebb1371ffd850e75ff108eb69c293f64bd6aaafd39533c53fb0902d60467bf201740f715109eb6230923fcbe91814c9bc8da2898e13f739231d6b
|
7
|
+
data.tar.gz: 8a8181d58ae478bbe2a9ea4fac39720f25a3721b058ace4ce4f1e159bc8b2528d0723759e7ce66b263048ed0c28001dea172af2c8fb3bc90117352a6d24f657f
|
data/.travis.yml
CHANGED
data/features/examples.feature
CHANGED
@@ -20,6 +20,8 @@ Feature: Parse the names in the Readme file
|
|
20
20
|
| Ms. Sofia Kovalevskaya | Sofia | | Kovalevskaya | | | Ms. | |
|
21
21
|
| Countess Ada Lovelace | Ada | | Lovelace | | Countess | | |
|
22
22
|
| Augusta Ada King | Augusta Ada | | King | | | | |
|
23
|
+
| Julia Herr | Julia | | Herr | | | | |
|
24
|
+
| Herr, Julia | Julia | | Herr | | | | |
|
23
25
|
|
24
26
|
@readme @sort
|
25
27
|
Scenarios: Readme examples (sort-order)
|
data/lib/namae/parser.rb
CHANGED
@@ -160,7 +160,11 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 107)
|
|
160
160
|
when input.scan(suffix)
|
161
161
|
consume_word(:SUFFIX, input.matched.strip)
|
162
162
|
when input.scan(appellation)
|
163
|
-
|
163
|
+
if @words.zero?
|
164
|
+
[:APPELLATION, input.matched.strip]
|
165
|
+
else
|
166
|
+
consume_word(:UWORD, input.matched)
|
167
|
+
end
|
164
168
|
when input.scan(/((\\\w+)?\{[^\}]*\})*[[:upper:]][^\s#{stops}]*/)
|
165
169
|
consume_word(:UWORD, input.matched)
|
166
170
|
when input.scan(/((\\\w+)?\{[^\}]*\})*[[:lower:]][^\s#{stops}]*/)
|
data/lib/namae/parser.y
CHANGED
@@ -251,7 +251,11 @@ require 'strscan'
|
|
251
251
|
when input.scan(suffix)
|
252
252
|
consume_word(:SUFFIX, input.matched.strip)
|
253
253
|
when input.scan(appellation)
|
254
|
-
|
254
|
+
if @words.zero?
|
255
|
+
[:APPELLATION, input.matched.strip]
|
256
|
+
else
|
257
|
+
consume_word(:UWORD, input.matched)
|
258
|
+
end
|
255
259
|
when input.scan(/((\\\w+)?\{[^\}]*\})*[[:upper:]][^\s#{stops}]*/)
|
256
260
|
consume_word(:UWORD, input.matched)
|
257
261
|
when input.scan(/((\\\w+)?\{[^\}]*\})*[[:lower:]][^\s#{stops}]*/)
|
data/lib/namae/version.rb
CHANGED
data/namae.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: namae 0.
|
5
|
+
# stub: namae 0.11.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "namae".freeze
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.11.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Sylvester Keil".freeze, "Dan Collis-Puro".freeze]
|
14
|
-
s.date = "2016-
|
14
|
+
s.date = "2016-06-20"
|
15
15
|
s.description = " Namae (\u{540d}\u{524d}) is a parser for human names. It recognizes personal names of various cultural backgrounds and tries to split them into their component parts (e.g., given and family names, honorifics etc.). ".freeze
|
16
16
|
s.email = ["sylvester@keil.or.at".freeze, "dan@collispuro.com".freeze]
|
17
17
|
s.extra_rdoc_files = [
|
data/spec/namae/parser_spec.rb
CHANGED
@@ -74,7 +74,7 @@ module Namae
|
|
74
74
|
|
75
75
|
%w{Mr. Mr Mrs. Ms Herr Frau Miss}.each do |appellation|
|
76
76
|
describe "the next token is #{appellation.inspect}" do
|
77
|
-
before { parser.send(:input).string = appellation }
|
77
|
+
before { parser.reset.send(:input).string = appellation }
|
78
78
|
it 'returns an APPELLATION token' do
|
79
79
|
expect(parser.send(:next_token)).to eq([:APPELLATION, appellation])
|
80
80
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: namae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: simplecov
|