Created
April 22, 2016 17:21
-
-
Save AlJohri/315251f54653a3c3ffe3ccb41b074848 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Openfst < Formula | |
homepage "http://www.openfst.org/" | |
url "http://openfst.cs.nyu.edu/twiki/pub/FST/FstDownload/openfst-1.4.1.tar.gz" | |
sha256 "e671bf6bd4425a1fed4e7543a024201b74869bfdd029bdf9d10c53a3c2818277" | |
needs :cxx11 | |
def install | |
ENV.cxx11 | |
system "./configure", "--prefix=#{prefix}", | |
"--enable-static", | |
"--enable-shared", | |
"--enable-far", | |
"--enable-lookahead-fsts", | |
"--enable-const-fsts", | |
"--enable-pdt", | |
"--enable-ngram-fsts", | |
"--enable-linear-fsts" | |
system "make", "install" | |
end | |
test do | |
# Based on http://openfst.org/twiki/bin/view/FST/FstExamples. | |
# Makes symbol table. | |
File.open("ascii.syms", "w") do |sink| | |
sink.puts "<epsilon>\t0" | |
sink.puts "<space>\t32" | |
33.upto(126) { |i| sink.puts "#{i.chr}\t#{i}" } | |
end | |
# Makes arclist for downcasing FST. | |
File.open("downcase.arc", "w") do |sink| | |
sink.puts "0\t0\t<epsilon>\t<epsilon>" | |
sink.puts "0\t0\t<space>\t<space>" | |
33.upto(126) { |i| sink.puts "0\t0\t#{i.chr}\t#{i.chr.downcase}" } | |
sink.puts "0" | |
end | |
## Compile the machine | |
system bin/"fstcompile", "--isymbols=ascii.syms", | |
"--osymbols=ascii.syms", | |
"downcase.arc", | |
"downcase.fst" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What was changed from the most recent version?
--build-from-source
)