<commit_before>require 'formula'

class Hunspell < Formula
  homepage 'http://hunspell.sourceforge.net/'
  url 'http://downloads.sourceforge.net/hunspell/hunspell-1.3.2.tar.gz'
  sha1 '902c76d2b55a22610e2227abc4fd26cbe606a51c'

  depends_on 'readline'

  def patches
    # hunspell does not prepend $HOME to all USEROODIRs
    # http://sourceforge.net/p/hunspell/bugs/236/
    { :p0 => DATA }
  end

  def install
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--with-ui",
                          "--with-readline"
    system "make"
    ENV.deparallelize
    system "make install"
  end
end<commit_msg>hunspell: Add caveats about how to obtain dictionaries<commit_after>require 'formula'

class Hunspell < Formula
  homepage 'http://hunspell.sourceforge.net/'
  url 'http://downloads.sourceforge.net/hunspell/hunspell-1.3.2.tar.gz'
  sha1 '902c76d2b55a22610e2227abc4fd26cbe606a51c'

  depends_on 'readline'

  def patches
    # hunspell does not prepend $HOME to all USEROODIRs
    # http://sourceforge.net/p/hunspell/bugs/236/
    { :p0 => DATA }
  end

  def install
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--with-ui",
                          "--with-readline"
    system "make"
    ENV.deparallelize
    system "make install"
  end

  def caveats; <<-EOS.undent
    Dictionary files (*.aff and *.dic) should be placed in
    ~/Library/Spelling/ or /Library/Spelling/.  Homebrew itself
    provides no dictionaries for Hunspell, but you can download
    compatible dictionaries from other sources, such as
    https://wiki.openoffice.org/wiki/Dictionaries .
    EOS
  end
end
{'fraction_non_alphanumeric': 0.11464245175936436, 'fraction_numerical': 0.03745743473325766, 'mean_word_length': 2.396917148362235, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3366349', 'n_tokens_mistral': 623, 'n_tokens_neox': 581, 'n_words': 128}