homebrew-core/Formula/sentencepiece.rb

23 lines
650 B
Ruby
Raw Normal View History

class Sentencepiece < Formula
desc "Unsupervised text tokenizer and detokenizer"
homepage "https://github.com/google/sentencepiece"
url "https://github.com/google/sentencepiece/archive/v0.1.84.tar.gz"
sha256 "7f5505bd46aa5103ad235d61c269932c5922e68597eb484a9d27faed6af1419f"
depends_on "cmake" => :build
def install
mkdir "build" do
system "cmake", "..", *std_cmake_args
system "make"
system "make", "install"
end
pkgshare.install "data"
end
test do
cp (pkgshare/"data/botchan.txt"), testpath
system "#{bin}/spm_train", "--input=botchan.txt", "--model_prefix=m", "--vocab_size=1000"
end
end