namae 0.10.0 → 0.10.1

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: 7e3498b418afe338293a9fe9c7b4c8747ee014b2
4
- data.tar.gz: cac2386cd67b385330b50a8d722429100020b2e6
3
+ metadata.gz: ca19aae411bcf041601add1b75bca7331c35f1a7
4
+ data.tar.gz: 2e7abaa42672658edc7bd74e3a6cca1d4f728af4
5
5
  SHA512:
6
- metadata.gz: a2001bf45ca48aa8d9d1a8f31143a3687f5013ffa4e8be7837c7efa08a5acb9257cd8e7685a0ee19f89a49d8e4bf841a596cc99e734087d6bb32828c025b0e34
7
- data.tar.gz: e7b62fc3a1278938f42e5fcee152cf47ba06e5378f3bedef6bc238d3983a11d2ffc25bc7ec6c8dd90655dc6ca29f976d62e2c3dd710d6cd0700056481244f1d3
6
+ metadata.gz: b885c997dd74538dfeda15264f22ae1fa519f2ece551ed63a7a2efd99e3f6a4e7b57395801416a3fd0b3c512f5e379c3497fd669c26371ec33e68e1328a50ee2
7
+ data.tar.gz: 908cd4363fe01f26abafac6412db202986277ce137bd70f0e0aad0aa0ca7d552ceed010a465f9627114c91a0b42b87717818a2685076be9047b3da8c7dc185cf
data/lib/namae/parser.rb CHANGED
@@ -25,7 +25,7 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 107)
25
25
  :comma => ',',
26
26
  :stops => ',;',
27
27
  :separator => /\s*(\band\b|\&|;)\s*/i,
28
- :title => /\s*\b(sir|lord|count(ess)?|(prof|dr|md|ph\.?d)\.?)(\s+|$)/i,
28
+ :title => /\s*\b(sir|lord|count(ess)?|(gen|adm|col|maj|capt|cmdr|lt|sgt|cpl|pvt|prof|dr|md|ph\.?d)\.?)(\s+|$)/i,
29
29
  :suffix => /\s*\b(JR|Jr|jr|SR|Sr|sr|[IVX]{2,})(\.|\b)/,
30
30
  :appellation => /\s*\b((mrs?|ms|fr|hr)\.?|miss|herr|frau)(\s+|$)/i
31
31
  }
data/lib/namae/parser.y CHANGED
@@ -116,7 +116,7 @@ require 'strscan'
116
116
  :comma => ',',
117
117
  :stops => ',;',
118
118
  :separator => /\s*(\band\b|\&|;)\s*/i,
119
- :title => /\s*\b(sir|lord|count(ess)?|(prof|dr|md|ph\.?d)\.?)(\s+|$)/i,
119
+ :title => /\s*\b(sir|lord|count(ess)?|(gen|adm|col|maj|capt|cmdr|lt|sgt|cpl|pvt|prof|dr|md|ph\.?d)\.?)(\s+|$)/i,
120
120
  :suffix => /\s*\b(JR|Jr|jr|SR|Sr|sr|[IVX]{2,})(\.|\b)/,
121
121
  :appellation => /\s*\b((mrs?|ms|fr|hr)\.?|miss|herr|frau)(\s+|$)/i
122
122
  }
data/lib/namae/version.rb CHANGED
@@ -2,7 +2,7 @@ module Namae
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 10
5
- PATCH = 0
5
+ PATCH = 1
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.').freeze
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.10.0 ruby lib
5
+ # stub: namae 0.10.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "namae"
9
- s.version = "0.10.0"
9
+ s.version = "0.10.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Sylvester Keil", "Dan Collis-Puro"]
14
- s.date = "2015-04-26"
14
+ s.date = "2015-05-10"
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.). "
16
16
  s.email = ["sylvester@keil.or.at", "dan@collispuro.com"]
17
17
  s.extra_rdoc_files = [
@@ -52,7 +52,7 @@ Gem::Specification.new do |s|
52
52
  ]
53
53
  s.homepage = "https://github.com/berkmancenter/namae"
54
54
  s.licenses = ["AGPL"]
55
- s.rubygems_version = "2.4.5"
55
+ s.rubygems_version = "2.4.6"
56
56
  s.summary = "Namae (\u{540d}\u{524d}) parses personal names and splits them into their component parts."
57
57
 
58
58
  if s.respond_to? :specification_version then
@@ -106,6 +106,19 @@ module Namae
106
106
  end
107
107
  end
108
108
  end
109
+
110
+ %w{Gen. Adm Col. Maj Capt. Cmdr. Lt. Sgt. Cpl Pvt.}.each do |title|
111
+ describe "the next token is #{title.inspect}" do
112
+ before { parser.send(:input).string = title }
113
+ it 'returns a TITLE token' do
114
+ expect(parser.send(:next_token)).to eq([:TITLE, title])
115
+ end
116
+
117
+ it 'the input matches the suffix pattern' do
118
+ expect(parser.title).to match(title)
119
+ end
120
+ end
121
+ end
109
122
  end
110
123
 
111
124
  describe '#parse!' do
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.10.0
4
+ version: 0.10.1
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: 2015-04-26 00:00:00.000000000 Z
12
+ date: 2015-05-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simplecov
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  requirements: []
131
131
  rubyforge_project:
132
- rubygems_version: 2.4.5
132
+ rubygems_version: 2.4.6
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Namae (名前) parses personal names and splits them into their component parts.