<commit_before>require 'fileutils'
require 'forwardable'
require 'singleton'

require 'lru_redux'
require 'simstring_pure'
require 'text'

class SecurityNameDatabase
  class << self
    def phonetic_key(company_name)
      words = company_name.gsub(/\s+/m, ' ').strip.split(" ")
      phonetic_words = words.map {|word| Text::Metaphone.double_metaphone(word).first }
      phonetic_words.join(" ")<commit_msg>adding comment<commit_after>require 'fileutils'
require 'forwardable'
require 'singleton'

require 'lru_redux'
require 'simstring_pure'
require 'text'

class SecurityNameDatabase
  class << self
    # uses Double Metaphone (and perhaps in the future Metaphone 3 - see https://github.com/OpenRefine/OpenRefine/blob/master/main/src/com/google/refine/clustering/binning/Metaphone3.java)
    def phonetic_key(company_name)
      words = company_name.gsub(/\s+/m, ' ').strip.split(" ")
      phonetic_words = words.map {|word| Text::Metaphone.double_metaphone(word).first }
      phonetic_words.join(" ")
{'fraction_non_alphanumeric': 0.1259920634920635, 'fraction_numerical': 0.001984126984126984, 'mean_word_length': 4.832369942196531, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2241475', 'n_tokens_mistral': 346, 'n_tokens_neox': 333, 'n_words': 65}