lib/name_tamer.rb in name-tamer-0.0.0 vs lib/name_tamer.rb in name-tamer-0.0.1
- old
+ new
@@ -8,11 +8,10 @@
# http://en.wikipedia.org/wiki/List_of_post-nominal_letters_(USA)
# http://en.wikipedia.org/wiki/List_of_post-nominal_letters_(United_Kingdom)
# http://en.wikipedia.org/wiki/Nobiliary_particle
# http://en.wikipedia.org/wiki/Spanish_naming_customs
# http://linguistlist.org/pubs/tocs/JournalUnifiedStyleSheet2007.pdf [PDF]
-require 'active_support/core_ext/object'
class NameTamer
attr_reader :name, :contact_type
class << self
@@ -276,18 +275,18 @@
# We pass to this routine either prefixes or suffixes
def remove_outermost_adfix adfix_type, name_part
adfixes = ADFIX_PATTERNS[adfix_type]
contact_type = contact_type_best_effort
parts = name_part.partition adfixes[contact_type]
- @adfix_found = parts[1].present?
+ @adfix_found = !parts[1].empty?
# If the contact type is indeterminate and we didn't find a diagnostic adfix
# for a person then try again for an organization
if @contact_type.nil?
unless @adfix_found
contact_type = :organization
parts = name_part.partition adfixes[contact_type]
- @adfix_found = parts[1].present?
+ @adfix_found = !parts[1].empty?
end
end
if @adfix_found
# If we've found a diagnostic adfix then set the contact type