repo_id
stringlengths
18
103
file_path
stringlengths
30
136
content
stringlengths
2
3.36M
__index_level_0__
int64
0
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst/compact-fst.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // FST Class for memory-efficient representation of common types of // FSTs: linear automata, acceptors, unweighted FSTs, ... #ifndef FST_COMPACT_FST_H_ #define FST_COMPACT_FST_H_ #include <climits> #include <iterator> #include <memory> #include <tuple> #include <utility> #include <vector> #include <fst/log.h> #include <fst/cache.h> #include <fst/expanded-fst.h> #include <fst/fst-decl.h> // For optional argument declarations #include <fst/mapped-file.h> #include <fst/matcher.h> #include <fst/test-properties.h> #include <fst/util.h> namespace fst { struct CompactFstOptions : public CacheOptions { // The default caching behaviour is to do no caching. Most compactors are // cheap and therefore we save memory by not doing caching. CompactFstOptions() : CacheOptions(true, 0) {} explicit CompactFstOptions(const CacheOptions &opts) : CacheOptions(opts) {} }; // New upcoming (Fst) Compactor interface - currently used internally // by CompactFstImpl. // // class Compactor { // public: // // Constructor from the Fst to be compacted. // Compactor(const Fst<Arc> &fst, ...); // // Copy constructor // Compactor(const Compactor &compactor, bool safe = false) // // Default constructor (optional, see comment below). // Compactor(); // // // Returns the start state, number of states, and total number of arcs // // of the compacted Fst // StateId Start() const; // StateId NumStates() const; // size_t NumArcs() const; // // // Accessor class for state attributes. // class State { // public: // State(); // Required, corresponds to kNoStateId. // State(const Compactor *c, StateId); // Accessor for StateId 's'. // StateId GetStateId() const; // Weight Final() const; // size_t NumArcs() const; // Arc GetArc(size_t i) const; // }; // // // Modifies 'state' accessor to provide access to state id 's'. // void SetState(StateId s, State *state); // // Tests whether 'fst' can be compacted by this compactor. // bool IsCompatible(const Fst<A> &fst) const; // // Return the properties that are always true for an fst // // compacted using this compactor // uint64 Properties() const; // // Return a string identifying the type of compactor. // static const string &Type(); // // Return true if an error has occured. // bool Error() const; // // Writes a compactor to a file. // bool Write(std::ostream &strm, const FstWriteOptions &opts) const; // // Reads a compactor from a file. // static Compactor*Read(std::istream &strm, const FstReadOptions &opts, // const FstHeader &hdr); // }; // // Old (Arc) Compactor Interface: // // The ArcCompactor class determines how arcs and final weights are compacted // and expanded. // // Final weights are treated as transitions to the superfinal state, i.e., // ilabel = olabel = kNoLabel and nextstate = kNoStateId. // // There are two types of compactors: // // * Fixed out-degree compactors: 'compactor.Size()' returns a positive integer // 's'. An FST can be compacted by this compactor only if each state has // exactly 's' outgoing transitions (counting a non-Zero() final weight as a // transition). A typical example is a compactor for string FSTs, i.e., // 's == 1'. // // * Variable out-degree compactors: 'compactor.Size() == -1'. There are no // out-degree restrictions for these compactors. // // Interface: // // class ArcCompactor { // public: // // Element is the type of the compacted transitions. // using Element = ... // // // Returns the compacted representation of a transition 'arc' // // at a state 's'. // Element Compact(StateId s, const Arc &arc); // // // Returns the transition at state 's' represented by the compacted // // transition 'e'. // Arc Expand(StateId s, const Element &e) const; // // // Returns -1 for variable out-degree compactors, and the mandatory // // out-degree otherwise. // ssize_t Size() const; // // // Tests whether an FST can be compacted by this compactor. // bool Compatible(const Fst<A> &fst) const; // // // Returns the properties that are always true for an FST compacted using // // this compactor // uint64 Properties() const; // // // Returns a string identifying the type of compactor. // static const string &Type(); // // // Writes a compactor to a file. // bool Write(std::ostream &strm) const; // // // Reads a compactor from a file. // static ArcCompactor *Read(std::istream &strm); // // // Default constructor (optional, see comment below). // ArcCompactor(); // }; // // The default constructor is only required for FST_REGISTER to work (i.e., // enabling Convert() and the command-line utilities to work with this new // compactor). However, a default constructor always needs to be specified for // this code to compile, but one can have it simply raise an error when called, // like so: // // Compactor::Compactor() { // FSTERROR() << "Compactor: No default constructor"; // } // Default implementation data for CompactFst, which can shared between // otherwise independent copies. // // The implementation contains two arrays: 'states_' and 'compacts_'. // // For fixed out-degree compactors, the 'states_' array is unallocated. The // 'compacts_' contains the compacted transitions. Its size is 'ncompacts_'. // The outgoing transitions at a given state are stored consecutively. For a // given state 's', its 'compactor.Size()' outgoing transitions (including // superfinal transition when 's' is final), are stored in position // ['s*compactor.Size()', '(s+1)*compactor.Size()'). // // For variable out-degree compactors, the states_ array has size // 'nstates_ + 1' and contains pointers to positions into 'compacts_'. For a // given state 's', the compacted transitions of 's' are stored in positions // ['states_[s]', 'states_[s + 1]') in 'compacts_'. By convention, // 'states_[nstates_] == ncompacts_'. // // In both cases, the superfinal transitions (when 's' is final, i.e., // 'Final(s) != Weight::Zero()') are stored first. // // The unsigned type U is used to represent indices into the compacts_ array. template <class Element, class Unsigned> class DefaultCompactStore { public: DefaultCompactStore() : states_(nullptr), compacts_(nullptr), nstates_(0), ncompacts_(0), narcs_(0), start_(kNoStateId), error_(false) {} template <class Arc, class Compactor> DefaultCompactStore(const Fst<Arc> &fst, const Compactor &compactor); template <class Iterator, class Compactor> DefaultCompactStore(const Iterator &begin, const Iterator &end, const Compactor &compactor); ~DefaultCompactStore() { if (!states_region_) delete[] states_; if (!compacts_region_) delete[] compacts_; } template <class Compactor> static DefaultCompactStore<Element, Unsigned> *Read( std::istream &strm, const FstReadOptions &opts, const FstHeader &hdr, const Compactor &compactor); bool Write(std::ostream &strm, const FstWriteOptions &opts) const; Unsigned States(ssize_t i) const { return states_[i]; } const Element &Compacts(size_t i) const { return compacts_[i]; } size_t NumStates() const { return nstates_; } size_t NumCompacts() const { return ncompacts_; } size_t NumArcs() const { return narcs_; } ssize_t Start() const { return start_; } bool Error() const { return error_; } // Returns a string identifying the type of data storage container. static const string &Type(); private: std::unique_ptr<MappedFile> states_region_; std::unique_ptr<MappedFile> compacts_region_; Unsigned *states_; Element *compacts_; size_t nstates_; size_t ncompacts_; size_t narcs_; ssize_t start_; bool error_; }; template <class Element, class Unsigned> template <class Arc, class Compactor> DefaultCompactStore<Element, Unsigned>::DefaultCompactStore( const Fst<Arc> &fst, const Compactor &compactor) : states_(nullptr), compacts_(nullptr), nstates_(0), ncompacts_(0), narcs_(0), start_(kNoStateId), error_(false) { using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; start_ = fst.Start(); // Counts # of states and arcs. StateId nfinals = 0; for (StateIterator<Fst<Arc>> siter(fst); !siter.Done(); siter.Next()) { ++nstates_; const auto s = siter.Value(); for (ArcIterator<Fst<Arc>> aiter(fst, s); !aiter.Done(); aiter.Next()) { ++narcs_; } if (fst.Final(s) != Weight::Zero()) ++nfinals; } if (compactor.Size() == -1) { states_ = new Unsigned[nstates_ + 1]; ncompacts_ = narcs_ + nfinals; compacts_ = new Element[ncompacts_]; states_[nstates_] = ncompacts_; } else { states_ = nullptr; ncompacts_ = nstates_ * compactor.Size(); if ((narcs_ + nfinals) != ncompacts_) { FSTERROR() << "DefaultCompactStore: Compactor incompatible with FST"; error_ = true; return; } compacts_ = new Element[ncompacts_]; } size_t pos = 0; size_t fpos = 0; for (size_t s = 0; s < nstates_; ++s) { fpos = pos; if (compactor.Size() == -1) states_[s] = pos; if (fst.Final(s) != Weight::Zero()) { compacts_[pos++] = compactor.Compact( s, Arc(kNoLabel, kNoLabel, fst.Final(s), kNoStateId)); } for (ArcIterator<Fst<Arc>> aiter(fst, s); !aiter.Done(); aiter.Next()) { compacts_[pos++] = compactor.Compact(s, aiter.Value()); } if ((compactor.Size() != -1) && ((pos - fpos) != compactor.Size())) { FSTERROR() << "DefaultCompactStore: Compactor incompatible with FST"; error_ = true; return; } } if (pos != ncompacts_) { FSTERROR() << "DefaultCompactStore: Compactor incompatible with FST"; error_ = true; return; } } template <class Element, class Unsigned> template <class Iterator, class Compactor> DefaultCompactStore<Element, Unsigned>::DefaultCompactStore( const Iterator &begin, const Iterator &end, const Compactor &compactor) : states_(nullptr), compacts_(nullptr), nstates_(0), ncompacts_(0), narcs_(0), start_(kNoStateId), error_(false) { using Arc = typename Compactor::Arc; using Weight = typename Arc::Weight; if (compactor.Size() != -1) { ncompacts_ = std::distance(begin, end); if (compactor.Size() == 1) { // For strings, allows implicit final weight. Empty input is the empty // string. if (ncompacts_ == 0) { ++ncompacts_; } else { const auto arc = compactor.Expand(ncompacts_ - 1, *(begin + (ncompacts_ - 1))); if (arc.ilabel != kNoLabel) ++ncompacts_; } } if (ncompacts_ % compactor.Size()) { FSTERROR() << "DefaultCompactStore: Size of input container incompatible" << " with compactor"; error_ = true; return; } if (ncompacts_ == 0) return; start_ = 0; nstates_ = ncompacts_ / compactor.Size(); compacts_ = new Element[ncompacts_]; size_t i = 0; Iterator it = begin; for (; it != end; ++it, ++i) { compacts_[i] = *it; if (compactor.Expand(i, *it).ilabel != kNoLabel) ++narcs_; } if (i < ncompacts_) { compacts_[i] = compactor.Compact( i, Arc(kNoLabel, kNoLabel, Weight::One(), kNoStateId)); } } else { if (std::distance(begin, end) == 0) return; // Count # of states, arcs and compacts. auto it = begin; for (size_t i = 0; it != end; ++it, ++i) { const auto arc = compactor.Expand(i, *it); if (arc.ilabel != kNoLabel) { ++narcs_; ++ncompacts_; } else { ++nstates_; if (arc.weight != Weight::Zero()) ++ncompacts_; } } start_ = 0; compacts_ = new Element[ncompacts_]; states_ = new Unsigned[nstates_ + 1]; states_[nstates_] = ncompacts_; size_t i = 0; size_t s = 0; for (it = begin; it != end; ++it) { const auto arc = compactor.Expand(i, *it); if (arc.ilabel != kNoLabel) { compacts_[i++] = *it; } else { states_[s++] = i; if (arc.weight != Weight::Zero()) compacts_[i++] = *it; } } if ((s != nstates_) || (i != ncompacts_)) { FSTERROR() << "DefaultCompactStore: Ill-formed input container"; error_ = true; return; } } } template <class Element, class Unsigned> template <class Compactor> DefaultCompactStore<Element, Unsigned> *DefaultCompactStore<Element, Unsigned>::Read(std::istream &strm, const FstReadOptions &opts, const FstHeader &hdr, const Compactor &compactor) { std::unique_ptr<DefaultCompactStore<Element, Unsigned>> data( new DefaultCompactStore<Element, Unsigned>()); data->start_ = hdr.Start(); data->nstates_ = hdr.NumStates(); data->narcs_ = hdr.NumArcs(); if (compactor.Size() == -1) { if ((hdr.GetFlags() & FstHeader::IS_ALIGNED) && !AlignInput(strm)) { LOG(ERROR) << "DefaultCompactStore::Read: Alignment failed: " << opts.source; return nullptr; } auto b = (data->nstates_ + 1) * sizeof(Unsigned); data->states_region_.reset(MappedFile::Map( &strm, opts.mode == FstReadOptions::MAP, opts.source, b)); if (!strm || !data->states_region_) { LOG(ERROR) << "DefaultCompactStore::Read: Read failed: " << opts.source; return nullptr; } data->states_ = static_cast<Unsigned *>(data->states_region_->mutable_data()); } else { data->states_ = nullptr; } data->ncompacts_ = compactor.Size() == -1 ? data->states_[data->nstates_] : data->nstates_ * compactor.Size(); if ((hdr.GetFlags() & FstHeader::IS_ALIGNED) && !AlignInput(strm)) { LOG(ERROR) << "DefaultCompactStore::Read: Alignment failed: " << opts.source; return nullptr; } size_t b = data->ncompacts_ * sizeof(Element); data->compacts_region_.reset( MappedFile::Map(&strm, opts.mode == FstReadOptions::MAP, opts.source, b)); if (!strm || !data->compacts_region_) { LOG(ERROR) << "DefaultCompactStore::Read: Read failed: " << opts.source; return nullptr; } data->compacts_ = static_cast<Element *>(data->compacts_region_->mutable_data()); return data.release(); } template <class Element, class Unsigned> bool DefaultCompactStore<Element, Unsigned>::Write( std::ostream &strm, const FstWriteOptions &opts) const { if (states_) { if (opts.align && !AlignOutput(strm)) { LOG(ERROR) << "DefaultCompactStore::Write: Alignment failed: " << opts.source; return false; } strm.write(reinterpret_cast<char *>(states_), (nstates_ + 1) * sizeof(Unsigned)); } if (opts.align && !AlignOutput(strm)) { LOG(ERROR) << "DefaultCompactStore::Write: Alignment failed: " << opts.source; return false; } strm.write(reinterpret_cast<char *>(compacts_), ncompacts_ * sizeof(Element)); strm.flush(); if (!strm) { LOG(ERROR) << "DefaultCompactStore::Write: Write failed: " << opts.source; return false; } return true; } template <class Element, class Unsigned> const string &DefaultCompactStore<Element, Unsigned>::Type() { static const string *const type = new string("compact"); return *type; } template <class C, class U, class S> class DefaultCompactState; // Wraps an arc compactor and a compact store as a new Fst compactor. template <class C, class U, class S = DefaultCompactStore<typename C::Element, U>> class DefaultCompactor { public: using ArcCompactor = C; using Unsigned = U; using CompactStore = S; using Element = typename C::Element; using Arc = typename C::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using State = DefaultCompactState<C, U, S>; friend State; DefaultCompactor() : arc_compactor_(nullptr), compact_store_(nullptr) {} // Constructs from Fst. DefaultCompactor(const Fst<Arc> &fst, std::shared_ptr<ArcCompactor> arc_compactor) : arc_compactor_(std::move(arc_compactor)), compact_store_(std::make_shared<S>(fst, *arc_compactor_)) {} DefaultCompactor(const Fst<Arc> &fst, std::shared_ptr<DefaultCompactor<C, U, S>> compactor) : arc_compactor_(compactor->arc_compactor_), compact_store_(compactor->compact_store_ == nullptr ? std::make_shared<S>(fst, *arc_compactor_) : compactor->compact_store_) {} // Constructs from CompactStore. DefaultCompactor(std::shared_ptr<ArcCompactor> arc_compactor, std::shared_ptr<CompactStore> compact_store) : arc_compactor_(std::move(arc_compactor)), compact_store_(std::move(compact_store)) {} // Constructs from set of compact elements (when arc_compactor.Size() != -1). template <class Iterator> DefaultCompactor(const Iterator &b, const Iterator &e, std::shared_ptr<C> arc_compactor) : arc_compactor_(std::move(arc_compactor)), compact_store_(std::make_shared<S>(b, e, *arc_compactor_)) {} // Copy constructor. DefaultCompactor(const DefaultCompactor<C, U, S> &compactor) : arc_compactor_(std::make_shared<C>(*compactor.GetArcCompactor())), compact_store_(compactor.SharedCompactStore()) {} template <class OtherC> explicit DefaultCompactor(const DefaultCompactor<OtherC, U, S> &compactor) : arc_compactor_(std::make_shared<C>(*compactor.GetArcCompactor())), compact_store_(compactor.SharedCompactStore()) {} StateId Start() const { return compact_store_->Start(); } StateId NumStates() const { return compact_store_->NumStates(); } size_t NumArcs() const { return compact_store_->NumArcs(); } void SetState(StateId s, State *state) const { if (state->GetStateId() != s) state->Set(this, s); } static DefaultCompactor<C, U, S> *Read(std::istream &strm, const FstReadOptions &opts, const FstHeader &hdr) { std::shared_ptr<C> arc_compactor(C::Read(strm)); if (arc_compactor == nullptr) return nullptr; std::shared_ptr<S> compact_store(S::Read(strm, opts, hdr, *arc_compactor)); if (compact_store == nullptr) return nullptr; return new DefaultCompactor<C, U, S>(arc_compactor, compact_store); } bool Write(std::ostream &strm, const FstWriteOptions &opts) const { return arc_compactor_->Write(strm) && compact_store_->Write(strm, opts); } uint64 Properties() const { return arc_compactor_->Properties(); } bool IsCompatible(const Fst<Arc> &fst) const { return arc_compactor_->Compatible(fst); } bool Error() const { return compact_store_->Error(); } bool HasFixedOutdegree() const { return arc_compactor_->Size() != -1; } static const string &Type() { static const string *const type = [] { string type = "compact"; if (sizeof(U) != sizeof(uint32)) type += std::to_string(8 * sizeof(U)); type += "_"; type += C::Type(); if (CompactStore::Type() != "compact") { type += "_"; type += CompactStore::Type(); } return new string(type); }(); return *type; } const ArcCompactor *GetArcCompactor() const { return arc_compactor_.get(); } CompactStore *GetCompactStore() const { return compact_store_.get(); } std::shared_ptr<ArcCompactor> SharedArcCompactor() const { return arc_compactor_; } std::shared_ptr<CompactStore> SharedCompactStore() const { return compact_store_; } // TODO(allauzen): remove dependencies on this method and make private. Arc ComputeArc(StateId s, Unsigned i, uint32 f) const { return arc_compactor_->Expand(s, compact_store_->Compacts(i), f); } private: std::pair<Unsigned, Unsigned> CompactsRange(StateId s) const { std::pair<size_t, size_t> range; if (HasFixedOutdegree()) { range.first = s * arc_compactor_->Size(); range.second = arc_compactor_->Size(); } else { range.first = compact_store_->States(s); range.second = compact_store_->States(s + 1) - range.first; } return range; } private: std::shared_ptr<ArcCompactor> arc_compactor_; std::shared_ptr<CompactStore> compact_store_; }; // Default implementation of state attributes accessor class for // DefaultCompactor. Use of efficient specialization strongly encouraged. template <class C, class U, class S> class DefaultCompactState { public: using Arc = typename C::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; DefaultCompactState() = default; DefaultCompactState(const DefaultCompactor<C, U, S> *compactor, StateId s) : compactor_(compactor), s_(s), range_(compactor->CompactsRange(s)), has_final_( range_.second != 0 && compactor->ComputeArc(s, range_.first, kArcILabelValue).ilabel == kNoLabel) { if (has_final_) { ++range_.first; --range_.second; } } void Set(const DefaultCompactor<C, U, S> *compactor, StateId s) { compactor_ = compactor; s_ = s; range_ = compactor->CompactsRange(s); if (range_.second != 0 && compactor->ComputeArc(s, range_.first, kArcILabelValue).ilabel == kNoLabel) { has_final_ = true; ++range_.first; --range_.second; } else { has_final_ = false; } } StateId GetStateId() const { return s_; } Weight Final() const { if (!has_final_) return Weight::Zero(); return compactor_->ComputeArc(s_, range_.first - 1, kArcWeightValue).weight; } size_t NumArcs() const { return range_.second; } Arc GetArc(size_t i, uint32 f) const { return compactor_->ComputeArc(s_, range_.first + i, f); } private: const DefaultCompactor<C, U, S> *compactor_ = nullptr; // borrowed ref. StateId s_ = kNoStateId; std::pair<U, U> range_ = {0, 0}; bool has_final_ = false; }; // Specialization for DefaultCompactStore. template <class C, class U> class DefaultCompactState<C, U, DefaultCompactStore<typename C::Element, U>> { public: using Arc = typename C::Arc; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using CompactStore = DefaultCompactStore<typename C::Element, U>; DefaultCompactState() = default; DefaultCompactState( const DefaultCompactor<C, U, CompactStore> *compactor, StateId s) : arc_compactor_(compactor->GetArcCompactor()), s_(s) { Init(compactor); } void Set(const DefaultCompactor<C, U, CompactStore> *compactor, StateId s) { arc_compactor_ = compactor->GetArcCompactor(); s_ = s; has_final_ = false; Init(compactor); } StateId GetStateId() const { return s_; } Weight Final() const { if (!has_final_) return Weight::Zero(); return arc_compactor_->Expand(s_, *(compacts_ - 1), kArcWeightValue).weight; } size_t NumArcs() const { return num_arcs_; } Arc GetArc(size_t i, uint32 f) const { return arc_compactor_->Expand(s_, compacts_[i], f); } private: void Init(const DefaultCompactor<C, U, CompactStore> *compactor) { const auto *store = compactor->GetCompactStore(); U offset; if (!compactor->HasFixedOutdegree()) { // Variable out-degree compactor. offset = store->States(s_); num_arcs_ = store->States(s_ + 1) - offset; } else { // Fixed out-degree compactor. offset = s_ * arc_compactor_->Size(); num_arcs_ = arc_compactor_->Size(); } if (num_arcs_ > 0) { compacts_ = &(store->Compacts(offset)); if (arc_compactor_->Expand(s_, *compacts_, kArcILabelValue).ilabel == kNoStateId) { ++compacts_; --num_arcs_; has_final_ = true; } } } private: const C *arc_compactor_ = nullptr; // Borrowed reference. const typename C::Element *compacts_ = nullptr; // Borrowed reference. StateId s_ = kNoStateId; U num_arcs_ = 0; bool has_final_ = false; }; template <class Arc, class ArcCompactor, class Unsigned, class CompactStore, class CacheStore> class CompactFst; template <class F, class G> void Cast(const F &, G *); namespace internal { // Implementation class for CompactFst, which contains parametrizeable // Fst data storage (DefaultCompactStore by default) and Fst cache. template <class Arc, class C, class CacheStore = DefaultCacheStore<Arc>> class CompactFstImpl : public CacheBaseImpl<typename CacheStore::State, CacheStore> { public: using Weight = typename Arc::Weight; using StateId = typename Arc::StateId; using Compactor = C; using FstImpl<Arc>::SetType; using FstImpl<Arc>::SetProperties; using FstImpl<Arc>::Properties; using FstImpl<Arc>::SetInputSymbols; using FstImpl<Arc>::SetOutputSymbols; using FstImpl<Arc>::WriteHeader; using ImplBase = CacheBaseImpl<typename CacheStore::State, CacheStore>; using ImplBase::PushArc; using ImplBase::HasArcs; using ImplBase::HasFinal; using ImplBase::HasStart; using ImplBase::SetArcs; using ImplBase::SetFinal; using ImplBase::SetStart; CompactFstImpl() : ImplBase(CompactFstOptions()), compactor_() { SetType(Compactor::Type()); SetProperties(kNullProperties | kStaticProperties); } CompactFstImpl(const Fst<Arc> &fst, std::shared_ptr<Compactor> compactor, const CompactFstOptions &opts) : ImplBase(opts), compactor_(std::make_shared<Compactor>(fst, compactor)) { SetType(Compactor::Type()); SetInputSymbols(fst.InputSymbols()); SetOutputSymbols(fst.OutputSymbols()); if (compactor_->Error()) SetProperties(kError, kError); uint64 copy_properties = fst.Properties(kMutable, false) ? fst.Properties(kCopyProperties, true): CheckProperties(fst, kCopyProperties & ~kWeightedCycles & ~kUnweightedCycles, kCopyProperties); if ((copy_properties & kError) || !compactor_->IsCompatible(fst)) { FSTERROR() << "CompactFstImpl: Input Fst incompatible with compactor"; SetProperties(kError, kError); return; } SetProperties(copy_properties | kStaticProperties); } CompactFstImpl(std::shared_ptr<Compactor> compactor, const CompactFstOptions &opts) : ImplBase(opts), compactor_(compactor) { SetType(Compactor::Type()); SetProperties(kStaticProperties | compactor_->Properties()); if (compactor_->Error()) SetProperties(kError, kError); } CompactFstImpl(const CompactFstImpl<Arc, Compactor, CacheStore> &impl) : ImplBase(impl), compactor_(impl.compactor_ == nullptr ? std::make_shared<Compactor>() : std::make_shared<Compactor>(*impl.compactor_)) { SetType(impl.Type()); SetProperties(impl.Properties()); SetInputSymbols(impl.InputSymbols()); SetOutputSymbols(impl.OutputSymbols()); } // Allows to change the cache store from OtherI to I. template <class OtherCacheStore> CompactFstImpl(const CompactFstImpl<Arc, Compactor, OtherCacheStore> &impl) : ImplBase(CacheOptions(impl.GetCacheGc(), impl.GetCacheLimit())), compactor_(impl.compactor_ == nullptr ? std::make_shared<Compactor>() : std::make_shared<Compactor>(*impl.compactor_)) { SetType(impl.Type()); SetProperties(impl.Properties()); SetInputSymbols(impl.InputSymbols()); SetOutputSymbols(impl.OutputSymbols()); } StateId Start() { if (!HasStart()) SetStart(compactor_->Start()); return ImplBase::Start(); } Weight Final(StateId s) { if (HasFinal(s)) return ImplBase::Final(s); compactor_->SetState(s, &state_); return state_.Final(); } StateId NumStates() const { if (Properties(kError)) return 0; return compactor_->NumStates(); } size_t NumArcs(StateId s) { if (HasArcs(s)) return ImplBase::NumArcs(s); compactor_->SetState(s, &state_); return state_.NumArcs(); } size_t NumInputEpsilons(StateId s) { if (!HasArcs(s) && !Properties(kILabelSorted)) Expand(s); if (HasArcs(s)) return ImplBase::NumInputEpsilons(s); return CountEpsilons(s, false); } size_t NumOutputEpsilons(StateId s) { if (!HasArcs(s) && !Properties(kOLabelSorted)) Expand(s); if (HasArcs(s)) return ImplBase::NumOutputEpsilons(s); return CountEpsilons(s, true); } size_t CountEpsilons(StateId s, bool output_epsilons) { compactor_->SetState(s, &state_); const uint32 f = output_epsilons ? kArcOLabelValue : kArcILabelValue; size_t num_eps = 0; for (size_t i = 0; i < state_.NumArcs(); ++i) { const auto& arc = state_.GetArc(i, f); const auto label = output_epsilons ? arc.olabel : arc.ilabel; if (label == 0) ++num_eps; else if (label > 0) break; } return num_eps; } static CompactFstImpl<Arc, Compactor, CacheStore> *Read( std::istream &strm, const FstReadOptions &opts) { std::unique_ptr<CompactFstImpl<Arc, Compactor, CacheStore>> impl( new CompactFstImpl<Arc, Compactor, CacheStore>()); FstHeader hdr; if (!impl->ReadHeader(strm, opts, kMinFileVersion, &hdr)) { return nullptr; } // Ensures compatibility. if (hdr.Version() == kAlignedFileVersion) { hdr.SetFlags(hdr.GetFlags() | FstHeader::IS_ALIGNED); } impl->compactor_ = std::shared_ptr<Compactor>( Compactor::Read(strm, opts, hdr)); if (!impl->compactor_) { return nullptr; } return impl.release(); } bool Write(std::ostream &strm, const FstWriteOptions &opts) const { FstHeader hdr; hdr.SetStart(compactor_->Start()); hdr.SetNumStates(compactor_->NumStates()); hdr.SetNumArcs(compactor_->NumArcs()); // Ensures compatibility. const auto file_version = opts.align ? kAlignedFileVersion : kFileVersion; WriteHeader(strm, opts, file_version, &hdr); return compactor_->Write(strm, opts); } // Provides information needed for generic state iterator. void InitStateIterator(StateIteratorData<Arc> *data) const { data->base = nullptr; data->nstates = compactor_->NumStates(); } void InitArcIterator(StateId s, ArcIteratorData<Arc> *data) { if (!HasArcs(s)) Expand(s); ImplBase::InitArcIterator(s, data); } void Expand(StateId s) { compactor_->SetState(s, &state_); for (size_t i = 0; i < state_.NumArcs(); ++i) PushArc(s, state_.GetArc(i, kArcValueFlags)); SetArcs(s); if (!HasFinal(s)) SetFinal(s, state_.Final()); } const Compactor *GetCompactor() const { return compactor_.get(); } std::shared_ptr<Compactor> SharedCompactor() const { return compactor_; } void SetCompactor(std::shared_ptr<Compactor> compactor) { // TODO(allauzen): is this correct? is this needed? // TODO(allauzen): consider removing and forcing this through direct calls // to compactor. compactor_ = compactor; } // Properties always true of this FST class. static constexpr uint64 kStaticProperties = kExpanded; protected: template <class OtherArc, class OtherCompactor, class OtherCacheStore> explicit CompactFstImpl( const CompactFstImpl<OtherArc, OtherCompactor, OtherCacheStore> &impl) : compactor_(std::make_shared<Compactor>(*impl.GetCompactor())) { SetType(impl.Type()); SetProperties(impl.Properties()); SetInputSymbols(impl.InputSymbols()); SetOutputSymbols(impl.OutputSymbols()); } private: // Allows access during write. template <class AnyArc, class ArcCompactor, class Unsigned, class CompactStore, class AnyCacheStore> friend class ::fst::CompactFst; // allow access during write. // Current unaligned file format version. static constexpr int kFileVersion = 2; // Current aligned file format version. static constexpr int kAlignedFileVersion = 1; // Minimum file format version supported. static constexpr int kMinFileVersion = 1; std::shared_ptr<Compactor> compactor_; typename Compactor::State state_; }; template <class Arc, class Compactor, class CacheStore> constexpr uint64 CompactFstImpl<Arc, Compactor, CacheStore>::kStaticProperties; template <class Arc, class Compactor, class CacheStore> constexpr int CompactFstImpl<Arc, Compactor, CacheStore>::kFileVersion; template <class Arc, class Compactor, class CacheStore> constexpr int CompactFstImpl<Arc, Compactor, CacheStore>::kAlignedFileVersion; template <class Arc, class Compactor, class CacheStore> constexpr int CompactFstImpl<Arc, Compactor, CacheStore>::kMinFileVersion; } // namespace internal // This class attaches interface to implementation and handles reference // counting, delegating most methods to ImplToExpandedFst. The Unsigned type // is used to represent indices into the compact arc array. (Template // argument defaults are declared in fst-decl.h.) template <class A, class ArcCompactor, class Unsigned, class CompactStore, class CacheStore> class CompactFst : public ImplToExpandedFst<internal::CompactFstImpl< A, DefaultCompactor<ArcCompactor, Unsigned, CompactStore>, CacheStore>> { public: template <class F, class G> void friend Cast(const F &, G *); using Arc = A; using StateId = typename A::StateId; using Compactor = DefaultCompactor<ArcCompactor, Unsigned, CompactStore>; using Impl = internal::CompactFstImpl<A, Compactor, CacheStore>; using Store = CacheStore; // for CacheArcIterator friend class StateIterator< CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore>>; friend class ArcIterator< CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore>>; CompactFst() : ImplToExpandedFst<Impl>(std::make_shared<Impl>()) {} // If data is not nullptr, it is assumed to be already initialized. explicit CompactFst( const Fst<A> &fst, const ArcCompactor &compactor = ArcCompactor(), const CompactFstOptions &opts = CompactFstOptions(), std::shared_ptr<CompactStore> data = std::shared_ptr<CompactStore>()) : ImplToExpandedFst<Impl>( std::make_shared<Impl>( fst, std::make_shared<Compactor>( std::make_shared<ArcCompactor>(compactor), data), opts)) {} // If data is not nullptr, it is assumed to be already initialized. CompactFst( const Fst<Arc> &fst, std::shared_ptr<ArcCompactor> compactor, const CompactFstOptions &opts = CompactFstOptions(), std::shared_ptr<CompactStore> data = std::shared_ptr<CompactStore>()) : ImplToExpandedFst<Impl>( std::make_shared<Impl>(fst, std::make_shared<Compactor>(compactor, data), opts)) {} // The following 2 constructors take as input two iterators delimiting a set // of (already) compacted transitions, starting with the transitions out of // the initial state. The format of the input differs for fixed out-degree // and variable out-degree compactors. // // - For fixed out-degree compactors, the final weight (encoded as a // compacted transition) needs to be given only for final states. All strings // (compactor of size 1) will be assume to be terminated by a final state // even when the final state is not implicitely given. // // - For variable out-degree compactors, the final weight (encoded as a // compacted transition) needs to be given for all states and must appeared // first in the list (for state s, final weight of s, followed by outgoing // transitons in s). // // These 2 constructors allows the direct construction of a CompactFst // without first creating a more memory-hungry regular FST. This is useful // when memory usage is severely constrained. template <class Iterator> explicit CompactFst(const Iterator &begin, const Iterator &end, const ArcCompactor &compactor = ArcCompactor(), const CompactFstOptions &opts = CompactFstOptions()) : ImplToExpandedFst<Impl>( std::make_shared<Impl>( std::make_shared<Compactor>( begin, end, std::make_shared<ArcCompactor>(compactor)), opts)) {} template <class Iterator> CompactFst(const Iterator &begin, const Iterator &end, std::shared_ptr<ArcCompactor> compactor, const CompactFstOptions &opts = CompactFstOptions()) : ImplToExpandedFst<Impl>( std::make_shared<Impl>( std::make_shared<Compactor>(begin, end, compactor), opts)) {} // See Fst<>::Copy() for doc. CompactFst( const CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore> &fst, bool safe = false) : ImplToExpandedFst<Impl>(fst, safe) {} // Get a copy of this CompactFst. See Fst<>::Copy() for further doc. CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore> *Copy( bool safe = false) const override { return new CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore>( *this, safe); } // Read a CompactFst from an input stream; return nullptr on error static CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore> *Read( std::istream &strm, const FstReadOptions &opts) { auto *impl = Impl::Read(strm, opts); return impl ? new CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore>(std::shared_ptr<Impl>(impl)) : nullptr; } // Read a CompactFst from a file; return nullptr on error // Empty filename reads from standard input static CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore> *Read( const string &filename) { auto *impl = ImplToExpandedFst<Impl>::Read(filename); return impl ? new CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore>(std::shared_ptr<Impl>(impl)) : nullptr; } bool Write(std::ostream &strm, const FstWriteOptions &opts) const override { return GetImpl()->Write(strm, opts); } bool Write(const string &filename) const override { return Fst<Arc>::WriteFile(filename); } template <class FST> static bool WriteFst(const FST &fst, const ArcCompactor &compactor, std::ostream &strm, const FstWriteOptions &opts); void InitStateIterator(StateIteratorData<Arc> *data) const override { GetImpl()->InitStateIterator(data); } void InitArcIterator(StateId s, ArcIteratorData<Arc> *data) const override { GetMutableImpl()->InitArcIterator(s, data); } MatcherBase<Arc> *InitMatcher(MatchType match_type) const override { return new SortedMatcher< CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore>>( *this, match_type); } template <class Iterator> void SetCompactElements(const Iterator &b, const Iterator &e) { GetMutableImpl()->SetCompactor(std::make_shared<Compactor>( b, e, std::make_shared<ArcCompactor>())); } private: using ImplToFst<Impl, ExpandedFst<Arc>>::GetImpl; using ImplToFst<Impl, ExpandedFst<Arc>>::GetMutableImpl; explicit CompactFst(std::shared_ptr<Impl> impl) : ImplToExpandedFst<Impl>(impl) {} // Use overloading to extract the type of the argument. static Impl *GetImplIfCompactFst( const CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore> &compact_fst) { return compact_fst.GetImpl(); } // This does not give privileged treatment to subclasses of CompactFst. template <typename NonCompactFst> static Impl *GetImplIfCompactFst(const NonCompactFst &fst) { return nullptr; } CompactFst &operator=(const CompactFst &fst) = delete; }; // Writes FST in Compact format, with a possible pass over the machine before // writing to compute the number of states and arcs. template <class A, class ArcCompactor, class Unsigned, class CompactStore, class CacheStore> template <class FST> bool CompactFst<A, ArcCompactor, Unsigned, CompactStore, CacheStore>::WriteFst( const FST &fst, const ArcCompactor &compactor, std::ostream &strm, const FstWriteOptions &opts) { using Arc = A; using Weight = typename A::Weight; using Element = typename ArcCompactor::Element; const auto file_version = opts.align ? Impl::kAlignedFileVersion : Impl::kFileVersion; size_t num_arcs = -1; size_t num_states = -1; auto first_pass_compactor = compactor; if (auto *impl = GetImplIfCompactFst(fst)) { num_arcs = impl->GetCompactor()->GetCompactStore()->NumArcs(); num_states = impl->GetCompactor()->GetCompactStore()->NumStates(); first_pass_compactor = *impl->GetCompactor()->GetArcCompactor(); } else { // A first pass is needed to compute the state of the compactor, which // is saved ahead of the rest of the data structures. This unfortunately // means forcing a complete double compaction when writing in this format. // TODO(allauzen): eliminate mutable state from compactors. num_arcs = 0; num_states = 0; for (StateIterator<FST> siter(fst); !siter.Done(); siter.Next()) { const auto s = siter.Value(); ++num_states; if (fst.Final(s) != Weight::Zero()) { first_pass_compactor.Compact( s, Arc(kNoLabel, kNoLabel, fst.Final(s), kNoStateId)); } for (ArcIterator<FST> aiter(fst, s); !aiter.Done(); aiter.Next()) { ++num_arcs; first_pass_compactor.Compact(s, aiter.Value()); } } } FstHeader hdr; hdr.SetStart(fst.Start()); hdr.SetNumStates(num_states); hdr.SetNumArcs(num_arcs); string type = "compact"; if (sizeof(Unsigned) != sizeof(uint32)) { type += std::to_string(CHAR_BIT * sizeof(Unsigned)); } type += "_"; type += ArcCompactor::Type(); if (CompactStore::Type() != "compact") { type += "_"; type += CompactStore::Type(); } const auto copy_properties = fst.Properties(kCopyProperties, true); if ((copy_properties & kError) || !compactor.Compatible(fst)) { FSTERROR() << "Fst incompatible with compactor"; return false; } uint64 properties = copy_properties | Impl::kStaticProperties; internal::FstImpl<Arc>::WriteFstHeader(fst, strm, opts, file_version, type, properties, &hdr); first_pass_compactor.Write(strm); if (first_pass_compactor.Size() == -1) { if (opts.align && !AlignOutput(strm)) { LOG(ERROR) << "CompactFst::Write: Alignment failed: " << opts.source; return false; } Unsigned compacts = 0; for (StateIterator<FST> siter(fst); !siter.Done(); siter.Next()) { const auto s = siter.Value(); strm.write(reinterpret_cast<const char *>(&compacts), sizeof(compacts)); if (fst.Final(s) != Weight::Zero()) { ++compacts; } compacts += fst.NumArcs(s); } strm.write(reinterpret_cast<const char *>(&compacts), sizeof(compacts)); } if (opts.align && !AlignOutput(strm)) { LOG(ERROR) << "Could not align file during write after writing states"; } const auto &second_pass_compactor = compactor; Element element; for (StateIterator<FST> siter(fst); !siter.Done(); siter.Next()) { const auto s = siter.Value(); if (fst.Final(s) != Weight::Zero()) { element = second_pass_compactor.Compact( s, A(kNoLabel, kNoLabel, fst.Final(s), kNoStateId)); strm.write(reinterpret_cast<const char *>(&element), sizeof(element)); } for (ArcIterator<FST> aiter(fst, s); !aiter.Done(); aiter.Next()) { element = second_pass_compactor.Compact(s, aiter.Value()); strm.write(reinterpret_cast<const char *>(&element), sizeof(element)); } } strm.flush(); if (!strm) { LOG(ERROR) << "CompactFst write failed: " << opts.source; return false; } return true; } // Specialization for CompactFst; see generic version in fst.h for sample // usage (but use the CompactFst type!). This version should inline. template <class Arc, class ArcCompactor, class Unsigned, class CompactStore, class CacheStore> class StateIterator< CompactFst<Arc, ArcCompactor, Unsigned, CompactStore, CacheStore>> { public: using StateId = typename Arc::StateId; explicit StateIterator( const CompactFst<Arc, ArcCompactor, Unsigned, CompactStore, CacheStore> &fst) : nstates_(fst.GetImpl()->NumStates()), s_(0) {} bool Done() const { return s_ >= nstates_; } StateId Value() const { return s_; } void Next() { ++s_; } void Reset() { s_ = 0; } private: StateId nstates_; StateId s_; }; // Specialization for CompactFst. Never caches, // always iterates over the underlying compact elements. template <class Arc, class ArcCompactor, class Unsigned, class CompactStore, class CacheStore> class ArcIterator<CompactFst< Arc, ArcCompactor, Unsigned, CompactStore, CacheStore>> { public: using StateId = typename Arc::StateId; using Element = typename ArcCompactor::Element; using Compactor = DefaultCompactor<ArcCompactor, Unsigned, CompactStore>; using State = typename Compactor::State; ArcIterator(const CompactFst<Arc, ArcCompactor, Unsigned, CompactStore, CacheStore> &fst, StateId s) : state_(fst.GetImpl()->GetCompactor(), s), pos_(0), flags_(kArcValueFlags) {} bool Done() const { return pos_ >= state_.NumArcs(); } const Arc &Value() const { arc_ = state_.GetArc(pos_, flags_); return arc_; } void Next() { ++pos_; } size_t Position() const { return pos_; } void Reset() { pos_ = 0; } void Seek(size_t pos) { pos_ = pos; } uint32 Flags() const { return flags_; } void SetFlags(uint32 f, uint32 m) { flags_ &= ~m; flags_ |= (f & kArcValueFlags); } private: State state_; size_t pos_; mutable Arc arc_; uint32 flags_; }; // ArcCompactor for unweighted string FSTs. template <class A> class StringCompactor { public: using Arc = A; using Label = typename Arc::Label; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Element = Label; Element Compact(StateId s, const Arc &arc) const { return arc.ilabel; } Arc Expand(StateId s, const Element &p, uint32 f = kArcValueFlags) const { return Arc(p, p, Weight::One(), p != kNoLabel ? s + 1 : kNoStateId); } constexpr ssize_t Size() const { return 1; } constexpr uint64 Properties() const { return kString | kAcceptor | kUnweighted; } bool Compatible(const Fst<Arc> &fst) const { const auto props = Properties(); return fst.Properties(props, true) == props; } static const string &Type() { static const string *const type = new string("string"); return *type; } bool Write(std::ostream &strm) const { return true; } static StringCompactor *Read(std::istream &strm) { return new StringCompactor; } }; // ArcCompactor for weighted string FSTs. template <class A> class WeightedStringCompactor { public: using Arc = A; using Label = typename Arc::Label; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Element = std::pair<Label, Weight>; Element Compact(StateId s, const Arc &arc) const { return std::make_pair(arc.ilabel, arc.weight); } Arc Expand(StateId s, const Element &p, uint32 f = kArcValueFlags) const { return Arc(p.first, p.first, p.second, p.first != kNoLabel ? s + 1 : kNoStateId); } constexpr ssize_t Size() const { return 1; } constexpr uint64 Properties() const { return kString | kAcceptor; } bool Compatible(const Fst<Arc> &fst) const { const auto props = Properties(); return fst.Properties(props, true) == props; } static const string &Type() { static const string *const type = new string("weighted_string"); return *type; } bool Write(std::ostream &strm) const { return true; } static WeightedStringCompactor *Read(std::istream &strm) { return new WeightedStringCompactor; } }; // ArcCompactor for unweighted acceptor FSTs. template <class A> class UnweightedAcceptorCompactor { public: using Arc = A; using Label = typename Arc::Label; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Element = std::pair<Label, StateId>; Element Compact(StateId s, const Arc &arc) const { return std::make_pair(arc.ilabel, arc.nextstate); } Arc Expand(StateId s, const Element &p, uint32 f = kArcValueFlags) const { return Arc(p.first, p.first, Weight::One(), p.second); } constexpr ssize_t Size() const { return -1; } constexpr uint64 Properties() const { return kAcceptor | kUnweighted; } bool Compatible(const Fst<Arc> &fst) const { const auto props = Properties(); return fst.Properties(props, true) == props; } static const string &Type() { static const string *const type = new string("unweighted_acceptor"); return *type; } bool Write(std::ostream &strm) const { return true; } static UnweightedAcceptorCompactor *Read(std::istream &istrm) { return new UnweightedAcceptorCompactor; } }; // ArcCompactor for weighted acceptor FSTs. template <class A> class AcceptorCompactor { public: using Arc = A; using Label = typename Arc::Label; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Element = std::pair<std::pair<Label, Weight>, StateId>; Element Compact(StateId s, const Arc &arc) const { return std::make_pair(std::make_pair(arc.ilabel, arc.weight), arc.nextstate); } Arc Expand(StateId s, const Element &p, uint32 f = kArcValueFlags) const { return Arc(p.first.first, p.first.first, p.first.second, p.second); } constexpr ssize_t Size() const { return -1; } constexpr uint64 Properties() const { return kAcceptor; } bool Compatible(const Fst<Arc> &fst) const { const auto props = Properties(); return fst.Properties(props, true) == props; } static const string &Type() { static const string *const type = new string("acceptor"); return *type; } bool Write(std::ostream &strm) const { return true; } static AcceptorCompactor *Read(std::istream &strm) { return new AcceptorCompactor; } }; // ArcCompactor for unweighted FSTs. template <class A> class UnweightedCompactor { public: using Arc = A; using Label = typename Arc::Label; using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; using Element = std::pair<std::pair<Label, Label>, StateId>; Element Compact(StateId s, const Arc &arc) const { return std::make_pair(std::make_pair(arc.ilabel, arc.olabel), arc.nextstate); } Arc Expand(StateId s, const Element &p, uint32 f = kArcValueFlags) const { return Arc(p.first.first, p.first.second, Weight::One(), p.second); } constexpr ssize_t Size() const { return -1; } constexpr uint64 Properties() const { return kUnweighted; } bool Compatible(const Fst<Arc> &fst) const { const auto props = Properties(); return fst.Properties(props, true) == props; } static const string &Type() { static const string *const type = new string("unweighted"); return *type; } bool Write(std::ostream &strm) const { return true; } static UnweightedCompactor *Read(std::istream &strm) { return new UnweightedCompactor; } }; template <class Arc, class Unsigned /* = uint32 */> using CompactStringFst = CompactFst<Arc, StringCompactor<Arc>, Unsigned>; template <class Arc, class Unsigned /* = uint32 */> using CompactWeightedStringFst = CompactFst<Arc, WeightedStringCompactor<Arc>, Unsigned>; template <class Arc, class Unsigned /* = uint32 */> using CompactAcceptorFst = CompactFst<Arc, AcceptorCompactor<Arc>, Unsigned>; template <class Arc, class Unsigned /* = uint32 */> using CompactUnweightedFst = CompactFst<Arc, UnweightedCompactor<Arc>, Unsigned>; template <class Arc, class Unsigned /* = uint32 */> using CompactUnweightedAcceptorFst = CompactFst<Arc, UnweightedAcceptorCompactor<Arc>, Unsigned>; using StdCompactStringFst = CompactStringFst<StdArc, uint32>; using StdCompactWeightedStringFst = CompactWeightedStringFst<StdArc, uint32>; using StdCompactAcceptorFst = CompactAcceptorFst<StdArc, uint32>; using StdCompactUnweightedFst = CompactUnweightedFst<StdArc, uint32>; using StdCompactUnweightedAcceptorFst = CompactUnweightedAcceptorFst<StdArc, uint32>; } // namespace fst #endif // FST_COMPACT_FST_H_
0
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/include
coqui_public_repos/STT/native_client/ctcdecode/third_party/openfst-1.6.7/src/include/fst/rmfinalepsilon.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Function to remove of final states that have epsilon-only input arcs. #ifndef FST_RMFINALEPSILON_H_ #define FST_RMFINALEPSILON_H_ #include <unordered_set> #include <vector> #include <fst/connect.h> #include <fst/mutable-fst.h> namespace fst { // Removes final states that have epsilon-only input arcs. template <class Arc> void RmFinalEpsilon(MutableFst<Arc> *fst) { using StateId = typename Arc::StateId; using Weight = typename Arc::Weight; // Determines the coaccesibility of states. std::vector<bool> access; std::vector<bool> coaccess; uint64 props = 0; SccVisitor<Arc> scc_visitor(nullptr, &access, &coaccess, &props); DfsVisit(*fst, &scc_visitor); // Finds potential list of removable final states. These are final states that // have no outgoing transitions or final states that have a non-coaccessible // future. std::unordered_set<StateId> finals; for (StateIterator<Fst<Arc>> siter(*fst); !siter.Done(); siter.Next()) { const auto s = siter.Value(); if (fst->Final(s) != Weight::Zero()) { bool future_coaccess = false; for (ArcIterator<Fst<Arc>> aiter(*fst, s); !aiter.Done(); aiter.Next()) { const auto &arc = aiter.Value(); if (coaccess[arc.nextstate]) { future_coaccess = true; break; } } if (!future_coaccess) finals.insert(s); } } // Moves the final weight. std::vector<Arc> arcs; for (StateIterator<Fst<Arc>> siter(*fst); !siter.Done(); siter.Next()) { const auto s = siter.Value(); auto weight = fst->Final(s); arcs.clear(); for (ArcIterator<Fst<Arc>> aiter(*fst, s); !aiter.Done(); aiter.Next()) { const auto &arc = aiter.Value(); // Next state is in the list of finals. if (finals.find(arc.nextstate) != finals.end()) { // Sums up all epsilon arcs. if (arc.ilabel == 0 && arc.olabel == 0) { weight = Plus(Times(fst->Final(arc.nextstate), arc.weight), weight); } else { arcs.push_back(arc); } } else { arcs.push_back(arc); } } // If some arcs (epsilon arcs) were deleted, delete all arcs and add back // only the non-epsilon arcs. if (arcs.size() < fst->NumArcs(s)) { fst->DeleteArcs(s); fst->SetFinal(s, weight); for (const auto &arc : arcs) fst->AddArc(s, arc); } } Connect(fst); } } // namespace fst #endif // FST_RMFINALEPSILON_H_
0
coqui_public_repos/STT-models/maltese/itml
coqui_public_repos/STT-models/maltese/itml/v0.1.0/LICENSE
GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <https://www.gnu.org/licenses/>.
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/test/fst_test.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Regression test for FST classes. #include <fst/test/fst_test.h> #include <utility> #include <fst/flags.h> #include <fst/log.h> #include <fst/compact-fst.h> #include <fst/const-fst.h> #include <fst/edit-fst.h> #include <fst/matcher-fst.h> namespace fst { namespace { // A user-defined arc type. struct CustomArc { typedef int16 Label; typedef ProductWeight<TropicalWeight, LogWeight> Weight; typedef int64 StateId; CustomArc(Label i, Label o, Weight w, StateId s) : ilabel(i), olabel(o), weight(std::move(w)), nextstate(s) {} CustomArc() {} static const string &Type() { // Arc type name static const string *const type = new string("my"); return *type; } Label ilabel; // Transition input label Label olabel; // Transition output label Weight weight; // Transition weight StateId nextstate; // Transition destination state }; // A user-defined compactor for test FST. template <class A> class CustomCompactor { public: typedef A Arc; typedef typename A::Label Label; typedef typename A::StateId StateId; typedef typename A::Weight Weight; typedef std::pair<Label, Weight> Element; Element Compact(StateId s, const A &arc) const { return std::make_pair(arc.ilabel, arc.weight); } Arc Expand(StateId s, const Element &p, uint32 f = kArcValueFlags) const { return p.first == kNoLabel ? Arc(kNoLabel, kNoLabel, p.second, kNoStateId) : Arc(p.first, 0, p.second, s); } ssize_t Size() const { return -1; } uint64 Properties() const { return 0ULL; } bool Compatible(const Fst<A> &fst) const { return true; } static const string &Type() { static const string *const type = new string("my"); return *type; } bool Write(std::ostream &strm) const { return true; } static CustomCompactor *Read(std::istream &strm) { return new CustomCompactor; } }; REGISTER_FST(VectorFst, CustomArc); REGISTER_FST(ConstFst, CustomArc); static fst::FstRegisterer<CompactFst<StdArc, CustomCompactor<StdArc>>> CompactFst_StdArc_CustomCompactor_registerer; static fst::FstRegisterer<CompactFst<CustomArc, CustomCompactor<CustomArc>>> CompactFst_CustomArc_CustomCompactor_registerer; static fst::FstRegisterer<ConstFst<StdArc, uint16>> ConstFst_StdArc_uint16_registerer; static fst::FstRegisterer< CompactFst<StdArc, CustomCompactor<StdArc>, uint16>> CompactFst_StdArc_CustomCompactor_uint16_registerer; } // namespace } // namespace fst using fst::FstTester; using fst::VectorFst; using fst::ConstFst; using fst::MatcherFst; using fst::CompactFst; using fst::Fst; using fst::StdArc; using fst::CustomArc; using fst::CustomCompactor; using fst::StdArcLookAheadFst; using fst::EditFst; int main(int argc, char **argv) { FLAGS_fst_verify_properties = true; std::set_new_handler(FailedNewHandler); SET_FLAGS(argv[0], &argc, &argv, true); // VectorFst<StdArc> tests { FstTester<VectorFst<StdArc>> std_vector_tester; std_vector_tester.TestBase(); std_vector_tester.TestExpanded(); std_vector_tester.TestAssign(); std_vector_tester.TestCopy(); std_vector_tester.TestIO(); std_vector_tester.TestMutable(); } // ConstFst<StdArc> tests { FstTester<ConstFst<StdArc>> std_const_tester; std_const_tester.TestBase(); std_const_tester.TestExpanded(); std_const_tester.TestCopy(); std_const_tester.TestIO(); } // CompactFst<StdArc, CustomCompactor<StdArc>> { FstTester<CompactFst<StdArc, CustomCompactor<StdArc>>> std_compact_tester; std_compact_tester.TestBase(); std_compact_tester.TestExpanded(); std_compact_tester.TestCopy(); std_compact_tester.TestIO(); } // VectorFst<CustomArc> tests { FstTester<VectorFst<CustomArc>> std_vector_tester; std_vector_tester.TestBase(); std_vector_tester.TestExpanded(); std_vector_tester.TestAssign(); std_vector_tester.TestCopy(); std_vector_tester.TestIO(); std_vector_tester.TestMutable(); } // ConstFst<CustomArc> tests { FstTester<ConstFst<CustomArc>> std_const_tester; std_const_tester.TestBase(); std_const_tester.TestExpanded(); std_const_tester.TestCopy(); std_const_tester.TestIO(); } // CompactFst<CustomArc, CustomCompactor<CustomArc>> { FstTester<CompactFst<CustomArc, CustomCompactor<CustomArc>>> std_compact_tester; std_compact_tester.TestBase(); std_compact_tester.TestExpanded(); std_compact_tester.TestCopy(); std_compact_tester.TestIO(); } // ConstFst<StdArc, uint16> tests { FstTester<ConstFst<StdArc, uint16>> std_const_tester; std_const_tester.TestBase(); std_const_tester.TestExpanded(); std_const_tester.TestCopy(); std_const_tester.TestIO(); } // CompactFst<StdArc, CustomCompactor<StdArc>, uint16> { FstTester<CompactFst<StdArc, CustomCompactor<StdArc>, uint16>> std_compact_tester; std_compact_tester.TestBase(); std_compact_tester.TestExpanded(); std_compact_tester.TestCopy(); std_compact_tester.TestIO(); } // FstTester<StdArcLookAheadFst> { FstTester<StdArcLookAheadFst> std_matcher_tester; std_matcher_tester.TestBase(); std_matcher_tester.TestExpanded(); std_matcher_tester.TestCopy(); } // EditFst<StdArc> tests { FstTester<EditFst<StdArc>> std_edit_tester; std_edit_tester.TestBase(); std_edit_tester.TestExpanded(); std_edit_tester.TestAssign(); std_edit_tester.TestCopy(); std_edit_tester.TestMutable(); } std::cout << "PASS" << std::endl; return 0; }
0
coqui_public_repos/STT-examples
coqui_public_repos/STT-examples/django_api_streaming/Dockerfile
FROM python:3.8-buster COPY . /app/ WORKDIR /app RUN pip install -r requirements.txt RUN pip install 'gunicorn==20.0.*' EXPOSE 8000 #EXPOSE 5432 # Uncomment if you use postgresQL db RUN chmod +x /app/entrypoint.sh ENTRYPOINT ["/app/entrypoint.sh"] CMD ["gunicorn", "--log-file=/var/log/gunicorn.log", "example.wsgi", "-b 0.0.0.0:8000"]
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/bin/fstinvert-main.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Inverts a transduction. #include <cstring> #include <memory> #include <string> #include <fst/flags.h> #include <fst/script/invert.h> int fstinvert_main(int argc, char **argv) { namespace s = fst::script; using fst::script::MutableFstClass; string usage = "Inverts a transduction.\n\n Usage: "; usage += argv[0]; usage += " [in.fst [out.fst]]\n"; std::set_new_handler(FailedNewHandler); SET_FLAGS(usage.c_str(), &argc, &argv, true); if (argc > 3) { ShowUsage(); return 1; } const string in_name = (argc > 1 && strcmp(argv[1], "-") != 0) ? argv[1] : ""; const string out_name = argc > 2 ? argv[2] : ""; std::unique_ptr<MutableFstClass> fst(MutableFstClass::Read(in_name, true)); if (!fst) return 1; s::Invert(fst.get()); return !fst->Write(out_name); }
0
coqui_public_repos/TTS/tests
coqui_public_repos/TTS/tests/aux_tests/test_numpy_transforms.py
import math import os import unittest from dataclasses import dataclass import librosa import numpy as np from coqpit import Coqpit from tests import get_tests_input_path, get_tests_output_path, get_tests_path from TTS.utils.audio import numpy_transforms as np_transforms TESTS_PATH = get_tests_path() OUT_PATH = os.path.join(get_tests_output_path(), "audio_tests") WAV_FILE = os.path.join(get_tests_input_path(), "example_1.wav") os.makedirs(OUT_PATH, exist_ok=True) # pylint: disable=no-self-use class TestNumpyTransforms(unittest.TestCase): def setUp(self) -> None: @dataclass class AudioConfig(Coqpit): sample_rate: int = 22050 fft_size: int = 1024 num_mels: int = 256 mel_fmax: int = 1800 mel_fmin: int = 0 hop_length: int = 256 win_length: int = 1024 pitch_fmax: int = 640 pitch_fmin: int = 1 trim_db: int = -1 min_silence_sec: float = 0.01 gain: float = 1.0 base: float = 10.0 self.config = AudioConfig() self.sample_wav, _ = librosa.load(WAV_FILE, sr=self.config.sample_rate) def test_build_mel_basis(self): """Check if the mel basis is correctly built""" print(" > Testing mel basis building.") mel_basis = np_transforms.build_mel_basis(**self.config) self.assertEqual(mel_basis.shape, (self.config.num_mels, self.config.fft_size // 2 + 1)) def test_millisec_to_length(self): """Check if the conversion from milliseconds to length is correct""" print(" > Testing millisec to length conversion.") win_len, hop_len = np_transforms.millisec_to_length( frame_length_ms=1000, frame_shift_ms=12.5, sample_rate=self.config.sample_rate ) self.assertEqual(hop_len, int(12.5 / 1000.0 * self.config.sample_rate)) self.assertEqual(win_len, self.config.sample_rate) def test_amplitude_db_conversion(self): di = np.random.rand(11) o1 = np_transforms.amp_to_db(x=di, gain=1.0, base=10) o2 = np_transforms.db_to_amp(x=o1, gain=1.0, base=10) np.testing.assert_almost_equal(di, o2, decimal=5) def test_preemphasis_deemphasis(self): di = np.random.rand(11) o1 = np_transforms.preemphasis(x=di, coeff=0.95) o2 = np_transforms.deemphasis(x=o1, coeff=0.95) np.testing.assert_almost_equal(di, o2, decimal=5) def test_spec_to_mel(self): mel_basis = np_transforms.build_mel_basis(**self.config) spec = np.random.rand(self.config.fft_size // 2 + 1, 20) # [C, T] mel = np_transforms.spec_to_mel(spec=spec, mel_basis=mel_basis) self.assertEqual(mel.shape, (self.config.num_mels, 20)) def mel_to_spec(self): mel_basis = np_transforms.build_mel_basis(**self.config) mel = np.random.rand(self.config.num_mels, 20) # [C, T] spec = np_transforms.mel_to_spec(mel=mel, mel_basis=mel_basis) self.assertEqual(spec.shape, (self.config.fft_size // 2 + 1, 20)) def test_wav_to_spec(self): spec = np_transforms.wav_to_spec(wav=self.sample_wav, **self.config) self.assertEqual( spec.shape, (self.config.fft_size // 2 + 1, math.ceil(self.sample_wav.shape[0] / self.config.hop_length)) ) def test_wav_to_mel(self): mel_basis = np_transforms.build_mel_basis(**self.config) mel = np_transforms.wav_to_mel(wav=self.sample_wav, mel_basis=mel_basis, **self.config) self.assertEqual( mel.shape, (self.config.num_mels, math.ceil(self.sample_wav.shape[0] / self.config.hop_length)) ) def test_compute_f0(self): pitch = np_transforms.compute_f0(x=self.sample_wav, **self.config) mel_basis = np_transforms.build_mel_basis(**self.config) mel = np_transforms.wav_to_mel(wav=self.sample_wav, mel_basis=mel_basis, **self.config) assert pitch.shape[0] == mel.shape[1] def test_load_wav(self): wav = np_transforms.load_wav(filename=WAV_FILE, resample=False, sample_rate=22050) wav_resample = np_transforms.load_wav(filename=WAV_FILE, resample=True, sample_rate=16000) self.assertEqual(wav.shape, (self.sample_wav.shape[0],)) self.assertNotEqual(wav_resample.shape, (self.sample_wav.shape[0],))
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst/union-weight.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Union weight set and associated semiring operation definitions. // // TODO(riley): add in normalizer functor #ifndef FST_UNION_WEIGHT_H_ #define FST_UNION_WEIGHT_H_ #include <cstdlib> #include <iostream> #include <list> #include <sstream> #include <string> #include <utility> #include <fst/weight.h> namespace fst { // Example UnionWeightOptions for UnionWeight template below. The Merge // operation is used to collapse elements of the set and the Compare function // to efficiently implement the merge. In the simplest case, merge would just // apply with equality of set elements so the result is a set (and not a // multiset). More generally, this can be used to maintain the multiplicity or // other such weight associated with the set elements (cf. Gallic weights). // template <class W> // struct UnionWeightOptions { // // Comparison function C is a total order on W that is monotonic w.r.t. to // // Times: for all a, b,c != Zero(): C(a, b) => C(ca, cb) and is // // anti-monotonic w.r.rt to Divide: C(a, b) => C(c/b, c/a). // // // // For all a, b: only one of C(a, b), C(b, a) or a ~ b must true where // // ~ is an equivalence relation on W. Also we require a ~ b iff // // a.Reverse() ~ b.Reverse(). // using Compare = NaturalLess<W>; // // // How to combine two weights if a ~ b as above. For all a, b: a ~ b => // // merge(a, b) ~ a, Merge must define a semiring endomorphism from the // // unmerged weight sets to the merged weight sets. // struct Merge { // W operator()(const W &w1, const W &w2) const { return w1; } // }; // // // For ReverseWeight. // using ReverseOptions = UnionWeightOptions<ReverseWeight>; // }; template <class W, class O> class UnionWeight; template <class W, class O> class UnionWeightIterator; template <class W, class O> class UnionWeightReverseIterator; template <class W, class O> bool operator==(const UnionWeight<W, O> &, const UnionWeight<W, O> &); // Semiring that uses Times() and One() from W and union and the empty set // for Plus() and Zero(), respectively. Template argument O specifies the union // weight options as above. template <class W, class O> class UnionWeight { public: using Weight = W; using Compare = typename O::Compare; using Merge = typename O::Merge; using ReverseWeight = UnionWeight<typename W::ReverseWeight, typename O::ReverseOptions>; friend class UnionWeightIterator<W, O>; friend class UnionWeightReverseIterator<W, O>; friend bool operator== <>(const UnionWeight<W, O> &, const UnionWeight<W, O> &); // Sets represented as first_ weight + rest_ weights. Uses first_ as // NoWeight() to indicate the union weight Zero() ask the empty set. Uses // rest_ containing NoWeight() to indicate the union weight NoWeight(). UnionWeight() : first_(W::NoWeight()) {} explicit UnionWeight(W weight) : first_(weight) { if (weight == W::NoWeight()) rest_.push_back(weight); } static const UnionWeight<W, O> &Zero() { static const UnionWeight<W, O> zero(W::NoWeight()); return zero; } static const UnionWeight<W, O> &One() { static const UnionWeight<W, O> one(W::One()); return one; } static const UnionWeight<W, O> &NoWeight() { static const UnionWeight<W, O> no_weight(W::Zero(), W::NoWeight()); return no_weight; } static const string &Type() { static const string *const type = new string(W::Type() + "_union"); return *type; } static constexpr uint64 Properties() { return W::Properties() & (kLeftSemiring | kRightSemiring | kCommutative | kIdempotent); } bool Member() const; std::istream &Read(std::istream &strm); std::ostream &Write(std::ostream &strm) const; size_t Hash() const; UnionWeight<W, O> Quantize(float delta = kDelta) const; ReverseWeight Reverse() const; // These operations combined with the UnionWeightIterator and // UnionWeightReverseIterator provide the access and mutation of the union // weight internal elements. // Common initializer among constructors; clears existing UnionWeight. void Clear() { first_ = W::NoWeight(); rest_.clear(); } size_t Size() const { return first_.Member() ? rest_.size() + 1 : 0; } const W &Back() const { return rest_.empty() ? first_ : rest_.back(); } // When srt is true, assumes elements added sorted w.r.t Compare and merging // of weights performed as needed. Otherwise, just ensures first_ is the // least element wrt Compare. void PushBack(W weight, bool srt); // Sorts the elements of the set. Assumes that first_, if present, is the // least element. void Sort() { rest_.sort(comp_); } private: W &Back() { if (rest_.empty()) { return first_; } else { return rest_.back(); } } UnionWeight(W w1, W w2) : first_(std::move(w1)), rest_(1, std::move(w2)) {} W first_; // First weight in set. std::list<W> rest_; // Remaining weights in set. Compare comp_; Merge merge_; }; template <class W, class O> void UnionWeight<W, O>::PushBack(W weight, bool srt) { if (!weight.Member()) { rest_.push_back(std::move(weight)); } else if (!first_.Member()) { first_ = std::move(weight); } else if (srt) { auto &back = Back(); if (comp_(back, weight)) { rest_.push_back(std::move(weight)); } else { back = merge_(back, std::move(weight)); } } else { if (comp_(first_, weight)) { rest_.push_back(std::move(weight)); } else { rest_.push_back(first_); first_ = std::move(weight); } } } // Traverses union weight in the forward direction. template <class W, class O> class UnionWeightIterator { public: explicit UnionWeightIterator(const UnionWeight<W, O> &weight) : first_(weight.first_), rest_(weight.rest_), init_(true), it_(rest_.begin()) {} bool Done() const { return init_ ? !first_.Member() : it_ == rest_.end(); } const W &Value() const { return init_ ? first_ : *it_; } void Next() { if (init_) { init_ = false; } else { ++it_; } } void Reset() { init_ = true; it_ = rest_.begin(); } private: const W &first_; const std::list<W> &rest_; bool init_; // in the initialized state? typename std::list<W>::const_iterator it_; }; // Traverses union weight in backward direction. template <typename L, class O> class UnionWeightReverseIterator { public: explicit UnionWeightReverseIterator(const UnionWeight<L, O> &weight) : first_(weight.first_), rest_(weight.rest_), fin_(!first_.Member()), it_(rest_.rbegin()) {} bool Done() const { return fin_; } const L &Value() const { return it_ == rest_.rend() ? first_ : *it_; } void Next() { if (it_ == rest_.rend()) { fin_ = true; } else { ++it_; } } void Reset() { fin_ = !first_.Member(); it_ = rest_.rbegin(); } private: const L &first_; const std::list<L> &rest_; bool fin_; // in the final state? typename std::list<L>::const_reverse_iterator it_; }; // UnionWeight member functions follow that require UnionWeightIterator. template <class W, class O> inline std::istream &UnionWeight<W, O>::Read(std::istream &istrm) { Clear(); int32 size; ReadType(istrm, &size); for (int i = 0; i < size; ++i) { W weight; ReadType(istrm, &weight); PushBack(weight, true); } return istrm; } template <class W, class O> inline std::ostream &UnionWeight<W, O>::Write(std::ostream &ostrm) const { const int32 size = Size(); WriteType(ostrm, size); for (UnionWeightIterator<W, O> it(*this); !it.Done(); it.Next()) { WriteType(ostrm, it.Value()); } return ostrm; } template <class W, class O> inline bool UnionWeight<W, O>::Member() const { if (Size() <= 1) return true; for (UnionWeightIterator<W, O> it(*this); !it.Done(); it.Next()) { if (!it.Value().Member()) return false; } return true; } template <class W, class O> inline UnionWeight<W, O> UnionWeight<W, O>::Quantize(float delta) const { UnionWeight<W, O> weight; for (UnionWeightIterator<W, O> it(*this); !it.Done(); it.Next()) { weight.PushBack(it.Value().Quantize(delta), true); } return weight; } template <class W, class O> inline typename UnionWeight<W, O>::ReverseWeight UnionWeight<W, O>::Reverse() const { ReverseWeight weight; for (UnionWeightIterator<W, O> it(*this); !it.Done(); it.Next()) { weight.PushBack(it.Value().Reverse(), false); } weight.Sort(); return weight; } template <class W, class O> inline size_t UnionWeight<W, O>::Hash() const { size_t h = 0; static constexpr int lshift = 5; static constexpr int rshift = CHAR_BIT * sizeof(size_t) - lshift; for (UnionWeightIterator<W, O> it(*this); !it.Done(); it.Next()) { h = h << lshift ^ h >> rshift ^ it.Value().Hash(); } return h; } // Requires union weight has been canonicalized. template <class W, class O> inline bool operator==(const UnionWeight<W, O> &w1, const UnionWeight<W, O> &w2) { if (w1.Size() != w2.Size()) return false; UnionWeightIterator<W, O> it1(w1); UnionWeightIterator<W, O> it2(w2); for (; !it1.Done(); it1.Next(), it2.Next()) { if (it1.Value() != it2.Value()) return false; } return true; } // Requires union weight has been canonicalized. template <class W, class O> inline bool operator!=(const UnionWeight<W, O> &w1, const UnionWeight<W, O> &w2) { return !(w1 == w2); } // Requires union weight has been canonicalized. template <class W, class O> inline bool ApproxEqual(const UnionWeight<W, O> &w1, const UnionWeight<W, O> &w2, float delta = kDelta) { if (w1.Size() != w2.Size()) return false; UnionWeightIterator<W, O> it1(w1); UnionWeightIterator<W, O> it2(w2); for (; !it1.Done(); it1.Next(), it2.Next()) { if (!ApproxEqual(it1.Value(), it2.Value(), delta)) return false; } return true; } template <class W, class O> inline std::ostream &operator<<(std::ostream &ostrm, const UnionWeight<W, O> &weight) { UnionWeightIterator<W, O> it(weight); if (it.Done()) { return ostrm << "EmptySet"; } else if (!weight.Member()) { return ostrm << "BadSet"; } else { CompositeWeightWriter writer(ostrm); writer.WriteBegin(); for (; !it.Done(); it.Next()) writer.WriteElement(it.Value()); writer.WriteEnd(); } return ostrm; } template <class W, class O> inline std::istream &operator>>(std::istream &istrm, UnionWeight<W, O> &weight) { string s; istrm >> s; if (s == "EmptySet") { weight = UnionWeight<W, O>::Zero(); } else if (s == "BadSet") { weight = UnionWeight<W, O>::NoWeight(); } else { weight = UnionWeight<W, O>::Zero(); std::istringstream sstrm(s); CompositeWeightReader reader(sstrm); reader.ReadBegin(); bool more = true; while (more) { W v; more = reader.ReadElement(&v); weight.PushBack(v, true); } reader.ReadEnd(); } return istrm; } template <class W, class O> inline UnionWeight<W, O> Plus(const UnionWeight<W, O> &w1, const UnionWeight<W, O> &w2) { if (!w1.Member() || !w2.Member()) return UnionWeight<W, O>::NoWeight(); if (w1 == UnionWeight<W, O>::Zero()) return w2; if (w2 == UnionWeight<W, O>::Zero()) return w1; UnionWeightIterator<W, O> it1(w1); UnionWeightIterator<W, O> it2(w2); UnionWeight<W, O> sum; typename O::Compare comp; while (!it1.Done() && !it2.Done()) { const auto v1 = it1.Value(); const auto v2 = it2.Value(); if (comp(v1, v2)) { sum.PushBack(v1, true); it1.Next(); } else { sum.PushBack(v2, true); it2.Next(); } } for (; !it1.Done(); it1.Next()) sum.PushBack(it1.Value(), true); for (; !it2.Done(); it2.Next()) sum.PushBack(it2.Value(), true); return sum; } template <class W, class O> inline UnionWeight<W, O> Times(const UnionWeight<W, O> &w1, const UnionWeight<W, O> &w2) { if (!w1.Member() || !w2.Member()) return UnionWeight<W, O>::NoWeight(); if (w1 == UnionWeight<W, O>::Zero() || w2 == UnionWeight<W, O>::Zero()) { return UnionWeight<W, O>::Zero(); } UnionWeightIterator<W, O> it1(w1); UnionWeightIterator<W, O> it2(w2); UnionWeight<W, O> prod1; for (; !it1.Done(); it1.Next()) { UnionWeight<W, O> prod2; for (; !it2.Done(); it2.Next()) { prod2.PushBack(Times(it1.Value(), it2.Value()), true); } prod1 = Plus(prod1, prod2); it2.Reset(); } return prod1; } template <class W, class O> inline UnionWeight<W, O> Divide(const UnionWeight<W, O> &w1, const UnionWeight<W, O> &w2, DivideType typ) { if (!w1.Member() || !w2.Member()) return UnionWeight<W, O>::NoWeight(); if (w1 == UnionWeight<W, O>::Zero() || w2 == UnionWeight<W, O>::Zero()) { return UnionWeight<W, O>::Zero(); } UnionWeightIterator<W, O> it1(w1); UnionWeightReverseIterator<W, O> it2(w2); UnionWeight<W, O> quot; if (w1.Size() == 1) { for (; !it2.Done(); it2.Next()) { quot.PushBack(Divide(it1.Value(), it2.Value(), typ), true); } } else if (w2.Size() == 1) { for (; !it1.Done(); it1.Next()) { quot.PushBack(Divide(it1.Value(), it2.Value(), typ), true); } } else { quot = UnionWeight<W, O>::NoWeight(); } return quot; } // This function object generates weights over the union of weights for the // underlying generators for the template weight types. This is intended // primarily for testing. template <class W, class O> class WeightGenerate<UnionWeight<W, O>> { public: using Weight = UnionWeight<W, O>; using Generate = WeightGenerate<W>; explicit WeightGenerate(bool allow_zero = true, size_t num_random_weights = kNumRandomWeights) : generate_(false), allow_zero_(allow_zero), num_random_weights_(num_random_weights) {} Weight operator()() const { const int n = rand() % (num_random_weights_ + 1); // NOLINT if (allow_zero_ && n == num_random_weights_) { return Weight::Zero(); } else if (n % 2 == 0) { return Weight(generate_()); } else { return Plus(Weight(generate_()), Weight(generate_())); } } private: Generate generate_; // Permits Zero() and zero divisors. bool allow_zero_; // The number of alternative random weights. const size_t num_random_weights_; }; } // namespace fst #endif // FST_UNION_WEIGHT_H_
0
coqui_public_repos/STT-models/slovenian/itml
coqui_public_repos/STT-models/slovenian/itml/v0.1.0/MODEL_CARD.md
# Model card for Slovenian STT Jump to section: - [Model details](#model-details) - [Intended use](#intended-use) - [Performance Factors](#performance-factors) - [Metrics](#metrics) - [Training data](#training-data) - [Evaluation data](#evaluation-data) - [Ethical considerations](#ethical-considerations) - [Caveats and recommendations](#caveats-and-recommendations) ## Model details - Person or organization developing model: Originally trained by [Francis Tyers](https://scholar.google.fr/citations?user=o5HSM6cAAAAJ) and the [Inclusive Technology for Marginalised Languages](https://itml.cl.indiana.edu/) group. - Model language: Slovenian / Slovenščina / `sl` - Model date: April 9, 2021 - Model type: `Speech-to-Text` - Model version: `v0.1.0` - Compatible with 🐸 STT version: `v0.9.3` - License: AGPL - Citation details: `@techreport{slovenian-stt, author = {Tyers,Francis}, title = {Slovenian STT 0.1}, institution = {Coqui}, address = {\url{https://github.com/coqui-ai/STT-models}} year = {2021}, month = {April}, number = {STT-CV6.1-SL-0.1} }` - Where to send questions or comments about the model: You can leave an issue on [`STT-model` issues](https://github.com/coqui-ai/STT-models/issues), open a new discussion on [`STT-model` discussions](https://github.com/coqui-ai/STT-models/discussions), or chat with us on [Gitter](https://gitter.im/coqui-ai/). ## Intended use Speech-to-Text for the [Slovenian Language](https://en.wikipedia.org/wiki/Slovenian_language) on 16kHz, mono-channel audio. ## Performance Factors Factors relevant to Speech-to-Text performance include but are not limited to speaker demographics, recording quality, and background noise. Read more about STT performance factors [here](https://stt.readthedocs.io/en/latest/DEPLOYMENT.html#how-will-a-model-perform-on-my-data). ## Metrics STT models are usually evaluated in terms of their transcription accuracy, deployment Real-Time Factor, and model size on disk. #### Transcription Accuracy The following Word Error Rates and Character Error Rates are reported on [omnilingo](https://tepozcatl.omnilingo.cc/sl/). |Test Corpus|WER|CER| |-----------|---|---| |Common Voice|90.2\%|31.1\%| #### Real-Time Factor Real-Time Factor (RTF) is defined as `processing-time / length-of-audio`. The exact real-time factor of an STT model will depend on the hardware setup, so you may experience a different RTF. Recorded average RTF on laptop CPU: `` #### Model Size `model.pbmm`: 181M `model.tflite`: 46M ### Approaches to uncertainty and variability Confidence scores and multiple paths from the decoding beam can be used to measure model uncertainty and provide multiple, variable transcripts for any processed audio. ## Training data This model was trained on Common Voice 6.1 train. ## Evaluation data The Model was evaluated on Common Voice 6.1 test. ## Ethical considerations Deploying a Speech-to-Text model into any production setting has ethical implications. You should consider these implications before use. ### Demographic Bias You should assume every machine learning model has demographic bias unless proven otherwise. For STT models, it is often the case that transcription accuracy is better for men than it is for women. If you are using this model in production, you should acknowledge this as a potential issue. ### Surveillance Speech-to-Text may be mis-used to invade the privacy of others by recording and mining information from private conversations. This kind of individual privacy is protected by law in may countries. You should not assume consent to record and analyze private speech. ## Caveats and recommendations Machine learning models (like this STT model) perform best on data that is similar to the data on which they were trained. Read about what to expect from an STT model with regard to your data [here](https://stt.readthedocs.io/en/latest/DEPLOYMENT.html#how-will-a-model-perform-on-my-data). In most applications, it is recommended that you [train your own language model](https://stt.readthedocs.io/en/latest/LANGUAGE_MODEL.html) to improve transcription accuracy on your speech data.
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/include/fst/set-weight.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. // // Weights consisting of sets (of integral Labels) and // associated semiring operation definitions using intersect // and union. #ifndef FST_SET_WEIGHT_H_ #define FST_SET_WEIGHT_H_ #include <cstdlib> #include <algorithm> #include <list> #include <string> #include <vector> #include <fst/union-weight.h> #include <fst/weight.h> namespace fst { constexpr int kSetEmpty = 0; // Label for the empty set. constexpr int kSetUniv = -1; // Label for the universal set. constexpr int kSetBad = -2; // Label for a non-set. constexpr char kSetSeparator = '_'; // Label separator in sets. // Determines whether to use (intersect, union) or (union, intersect) // as (+, *) for the semiring. SET_INTERSECT_UNION_RESTRICTED is a // restricted version of (intersect, union) that requires summed // arguments to be equal (or an error is signalled), useful for // algorithms that require a unique labelled path weight. SET_BOOLEAN // treats all non-Zero() elements as equivalent (with Zero() == // UnivSet()), useful for algorithms that don't really depend on the // detailed sets. enum SetType { SET_INTERSECT_UNION = 0, SET_UNION_INTERSECT = 1, SET_INTERSECT_UNION_RESTRICT = 2, SET_BOOLEAN = 3 }; template <class> class SetWeightIterator; // Set semiring of integral labels. template <typename Label_, SetType S = SET_INTERSECT_UNION> class SetWeight { public: using Label = Label_; using ReverseWeight = SetWeight<Label, S>; using Iterator = SetWeightIterator<SetWeight>; friend class SetWeightIterator<SetWeight>; // Allow type-converting copy and move constructors private access. template <typename L2, SetType S2> friend class SetWeight; SetWeight() {} // Input should be positive, sorted and unique. template <typename Iterator> SetWeight(const Iterator &begin, const Iterator &end) { for (auto iter = begin; iter != end; ++iter) PushBack(*iter); } // Input should be positive. (Non-positive value has // special internal meaning w.r.t. integral constants above.) explicit SetWeight(Label label) { PushBack(label); } template <SetType S2> explicit SetWeight(const SetWeight<Label, S2> &w) : first_(w.first_), rest_(w.rest_) {} template <SetType S2> explicit SetWeight(SetWeight<Label, S2> &&w) : first_(w.first_), rest_(std::move(w.rest_)) { w.Clear(); } template <SetType S2> SetWeight &operator=(const SetWeight<Label, S2> &w) { first_ = w.first_; rest_ = w.rest_; return *this; } template <SetType S2> SetWeight &operator=(SetWeight<Label, S2> &&w) { first_ = w.first_; rest_ = std::move(w.rest_); w.Clear(); return *this; } static const SetWeight &Zero() { return S == SET_UNION_INTERSECT ? EmptySet() : UnivSet(); } static const SetWeight &One() { return S == SET_UNION_INTERSECT ? UnivSet() : EmptySet(); } static const SetWeight &NoWeight() { static const auto *const no_weight = new SetWeight(Label(kSetBad)); return *no_weight; } static const string &Type() { static const string *const type = new string( S == SET_UNION_INTERSECT ? "union_intersect_set" : (S == SET_INTERSECT_UNION ? "intersect_union_set" : (S == SET_INTERSECT_UNION_RESTRICT ? "restricted_set_intersect_union" : "boolean_set"))); return *type; } bool Member() const; std::istream &Read(std::istream &strm); std::ostream &Write(std::ostream &strm) const; size_t Hash() const; SetWeight Quantize(float delta = kDelta) const { return *this; } ReverseWeight Reverse() const; static constexpr uint64 Properties() { return kIdempotent | kLeftSemiring | kRightSemiring | kCommutative; } // These operations combined with the SetWeightIterator // provide the access and mutation of the set internal elements. // The empty set. static const SetWeight &EmptySet() { static const auto *const empty = new SetWeight(Label(kSetEmpty)); return *empty; } // The univeral set. static const SetWeight &UnivSet() { static const auto *const univ = new SetWeight(Label(kSetUniv)); return *univ; } // Clear existing SetWeight. void Clear() { first_ = kSetEmpty; rest_.clear(); } size_t Size() const { return first_ == kSetEmpty ? 0 : rest_.size() + 1; } Label Back() { if (rest_.empty()) { return first_; } else { return rest_.back(); } } // Caller must add in sort order and be unique (or error signalled). // Input should also be positive. Non-positive value (for the first // push) has special internal meaning w.r.t. integral constants above. void PushBack(Label label) { if (first_ == kSetEmpty) { first_ = label; } else { if (label <= Back() || label <= 0) { FSTERROR() << "SetWeight: labels must be positive, added" << " in sort order and be unique."; rest_.push_back(Label(kSetBad)); } rest_.push_back(label); } } private: Label first_ = kSetEmpty; // First label in set (kSetEmpty if empty). std::list<Label> rest_; // Remaining labels in set. }; // Traverses set in forward direction. template <class SetWeight_> class SetWeightIterator { public: using Weight = SetWeight_; using Label = typename Weight::Label; explicit SetWeightIterator(const Weight &w) : first_(w.first_), rest_(w.rest_), init_(true), iter_(rest_.begin()) {} bool Done() const { if (init_) { return first_ == kSetEmpty; } else { return iter_ == rest_.end(); } } const Label &Value() const { return init_ ? first_ : *iter_; } void Next() { if (init_) { init_ = false; } else { ++iter_; } } void Reset() { init_ = true; iter_ = rest_.begin(); } private: const Label &first_; const decltype(Weight::rest_) &rest_; bool init_; // In the initialized state? typename decltype(Weight::rest_)::const_iterator iter_; }; // SetWeight member functions follow that require SetWeightIterator template <typename Label, SetType S> inline std::istream &SetWeight<Label, S>::Read(std::istream &strm) { Clear(); int32 size; ReadType(strm, &size); for (int32 i = 0; i < size; ++i) { Label label; ReadType(strm, &label); PushBack(label); } return strm; } template <typename Label, SetType S> inline std::ostream &SetWeight<Label, S>::Write(std::ostream &strm) const { const int32 size = Size(); WriteType(strm, size); for (Iterator iter(*this); !iter.Done(); iter.Next()) { WriteType(strm, iter.Value()); } return strm; } template <typename Label, SetType S> inline bool SetWeight<Label, S>::Member() const { Iterator iter(*this); return iter.Value() != Label(kSetBad); } template <typename Label, SetType S> inline typename SetWeight<Label, S>::ReverseWeight SetWeight<Label, S>::Reverse() const { return *this; } template <typename Label, SetType S> inline size_t SetWeight<Label, S>::Hash() const { using Weight = SetWeight<Label, S>; if (S == SET_BOOLEAN) { return *this == Weight::Zero() ? 0 : 1; } else { size_t h = 0; for (Iterator iter(*this); !iter.Done(); iter.Next()) { h ^= h << 1 ^ iter.Value(); } return h; } } // Default == template <typename Label, SetType S> inline bool operator==(const SetWeight<Label, S> &w1, const SetWeight<Label, S> &w2) { if (w1.Size() != w2.Size()) return false; using Iterator = typename SetWeight<Label, S>::Iterator; Iterator iter1(w1); Iterator iter2(w2); for (; !iter1.Done(); iter1.Next(), iter2.Next()) { if (iter1.Value() != iter2.Value()) return false; } return true; } // Boolean == template <typename Label> inline bool operator==(const SetWeight<Label, SET_BOOLEAN> &w1, const SetWeight<Label, SET_BOOLEAN> &w2) { // x == kSetEmpty if x \nin {kUnivSet, kSetBad} if (!w1.Member() || !w2.Member()) return false; using Iterator = typename SetWeight<Label, SET_BOOLEAN>::Iterator; Iterator iter1(w1); Iterator iter2(w2); Label label1 = iter1.Done() ? kSetEmpty : iter1.Value(); Label label2 = iter2.Done() ? kSetEmpty : iter2.Value(); if (label1 == kSetUniv) return label2 == kSetUniv; if (label2 == kSetUniv) return label1 == kSetUniv; return true; } template <typename Label, SetType S> inline bool operator!=(const SetWeight<Label, S> &w1, const SetWeight<Label, S> &w2) { return !(w1 == w2); } template <typename Label, SetType S> inline bool ApproxEqual(const SetWeight<Label, S> &w1, const SetWeight<Label, S> &w2, float delta = kDelta) { return w1 == w2; } template <typename Label, SetType S> inline std::ostream &operator<<(std::ostream &strm, const SetWeight<Label, S> &weight) { typename SetWeight<Label, S>::Iterator iter(weight); if (iter.Done()) { return strm << "EmptySet"; } else if (iter.Value() == Label(kSetUniv)) { return strm << "UnivSet"; } else if (iter.Value() == Label(kSetBad)) { return strm << "BadSet"; } else { for (size_t i = 0; !iter.Done(); ++i, iter.Next()) { if (i > 0) strm << kSetSeparator; strm << iter.Value(); } } return strm; } template <typename Label, SetType S> inline std::istream &operator>>(std::istream &strm, SetWeight<Label, S> &weight) { string str; strm >> str; using Weight = SetWeight<Label, S>; if (str == "EmptySet") { weight = Weight(Label(kSetEmpty)); } else if (str == "UnivSet") { weight = Weight(Label(kSetUniv)); } else { weight.Clear(); char *p = nullptr; for (const char *cs = str.c_str(); !p || *p != '\0'; cs = p + 1) { const Label label = strtoll(cs, &p, 10); if (p == cs || (*p != 0 && *p != kSetSeparator)) { strm.clear(std::ios::badbit); break; } weight.PushBack(label); } } return strm; } template <typename Label, SetType S> inline SetWeight<Label, S> Union( const SetWeight<Label, S> &w1, const SetWeight<Label, S> &w2) { using Weight = SetWeight<Label, S>; using Iterator = typename SetWeight<Label, S>::Iterator; if (!w1.Member() || !w2.Member()) return Weight::NoWeight(); if (w1 == Weight::EmptySet()) return w2; if (w2 == Weight::EmptySet()) return w1; if (w1 == Weight::UnivSet()) return w1; if (w2 == Weight::UnivSet()) return w2; Iterator it1(w1); Iterator it2(w2); Weight result; while (!it1.Done() && !it2.Done()) { const auto v1 = it1.Value(); const auto v2 = it2.Value(); if (v1 < v2) { result.PushBack(v1); it1.Next(); } else if (v1 > v2) { result.PushBack(v2); it2.Next(); } else { result.PushBack(v1); it1.Next(); it2.Next(); } } for (; !it1.Done(); it1.Next()) result.PushBack(it1.Value()); for (; !it2.Done(); it2.Next()) result.PushBack(it2.Value()); return result; } template <typename Label, SetType S> inline SetWeight<Label, S> Intersect( const SetWeight<Label, S> &w1, const SetWeight<Label, S> &w2) { using Weight = SetWeight<Label, S>; using Iterator = typename SetWeight<Label, S>::Iterator; if (!w1.Member() || !w2.Member()) return Weight::NoWeight(); if (w1 == Weight::EmptySet()) return w1; if (w2 == Weight::EmptySet()) return w2; if (w1 == Weight::UnivSet()) return w2; if (w2 == Weight::UnivSet()) return w1; Iterator it1(w1); Iterator it2(w2); Weight result; while (!it1.Done() && !it2.Done()) { const auto v1 = it1.Value(); const auto v2 = it2.Value(); if (v1 < v2) { it1.Next(); } else if (v1 > v2) { it2.Next(); } else { result.PushBack(v1); it1.Next(); it2.Next(); } } return result; } template <typename Label, SetType S> inline SetWeight<Label, S> Difference( const SetWeight<Label, S> &w1, const SetWeight<Label, S> &w2) { using Weight = SetWeight<Label, S>; using Iterator = typename SetWeight<Label, S>::Iterator; if (!w1.Member() || !w2.Member()) return Weight::NoWeight(); if (w1 == Weight::EmptySet()) return w1; if (w2 == Weight::EmptySet()) return w1; if (w2 == Weight::UnivSet()) return Weight::EmptySet(); Iterator it1(w1); Iterator it2(w2); Weight result; while (!it1.Done() && !it2.Done()) { const auto v1 = it1.Value(); const auto v2 = it2.Value(); if (v1 < v2) { result.PushBack(v1); it1.Next(); } else if (v1 > v2) { it2.Next(); } else { it1.Next(); it2.Next(); } } for (; !it1.Done(); it1.Next()) result.PushBack(it1.Value()); return result; } // Default: Plus = Intersect. template <typename Label, SetType S> inline SetWeight<Label, S> Plus( const SetWeight<Label, S> &w1, const SetWeight<Label, S> &w2) { return Intersect(w1, w2); } // Plus = Union. template <typename Label> inline SetWeight<Label, SET_UNION_INTERSECT> Plus( const SetWeight<Label, SET_UNION_INTERSECT> &w1, const SetWeight<Label, SET_UNION_INTERSECT> &w2) { return Union(w1, w2); } // Plus = Set equality is required (for non-Zero() input). The // restriction is useful (e.g., in determinization) to ensure the input // has a unique labelled path weight. template <typename Label> inline SetWeight<Label, SET_INTERSECT_UNION_RESTRICT> Plus( const SetWeight<Label, SET_INTERSECT_UNION_RESTRICT> &w1, const SetWeight<Label, SET_INTERSECT_UNION_RESTRICT> &w2) { using Weight = SetWeight<Label, SET_INTERSECT_UNION_RESTRICT>; if (!w1.Member() || !w2.Member()) return Weight::NoWeight(); if (w1 == Weight::Zero()) return w2; if (w2 == Weight::Zero()) return w1; if (w1 != w2) { FSTERROR() << "SetWeight::Plus: Unequal arguments " << "(non-unique labelled path weights?)" << " w1 = " << w1 << " w2 = " << w2; return Weight::NoWeight(); } return w1; } // Plus = Or. template <typename Label> inline SetWeight<Label, SET_BOOLEAN> Plus( const SetWeight<Label, SET_BOOLEAN> &w1, const SetWeight<Label, SET_BOOLEAN> &w2) { using Weight = SetWeight<Label, SET_BOOLEAN>; if (!w1.Member() || !w2.Member()) return Weight::NoWeight(); if (w1 == Weight::One()) return w1; if (w2 == Weight::One()) return w2; return Weight::Zero(); } // Default: Times = Union. template <typename Label, SetType S> inline SetWeight<Label, S> Times( const SetWeight<Label, S> &w1, const SetWeight<Label, S> &w2) { return Union(w1, w2); } // Times = Intersect. template <typename Label> inline SetWeight<Label, SET_UNION_INTERSECT> Times( const SetWeight<Label, SET_UNION_INTERSECT> &w1, const SetWeight<Label, SET_UNION_INTERSECT> &w2) { return Intersect(w1, w2); } // Times = And. template <typename Label> inline SetWeight<Label, SET_BOOLEAN> Times( const SetWeight<Label, SET_BOOLEAN> &w1, const SetWeight<Label, SET_BOOLEAN> &w2) { using Weight = SetWeight<Label, SET_BOOLEAN>; if (!w1.Member() || !w2.Member()) return Weight::NoWeight(); if (w1 == Weight::One()) return w2; return w1; } // Divide = Difference. template <typename Label, SetType S> inline SetWeight<Label, S> Divide(const SetWeight<Label, S> &w1, const SetWeight<Label, S> &w2, DivideType divide_type = DIVIDE_ANY) { return Difference(w1, w2); } // Divide = dividend (or the universal set if the // dividend == divisor). template <typename Label> inline SetWeight<Label, SET_UNION_INTERSECT> Divide( const SetWeight<Label, SET_UNION_INTERSECT> &w1, const SetWeight<Label, SET_UNION_INTERSECT> &w2, DivideType divide_type = DIVIDE_ANY) { using Weight = SetWeight<Label, SET_UNION_INTERSECT>; if (!w1.Member() || !w2.Member()) return Weight::NoWeight(); if (w1 == w2) return Weight::UnivSet(); return w1; } // Divide = Or Not. template <typename Label> inline SetWeight<Label, SET_BOOLEAN> Divide( const SetWeight<Label, SET_BOOLEAN> &w1, const SetWeight<Label, SET_BOOLEAN> &w2, DivideType divide_type = DIVIDE_ANY) { using Weight = SetWeight<Label, SET_BOOLEAN>; if (!w1.Member() || !w2.Member()) return Weight::NoWeight(); if (w1 == Weight::One()) return w1; if (w2 == Weight::Zero()) return Weight::One(); return Weight::Zero(); } // Converts between different set types. template <typename Label, SetType S1, SetType S2> struct WeightConvert<SetWeight<Label, S1>, SetWeight<Label, S2>> { SetWeight<Label, S2> operator()(const SetWeight<Label, S1> &w1) const { using Iterator = SetWeightIterator<SetWeight<Label, S1>>; SetWeight<Label, S2> w2; for (Iterator iter(w1); !iter.Done(); iter.Next()) w2.PushBack(iter.Value()); return w2; } }; // This function object generates SetWeights that are random integer sets // from {1, ... , alphabet_size}^{0, max_set_length} U { Zero }. This is // intended primarily for testing. template <class Label, SetType S> class WeightGenerate<SetWeight<Label, S>> { public: using Weight = SetWeight<Label, S>; explicit WeightGenerate(bool allow_zero = true, size_t alphabet_size = kNumRandomWeights, size_t max_set_length = kNumRandomWeights) : allow_zero_(allow_zero), alphabet_size_(alphabet_size), max_set_length_(max_set_length) {} Weight operator()() const { const size_t n = rand() % (max_set_length_ + allow_zero_); // NOLINT if (allow_zero_ && n == max_set_length_) return Weight::Zero(); std::vector<Label> labels; for (size_t i = 0; i < n; ++i) { labels.push_back(rand() % alphabet_size_ + 1); // NOLINT } std::sort(labels.begin(), labels.end()); const auto labels_end = std::unique(labels.begin(), labels.end()); labels.resize(labels_end - labels.begin()); return Weight(labels.begin(), labels.end()); } private: // Permits Zero() and zero divisors. const bool allow_zero_; // Alphabet size for random weights. const size_t alphabet_size_; // Number of alternative random weights. const size_t max_set_length_; }; } // namespace fst #endif // FST_SET_WEIGHT_H_
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/bin/Makefile.in
# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_BIN_TRUE@bin_PROGRAMS = fstarcsort$(EXEEXT) fstclosure$(EXEEXT) \ @HAVE_BIN_TRUE@ fstcompile$(EXEEXT) fstcompose$(EXEEXT) \ @HAVE_BIN_TRUE@ fstconcat$(EXEEXT) fstconnect$(EXEEXT) \ @HAVE_BIN_TRUE@ fstconvert$(EXEEXT) fstdeterminize$(EXEEXT) \ @HAVE_BIN_TRUE@ fstdifference$(EXEEXT) fstdisambiguate$(EXEEXT) \ @HAVE_BIN_TRUE@ fstdraw$(EXEEXT) fstencode$(EXEEXT) \ @HAVE_BIN_TRUE@ fstepsnormalize$(EXEEXT) fstequal$(EXEEXT) \ @HAVE_BIN_TRUE@ fstequivalent$(EXEEXT) fstinfo$(EXEEXT) \ @HAVE_BIN_TRUE@ fstintersect$(EXEEXT) fstinvert$(EXEEXT) \ @HAVE_BIN_TRUE@ fstisomorphic$(EXEEXT) fstmap$(EXEEXT) \ @HAVE_BIN_TRUE@ fstminimize$(EXEEXT) fstprint$(EXEEXT) \ @HAVE_BIN_TRUE@ fstproject$(EXEEXT) fstprune$(EXEEXT) \ @HAVE_BIN_TRUE@ fstpush$(EXEEXT) fstrandgen$(EXEEXT) \ @HAVE_BIN_TRUE@ fstrelabel$(EXEEXT) fstreplace$(EXEEXT) \ @HAVE_BIN_TRUE@ fstreverse$(EXEEXT) fstreweight$(EXEEXT) \ @HAVE_BIN_TRUE@ fstrmepsilon$(EXEEXT) \ @HAVE_BIN_TRUE@ fstshortestdistance$(EXEEXT) \ @HAVE_BIN_TRUE@ fstshortestpath$(EXEEXT) fstsymbols$(EXEEXT) \ @HAVE_BIN_TRUE@ fstsynchronize$(EXEEXT) fsttopsort$(EXEEXT) \ @HAVE_BIN_TRUE@ fstunion$(EXEEXT) subdir = src/bin DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/src/include/fst/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__fstarcsort_SOURCES_DIST = fstarcsort.cc fstarcsort-main.cc @HAVE_BIN_TRUE@am_fstarcsort_OBJECTS = fstarcsort.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstarcsort-main.$(OBJEXT) fstarcsort_OBJECTS = $(am_fstarcsort_OBJECTS) fstarcsort_LDADD = $(LDADD) am__DEPENDENCIES_1 = fstarcsort_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__fstclosure_SOURCES_DIST = fstclosure.cc fstclosure-main.cc @HAVE_BIN_TRUE@am_fstclosure_OBJECTS = fstclosure.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstclosure-main.$(OBJEXT) fstclosure_OBJECTS = $(am_fstclosure_OBJECTS) fstclosure_LDADD = $(LDADD) fstclosure_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstcompile_SOURCES_DIST = fstcompile.cc fstcompile-main.cc @HAVE_BIN_TRUE@am_fstcompile_OBJECTS = fstcompile.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstcompile-main.$(OBJEXT) fstcompile_OBJECTS = $(am_fstcompile_OBJECTS) fstcompile_LDADD = $(LDADD) fstcompile_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstcompose_SOURCES_DIST = fstcompose.cc fstcompose-main.cc @HAVE_BIN_TRUE@am_fstcompose_OBJECTS = fstcompose.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstcompose-main.$(OBJEXT) fstcompose_OBJECTS = $(am_fstcompose_OBJECTS) fstcompose_LDADD = $(LDADD) fstcompose_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstconcat_SOURCES_DIST = fstconcat.cc fstconcat-main.cc @HAVE_BIN_TRUE@am_fstconcat_OBJECTS = fstconcat.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstconcat-main.$(OBJEXT) fstconcat_OBJECTS = $(am_fstconcat_OBJECTS) fstconcat_LDADD = $(LDADD) fstconcat_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstconnect_SOURCES_DIST = fstconnect.cc fstconnect-main.cc @HAVE_BIN_TRUE@am_fstconnect_OBJECTS = fstconnect.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstconnect-main.$(OBJEXT) fstconnect_OBJECTS = $(am_fstconnect_OBJECTS) fstconnect_LDADD = $(LDADD) fstconnect_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstconvert_SOURCES_DIST = fstconvert.cc fstconvert-main.cc @HAVE_BIN_TRUE@am_fstconvert_OBJECTS = fstconvert.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstconvert-main.$(OBJEXT) fstconvert_OBJECTS = $(am_fstconvert_OBJECTS) fstconvert_LDADD = $(LDADD) fstconvert_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstdeterminize_SOURCES_DIST = fstdeterminize.cc \ fstdeterminize-main.cc @HAVE_BIN_TRUE@am_fstdeterminize_OBJECTS = fstdeterminize.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstdeterminize-main.$(OBJEXT) fstdeterminize_OBJECTS = $(am_fstdeterminize_OBJECTS) fstdeterminize_LDADD = $(LDADD) fstdeterminize_DEPENDENCIES = ../script/libfstscript.la \ ../lib/libfst.la $(am__DEPENDENCIES_1) am__fstdifference_SOURCES_DIST = fstdifference.cc \ fstdifference-main.cc @HAVE_BIN_TRUE@am_fstdifference_OBJECTS = fstdifference.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstdifference-main.$(OBJEXT) fstdifference_OBJECTS = $(am_fstdifference_OBJECTS) fstdifference_LDADD = $(LDADD) fstdifference_DEPENDENCIES = ../script/libfstscript.la \ ../lib/libfst.la $(am__DEPENDENCIES_1) am__fstdisambiguate_SOURCES_DIST = fstdisambiguate.cc \ fstdisambiguate-main.cc @HAVE_BIN_TRUE@am_fstdisambiguate_OBJECTS = fstdisambiguate.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstdisambiguate-main.$(OBJEXT) fstdisambiguate_OBJECTS = $(am_fstdisambiguate_OBJECTS) fstdisambiguate_LDADD = $(LDADD) fstdisambiguate_DEPENDENCIES = ../script/libfstscript.la \ ../lib/libfst.la $(am__DEPENDENCIES_1) am__fstdraw_SOURCES_DIST = fstdraw.cc fstdraw-main.cc @HAVE_BIN_TRUE@am_fstdraw_OBJECTS = fstdraw.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstdraw-main.$(OBJEXT) fstdraw_OBJECTS = $(am_fstdraw_OBJECTS) fstdraw_LDADD = $(LDADD) fstdraw_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstencode_SOURCES_DIST = fstencode.cc fstencode-main.cc @HAVE_BIN_TRUE@am_fstencode_OBJECTS = fstencode.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstencode-main.$(OBJEXT) fstencode_OBJECTS = $(am_fstencode_OBJECTS) fstencode_LDADD = $(LDADD) fstencode_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstepsnormalize_SOURCES_DIST = fstepsnormalize.cc \ fstepsnormalize-main.cc @HAVE_BIN_TRUE@am_fstepsnormalize_OBJECTS = fstepsnormalize.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstepsnormalize-main.$(OBJEXT) fstepsnormalize_OBJECTS = $(am_fstepsnormalize_OBJECTS) fstepsnormalize_LDADD = $(LDADD) fstepsnormalize_DEPENDENCIES = ../script/libfstscript.la \ ../lib/libfst.la $(am__DEPENDENCIES_1) am__fstequal_SOURCES_DIST = fstequal.cc fstequal-main.cc @HAVE_BIN_TRUE@am_fstequal_OBJECTS = fstequal.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstequal-main.$(OBJEXT) fstequal_OBJECTS = $(am_fstequal_OBJECTS) fstequal_LDADD = $(LDADD) fstequal_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstequivalent_SOURCES_DIST = fstequivalent.cc \ fstequivalent-main.cc @HAVE_BIN_TRUE@am_fstequivalent_OBJECTS = fstequivalent.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstequivalent-main.$(OBJEXT) fstequivalent_OBJECTS = $(am_fstequivalent_OBJECTS) fstequivalent_LDADD = $(LDADD) fstequivalent_DEPENDENCIES = ../script/libfstscript.la \ ../lib/libfst.la $(am__DEPENDENCIES_1) am__fstinfo_SOURCES_DIST = fstinfo.cc fstinfo-main.cc @HAVE_BIN_TRUE@am_fstinfo_OBJECTS = fstinfo.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstinfo-main.$(OBJEXT) fstinfo_OBJECTS = $(am_fstinfo_OBJECTS) fstinfo_LDADD = $(LDADD) fstinfo_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstintersect_SOURCES_DIST = fstintersect.cc fstintersect-main.cc @HAVE_BIN_TRUE@am_fstintersect_OBJECTS = fstintersect.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstintersect-main.$(OBJEXT) fstintersect_OBJECTS = $(am_fstintersect_OBJECTS) fstintersect_LDADD = $(LDADD) fstintersect_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstinvert_SOURCES_DIST = fstinvert.cc fstinvert-main.cc @HAVE_BIN_TRUE@am_fstinvert_OBJECTS = fstinvert.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstinvert-main.$(OBJEXT) fstinvert_OBJECTS = $(am_fstinvert_OBJECTS) fstinvert_LDADD = $(LDADD) fstinvert_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstisomorphic_SOURCES_DIST = fstisomorphic.cc \ fstisomorphic-main.cc @HAVE_BIN_TRUE@am_fstisomorphic_OBJECTS = fstisomorphic.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstisomorphic-main.$(OBJEXT) fstisomorphic_OBJECTS = $(am_fstisomorphic_OBJECTS) fstisomorphic_LDADD = $(LDADD) fstisomorphic_DEPENDENCIES = ../script/libfstscript.la \ ../lib/libfst.la $(am__DEPENDENCIES_1) am__fstmap_SOURCES_DIST = fstmap.cc fstmap-main.cc @HAVE_BIN_TRUE@am_fstmap_OBJECTS = fstmap.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstmap-main.$(OBJEXT) fstmap_OBJECTS = $(am_fstmap_OBJECTS) fstmap_LDADD = $(LDADD) fstmap_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstminimize_SOURCES_DIST = fstminimize.cc fstminimize-main.cc @HAVE_BIN_TRUE@am_fstminimize_OBJECTS = fstminimize.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstminimize-main.$(OBJEXT) fstminimize_OBJECTS = $(am_fstminimize_OBJECTS) fstminimize_LDADD = $(LDADD) fstminimize_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstprint_SOURCES_DIST = fstprint.cc fstprint-main.cc @HAVE_BIN_TRUE@am_fstprint_OBJECTS = fstprint.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstprint-main.$(OBJEXT) fstprint_OBJECTS = $(am_fstprint_OBJECTS) fstprint_LDADD = $(LDADD) fstprint_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstproject_SOURCES_DIST = fstproject.cc fstproject-main.cc @HAVE_BIN_TRUE@am_fstproject_OBJECTS = fstproject.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstproject-main.$(OBJEXT) fstproject_OBJECTS = $(am_fstproject_OBJECTS) fstproject_LDADD = $(LDADD) fstproject_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstprune_SOURCES_DIST = fstprune.cc fstprune-main.cc @HAVE_BIN_TRUE@am_fstprune_OBJECTS = fstprune.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstprune-main.$(OBJEXT) fstprune_OBJECTS = $(am_fstprune_OBJECTS) fstprune_LDADD = $(LDADD) fstprune_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstpush_SOURCES_DIST = fstpush.cc fstpush-main.cc @HAVE_BIN_TRUE@am_fstpush_OBJECTS = fstpush.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstpush-main.$(OBJEXT) fstpush_OBJECTS = $(am_fstpush_OBJECTS) fstpush_LDADD = $(LDADD) fstpush_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstrandgen_SOURCES_DIST = fstrandgen.cc fstrandgen-main.cc @HAVE_BIN_TRUE@am_fstrandgen_OBJECTS = fstrandgen.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstrandgen-main.$(OBJEXT) fstrandgen_OBJECTS = $(am_fstrandgen_OBJECTS) fstrandgen_LDADD = $(LDADD) fstrandgen_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstrelabel_SOURCES_DIST = fstrelabel.cc fstrelabel-main.cc @HAVE_BIN_TRUE@am_fstrelabel_OBJECTS = fstrelabel.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstrelabel-main.$(OBJEXT) fstrelabel_OBJECTS = $(am_fstrelabel_OBJECTS) fstrelabel_LDADD = $(LDADD) fstrelabel_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstreplace_SOURCES_DIST = fstreplace.cc fstreplace-main.cc @HAVE_BIN_TRUE@am_fstreplace_OBJECTS = fstreplace.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstreplace-main.$(OBJEXT) fstreplace_OBJECTS = $(am_fstreplace_OBJECTS) fstreplace_LDADD = $(LDADD) fstreplace_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstreverse_SOURCES_DIST = fstreverse.cc fstreverse-main.cc @HAVE_BIN_TRUE@am_fstreverse_OBJECTS = fstreverse.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstreverse-main.$(OBJEXT) fstreverse_OBJECTS = $(am_fstreverse_OBJECTS) fstreverse_LDADD = $(LDADD) fstreverse_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstreweight_SOURCES_DIST = fstreweight.cc fstreweight-main.cc @HAVE_BIN_TRUE@am_fstreweight_OBJECTS = fstreweight.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstreweight-main.$(OBJEXT) fstreweight_OBJECTS = $(am_fstreweight_OBJECTS) fstreweight_LDADD = $(LDADD) fstreweight_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstrmepsilon_SOURCES_DIST = fstrmepsilon.cc fstrmepsilon-main.cc @HAVE_BIN_TRUE@am_fstrmepsilon_OBJECTS = fstrmepsilon.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstrmepsilon-main.$(OBJEXT) fstrmepsilon_OBJECTS = $(am_fstrmepsilon_OBJECTS) fstrmepsilon_LDADD = $(LDADD) fstrmepsilon_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstshortestdistance_SOURCES_DIST = fstshortestdistance.cc \ fstshortestdistance-main.cc @HAVE_BIN_TRUE@am_fstshortestdistance_OBJECTS = \ @HAVE_BIN_TRUE@ fstshortestdistance.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstshortestdistance-main.$(OBJEXT) fstshortestdistance_OBJECTS = $(am_fstshortestdistance_OBJECTS) fstshortestdistance_LDADD = $(LDADD) fstshortestdistance_DEPENDENCIES = ../script/libfstscript.la \ ../lib/libfst.la $(am__DEPENDENCIES_1) am__fstshortestpath_SOURCES_DIST = fstshortestpath.cc \ fstshortestpath-main.cc @HAVE_BIN_TRUE@am_fstshortestpath_OBJECTS = fstshortestpath.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstshortestpath-main.$(OBJEXT) fstshortestpath_OBJECTS = $(am_fstshortestpath_OBJECTS) fstshortestpath_LDADD = $(LDADD) fstshortestpath_DEPENDENCIES = ../script/libfstscript.la \ ../lib/libfst.la $(am__DEPENDENCIES_1) am__fstsymbols_SOURCES_DIST = fstsymbols.cc fstsymbols-main.cc @HAVE_BIN_TRUE@am_fstsymbols_OBJECTS = fstsymbols.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstsymbols-main.$(OBJEXT) fstsymbols_OBJECTS = $(am_fstsymbols_OBJECTS) fstsymbols_LDADD = $(LDADD) fstsymbols_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstsynchronize_SOURCES_DIST = fstsynchronize.cc \ fstsynchronize-main.cc @HAVE_BIN_TRUE@am_fstsynchronize_OBJECTS = fstsynchronize.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstsynchronize-main.$(OBJEXT) fstsynchronize_OBJECTS = $(am_fstsynchronize_OBJECTS) fstsynchronize_LDADD = $(LDADD) fstsynchronize_DEPENDENCIES = ../script/libfstscript.la \ ../lib/libfst.la $(am__DEPENDENCIES_1) am__fsttopsort_SOURCES_DIST = fsttopsort.cc fsttopsort-main.cc @HAVE_BIN_TRUE@am_fsttopsort_OBJECTS = fsttopsort.$(OBJEXT) \ @HAVE_BIN_TRUE@ fsttopsort-main.$(OBJEXT) fsttopsort_OBJECTS = $(am_fsttopsort_OBJECTS) fsttopsort_LDADD = $(LDADD) fsttopsort_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) am__fstunion_SOURCES_DIST = fstunion.cc fstunion-main.cc @HAVE_BIN_TRUE@am_fstunion_OBJECTS = fstunion.$(OBJEXT) \ @HAVE_BIN_TRUE@ fstunion-main.$(OBJEXT) fstunion_OBJECTS = $(am_fstunion_OBJECTS) fstunion_LDADD = $(LDADD) fstunion_DEPENDENCIES = ../script/libfstscript.la ../lib/libfst.la \ $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(fstarcsort_SOURCES) $(fstclosure_SOURCES) \ $(fstcompile_SOURCES) $(fstcompose_SOURCES) \ $(fstconcat_SOURCES) $(fstconnect_SOURCES) \ $(fstconvert_SOURCES) $(fstdeterminize_SOURCES) \ $(fstdifference_SOURCES) $(fstdisambiguate_SOURCES) \ $(fstdraw_SOURCES) $(fstencode_SOURCES) \ $(fstepsnormalize_SOURCES) $(fstequal_SOURCES) \ $(fstequivalent_SOURCES) $(fstinfo_SOURCES) \ $(fstintersect_SOURCES) $(fstinvert_SOURCES) \ $(fstisomorphic_SOURCES) $(fstmap_SOURCES) \ $(fstminimize_SOURCES) $(fstprint_SOURCES) \ $(fstproject_SOURCES) $(fstprune_SOURCES) $(fstpush_SOURCES) \ $(fstrandgen_SOURCES) $(fstrelabel_SOURCES) \ $(fstreplace_SOURCES) $(fstreverse_SOURCES) \ $(fstreweight_SOURCES) $(fstrmepsilon_SOURCES) \ $(fstshortestdistance_SOURCES) $(fstshortestpath_SOURCES) \ $(fstsymbols_SOURCES) $(fstsynchronize_SOURCES) \ $(fsttopsort_SOURCES) $(fstunion_SOURCES) DIST_SOURCES = $(am__fstarcsort_SOURCES_DIST) \ $(am__fstclosure_SOURCES_DIST) $(am__fstcompile_SOURCES_DIST) \ $(am__fstcompose_SOURCES_DIST) $(am__fstconcat_SOURCES_DIST) \ $(am__fstconnect_SOURCES_DIST) $(am__fstconvert_SOURCES_DIST) \ $(am__fstdeterminize_SOURCES_DIST) \ $(am__fstdifference_SOURCES_DIST) \ $(am__fstdisambiguate_SOURCES_DIST) \ $(am__fstdraw_SOURCES_DIST) $(am__fstencode_SOURCES_DIST) \ $(am__fstepsnormalize_SOURCES_DIST) \ $(am__fstequal_SOURCES_DIST) $(am__fstequivalent_SOURCES_DIST) \ $(am__fstinfo_SOURCES_DIST) $(am__fstintersect_SOURCES_DIST) \ $(am__fstinvert_SOURCES_DIST) \ $(am__fstisomorphic_SOURCES_DIST) $(am__fstmap_SOURCES_DIST) \ $(am__fstminimize_SOURCES_DIST) $(am__fstprint_SOURCES_DIST) \ $(am__fstproject_SOURCES_DIST) $(am__fstprune_SOURCES_DIST) \ $(am__fstpush_SOURCES_DIST) $(am__fstrandgen_SOURCES_DIST) \ $(am__fstrelabel_SOURCES_DIST) $(am__fstreplace_SOURCES_DIST) \ $(am__fstreverse_SOURCES_DIST) $(am__fstreweight_SOURCES_DIST) \ $(am__fstrmepsilon_SOURCES_DIST) \ $(am__fstshortestdistance_SOURCES_DIST) \ $(am__fstshortestpath_SOURCES_DIST) \ $(am__fstsymbols_SOURCES_DIST) \ $(am__fstsynchronize_SOURCES_DIST) \ $(am__fsttopsort_SOURCES_DIST) $(am__fstunion_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libfstdir = @libfstdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../script $(ICU_FLAGS) LDADD = ../script/libfstscript.la ../lib/libfst.la -lm $(DL_LIBS) @HAVE_BIN_TRUE@fstarcsort_SOURCES = fstarcsort.cc fstarcsort-main.cc @HAVE_BIN_TRUE@fstclosure_SOURCES = fstclosure.cc fstclosure-main.cc @HAVE_BIN_TRUE@fstcompile_SOURCES = fstcompile.cc fstcompile-main.cc @HAVE_BIN_TRUE@fstcompose_SOURCES = fstcompose.cc fstcompose-main.cc @HAVE_BIN_TRUE@fstconcat_SOURCES = fstconcat.cc fstconcat-main.cc @HAVE_BIN_TRUE@fstconnect_SOURCES = fstconnect.cc fstconnect-main.cc @HAVE_BIN_TRUE@fstconvert_SOURCES = fstconvert.cc fstconvert-main.cc @HAVE_BIN_TRUE@fstdeterminize_SOURCES = fstdeterminize.cc fstdeterminize-main.cc @HAVE_BIN_TRUE@fstdifference_SOURCES = fstdifference.cc fstdifference-main.cc @HAVE_BIN_TRUE@fstdisambiguate_SOURCES = fstdisambiguate.cc fstdisambiguate-main.cc @HAVE_BIN_TRUE@fstdraw_SOURCES = fstdraw.cc fstdraw-main.cc @HAVE_BIN_TRUE@fstencode_SOURCES = fstencode.cc fstencode-main.cc @HAVE_BIN_TRUE@fstepsnormalize_SOURCES = fstepsnormalize.cc fstepsnormalize-main.cc @HAVE_BIN_TRUE@fstequal_SOURCES = fstequal.cc fstequal-main.cc @HAVE_BIN_TRUE@fstequivalent_SOURCES = fstequivalent.cc fstequivalent-main.cc @HAVE_BIN_TRUE@fstinfo_SOURCES = fstinfo.cc fstinfo-main.cc @HAVE_BIN_TRUE@fstintersect_SOURCES = fstintersect.cc fstintersect-main.cc @HAVE_BIN_TRUE@fstinvert_SOURCES = fstinvert.cc fstinvert-main.cc @HAVE_BIN_TRUE@fstisomorphic_SOURCES = fstisomorphic.cc fstisomorphic-main.cc @HAVE_BIN_TRUE@fstmap_SOURCES = fstmap.cc fstmap-main.cc @HAVE_BIN_TRUE@fstminimize_SOURCES = fstminimize.cc fstminimize-main.cc @HAVE_BIN_TRUE@fstprint_SOURCES = fstprint.cc fstprint-main.cc @HAVE_BIN_TRUE@fstproject_SOURCES = fstproject.cc fstproject-main.cc @HAVE_BIN_TRUE@fstprune_SOURCES = fstprune.cc fstprune-main.cc @HAVE_BIN_TRUE@fstpush_SOURCES = fstpush.cc fstpush-main.cc @HAVE_BIN_TRUE@fstrandgen_SOURCES = fstrandgen.cc fstrandgen-main.cc @HAVE_BIN_TRUE@fstrelabel_SOURCES = fstrelabel.cc fstrelabel-main.cc @HAVE_BIN_TRUE@fstreplace_SOURCES = fstreplace.cc fstreplace-main.cc @HAVE_BIN_TRUE@fstreverse_SOURCES = fstreverse.cc fstreverse-main.cc @HAVE_BIN_TRUE@fstreweight_SOURCES = fstreweight.cc fstreweight-main.cc @HAVE_BIN_TRUE@fstrmepsilon_SOURCES = fstrmepsilon.cc fstrmepsilon-main.cc @HAVE_BIN_TRUE@fstshortestdistance_SOURCES = fstshortestdistance.cc fstshortestdistance-main.cc @HAVE_BIN_TRUE@fstshortestpath_SOURCES = fstshortestpath.cc fstshortestpath-main.cc @HAVE_BIN_TRUE@fstsymbols_SOURCES = fstsymbols.cc fstsymbols-main.cc @HAVE_BIN_TRUE@fstsynchronize_SOURCES = fstsynchronize.cc fstsynchronize-main.cc @HAVE_BIN_TRUE@fsttopsort_SOURCES = fsttopsort.cc fsttopsort-main.cc @HAVE_BIN_TRUE@fstunion_SOURCES = fstunion.cc fstunion-main.cc all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/bin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/bin/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list fstarcsort$(EXEEXT): $(fstarcsort_OBJECTS) $(fstarcsort_DEPENDENCIES) $(EXTRA_fstarcsort_DEPENDENCIES) @rm -f fstarcsort$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstarcsort_OBJECTS) $(fstarcsort_LDADD) $(LIBS) fstclosure$(EXEEXT): $(fstclosure_OBJECTS) $(fstclosure_DEPENDENCIES) $(EXTRA_fstclosure_DEPENDENCIES) @rm -f fstclosure$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstclosure_OBJECTS) $(fstclosure_LDADD) $(LIBS) fstcompile$(EXEEXT): $(fstcompile_OBJECTS) $(fstcompile_DEPENDENCIES) $(EXTRA_fstcompile_DEPENDENCIES) @rm -f fstcompile$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstcompile_OBJECTS) $(fstcompile_LDADD) $(LIBS) fstcompose$(EXEEXT): $(fstcompose_OBJECTS) $(fstcompose_DEPENDENCIES) $(EXTRA_fstcompose_DEPENDENCIES) @rm -f fstcompose$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstcompose_OBJECTS) $(fstcompose_LDADD) $(LIBS) fstconcat$(EXEEXT): $(fstconcat_OBJECTS) $(fstconcat_DEPENDENCIES) $(EXTRA_fstconcat_DEPENDENCIES) @rm -f fstconcat$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstconcat_OBJECTS) $(fstconcat_LDADD) $(LIBS) fstconnect$(EXEEXT): $(fstconnect_OBJECTS) $(fstconnect_DEPENDENCIES) $(EXTRA_fstconnect_DEPENDENCIES) @rm -f fstconnect$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstconnect_OBJECTS) $(fstconnect_LDADD) $(LIBS) fstconvert$(EXEEXT): $(fstconvert_OBJECTS) $(fstconvert_DEPENDENCIES) $(EXTRA_fstconvert_DEPENDENCIES) @rm -f fstconvert$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstconvert_OBJECTS) $(fstconvert_LDADD) $(LIBS) fstdeterminize$(EXEEXT): $(fstdeterminize_OBJECTS) $(fstdeterminize_DEPENDENCIES) $(EXTRA_fstdeterminize_DEPENDENCIES) @rm -f fstdeterminize$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstdeterminize_OBJECTS) $(fstdeterminize_LDADD) $(LIBS) fstdifference$(EXEEXT): $(fstdifference_OBJECTS) $(fstdifference_DEPENDENCIES) $(EXTRA_fstdifference_DEPENDENCIES) @rm -f fstdifference$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstdifference_OBJECTS) $(fstdifference_LDADD) $(LIBS) fstdisambiguate$(EXEEXT): $(fstdisambiguate_OBJECTS) $(fstdisambiguate_DEPENDENCIES) $(EXTRA_fstdisambiguate_DEPENDENCIES) @rm -f fstdisambiguate$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstdisambiguate_OBJECTS) $(fstdisambiguate_LDADD) $(LIBS) fstdraw$(EXEEXT): $(fstdraw_OBJECTS) $(fstdraw_DEPENDENCIES) $(EXTRA_fstdraw_DEPENDENCIES) @rm -f fstdraw$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstdraw_OBJECTS) $(fstdraw_LDADD) $(LIBS) fstencode$(EXEEXT): $(fstencode_OBJECTS) $(fstencode_DEPENDENCIES) $(EXTRA_fstencode_DEPENDENCIES) @rm -f fstencode$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstencode_OBJECTS) $(fstencode_LDADD) $(LIBS) fstepsnormalize$(EXEEXT): $(fstepsnormalize_OBJECTS) $(fstepsnormalize_DEPENDENCIES) $(EXTRA_fstepsnormalize_DEPENDENCIES) @rm -f fstepsnormalize$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstepsnormalize_OBJECTS) $(fstepsnormalize_LDADD) $(LIBS) fstequal$(EXEEXT): $(fstequal_OBJECTS) $(fstequal_DEPENDENCIES) $(EXTRA_fstequal_DEPENDENCIES) @rm -f fstequal$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstequal_OBJECTS) $(fstequal_LDADD) $(LIBS) fstequivalent$(EXEEXT): $(fstequivalent_OBJECTS) $(fstequivalent_DEPENDENCIES) $(EXTRA_fstequivalent_DEPENDENCIES) @rm -f fstequivalent$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstequivalent_OBJECTS) $(fstequivalent_LDADD) $(LIBS) fstinfo$(EXEEXT): $(fstinfo_OBJECTS) $(fstinfo_DEPENDENCIES) $(EXTRA_fstinfo_DEPENDENCIES) @rm -f fstinfo$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstinfo_OBJECTS) $(fstinfo_LDADD) $(LIBS) fstintersect$(EXEEXT): $(fstintersect_OBJECTS) $(fstintersect_DEPENDENCIES) $(EXTRA_fstintersect_DEPENDENCIES) @rm -f fstintersect$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstintersect_OBJECTS) $(fstintersect_LDADD) $(LIBS) fstinvert$(EXEEXT): $(fstinvert_OBJECTS) $(fstinvert_DEPENDENCIES) $(EXTRA_fstinvert_DEPENDENCIES) @rm -f fstinvert$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstinvert_OBJECTS) $(fstinvert_LDADD) $(LIBS) fstisomorphic$(EXEEXT): $(fstisomorphic_OBJECTS) $(fstisomorphic_DEPENDENCIES) $(EXTRA_fstisomorphic_DEPENDENCIES) @rm -f fstisomorphic$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstisomorphic_OBJECTS) $(fstisomorphic_LDADD) $(LIBS) fstmap$(EXEEXT): $(fstmap_OBJECTS) $(fstmap_DEPENDENCIES) $(EXTRA_fstmap_DEPENDENCIES) @rm -f fstmap$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstmap_OBJECTS) $(fstmap_LDADD) $(LIBS) fstminimize$(EXEEXT): $(fstminimize_OBJECTS) $(fstminimize_DEPENDENCIES) $(EXTRA_fstminimize_DEPENDENCIES) @rm -f fstminimize$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstminimize_OBJECTS) $(fstminimize_LDADD) $(LIBS) fstprint$(EXEEXT): $(fstprint_OBJECTS) $(fstprint_DEPENDENCIES) $(EXTRA_fstprint_DEPENDENCIES) @rm -f fstprint$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstprint_OBJECTS) $(fstprint_LDADD) $(LIBS) fstproject$(EXEEXT): $(fstproject_OBJECTS) $(fstproject_DEPENDENCIES) $(EXTRA_fstproject_DEPENDENCIES) @rm -f fstproject$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstproject_OBJECTS) $(fstproject_LDADD) $(LIBS) fstprune$(EXEEXT): $(fstprune_OBJECTS) $(fstprune_DEPENDENCIES) $(EXTRA_fstprune_DEPENDENCIES) @rm -f fstprune$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstprune_OBJECTS) $(fstprune_LDADD) $(LIBS) fstpush$(EXEEXT): $(fstpush_OBJECTS) $(fstpush_DEPENDENCIES) $(EXTRA_fstpush_DEPENDENCIES) @rm -f fstpush$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstpush_OBJECTS) $(fstpush_LDADD) $(LIBS) fstrandgen$(EXEEXT): $(fstrandgen_OBJECTS) $(fstrandgen_DEPENDENCIES) $(EXTRA_fstrandgen_DEPENDENCIES) @rm -f fstrandgen$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstrandgen_OBJECTS) $(fstrandgen_LDADD) $(LIBS) fstrelabel$(EXEEXT): $(fstrelabel_OBJECTS) $(fstrelabel_DEPENDENCIES) $(EXTRA_fstrelabel_DEPENDENCIES) @rm -f fstrelabel$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstrelabel_OBJECTS) $(fstrelabel_LDADD) $(LIBS) fstreplace$(EXEEXT): $(fstreplace_OBJECTS) $(fstreplace_DEPENDENCIES) $(EXTRA_fstreplace_DEPENDENCIES) @rm -f fstreplace$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstreplace_OBJECTS) $(fstreplace_LDADD) $(LIBS) fstreverse$(EXEEXT): $(fstreverse_OBJECTS) $(fstreverse_DEPENDENCIES) $(EXTRA_fstreverse_DEPENDENCIES) @rm -f fstreverse$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstreverse_OBJECTS) $(fstreverse_LDADD) $(LIBS) fstreweight$(EXEEXT): $(fstreweight_OBJECTS) $(fstreweight_DEPENDENCIES) $(EXTRA_fstreweight_DEPENDENCIES) @rm -f fstreweight$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstreweight_OBJECTS) $(fstreweight_LDADD) $(LIBS) fstrmepsilon$(EXEEXT): $(fstrmepsilon_OBJECTS) $(fstrmepsilon_DEPENDENCIES) $(EXTRA_fstrmepsilon_DEPENDENCIES) @rm -f fstrmepsilon$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstrmepsilon_OBJECTS) $(fstrmepsilon_LDADD) $(LIBS) fstshortestdistance$(EXEEXT): $(fstshortestdistance_OBJECTS) $(fstshortestdistance_DEPENDENCIES) $(EXTRA_fstshortestdistance_DEPENDENCIES) @rm -f fstshortestdistance$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstshortestdistance_OBJECTS) $(fstshortestdistance_LDADD) $(LIBS) fstshortestpath$(EXEEXT): $(fstshortestpath_OBJECTS) $(fstshortestpath_DEPENDENCIES) $(EXTRA_fstshortestpath_DEPENDENCIES) @rm -f fstshortestpath$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstshortestpath_OBJECTS) $(fstshortestpath_LDADD) $(LIBS) fstsymbols$(EXEEXT): $(fstsymbols_OBJECTS) $(fstsymbols_DEPENDENCIES) $(EXTRA_fstsymbols_DEPENDENCIES) @rm -f fstsymbols$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstsymbols_OBJECTS) $(fstsymbols_LDADD) $(LIBS) fstsynchronize$(EXEEXT): $(fstsynchronize_OBJECTS) $(fstsynchronize_DEPENDENCIES) $(EXTRA_fstsynchronize_DEPENDENCIES) @rm -f fstsynchronize$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstsynchronize_OBJECTS) $(fstsynchronize_LDADD) $(LIBS) fsttopsort$(EXEEXT): $(fsttopsort_OBJECTS) $(fsttopsort_DEPENDENCIES) $(EXTRA_fsttopsort_DEPENDENCIES) @rm -f fsttopsort$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fsttopsort_OBJECTS) $(fsttopsort_LDADD) $(LIBS) fstunion$(EXEEXT): $(fstunion_OBJECTS) $(fstunion_DEPENDENCIES) $(EXTRA_fstunion_DEPENDENCIES) @rm -f fstunion$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fstunion_OBJECTS) $(fstunion_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstarcsort-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstarcsort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstclosure-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstclosure.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstcompile-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstcompile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstcompose-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstcompose.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstconcat-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstconcat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstconnect-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstconnect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstconvert-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstconvert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstdeterminize-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstdeterminize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstdifference-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstdifference.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstdisambiguate-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstdisambiguate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstdraw-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstdraw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstencode-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstencode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstepsnormalize-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstepsnormalize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstequal-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstequal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstequivalent-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstequivalent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstinfo-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstintersect-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstintersect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstinvert-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstinvert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstisomorphic-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstisomorphic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstmap-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstminimize-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstminimize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstprint-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstprint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstproject-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstproject.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstprune-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstprune.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstpush-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstpush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstrandgen-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstrandgen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstrelabel-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstrelabel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstreplace-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstreplace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstreverse-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstreverse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstreweight-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstreweight.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstrmepsilon-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstrmepsilon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstshortestdistance-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstshortestdistance.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstshortestpath-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstshortestpath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstsymbols-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstsymbols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstsynchronize-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstsynchronize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsttopsort-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsttopsort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstunion-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstunion.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
0
coqui_public_repos/STT
coqui_public_repos/STT/taskcluster/homebrew-build.sh
#!/bin/bash set -xe OS=$(uname) if [ "${OS}" != "Darwin" ]; then echo "This should only run on OSX." exit 1 fi; flavor=$1 source $(dirname "$0")/tc-tests-utils.sh if [ -z "${TASKCLUSTER_TASK_DIR}" ]; then echo "No TASKCLUSTER_TASK_DIR, aborting." exit 1 fi do_prepare_homebrew() { local _brew_instance=$1 if [ -z "${_brew_instance}" ]; then echo "No _brew_instance, aborting." exit 1 fi export PATH=${_brew_instance}/bin:$PATH export HOMEBREW_LOGS="${_brew_instance}/homebrew.logs/" export HOMEBREW_CACHE="${_brew_instance}/homebrew.cache/" export BREW_FORMULAS_COMMIT=ddd39cf1b71452bfe9c5f17f45cc0118796b20d3 # Never fail on pre-existing homebrew/ directory mkdir -p "${_brew_instance}" || true mkdir -p "${HOMEBREW_CACHE}" || true # Make sure to verify there is a 'brew' binary there, otherwise install things. if [ ! -x "${_brew_instance}/bin/brew" ]; then curl -L ${BREW_URL} | tar xz --strip 1 -C "${_brew_instance}" fi; check_homebrew "${_brew_instance}" # Then we force onto a specific well-known commit mkdir -p "$(brew --prefix)/Library/Taps/homebrew/homebrew-core" pushd "$(brew --prefix)/Library/Taps/homebrew/homebrew-core" git init git remote add origin https://github.com/Homebrew/homebrew-core.git git fetch origin git checkout ${BREW_FORMULAS_COMMIT} popd } check_homebrew() { local _expected_prefix=$1 echo "local brew prefix ..." local _local_prefix=$(brew --prefix) echo "${_local_prefix}" if [ "${_expected_prefix}" != "${_local_prefix}" ]; then echo "Weird state:" echo "_expected_prefix=${_expected_prefix}" echo "_local_prefix=${_local_prefix}" exit 1 fi; } install_pkg_homebrew() { local pkg=$1 (brew list --versions ${pkg} && brew upgrade --force-bottle ${pkg}) || brew install --force-bottle ${pkg} } prepare_homebrew_builds() { do_prepare_homebrew "${BUILDS_BREW}" install_pkg_homebrew "coreutils" install_pkg_homebrew "node@12" install_pkg_homebrew "openssl" install_pkg_homebrew "pkg-config" install_pkg_homebrew "pyenv-virtualenv" install_pkg_homebrew "readline" install_pkg_homebrew "sox" } prepare_homebrew_tests() { do_prepare_homebrew "${TESTS_BREW}" install_pkg_homebrew "nvm" source "${TESTS_BREW}/opt/nvm/nvm.sh" for node_ver in ${SUPPORTED_NODEJS_TESTS_VERSIONS}; do nvm install ${node_ver} done; install_pkg_homebrew "openssl" install_pkg_homebrew "pkg-config" install_pkg_homebrew "readline" install_pkg_homebrew "sox" } if [ "${flavor}" = "--builds" ]; then prepare_homebrew_builds fi; if [ "${flavor}" = "--tests" ]; then prepare_homebrew_tests fi;
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/include/fst/script/arc-class.h
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #ifndef FST_SCRIPT_ARC_CLASS_H_ #define FST_SCRIPT_ARC_CLASS_H_ #include <fst/script/weight-class.h> namespace fst { namespace script { // A struct representing an arc while ignoring arc type. It is passed as an // argument to AddArc. struct ArcClass { template <class Arc> explicit ArcClass(const Arc &arc) : ilabel(arc.ilabel), olabel(arc.olabel), weight(arc.weight), nextstate(arc.nextstate) {} ArcClass(int64_t ilabel, int64_t olabel, const WeightClass &weight, int64_t nextstate) : ilabel(ilabel), olabel(olabel), weight(weight), nextstate(nextstate) {} template <class Arc> Arc GetArc() const { return Arc(ilabel, olabel, *(weight.GetWeight<typename Arc::Weight>()), nextstate); } int64_t ilabel; int64_t olabel; WeightClass weight; int64_t nextstate; }; } // namespace script } // namespace fst #endif // FST_SCRIPT_ARC_CLASS_H_
0
coqui_public_repos/TTS/TTS/tts/utils/text
coqui_public_repos/TTS/TTS/tts/utils/text/phonemizers/ja_jp_phonemizer.py
from typing import Dict from TTS.tts.utils.text.japanese.phonemizer import japanese_text_to_phonemes from TTS.tts.utils.text.phonemizers.base import BasePhonemizer _DEF_JA_PUNCS = "、.,[]()?!〽~『』「」【】" _TRANS_TABLE = {"、": ","} def trans(text): for i, j in _TRANS_TABLE.items(): text = text.replace(i, j) return text class JA_JP_Phonemizer(BasePhonemizer): """🐸TTS Ja-Jp phonemizer using functions in `TTS.tts.utils.text.japanese.phonemizer` TODO: someone with JA knowledge should check this implementation Example: >>> from TTS.tts.utils.text.phonemizers import JA_JP_Phonemizer >>> phonemizer = JA_JP_Phonemizer() >>> phonemizer.phonemize("どちらに行きますか?", separator="|") 'd|o|c|h|i|r|a|n|i|i|k|i|m|a|s|u|k|a|?' """ language = "ja-jp" def __init__(self, punctuations=_DEF_JA_PUNCS, keep_puncs=True, **kwargs): # pylint: disable=unused-argument super().__init__(self.language, punctuations=punctuations, keep_puncs=keep_puncs) @staticmethod def name(): return "ja_jp_phonemizer" def _phonemize(self, text: str, separator: str = "|") -> str: ph = japanese_text_to_phonemes(text) if separator is not None or separator != "": return separator.join(ph) return ph def phonemize(self, text: str, separator="|", language=None) -> str: """Custom phonemize for JP_JA Skip pre-post processing steps used by the other phonemizers. """ return self._phonemize(text, separator) @staticmethod def supported_languages() -> Dict: return {"ja-jp": "Japanese (Japan)"} def version(self) -> str: return "0.0.1" def is_available(self) -> bool: return True # if __name__ == "__main__": # text = "これは、電話をかけるための私の日本語の例のテキストです。" # e = JA_JP_Phonemizer() # print(e.supported_languages()) # print(e.version()) # print(e.language) # print(e.name()) # print(e.is_available()) # print("`" + e.phonemize(text) + "`")
0
coqui_public_repos/inference-engine/third_party/cereal/include/cereal/external/rapidjson
coqui_public_repos/inference-engine/third_party/cereal/include/cereal/external/rapidjson/msinttypes/inttypes.h
// ISO C9x compliant inttypes.h for Microsoft Visual Studio // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 // // Copyright (c) 2006-2013 Alexander Chemeris // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the product nor the names of its contributors may // be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // /////////////////////////////////////////////////////////////////////////////// // The above software in this distribution may have been modified by // THL A29 Limited ("Tencent Modifications"). // All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. #ifndef _MSC_VER // [ #error "Use this header only with Microsoft Visual C++ compilers!" #endif // _MSC_VER ] #ifndef _MSC_INTTYPES_H_ // [ #define _MSC_INTTYPES_H_ #if _MSC_VER > 1000 #pragma once #endif #include "stdint.h" // miloyip: VC supports inttypes.h since VC2013 #if _MSC_VER >= 1800 #include <inttypes.h> #else // 7.8 Format conversion of integer types typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; // 7.8.1 Macros for format specifiers #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 // The fprintf macros for signed integers are: #define PRId8 "d" #define PRIi8 "i" #define PRIdLEAST8 "d" #define PRIiLEAST8 "i" #define PRIdFAST8 "d" #define PRIiFAST8 "i" #define PRId16 "hd" #define PRIi16 "hi" #define PRIdLEAST16 "hd" #define PRIiLEAST16 "hi" #define PRIdFAST16 "hd" #define PRIiFAST16 "hi" #define PRId32 "I32d" #define PRIi32 "I32i" #define PRIdLEAST32 "I32d" #define PRIiLEAST32 "I32i" #define PRIdFAST32 "I32d" #define PRIiFAST32 "I32i" #define PRId64 "I64d" #define PRIi64 "I64i" #define PRIdLEAST64 "I64d" #define PRIiLEAST64 "I64i" #define PRIdFAST64 "I64d" #define PRIiFAST64 "I64i" #define PRIdMAX "I64d" #define PRIiMAX "I64i" #define PRIdPTR "Id" #define PRIiPTR "Ii" // The fprintf macros for unsigned integers are: #define PRIo8 "o" #define PRIu8 "u" #define PRIx8 "x" #define PRIX8 "X" #define PRIoLEAST8 "o" #define PRIuLEAST8 "u" #define PRIxLEAST8 "x" #define PRIXLEAST8 "X" #define PRIoFAST8 "o" #define PRIuFAST8 "u" #define PRIxFAST8 "x" #define PRIXFAST8 "X" #define PRIo16 "ho" #define PRIu16 "hu" #define PRIx16 "hx" #define PRIX16 "hX" #define PRIoLEAST16 "ho" #define PRIuLEAST16 "hu" #define PRIxLEAST16 "hx" #define PRIXLEAST16 "hX" #define PRIoFAST16 "ho" #define PRIuFAST16 "hu" #define PRIxFAST16 "hx" #define PRIXFAST16 "hX" #define PRIo32 "I32o" #define PRIu32 "I32u" #define PRIx32 "I32x" #define PRIX32 "I32X" #define PRIoLEAST32 "I32o" #define PRIuLEAST32 "I32u" #define PRIxLEAST32 "I32x" #define PRIXLEAST32 "I32X" #define PRIoFAST32 "I32o" #define PRIuFAST32 "I32u" #define PRIxFAST32 "I32x" #define PRIXFAST32 "I32X" #define PRIo64 "I64o" #define PRIu64 "I64u" #define PRIx64 "I64x" #define PRIX64 "I64X" #define PRIoLEAST64 "I64o" #define PRIuLEAST64 "I64u" #define PRIxLEAST64 "I64x" #define PRIXLEAST64 "I64X" #define PRIoFAST64 "I64o" #define PRIuFAST64 "I64u" #define PRIxFAST64 "I64x" #define PRIXFAST64 "I64X" #define PRIoMAX "I64o" #define PRIuMAX "I64u" #define PRIxMAX "I64x" #define PRIXMAX "I64X" #define PRIoPTR "Io" #define PRIuPTR "Iu" #define PRIxPTR "Ix" #define PRIXPTR "IX" // The fscanf macros for signed integers are: #define SCNd8 "d" #define SCNi8 "i" #define SCNdLEAST8 "d" #define SCNiLEAST8 "i" #define SCNdFAST8 "d" #define SCNiFAST8 "i" #define SCNd16 "hd" #define SCNi16 "hi" #define SCNdLEAST16 "hd" #define SCNiLEAST16 "hi" #define SCNdFAST16 "hd" #define SCNiFAST16 "hi" #define SCNd32 "ld" #define SCNi32 "li" #define SCNdLEAST32 "ld" #define SCNiLEAST32 "li" #define SCNdFAST32 "ld" #define SCNiFAST32 "li" #define SCNd64 "I64d" #define SCNi64 "I64i" #define SCNdLEAST64 "I64d" #define SCNiLEAST64 "I64i" #define SCNdFAST64 "I64d" #define SCNiFAST64 "I64i" #define SCNdMAX "I64d" #define SCNiMAX "I64i" #ifdef _WIN64 // [ # define SCNdPTR "I64d" # define SCNiPTR "I64i" #else // _WIN64 ][ # define SCNdPTR "ld" # define SCNiPTR "li" #endif // _WIN64 ] // The fscanf macros for unsigned integers are: #define SCNo8 "o" #define SCNu8 "u" #define SCNx8 "x" #define SCNX8 "X" #define SCNoLEAST8 "o" #define SCNuLEAST8 "u" #define SCNxLEAST8 "x" #define SCNXLEAST8 "X" #define SCNoFAST8 "o" #define SCNuFAST8 "u" #define SCNxFAST8 "x" #define SCNXFAST8 "X" #define SCNo16 "ho" #define SCNu16 "hu" #define SCNx16 "hx" #define SCNX16 "hX" #define SCNoLEAST16 "ho" #define SCNuLEAST16 "hu" #define SCNxLEAST16 "hx" #define SCNXLEAST16 "hX" #define SCNoFAST16 "ho" #define SCNuFAST16 "hu" #define SCNxFAST16 "hx" #define SCNXFAST16 "hX" #define SCNo32 "lo" #define SCNu32 "lu" #define SCNx32 "lx" #define SCNX32 "lX" #define SCNoLEAST32 "lo" #define SCNuLEAST32 "lu" #define SCNxLEAST32 "lx" #define SCNXLEAST32 "lX" #define SCNoFAST32 "lo" #define SCNuFAST32 "lu" #define SCNxFAST32 "lx" #define SCNXFAST32 "lX" #define SCNo64 "I64o" #define SCNu64 "I64u" #define SCNx64 "I64x" #define SCNX64 "I64X" #define SCNoLEAST64 "I64o" #define SCNuLEAST64 "I64u" #define SCNxLEAST64 "I64x" #define SCNXLEAST64 "I64X" #define SCNoFAST64 "I64o" #define SCNuFAST64 "I64u" #define SCNxFAST64 "I64x" #define SCNXFAST64 "I64X" #define SCNoMAX "I64o" #define SCNuMAX "I64u" #define SCNxMAX "I64x" #define SCNXMAX "I64X" #ifdef _WIN64 // [ # define SCNoPTR "I64o" # define SCNuPTR "I64u" # define SCNxPTR "I64x" # define SCNXPTR "I64X" #else // _WIN64 ][ # define SCNoPTR "lo" # define SCNuPTR "lu" # define SCNxPTR "lx" # define SCNXPTR "lX" #endif // _WIN64 ] #endif // __STDC_FORMAT_MACROS ] // 7.8.2 Functions for greatest-width integer types // 7.8.2.1 The imaxabs function #define imaxabs _abs64 // 7.8.2.2 The imaxdiv function // This is modified version of div() function from Microsoft's div.c found // in %MSVC.NET%\crt\src\div.c #ifdef STATIC_IMAXDIV // [ static #else // STATIC_IMAXDIV ][ _inline #endif // STATIC_IMAXDIV ] imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) { imaxdiv_t result; result.quot = numer / denom; result.rem = numer % denom; if (numer < 0 && result.rem > 0) { // did division wrong; must fix up ++result.quot; result.rem -= denom; } return result; } // 7.8.2.3 The strtoimax and strtoumax functions #define strtoimax _strtoi64 #define strtoumax _strtoui64 // 7.8.2.4 The wcstoimax and wcstoumax functions #define wcstoimax _wcstoi64 #define wcstoumax _wcstoui64 #endif // _MSC_VER >= 1800 #endif // _MSC_INTTYPES_H_ ]
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/extensions
coqui_public_repos/inference-engine/third_party/openfst-1.6.7/src/extensions/const/Makefile.in
# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/extensions/const DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_python_devel.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/src/include/fst/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libfstdir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(libfst_LTLIBRARIES) const16_fst_la_LIBADD = am_const16_fst_la_OBJECTS = const16-fst.lo const16_fst_la_OBJECTS = $(am_const16_fst_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = const16_fst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(const16_fst_la_LDFLAGS) \ $(LDFLAGS) -o $@ const64_fst_la_LIBADD = am_const64_fst_la_OBJECTS = const64-fst.lo const64_fst_la_OBJECTS = $(am_const64_fst_la_OBJECTS) const64_fst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(const64_fst_la_LDFLAGS) \ $(LDFLAGS) -o $@ const8_fst_la_LIBADD = am_const8_fst_la_OBJECTS = const8-fst.lo const8_fst_la_OBJECTS = $(am_const8_fst_la_OBJECTS) const8_fst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(const8_fst_la_LDFLAGS) $(LDFLAGS) \ -o $@ am__DEPENDENCIES_1 = libfstconst_la_DEPENDENCIES = ../../lib/libfst.la \ $(am__DEPENDENCIES_1) am_libfstconst_la_OBJECTS = const8-fst.lo const16-fst.lo \ const64-fst.lo libfstconst_la_OBJECTS = $(am_libfstconst_la_OBJECTS) libfstconst_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libfstconst_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(const16_fst_la_SOURCES) $(const64_fst_la_SOURCES) \ $(const8_fst_la_SOURCES) $(libfstconst_la_SOURCES) DIST_SOURCES = $(const16_fst_la_SOURCES) $(const64_fst_la_SOURCES) \ $(const8_fst_la_SOURCES) $(libfstconst_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DL_LIBS = @DL_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libfstdir = @libfstdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS) libfst_LTLIBRARIES = const8-fst.la const16-fst.la const64-fst.la lib_LTLIBRARIES = libfstconst.la libfstconst_la_SOURCES = const8-fst.cc const16-fst.cc const64-fst.cc libfstconst_la_LDFLAGS = -version-info 10:0:0 -lm $(DL_LIBS) libfstconst_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS) const8_fst_la_SOURCES = const8-fst.cc const8_fst_la_LDFLAGS = -module const16_fst_la_SOURCES = const16-fst.cc const16_fst_la_LDFLAGS = -module const64_fst_la_SOURCES = const64-fst.cc const64_fst_la_LDFLAGS = -module all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/extensions/const/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/extensions/const/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-libfstLTLIBRARIES: $(libfst_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(libfst_LTLIBRARIES)'; test -n "$(libfstdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libfstdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libfstdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libfstdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libfstdir)"; \ } uninstall-libfstLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(libfst_LTLIBRARIES)'; test -n "$(libfstdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libfstdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libfstdir)/$$f"; \ done clean-libfstLTLIBRARIES: -test -z "$(libfst_LTLIBRARIES)" || rm -f $(libfst_LTLIBRARIES) @list='$(libfst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } const16-fst.la: $(const16_fst_la_OBJECTS) $(const16_fst_la_DEPENDENCIES) $(EXTRA_const16_fst_la_DEPENDENCIES) $(AM_V_CXXLD)$(const16_fst_la_LINK) -rpath $(libfstdir) $(const16_fst_la_OBJECTS) $(const16_fst_la_LIBADD) $(LIBS) const64-fst.la: $(const64_fst_la_OBJECTS) $(const64_fst_la_DEPENDENCIES) $(EXTRA_const64_fst_la_DEPENDENCIES) $(AM_V_CXXLD)$(const64_fst_la_LINK) -rpath $(libfstdir) $(const64_fst_la_OBJECTS) $(const64_fst_la_LIBADD) $(LIBS) const8-fst.la: $(const8_fst_la_OBJECTS) $(const8_fst_la_DEPENDENCIES) $(EXTRA_const8_fst_la_DEPENDENCIES) $(AM_V_CXXLD)$(const8_fst_la_LINK) -rpath $(libfstdir) $(const8_fst_la_OBJECTS) $(const8_fst_la_LIBADD) $(LIBS) libfstconst.la: $(libfstconst_la_OBJECTS) $(libfstconst_la_DEPENDENCIES) $(EXTRA_libfstconst_la_DEPENDENCIES) $(AM_V_CXXLD)$(libfstconst_la_LINK) -rpath $(libdir) $(libfstconst_la_OBJECTS) $(libfstconst_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/const16-fst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/const64-fst.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/const8-fst.Plo@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libfstdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libfstLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libfstLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-libfstLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libfstLTLIBRARIES clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ install-libfstLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-libfstLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
0
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/extensions
coqui_public_repos/inference-engine/third_party/openfst-1.6.9-win/src/extensions/pdt/getters.cc
// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #include <fst/extensions/pdt/getters.h> namespace fst { namespace script { bool GetPdtComposeFilter(const string &str, PdtComposeFilter *cf) { if (str == "expand") { *cf = EXPAND_FILTER; } else if (str == "expand_paren") { *cf = EXPAND_PAREN_FILTER; } else if (str == "paren") { *cf = PAREN_FILTER; } else { return false; } return true; } bool GetPdtParserType(const string &str, PdtParserType *pt) { if (str == "left") { *pt = PDT_LEFT_PARSER; } else if (str == "left_sr") { *pt = PDT_LEFT_SR_PARSER; } else { return false; } return true; } } // namespace script } // namespace fst
0