diff --git a/.gitignore b/.gitignore index e69de29..5768550 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/openfst-1.2.7.tar.gz +/openfst-man.tar.xz diff --git a/openfst-format.patch b/openfst-format.patch new file mode 100644 index 0000000..e2c8519 --- /dev/null +++ b/openfst-format.patch @@ -0,0 +1,160 @@ +diff -durp src.orig/include/fst/extensions/pdt/info.h src/include/fst/extensions/pdt/info.h +--- src.orig/include/fst/extensions/pdt/info.h 2011-02-04 18:57:20.000000000 -0700 ++++ src/include/fst/extensions/pdt/info.h 2011-02-24 11:59:51.729229125 -0700 +@@ -147,21 +147,21 @@ void PrintPdtInfo(const PdtInfo &pdti + pdtinfo.FstType().c_str()); + fprintf(fp, "%-50s%s\n", "arc type", + pdtinfo.ArcType().c_str()); +- fprintf(fp, "%-50s%lld\n", "# of states", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of states", + pdtinfo.NumStates()); +- fprintf(fp, "%-50s%lld\n", "# of arcs", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of arcs", + pdtinfo.NumArcs()); +- fprintf(fp, "%-50s%lld\n", "# of open parentheses", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of open parentheses", + pdtinfo.NumOpenParens()); +- fprintf(fp, "%-50s%lld\n", "# of close parentheses", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of close parentheses", + pdtinfo.NumCloseParens()); +- fprintf(fp, "%-50s%lld\n", "# of unique open parentheses", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of unique open parentheses", + pdtinfo.NumUniqueOpenParens()); +- fprintf(fp, "%-50s%lld\n", "# of unique close parentheses", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of unique close parentheses", + pdtinfo.NumUniqueCloseParens()); +- fprintf(fp, "%-50s%lld\n", "# of open parenthesis dest. states", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of open parenthesis dest. states", + pdtinfo.NumOpenParenStates()); +- fprintf(fp, "%-50s%lld\n", "# of close parenthesis source states", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of close parenthesis source states", + pdtinfo.NumCloseParenStates()); + } + +diff -durp src.orig/include/fst/script/draw-impl.h src/include/fst/script/draw-impl.h +--- src.orig/include/fst/script/draw-impl.h 2011-02-04 18:57:22.000000000 -0700 ++++ src/include/fst/script/draw-impl.h 2011-02-24 12:00:15.705531528 -0700 +@@ -127,7 +127,7 @@ template class FstDrawer { + PrintString(symbol); + } else { + char sid[kLineLen]; +- snprintf(sid, kLineLen, "%lld", id); ++ snprintf(sid, kLineLen, "%" PRId64, id); + PrintString(sid); + } + } +diff -durp src.orig/include/fst/script/info-impl.h src/include/fst/script/info-impl.h +--- src.orig/include/fst/script/info-impl.h 2011-02-04 18:57:22.000000000 -0700 ++++ src/include/fst/script/info-impl.h 2011-02-24 12:02:19.041519396 -0700 +@@ -230,19 +230,19 @@ void PrintFstInfo(const FstInfo &fsti + if (!fstinfo.LongInfo()) + return; + +- fprintf(fp, "%-50s%lld\n", "# of states", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of states", + fstinfo.NumStates()); +- fprintf(fp, "%-50s%lld\n", "# of arcs", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of arcs", + fstinfo.NumArcs()); +- fprintf(fp, "%-50s%lld\n", "initial state", ++ fprintf(fp, "%-50s%" PRId64 "\n", "initial state", + fstinfo.Start()); +- fprintf(fp, "%-50s%lld\n", "# of final states", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of final states", + fstinfo.NumFinal()); +- fprintf(fp, "%-50s%lld\n", "# of input/output epsilons", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of input/output epsilons", + fstinfo.NumEpsilons()); +- fprintf(fp, "%-50s%lld\n", "# of input epsilons", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of input epsilons", + fstinfo.NumInputEpsilons()); +- fprintf(fp, "%-50s%lld\n", "# of output epsilons", ++ fprintf(fp, "%-50s%" PRId64 "\n", "# of output epsilons", + fstinfo.NumOutputEpsilons()); + + string arc_type = ""; +@@ -254,19 +254,19 @@ void PrintFstInfo(const FstInfo &fsti + arc_type = "output-epsilon "; + + string accessible_label = "# of " + arc_type + "accessible states"; +- fprintf(fp, "%-50s%lld\n", accessible_label.c_str(), ++ fprintf(fp, "%-50s%" PRId64 "\n", accessible_label.c_str(), + fstinfo.NumAccessible()); + string coaccessible_label = "# of " + arc_type + "coaccessible states"; +- fprintf(fp, "%-50s%lld\n", coaccessible_label.c_str(), ++ fprintf(fp, "%-50s%" PRId64 "\n", coaccessible_label.c_str(), + fstinfo.NumCoAccessible()); + string connected_label = "# of " + arc_type + "connected states"; +- fprintf(fp, "%-50s%lld\n", connected_label.c_str(), ++ fprintf(fp, "%-50s%" PRId64 "\n", connected_label.c_str(), + fstinfo.NumConnected()); + string numcc_label = "# of " + arc_type + "connected components"; +- fprintf(fp, "%-50s%lld\n", numcc_label.c_str(), ++ fprintf(fp, "%-50s%" PRId64 "\n", numcc_label.c_str(), + fstinfo.NumCc()); + string numscc_label = "# of " + arc_type + "strongly conn components"; +- fprintf(fp, "%-50s%lld\n", numscc_label.c_str(), ++ fprintf(fp, "%-50s%" PRId64 "\n", numscc_label.c_str(), + fstinfo.NumScc()); + + fprintf(fp, "%-50s%c\n", "input matcher", +diff -durp src.orig/include/fst/types.h src/include/fst/types.h +--- src.orig/include/fst/types.h 2010-09-03 13:02:47.000000000 -0600 ++++ src/include/fst/types.h 2011-02-24 12:03:32.616653299 -0700 +@@ -18,12 +18,13 @@ + // Various type definitions (mostly for Google compatibility). + + #include // for ssize_t +-#include // *int*_t + + #include // for DISALLOW_COPY_AND_ASSIGN + + #ifndef FST_LIB_TYPES_H__ + #define FST_LIB_TYPES_H__ ++#define __STDC_FORMAT_MACROS ++#include // *int*_t + + typedef int8_t int8; + typedef int16_t int16; +diff -durp src.orig/lib/symbol-table.cc src/lib/symbol-table.cc +--- src.orig/lib/symbol-table.cc 2011-02-04 18:57:18.000000000 -0700 ++++ src/lib/symbol-table.cc 2011-02-24 12:04:32.775939305 -0700 +@@ -85,7 +85,7 @@ void SymbolTableImpl::MaybeRecomputeChec + labeled_check_sum_.Reset(); + char line[kLineLen]; + for (int64 key = 0; key < dense_key_limit_; ++key) { +- snprintf(line, kLineLen, "%s\t%lld", symbols_[key], key); ++ snprintf(line, kLineLen, "%s\t%" PRId64, symbols_[key], key); + labeled_check_sum_.Update(line); + } + for (map::const_iterator it = +@@ -93,7 +93,7 @@ void SymbolTableImpl::MaybeRecomputeChec + it != key_map_.end(); + ++it) { + if (it->first >= dense_key_limit_) { +- snprintf(line, kLineLen, "%s\t%lld", it->second, it->first); ++ snprintf(line, kLineLen, "%s\t%" PRId64, it->second, it->first); + labeled_check_sum_.Update(line); + } + } +@@ -226,7 +226,7 @@ void SymbolTable::AddTable(const SymbolT + bool SymbolTable::WriteText(ostream &strm) const { + for (SymbolTableIterator iter(*this); !iter.Done(); iter.Next()) { + char line[kLineLen]; +- snprintf(line, kLineLen, "%s%c%lld\n", ++ snprintf(line, kLineLen, "%s%c%" PRId64 "\n", + iter.Symbol().c_str(), FLAGS_fst_field_separator[0], + iter.Value()); + strm.write(line, strlen(line)); +diff -durp src.orig/lib/util.cc src/lib/util.cc +--- src.orig/lib/util.cc 2011-02-04 18:57:18.000000000 -0700 ++++ src/lib/util.cc 2011-02-24 12:04:57.944405852 -0700 +@@ -39,7 +39,7 @@ int64 StrToInt64(const string &s, const + void Int64ToStr(int64 n, string *s) { + const int kNumLen = 128; + char nstr[kNumLen]; +- snprintf(nstr, kNumLen, "%lld", n); ++ snprintf(nstr, kNumLen, "%" PRId64, n); + *s += nstr; + } + diff --git a/openfst.spec b/openfst.spec new file mode 100644 index 0000000..5f2f8af --- /dev/null +++ b/openfst.spec @@ -0,0 +1,159 @@ +Name: openfst +Version: 1.2.7 +Release: 1%{?dist} +Summary: Weighted finite-state transducer library + +Group: Development/Libraries +License: ASL 2.0 +URL: http://www.openfst.org/ +Source0: http://openfst.cs.nyu.edu/twiki/pub/FST/FstDownload/openfst-%{version}.tar.gz +Source1: http://openfst.cs.nyu.edu/twiki/pub/Contrib/OpenFstBashComp/openfstbc +# Man pages written by Jerry James. The text of the man pages is lifted from +# the sources, so it is under the same copyright and license. In short, I +# contributed the formatting, but none of the text (with a few very small +# exceptions). +Source2: openfst-man.tar.xz +# This patch corrects some format specifiers that are correct for 32-bit +# systems, but incorrect for 64-bit systems. It was last sent upstream +# 6 Jan 2011. +Patch0: openfst-format.patch + +BuildRequires: libicu-devel%{?_isa} + +%description +OpenFst is a library for constructing, combining, optimizing, and searching +weighted finite-state transducers (FSTs). Weighted finite-state transducers +are automata where each transition has an input label, an output label, and a +weight. The more familiar finite-state acceptor is represented as a +transducer with each transition's input and output label equal. Finite-state +acceptors are used to represent sets of strings (specifically, regular or +rational sets); finite-state transducers are used to represent binary +relations between pairs of strings (specifically, rational transductions). +The weights can be used to represent the cost of taking a particular +transition. + +FSTs have key applications in speech recognition and synthesis, machine +translation, optical character recognition, pattern matching, string +processing, machine learning, information extraction and retrieval among +others. Often a weighted transducer is used to represent a probabilistic +model (e.g., an n-gram model, pronunciation model). FSTs can be optimized by +determinization and minimization, models can be applied to hypothesis sets +(also represented as automata) or cascaded by finite-state composition, and +the best results can be selected by shortest-path algorithms. + +%package devel +Summary: Development files for OpenFst +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package includes the necessary files to develop systems with OpenFst. + +%package tools +Summary: Command-line tools for working with FSTs +Group: Applications/Multimedia +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description tools +This package contains command-line tools that give access to OpenFst +functionality. + +%prep +%setup -q +%patch0 + +# Add missing linkage and remove unnecessary linkage +sed -e 's|^LIBS = |LIBS = -ldl|' -i src/lib/Makefile.in +sed -e 's|^LIBS = |LIBS = -L../lib/.libs -lfst -ldl|' -i src/script/Makefile.in +sed -e 's|^LIBS = |LIBS = -L../../lib/.libs -lfst -ldl|' \ + -i src/extensions/compact/Makefile.in +sed -e 's|^LIBS = |LIBS = -L../../lib/.libs -lfst -ldl|' \ + -i src/extensions/const/Makefile.in +sed -e 's|^LIBS = |LIBS = -L../../lib/.libs -lfst -ldl|' \ + -i src/extensions/lookahead/Makefile.in +sed -e 's|^LIBS = |LIBS = -L../../lib/.libs -lfst -ldl|' \ + -e 's|^libfstpdtscript_la_LIBADD.*|libfstpdtscript_la_LIBADD = -L../../script/.libs -lfstscript|' \ + -i src/extensions/pdt/Makefile.in +sed -e 's|-lm -ldl|-ldl|' \ + -e 's|^libfstfarscript_la_LIBADD.*|libfstfarscript_la_LIBADD = -L../../lib/.libs -L.libs -lfst -lfstfar -ldl -licuuc|' \ + -i src/extensions/far/Makefile.in + +%build +%configure --disable-static --enable-bin --enable-compact-fsts \ + --enable-const-fsts --enable-lookahead-fsts --enable-far --enable-pdt \ + --with-icu + +# libicu pkgconfig says that -licu* requires -lm; rpmlint disagrees. +# See bz 681941. +sed -i 's|^ICU_LIBS.*|ICU_LIBS = -licui18n -licuuc -licudata -lpthread -ldl|' \ + Makefile src/extensions/Makefile src/extensions/far/Makefile + +# Libtool thinks that EVERYTHING must be linked with -lm. +sed -i 's/-lstdc++ -lm/-lstdc++/' libtool + +# Get rid of undesirable hardcoded rpaths +sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ + -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT + +# Get rid of libtool files +find $RPM_BUILD_ROOT%{_libdir} -name '*.la' | xargs rm -f + +# Install the bash completion file +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d +cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d + +# Install the man pages +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 +cd $RPM_BUILD_ROOT%{_mandir}/man1 +tar xf %{SOURCE2} + +# Move libraries that are actually used by binaries out of the private dir. +# Leave symbolic links behind, since they are dlopen()ed. + +# libfstfar and libfstfarscript +mv $RPM_BUILD_ROOT%{_libdir}/fst/libfstfar* $RPM_BUILD_ROOT%{_libdir} +ln -s ../libfstfar.so $RPM_BUILD_ROOT%{_libdir}/fst/libfstfar.so +ln -s ../libfstfar.so.0 $RPM_BUILD_ROOT%{_libdir}/fst/libfstfar.so.0 +ln -s ../libfstfarscript.so $RPM_BUILD_ROOT%{_libdir}/fst/libfstfarscript.so +ln -s ../libfstfarscript.so.0 $RPM_BUILD_ROOT%{_libdir}/fst/libfstfarscript.so.0 + +# libfstpdtscript +mv $RPM_BUILD_ROOT%{_libdir}/fst/libfstpdtscript* $RPM_BUILD_ROOT%{_libdir} +ln -s ../libfstpdtscript.so $RPM_BUILD_ROOT%{_libdir}/fst/libfstpdtscript.so +ln -s ../libfstpdtscript.so.0 $RPM_BUILD_ROOT%{_libdir}/fst/libfstpdtscript.so.0 + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%doc AUTHORS COPYING NEWS README +%dir %{_libdir}/fst +%{_libdir}/fst/*.so.* +%{_libdir}/*.so.* + +%files devel +%defattr(-,root,root,-) +%{_includedir}/fst +%{_libdir}/fst/*.so +%{_libdir}/*.so + +%files tools +%defattr(-,root,root,-) +%{_bindir}/* +%{_mandir}/man1/* +%config(noreplace) %{_sysconfdir}/bash_completion.d + +%changelog +* Wed Mar 2 2011 Jerry James - 1.2.7-1 +- Initial RPM diff --git a/openfstbc b/openfstbc new file mode 100644 index 0000000..1544945 --- /dev/null +++ b/openfstbc @@ -0,0 +1,685 @@ +#Bash completion file for OpenFst 1.2 +#Copyright Paul Dixon 2011 (paul@edobashira.com) +#Tested on Ubuntu 10.04 using bash 4.5 +#To use simply source the completion file. +#source openfstbc +#These bash completions will add tab completion to the OpenFst flags. This file adds three types of completions based on the flag’s value type. +#Flags which accept path, numeric values will complete with a trailing = character and then default to the standard path completion. +#Binary flags will complete without a trailing = character. +#Flags which can accepted an enumerable string value will complete will a trailing = and then suggest suitable values. For example the –arc_type= completions will suggest log and standard values parameters. + +#1 2 3 4 5 +#name cur prev pprev options +_completeenumerable () +{ + if [[ $2 == = || $3 == = ]] ; then + if [[ $3 == *$1 ]] ; then + COMPREPLY=($(compgen -W "$5" -- )) + return 0 + fi + if [[ $4 == *$1 ]] ; then + COMPREPLY=($(compgen -W "$5" -- $2)) + return 0 + fi + fi +} + +_fstprint() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--acceptor --isymbols= --osymbols= --ssymbols= --numeric --save_isymbols= --save_osymbols= --show_weight_one --allow_negative_labels " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstprint fstprint + +_fstclosure() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--closure_plus " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstclosure fstclosure + +_fstconvert() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--fst_type= " + + _completeenumerable fst_type ${cur} ${prev} ${pprev} "arc_lookahead compact16_acceptor compact16_string compact16_unweighted compact16_unweighted_acceptor compact16_weighted_string compact64_acceptor compact64_string compact64_unweighted compact64_unweighted_acceptor compact64_weighted_string compact8_acceptor compact8_string compact8_unweighted compact8_unweighted_acceptor compact8_weighted_string compact_acceptor compact_string compact_unweighted compact_unweighted_acceptor compact_weighted_string const const16 const64 const8 edit ilabel_lookahead olabel_lookahead vector" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstconvert fstconvert + +_fstshortestdistance() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--reverse --delta= --nstate= --queue_type= " + + _completeenumerable queue_type ${cur} ${prev} ${pprev} "auto fifo lifo shortest state top" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstshortestdistance fstshortestdistance + +_fstproject() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--project_output " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstproject fstproject + +_fstdraw() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--acceptor --isymbols= --osymbols= --ssymbols= --numeric --save_isymbols= --save_osymbols= --precision= --show_weight_one --title= --portrait --vertical --fontsize= --height= --width= --nodesep= --ranksep= --allow_negative_labels " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstdraw fstdraw + +_fstshortestpath() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--delta= --nshortest= --unique --weight= --nstate= --queue_type= " + + _completeenumerable queue_type ${cur} ${prev} ${pprev} "auto fifo lifo shortest state top" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstshortestpath fstshortestpath + +_fstcompile() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--acceptor --arc_type= --fst_type= --isymbols= --osymbols= --ssymbols= --keep_isymbols --keep_osymbols --keep_state_numbering --allow_negative_labels " + + _completeenumerable arc_type ${cur} ${prev} ${pprev} "log standard" + _completeenumerable fst_type ${cur} ${prev} ${pprev} "arc_lookahead compact16_acceptor compact16_string compact16_unweighted compact16_unweighted_acceptor compact16_weighted_string compact64_acceptor compact64_string compact64_unweighted compact64_unweighted_acceptor compact64_weighted_string compact8_acceptor compact8_string compact8_unweighted compact8_unweighted_acceptor compact8_weighted_string compact_acceptor compact_string compact_unweighted compact_unweighted_acceptor compact_weighted_string const const16 const64 const8 edit ilabel_lookahead olabel_lookahead vector" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstcompile fstcompile + +_fstreweight() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--to_final " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstreweight fstreweight + +_fstinfo() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--arc_filter= --info_type= --pipe --test_properties " + + _completeenumerable arc_filter ${cur} ${prev} ${pprev} "any epsilon iepsilon oepsilon" + _completeenumerable info_type ${cur} ${prev} ${pprev} "auto long short" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstinfo fstinfo + +_fstequal() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--delta= " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstequal fstequal + +_fstencode() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--encode_labels --encode_weights --encode_reuse --decode " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstencode fstencode + +_fstequivalent() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--delta= --random --max_length= --npath= --seed= --select= " + + _completeenumerable select ${cur} ${prev} ${pprev} "fast_log_prob log_prob uniform" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstequivalent fstequivalent + +_fstrandgen() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--max_length= --npath= --seed= --select= " + + _completeenumerable select ${cur} ${prev} ${pprev} "fast_log_prob log_prob uniform" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstrandgen fstrandgen + +_fstepsnormalize() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--eps_norm_output " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstepsnormalize fstepsnormalize + +_fstsymbols() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--isymbols= --osymbols= --clear_isymbols --clear_osymbols --relabel_ipairs= --relabel_opairs= --allow_negative_labels " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstsymbols fstsymbols + +_fstmap() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--delta= --map_type= --weight= " + + _completeenumerable map_type ${cur} ${prev} ${pprev} "identity invert plus quantize rmweight superfinal times" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstmap fstmap + +_fstpush() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--delta= --push_weights --push_labels --remove_total_weight --remove_common_affix --to_final " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstpush fstpush + +_fstrelabel() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--isymbols= --osymbols= --relabel_isymbols= --relabel_osymbols= --relabel_ipairs= --relabel_opairs= --allow_negative_labels " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstrelabel fstrelabel + +_fstprune() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--delta= --nstate= --weight= " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstprune fstprune + +_fstdifference() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--compose_filter= --connect " + + _completeenumerable compose_filter ${cur} ${prev} ${pprev} "auto alt_sequence match sequence" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstdifference fstdifference + +_fstdeterminize() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--delta= --nstate= --weight= --subsequential_label= " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstdeterminize fstdeterminize + +_fstreplace() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--epsilon_on_replace " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstreplace fstreplace + +_fstrmepsilon() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--connect --delta= --nstate= --reverse --weight= --queue_type= " + + _completeenumerable queue_type ${cur} ${prev} ${pprev} "auto fifo lifo shortest state top" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstrmepsilon fstrmepsilon + +_fstminimize() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--delta= " + + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstminimize fstminimize + +_fstcompose() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--compose_filter= --connect " + + _completeenumerable compose_filter ${cur} ${prev} ${pprev} "auto alt_sequence match sequence" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstcompose fstcompose + +_fstarcsort() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--sort_type= " + + _completeenumerable sort_type ${cur} ${prev} ${pprev} "ilabel olabel" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstarcsort fstarcsort + +_fstintersect() +{ + local cur prev opts filters len pprev + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + if (( $COMP_CWORD > 2)) ; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + else + pprev="NULL" + fi + + opts="--compose_filter= --connect " + + _completeenumerable compose_filter ${cur} ${prev} ${pprev} "auto alt_sequence match sequence" + + + if [[ ${cur} == -* ]] ; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0 + fi +} +complete -o default -o nospace -F _fstintersect fstintersect + diff --git a/sources b/sources index e69de29..cb3cd23 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +97196a97d2a1ec88d612321e64dac2e4 openfst-1.2.7.tar.gz +084e16fe2f167c8f30e03b695fe394f4 openfst-man.tar.xz