<commit_before>require 'formula'

class SwishE < Formula
  homepage 'http://swish-e.org/'
  url 'http://swish-e.org/distribution/swish-e-2.4.7.tar.gz'
  sha1 '0970c5f8dcb2f12130b38a9fc7dd99c2f2d7ebcb'

  depends_on 'libxml2'

  def install
    system "./configure", "--prefix=#{prefix}", "--mandir=#{man}"
    system "make install"
  end
end<commit_msg>swish-e: cleanup and add test.<commit_after>class SwishE < Formula
  homepage "http://swish-e.org/"
  url "http://swish-e.org/distribution/swish-e-2.4.7.tar.gz"
  sha256 "5ddd541ff8ecb3c78ad6ca76c79e620f457fac9f7d0721ad87e9fa22fe997962"

  depends_on "libxml2"

  def install
    system "./configure", "--prefix=#{prefix}", "--mandir=#{man}"
    system "make", "install"
  end

  test do
    system bin/"swish-e", "-S", "fs", "-i", *Dir[HOMEBREW_PREFIX/"*.md"]
    output = shell_output("#{bin}/swish-e -w respect")
    assert_match /^# Number of hits: [1-9]\d*$/, output
  end
end
{'fraction_non_alphanumeric': 0.1766595289079229, 'fraction_numerical': 0.07601713062098502, 'mean_word_length': 3.7948717948717947, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '463622', 'n_tokens_mistral': 414, 'n_tokens_neox': 382, 'n_words': 68}