<commit_before>class Whatsa::Disambig
  attr_accessor :descriptions
  attr_reader :title, :items

  def initialize(noko_doc)
    @title = noko_doc.css('h1').text
    @items = noko_doc.css('#mw-content-text li')
    @descriptions = make_descriptions
  end

  def choices
    self.descriptions.keys
  end

  private

  # make a hash with links and their descriptions
  def make_descriptions
    self.items.inject({}) do |memo, item|
      unless item.css('a').empty?
        memo[item.css('a').first.text] = item.text.split("\n").first
      end
      memo
    end
  end

end<commit_msg>got rid of whitespace in choice descriptions<commit_after>class Whatsa::Disambig
  attr_accessor :descriptions
  attr_reader :title, :items

  def initialize(noko_doc)
    @title = noko_doc.css('h1').text
    @items = noko_doc.css('#mw-content-text li')
    @descriptions = make_descriptions
  end

  def choices
    self.descriptions.keys
  end

  private

  # make a hash with links and their descriptions
  def make_descriptions
    self.items.inject({}) do |memo, item|
      unless item.css('a').empty?
        memo[item.css('a').first.text] = item.text.split("\n").first.strip
      end
      memo
    end
  end

end
{'fraction_non_alphanumeric': 0.11350455675227837, 'fraction_numerical': 0.0016570008285004142, 'mean_word_length': 3.136986301369863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2094122', 'n_tokens_mistral': 410, 'n_tokens_neox': 399, 'n_words': 95}