Module: Spellchecker::Dictionaries::CompanyNames

Defined in:
lib/spellchecker/dictionaries/company_names.rb

Constant Summary collapse

PATH =
Dictionaries.path.join('company_names.txt')
MUTEX =
Mutex.new

Class Method Summary collapse

Class Method Details

.allSet<String>

Returns:

  • (Set<String>)


12
13
14
15
16
# File 'lib/spellchecker/dictionaries/company_names.rb', line 12

def all
  @all || MUTEX.synchronize do
    @all ||= Set.new(PATH.read.split("\n"))
  end
end

.include?(string) ⇒ Boolean

Parameters:

  • string (String)

Returns:

  • (Boolean)


20
21
22
23
24
# File 'lib/spellchecker/dictionaries/company_names.rb', line 20

def include?(string)
  return false unless string

  all.include?(Utils.remove_suffix(string))
end