namae 0.6.0 → 0.7.0

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.
data/lib/namae/parser.rb CHANGED
@@ -121,11 +121,15 @@ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 90)
121
121
  end
122
122
 
123
123
  def will_see_suffix?
124
- input.peek(8).to_s.split(/\s+/)[0] =~ suffix
124
+ input.peek(8).to_s.strip.split(/\s+/)[0] =~ suffix
125
125
  end
126
126
 
127
+ def will_see_initial?
128
+ input.peek(6).to_s.strip.split(/\s+/)[0] =~ /[[:alpha:]]\./
129
+ end
130
+
127
131
  def seen_full_name?
128
- prefer_comma_as_separator? && @words > 1
132
+ prefer_comma_as_separator? && @words > 1 && !will_see_initial?
129
133
  end
130
134
 
131
135
  def next_token
data/lib/namae/parser.y CHANGED
@@ -195,11 +195,15 @@ require 'strscan'
195
195
  end
196
196
 
197
197
  def will_see_suffix?
198
- input.peek(8).to_s.split(/\s+/)[0] =~ suffix
198
+ input.peek(8).to_s.strip.split(/\s+/)[0] =~ suffix
199
199
  end
200
200
 
201
+ def will_see_initial?
202
+ input.peek(6).to_s.strip.split(/\s+/)[0] =~ /[[:alpha:]]\./
203
+ end
204
+
201
205
  def seen_full_name?
202
- prefer_comma_as_separator? && @words > 1
206
+ prefer_comma_as_separator? && @words > 1 && !will_see_initial?
203
207
  end
204
208
 
205
209
  def next_token
data/lib/namae/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Namae
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 6
4
+ MINOR = 7
5
5
  PATCH = 0
6
6
  BUILD = nil
7
7
 
data/namae.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "namae"
8
- s.version = "0.6.0"
8
+ s.version = "0.7.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sylvester Keil", "Dan Collis-Puro"]
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.6.0
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -147,7 +147,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
147
147
  version: '0'
148
148
  segments:
149
149
  - 0
150
- hash: -2694601471904958389
150
+ hash: -219042018557465799
151
151
  required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  none: false
153
153
  requirements: