Yukai Huang commited on
Commit
97b9eb6
·
unverified ·
1 Parent(s): eec7790

feat: you have to install openfst manually

Browse files
Files changed (1) hide show
  1. openfst.rb +63 -0
openfst.rb ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class Openfst < Formula
2
+ desc "Library for weighted finite-state transducers"
3
+ homepage "https://www.openfst.org/twiki/bin/view/FST/WebHome"
4
+ url "https://openfst.org/twiki/pub/FST/FstDownload/openfst-1.8.3.tar.gz"
5
+ sha256 "077714159d5cf3e38a80b6c6656d3ccc2c8b8b6c50bb41bb65c5fec10796bf53"
6
+ license "Apache-2.0"
7
+
8
+ livecheck do
9
+ url "https://www.openfst.org/twiki/bin/view/FST/FstDownload"
10
+ regex(/href=.*?openfst[._-]v?(\d+(?:\.\d+)+)\.t/i)
11
+ end
12
+
13
+ # bottle do
14
+ # sha256 cellar: :any, arm64_sequoia: "5d174e442429bca62cb5efef625032721a5c6987e18ade3078e88091df31d921"
15
+ # sha256 cellar: :any, arm64_sonoma: "3a0436dfb645f06b824d626e1b8e10c47b782b7134c6ac04d5f4ee4df106db22"
16
+ # sha256 cellar: :any, arm64_ventura: "76a0f9e9075766f227495fe513ce756167b62d3c6fd326399bbe259ba493b6ee"
17
+ # sha256 cellar: :any, arm64_monterey: "45aa8f4f880ea7e84b9aa4463f892d25b41b00cfb684aeb81efa94088e18d4c2"
18
+ # sha256 cellar: :any, sonoma: "9cc3657fddcd253c2e69e870a90978776f0356fab021338dcaad3c4c2837c20e"
19
+ # sha256 cellar: :any, ventura: "918bf970528321b4b385c8e08f57d9a45b530428bac2b0e74a474e5434fa1f03"
20
+ # sha256 cellar: :any, monterey: "62b9fbfe4dd8e058825ae75a682f922844c4f3dae90d956e5e9e0192496d33ae"
21
+ # sha256 cellar: :any_skip_relocation, x86_64_linux: "18b293aa36b18f6c227da97b39f8389accdf0f02a6b5801b197d062a473407fa"
22
+ # end
23
+
24
+ fails_with gcc: "5" # for C++17
25
+
26
+ def install
27
+ system "./configure", "--disable-dependency-tracking",
28
+ "--disable-silent-rules",
29
+ "--prefix=#{prefix}",
30
+ "--enable-fsts",
31
+ "--enable-compress",
32
+ "--enable-grm",
33
+ "--enable-special"
34
+ system "make"
35
+ system "make", "install"
36
+ end
37
+
38
+ test do
39
+ (testpath/"text.fst").write <<~EOS
40
+ 0 1 a x .5
41
+ 0 1 b y 1.5
42
+ 1 2 c z 2.5
43
+ 2 3.5
44
+ EOS
45
+
46
+ (testpath/"isyms.txt").write <<~EOS
47
+ <eps> 0
48
+ a 1
49
+ b 2
50
+ c 3
51
+ EOS
52
+
53
+ (testpath/"osyms.txt").write <<~EOS
54
+ <eps> 0
55
+ x 1
56
+ y 2
57
+ z 3
58
+ EOS
59
+
60
+ system bin/"fstcompile", "--isymbols=isyms.txt", "--osymbols=osyms.txt", "text.fst", "binary.fst"
61
+ assert_predicate testpath/"binary.fst", :exist?
62
+ end
63
+ end