<commit_before>require 'formula'

class StanfordParser < Formula
  url 'http://nlp.stanford.edu/software/stanford-parser-2010-02-26.tgz'
  homepage 'http://nlp.stanford.edu/software/lex-parser.shtml'
  md5 '25e26c79d221685956d2442592321027'
  version '1.6.2'

  def shim_script target_script
    <<-EOS
#!/bin/bash
exec "#{libexec}/#{target_script}" $@
EOS
  end

  def install
    libexec.install Dir['*']
    Dir["#{libexec}/*.csh"].each do |f|
      f = File.basename(f)
      (bin+f).write shim_script(f)
    end
  end

  def test
    system "#{bin}/lexparser.csh", "#{libexec}/testsent.txt"
  end
end<commit_msg>stanford-parser 2.0<commit_after>require 'formula'

class StanfordParser < Formula
  homepage 'http://nlp.stanford.edu/software/lex-parser.shtml'
  url 'http://nlp.stanford.edu/software/stanford-parser-2012-02-03.tgz'
  md5 'ebb6c7362b02c8b17832854421d6bb49'
  version '2.0'

  def shim_script target_script
    <<-EOS.undent
    #!/bin/bash
    exec "#{libexec}/#{target_script}" "$@"
    EOS
  end

  def install
    libexec.install Dir['*']
    Dir["#{libexec}/*.sh"].each do |f|
      f = File.basename(f)
      (bin+f).write shim_script(f)
    end
  end

  def test
    system "#{bin}/lexparser.sh", "#{libexec}/data/testsent.txt"
  end
end
{'fraction_non_alphanumeric': 0.16085578446909668, 'fraction_numerical': 0.059429477020602216, 'mean_word_length': 3.4006968641114983, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3712511', 'n_tokens_mistral': 553, 'n_tokens_neox': 502, 'n_words': 84}