<commit_before>require "formula"

class Queequeg < Formula
  homepage "http://queequeg.sourceforge.net/"
  url "https://downloads.sourceforge.net/project/queequeg/queequeg/queequeg-0.91/queequeg-0.91.tar.gz"
  sha1 "e0ceae717a297ee866e38ae7fd10c216df1232e9"

  bottle do
    cellar :any
    sha1 "865d487cdd7f447eee5cc102b2d5f79efdc1fb9e" => :yosemite
    sha1 "c088cb0e9a0ddc16c113fc8ff41446376d7f755c" => :mavericks
    sha1 "8cc2f12a1c395d8e1693f5ed6b37b94307968541" => :mountain_lion
  end

  depends_on :python if MacOS.version <= :snow_leopard
  depends_on "wordnet"

  def install
    # Build the dictionary
    system "make", "dict", "WORDNETDICT=#{Formula["wordnet"].opt_prefix}/dict"

    # Install python files and dictionary into libexec
    install_list = ["abstfilter.py", "constraint.py", "convdict.py",
                    "dictionary.py", "document.py",
                    "grammarerror.py", "markupbase_rev.py", "output.py",
                    "postagfix.py", "pstring.py", "qq", "regpat.py",
                    "sentence.py", "sgmllib_rev.py", "texparser.py", "unification.py"]
    libexec.install install_list
    if File.exist? "dict.cdb"
      libexec.install "dict.cdb"
    else
      libexec.install "dict.txt"
    end
    # Write a wrapper for qq
    bin.write_exec_script "#{libexec}/qq"
  end

  test do
    (testpath/"filename").write "This is a test."
    system "#{bin}/qq", "#{testpath}/filename"
  end
end
<commit_msg>queequeg: general cleanup.<commit_after>require "formula"

class Queequeg < Formula
  homepage "http://queequeg.sourceforge.net/"
  url "https://downloads.sourceforge.net/project/queequeg/queequeg/queequeg-0.91/queequeg-0.91.tar.gz"
  sha1 "e0ceae717a297ee866e38ae7fd10c216df1232e9"

  bottle do
    cellar :any
    sha1 "865d487cdd7f447eee5cc102b2d5f79efdc1fb9e" => :yosemite
    sha1 "c088cb0e9a0ddc16c113fc8ff41446376d7f755c" => :mavericks
    sha1 "8cc2f12a1c395d8e1693f5ed6b37b94307968541" => :mountain_lion
  end

  depends_on :python if MacOS.version <= :snow_leopard
  depends_on "wordnet"

  def install
    system "make", "dict", "WORDNETDICT=#{Formula["wordnet"].opt_prefix}/dict"

    libexec.install "abstfilter.py", "constraint.py", "convdict.py",
                    "dictionary.py", "document.py",
                    "grammarerror.py", "markupbase_rev.py", "output.py",
                    "postagfix.py", "pstring.py", "qq", "regpat.py",
                    "sentence.py", "sgmllib_rev.py", "texparser.py",
                    "unification.py"

    if File.exist? "dict.cdb"
      libexec.install "dict.cdb"
    else
      libexec.install "dict.txt"
    end

    bin.write_exec_script "#{libexec}/qq"
  end

  test do
    (testpath/"filename").write "This is a test."
    system "#{bin}/qq", "#{testpath}/filename"
  end
end

{'fraction_non_alphanumeric': 0.13161659513590845, 'fraction_numerical': 0.07510729613733906, 'mean_word_length': 3.168405365126677, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4183184', 'n_tokens_mistral': 1182, 'n_tokens_neox': 1062, 'n_words': 177}