lib/noble_names.rb
# Corrects only the business particle and leaves the
# other words alone.
# @param [Array] words An array of words to be checked.
# @return [Array] words An array of corrected words.
# @example A Business Name
#   correct_business_particles([
#     'cool', 'and', 'hip', 'gmbh'
#   ])                    #=> ['cool', 'and', 'hip', 'GmbH']
Corrects only the business particle and leaves the
other words alone.
Corrects only the business particle and leaves the other words alone .
def correct_business_particles(words)
      words.map! do |word|
        if business_particle?(word)
          word
            .replace(Data.business_particles.particles[word.downcase])
        else
          word
        end
      end
    end
def correct_business_particles ( words ) words . map! do | word | if business_particle? ( word ) word . replace ( Data . business_particles . particles [ word . downcase ] ) else word end end end
Corrects only the business particle and leaves the
other words alone.
Corrects only the business particle and leaves the other words alone .
words An array of corrected words.
words An array of corrected words .
Array
words
<not_specific>
<not_specific>
words An array of words to be checked.
words An array of words to be checked .
example
A Business Name correct_business_particles([ 'cool', 'and', 'hip', 'gmbh' ]) #=> ['cool', 'and', 'hip', 'GmbH']
A Business Name correct_business_particles ( [ ' cool ' ' and ' ' hip ' ' gmbh ' ] ) # = > [ ' cool ' ' and ' ' hip ' ' GmbH ' ]