Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

17
math/openfst/DESCR Normal file
View File

@@ -0,0 +1,17 @@
OpenFst is a library for constructing, combining, optimizing, and
searching weighted finite-state transducers (FSTs). Weighted
finite-state transducers are automata where each transition has an
input label, an output label, and a weight. The more familiar
finite-state acceptor is represented as a transducer with each
transition's input and output label equal. Finite-state acceptors
are used to represent sets of strings (specifically, regular or
rational sets); finite-state transducers are used to represent
binary relations between pairs of strings (specifically, rational
transductions). The weights can be used to represent the cost of
taking a particular transition.
This library was developed by contributors from Google Research
and NYU's Courant Institute. It is intended to be comprehensive,
flexible, efficient and scale well to large problems. it has been
extensively tested. It is an open source project distributed under
the Apache license.

21
math/openfst/Makefile Normal file
View File

@@ -0,0 +1,21 @@
# $NetBSD: Makefile,v 1.2 2012/09/11 23:04:25 asau Exp $
#
DISTNAME= openfst-1.1
CATEGORIES= math
MASTER_SITES= http://mohri-lt.cs.nyu.edu/twiki/pub/FST/FstDownload/
MAINTAINER= pallegra@gmail.com
HOMEPAGE= http://www.openfst.org/
COMMENT= OpenFst is a library for manipulating transducers
LICENSE= apache-2.0
USE_LANGUAGES= c c++
USE_LIBTOOL= yes
GNU_CONFIGURE= yes
.include "../../mk/dlopen.buildlink3.mk"
BUILDLINK_TRANSFORM+= opt:-ldl:${BUILDLINK_LDADD.dl:M*}
.include "../../mk/bsd.pkg.mk"

116
math/openfst/PLIST Normal file
View File

@@ -0,0 +1,116 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2009/11/03 17:53:44 wiz Exp $
bin/fstarcsort
bin/fstclosure
bin/fstcompile
bin/fstcompose
bin/fstconcat
bin/fstconnect
bin/fstconvert
bin/fstdeterminize
bin/fstdifference
bin/fstdraw
bin/fstencode
bin/fstepsnormalize
bin/fstequal
bin/fstequivalent
bin/fstinfo
bin/fstintersect
bin/fstinvert
bin/fstmap
bin/fstminimize
bin/fstprint
bin/fstproject
bin/fstprune
bin/fstpush
bin/fstrandgen
bin/fstrelabel
bin/fstreplace
bin/fstreverse
bin/fstreweight
bin/fstrmepsilon
bin/fstshortestdistance
bin/fstshortestpath
bin/fstsynchronize
bin/fsttopsort
bin/fstunion
include/fst/arc.h
include/fst/arcfilter.h
include/fst/arcmerge.h
include/fst/arcsort.h
include/fst/arcsum.h
include/fst/cache.h
include/fst/closure.h
include/fst/compact-fst.h
include/fst/compat.h
include/fst/complement.h
include/fst/compose-filter.h
include/fst/compose.h
include/fst/concat.h
include/fst/config.h
include/fst/connect.h
include/fst/const-fst.h
include/fst/determinize.h
include/fst/dfs-visit.h
include/fst/difference.h
include/fst/encode.h
include/fst/epsnormalize.h
include/fst/equal.h
include/fst/equivalent.h
include/fst/expanded-fst.h
include/fst/factor-weight.h
include/fst/flags.h
include/fst/float-weight.h
include/fst/fst-decl.h
include/fst/fst.h
include/fst/fstlib.h
include/fst/heap.h
include/fst/intersect.h
include/fst/invert.h
include/fst/lexicographic-weight.h
include/fst/lock.h
include/fst/log.h
include/fst/main.h
include/fst/mains.h
include/fst/map.h
include/fst/matcher.h
include/fst/minimize.h
include/fst/mutable-fst.h
include/fst/pair-weight.h
include/fst/partition.h
include/fst/product-weight.h
include/fst/project.h
include/fst/properties.h
include/fst/prune.h
include/fst/push.h
include/fst/queue.h
include/fst/randequivalent.h
include/fst/randgen.h
include/fst/random-weight.h
include/fst/rational.h
include/fst/register.h
include/fst/relabel.h
include/fst/replace.h
include/fst/reverse.h
include/fst/reweight.h
include/fst/rmepsilon.h
include/fst/rmfinalepsilon.h
include/fst/shortest-distance.h
include/fst/shortest-path.h
include/fst/slist.h
include/fst/state-table.h
include/fst/statesort.h
include/fst/string-weight.h
include/fst/symbol-table.h
include/fst/synchronize.h
include/fst/test-properties.h
include/fst/text-io.h
include/fst/topsort.h
include/fst/union-find.h
include/fst/union.h
include/fst/util.h
include/fst/vector-fst.h
include/fst/verify.h
include/fst/visit.h
include/fst/weight.h
lib/libfst.la
lib/libfstmain.la

26
math/openfst/distinfo Normal file
View File

@@ -0,0 +1,26 @@
$NetBSD: distinfo,v 1.3 2013/05/06 14:52:54 joerg Exp $
SHA1 (openfst-1.1.tar.gz) = b070f84a981dfadc4c049f505bd3406a43dfa55d
RMD160 (openfst-1.1.tar.gz) = 45657bb11f91ffdce5261ff6f4c103c164cc161b
Size (openfst-1.1.tar.gz) = 513404 bytes
SHA1 (patch-src_bin_compile-main.h) = b0f77cf8876acea5597b0ddb622dcddc52103cf0
SHA1 (patch-src_include_fst_cache.h) = 6a29b49f07b61a0ed9d9e2349805b836c45a25bc
SHA1 (patch-src_include_fst_compact-fst.h) = f1a2b9ec65d3c8be4d0574c96fa5e5a52c9e680c
SHA1 (patch-src_include_fst_compose.h) = 4fb25482929aecf37e69d9b6c23491f5512554f8
SHA1 (patch-src_include_fst_config.h.in) = 6c1eba23afe7d30026b37b9e7cf7c6552778c3e4
SHA1 (patch-src_include_fst_const-fst.h) = 758b60a5238f9f6f4a1a5a05c5abc41d81faa3a2
SHA1 (patch-src_include_fst_determinize.h) = c0ec374166a57c3df97cab25b5ec87231ec86df5
SHA1 (patch-src_include_fst_difference.h) = e66c128b621d1be4f9b7501d969cd2097f32aa04
SHA1 (patch-src_include_fst_encode.h) = ad9c3662b63dc40a40fa827fa011ea8332f04962
SHA1 (patch-src_include_fst_epsnormalize.h) = 1bee82d16fab4bdb4d635eb27aa22f9573d57fb9
SHA1 (patch-src_include_fst_equivalent.h) = dbc925b9de2b859a0a5493db4e5823dc8ed57e6c
SHA1 (patch-src_include_fst_factor-weight.h) = 311911d8308cdc073cffa2a2d0a52202330c4324
SHA1 (patch-src_include_fst_map.h) = 61faf469de577c944d2e66c10f1b877619ae0889
SHA1 (patch-src_include_fst_relabel.h) = 6fce070b426dfbcfb2aa89c05daec96b03cd6349
SHA1 (patch-src_include_fst_replace.h) = 2f8984463d5f083d3bc1fa439dc1a88e27f1954f
SHA1 (patch-src_include_fst_rmepsilon.h) = e371a2145c571378a49b707710b9ab5cc592f352
SHA1 (patch-src_include_fst_rmfinalepsilon.h) = fb1834d54a343982eb433f6c7ffddf1315a2b797
SHA1 (patch-src_include_fst_slist.h) = c63321cf232ec861ec07dc0c26a9c5c773c35f49
SHA1 (patch-src_include_fst_synchronize.h) = aed6efedd865bda3a881d5516487c4abdac36217
SHA1 (patch-src_include_fst_test-properties.h) = d82a8e542a8afbe10a7232c12a22a724a9fe0a0c
SHA1 (patch-src_include_fst_vector-fst.h) = 51178b6757e89e5c18807ec8521223dacaeb6c16

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-src_bin_compile-main.h,v 1.1 2013/05/06 14:53:16 joerg Exp $
--- src/bin/compile-main.h.orig 2013-05-03 17:26:20.000000000 +0000
+++ src/bin/compile-main.h
@@ -22,8 +22,15 @@
#ifndef FST_COMPILE_MAIN_H__
#define FST_COMPILE_MAIN_H__
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
+#endif
#include <sstream>
#include <string>
#include <vector>

View File

@@ -0,0 +1,27 @@
$NetBSD: patch-src_include_fst_cache.h,v 1.1 2012/07/03 17:42:05 joerg Exp $
--- src/include/fst/cache.h.orig 2012-07-03 09:45:36.000000000 +0000
+++ src/include/fst/cache.h
@@ -138,11 +138,11 @@ class CacheBaseImpl : public VectorFstBa
while (NumStates() <= s) // Add state to main cache
AddState(0);
if (!VectorFstBaseImpl<S>::GetState(s)) {
- SetState(s, new S);
+ this->SetState(s, new S);
if (cache_first_state_id_ != kNoStateId) { // Forget 1st cached state
while (NumStates() <= cache_first_state_id_)
AddState(0);
- SetState(cache_first_state_id_, cache_first_state_);
+ this->SetState(cache_first_state_id_, cache_first_state_);
if (cache_gc_) {
cache_states_.push_back(cache_first_state_id_);
cache_size_ += sizeof(S) +
@@ -296,7 +296,7 @@ class CacheBaseImpl : public VectorFstBa
(free_recent || !(state->flags & kCacheRecent)) && s != current) {
cache_size_ -= sizeof(S) + state->arcs.capacity() * sizeof(Arc);
delete state;
- SetState(s, 0);
+ this->SetState(s, 0);
cache_states_.erase(siter++);
} else {
state->flags &= ~kCacheRecent;

View File

@@ -0,0 +1,34 @@
$NetBSD: patch-src_include_fst_compact-fst.h,v 1.1 2012/07/03 17:42:05 joerg Exp $
--- src/include/fst/compact-fst.h.orig 2012-07-03 09:45:14.000000000 +0000
+++ src/include/fst/compact-fst.h
@@ -484,7 +484,7 @@ class CompactFstImpl : public CacheImpl<
StateId Start() {
if (!HasStart()) {
- SetStart(data_->Start());
+ this->SetStart(data_->Start());
}
return CacheImpl<A>::Start();
}
@@ -497,7 +497,7 @@ class CompactFstImpl : public CacheImpl<
arc = compactor_->Expand(s, data_->Compacts(compactor_->Size() == -1
? data_->States(s)
: s * compactor_->Size()));
- SetFinal(s, arc.ilabel == kNoLabel ? arc.weight : Weight::Zero());
+ this->SetFinal(s, arc.ilabel == kNoLabel ? arc.weight : Weight::Zero());
}
return CacheImpl<A>::Final(s);
}
@@ -566,9 +566,9 @@ class CompactFstImpl : public CacheImpl<
for (size_t i = begin; i < end; ++i) {
const Arc &arc = compactor_->Expand(s, data_->Compacts(i));
if (arc.ilabel == kNoLabel) continue;
- AddArc(s, arc);
+ this->AddArc(s, arc);
}
- SetArcs(s);
+ this->SetArcs(s);
}
private:

View File

@@ -0,0 +1,31 @@
$NetBSD: patch-src_include_fst_compose.h,v 1.1 2012/07/03 17:42:05 joerg Exp $
--- src/include/fst/compose.h.orig 2012-07-03 09:50:13.000000000 +0000
+++ src/include/fst/compose.h
@@ -114,7 +114,7 @@ class ComposeFstImplBase : public CacheI
if (!HasStart()) {
StateId start = ComputeStart();
if (start != kNoStateId) {
- SetStart(start);
+ this->SetStart(start);
}
}
return CacheImpl<A>::Start();
@@ -123,7 +123,7 @@ class ComposeFstImplBase : public CacheI
Weight Final(StateId s) {
if (!HasFinal(s)) {
Weight final = ComputeFinal(s);
- SetFinal(s, final);
+ this->SetFinal(s, final);
}
return CacheImpl<A>::Final(s);
}
@@ -266,7 +266,7 @@ class ComposeFstImpl : public ComposeFst
for (ArcIterator< Fst<A> > iterb(*fstb, sb); !iterb.Done(); iterb.Next())
MatchArc(s, matchera, iterb.Value(), match_input);
- SetArcs(s);
+ this->SetArcs(s);
}
// Matches a single transition from 'fstb' against 'fata' at 's'.

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-src_include_fst_config.h.in,v 1.1 2013/05/06 14:53:16 joerg Exp $
--- src/include/fst/config.h.in.orig 2013-05-03 17:47:24.000000000 +0000
+++ src/include/fst/config.h.in
@@ -2,7 +2,7 @@
/* Define to 1 if the system has the type `std::tr1::hash<long long
unsigned>'. */
-#define HAVE_STD__TR1__HASH_LONG_LONG_UNSIGNED_ 1
+#undef HAVE_STD__TR1__HASH_LONG_LONG_UNSIGNED_
/* Define to 1 if the system has the type `__gnu_cxx::slist<int>'. */
-#define HAVE___GNU_CXX__SLIST_INT_ 1
+#undef HAVE___GNU_CXX__SLIST_INT_

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-src_include_fst_const-fst.h,v 1.1 2012/07/03 17:42:05 joerg Exp $
--- src/include/fst/const-fst.h.orig 2012-07-03 09:46:39.000000000 +0000
+++ src/include/fst/const-fst.h
@@ -139,8 +139,8 @@ ConstFstImpl<A, U>::ConstFstImpl(const F
SetType(type);
uint64 copy_properties = fst.Properties(kCopyProperties, true);
SetProperties(copy_properties | kStaticProperties);
- SetInputSymbols(fst.InputSymbols());
- SetOutputSymbols(fst.OutputSymbols());
+ this->SetInputSymbols(fst.InputSymbols());
+ this->SetOutputSymbols(fst.OutputSymbols());
start_ = fst.Start();
// Count # of states and arcs.

View File

@@ -0,0 +1,50 @@
$NetBSD: patch-src_include_fst_determinize.h,v 1.2 2013/05/06 14:52:54 joerg Exp $
--- src/include/fst/determinize.h.orig 2009-03-21 03:35:33.000000000 +0000
+++ src/include/fst/determinize.h
@@ -21,9 +21,17 @@
#ifndef FST_LIB_DETERMINIZE_H__
#define FST_LIB_DETERMINIZE_H__
-#include <algorithm>
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
+#endif
+
+#include <algorithm>
#include <map>
#include <fst/slist.h>
#include <string>
@@ -171,7 +179,7 @@ class DeterminizeFstImplBase : public Ca
if (!HasStart()) {
StateId start = ComputeStart();
if (start != kNoStateId) {
- SetStart(start);
+ this->SetStart(start);
}
}
return CacheImpl<A>::Start();
@@ -180,7 +188,7 @@ class DeterminizeFstImplBase : public Ca
Weight Final(StateId s) {
if (!HasFinal(s)) {
Weight final = ComputeFinal(s);
- SetFinal(s, final);
+ this->SetFinal(s, final);
}
return CacheImpl<A>::Final(s);
}
@@ -363,7 +371,7 @@ class DeterminizeFsaImpl : public Determ
liter != label_map.end();
++liter)
AddArc(s, liter->first, liter->second);
- SetArcs(s);
+ this->SetArcs(s);
}
private:

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-src_include_fst_difference.h,v 1.1 2012/07/03 17:42:05 joerg Exp $
--- src/include/fst/difference.h.orig 2012-07-03 09:58:16.000000000 +0000
+++ src/include/fst/difference.h
@@ -95,7 +95,7 @@ class DifferenceFst : public ComposeFst<
copts.matcher2 = new R(cfst, MATCH_INPUT, ComplementFst<A>::kRhoLabel,
opts.matcher2);
- SetImpl(Init(fst1, cfst, copts));
+ this->SetImpl(this->Init(fst1, cfst, copts));
uint64 props1 = fst1.Properties(kFstProperties, false);
uint64 props2 = fst2.Properties(kFstProperties, false);

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-src_include_fst_encode.h,v 1.1 2013/05/06 14:53:16 joerg Exp $
--- src/include/fst/encode.h.orig 2013-05-03 17:23:12.000000000 +0000
+++ src/include/fst/encode.h
@@ -20,8 +20,15 @@
#ifndef FST_LIB_ENCODE_H__
#define FST_LIB_ENCODE_H__
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
+#endif
#include <string>
#include <vector>
#include <fst/map.h>

View File

@@ -0,0 +1,21 @@
$NetBSD: patch-src_include_fst_epsnormalize.h,v 1.1 2013/05/06 14:53:16 joerg Exp $
--- src/include/fst/epsnormalize.h.orig 2013-05-03 17:30:15.000000000 +0000
+++ src/include/fst/epsnormalize.h
@@ -20,8 +20,16 @@
#ifndef FST_LIB_EPSNORMALIZE_H__
#define FST_LIB_EPSNORMALIZE_H__
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
+#endif
+
#include <fst/slist.h>
#include <fst/factor-weight.h>

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-src_include_fst_equivalent.h,v 1.1 2013/05/06 14:53:16 joerg Exp $
--- src/include/fst/equivalent.h.orig 2013-05-03 17:31:26.000000000 +0000
+++ src/include/fst/equivalent.h
@@ -22,8 +22,15 @@
#include <algorithm>
#include <deque>
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
+#endif
#include <utility>
#include <vector>
#include <fst/encode.h>

View File

@@ -0,0 +1,73 @@
$NetBSD: patch-src_include_fst_factor-weight.h,v 1.2 2013/05/06 14:52:54 joerg Exp $
--- src/include/fst/factor-weight.h.orig 2009-03-21 03:35:33.000000000 +0000
+++ src/include/fst/factor-weight.h
@@ -20,9 +20,17 @@
#ifndef FST_LIB_FACTOR_WEIGHT_H__
#define FST_LIB_FACTOR_WEIGHT_H__
-#include <algorithm>
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
+#endif
+
+#include <algorithm>
#include <fst/slist.h>
#include <string>
#include <utility>
@@ -215,7 +223,7 @@ class FactorWeightFstImpl
if (s == kNoStateId)
return kNoStateId;
StateId start = FindState(Element(fst_->Start(), Weight::One()));
- SetStart(start);
+ this->SetStart(start);
}
return CacheImpl<A>::Start();
}
@@ -229,9 +237,9 @@ class FactorWeightFstImpl
: (Weight) Times(e.weight, fst_->Final(e.state));
FactorIterator f(w);
if (!(mode_ & kFactorFinalWeights) || f.Done())
- SetFinal(s, w);
+ this->SetFinal(s, w);
else
- SetFinal(s, Weight::Zero());
+ this->SetFinal(s, Weight::Zero());
}
return CacheImpl<A>::Final(s);
}
@@ -298,13 +306,13 @@ class FactorWeightFstImpl
FactorIterator fit(w);
if (!(mode_ & kFactorArcWeights) || fit.Done()) {
StateId d = FindState(Element(arc.nextstate, Weight::One()));
- AddArc(s, Arc(arc.ilabel, arc.olabel, w, d));
+ this->AddArc(s, Arc(arc.ilabel, arc.olabel, w, d));
} else {
for (; !fit.Done(); fit.Next()) {
const pair<Weight, Weight> &p = fit.Value();
StateId d = FindState(Element(arc.nextstate,
p.second.Quantize(delta_)));
- AddArc(s, Arc(arc.ilabel, arc.olabel, p.first, d));
+ this->AddArc(s, Arc(arc.ilabel, arc.olabel, p.first, d));
}
}
}
@@ -322,10 +330,10 @@ class FactorWeightFstImpl
const pair<Weight, Weight> &p = fit.Value();
StateId d = FindState(Element(kNoStateId,
p.second.Quantize(delta_)));
- AddArc(s, Arc(final_ilabel_, final_olabel_, p.first, d));
+ this->AddArc(s, Arc(final_ilabel_, final_olabel_, p.first, d));
}
}
- SetArcs(s);
+ this->SetArcs(s);
}
private:

View File

@@ -0,0 +1,100 @@
$NetBSD: patch-src_include_fst_map.h,v 1.2 2013/05/06 14:52:54 joerg Exp $
--- src/include/fst/map.h.orig 2009-03-21 03:35:34.000000000 +0000
+++ src/include/fst/map.h
@@ -21,8 +21,15 @@
#ifndef FST_LIB_MAP_H__
#define FST_LIB_MAP_H__
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
+#endif
#include <string>
#include <utility>
#include <fst/cache.h>
@@ -336,7 +343,7 @@ class MapFstImpl : public CacheImpl<B> {
StateId Start() {
if (!HasStart())
- SetStart(FindOState(fst_->Start()));
+ this->SetStart(FindOState(fst_->Start()));
return CacheImpl<B>::Start();
}
@@ -348,24 +355,24 @@ class MapFstImpl : public CacheImpl<B> {
B final_arc = (*mapper_)(A(0, 0, fst_->Final(FindIState(s)),
kNoStateId));
CHECK(final_arc.ilabel == 0 && final_arc.olabel == 0);
- SetFinal(s, final_arc.weight);
+ this->SetFinal(s, final_arc.weight);
break;
}
case MAP_ALLOW_SUPERFINAL: {
if (s == superfinal_) {
- SetFinal(s, Weight::One());
+ this->SetFinal(s, Weight::One());
} else {
B final_arc = (*mapper_)(A(0, 0, fst_->Final(FindIState(s)),
kNoStateId));
if (final_arc.ilabel == 0 && final_arc.olabel == 0)
- SetFinal(s, final_arc.weight);
+ this->SetFinal(s, final_arc.weight);
else
- SetFinal(s, Weight::Zero());
+ this->SetFinal(s, Weight::Zero());
}
break;
}
case MAP_REQUIRE_SUPERFINAL: {
- SetFinal(s, s == superfinal_ ? Weight::One() : Weight::Zero());
+ this->SetFinal(s, s == superfinal_ ? Weight::One() : Weight::Zero());
break;
}
}
@@ -399,14 +406,14 @@ class MapFstImpl : public CacheImpl<B> {
void Expand(StateId s) {
// Add exiting arcs.
- if (s == superfinal_) { SetArcs(s); return; }
+ if (s == superfinal_) { this->SetArcs(s); return; }
for (ArcIterator< Fst<A> > aiter(*fst_, FindIState(s));
!aiter.Done(); aiter.Next()) {
A aarc(aiter.Value());
aarc.nextstate = FindOState(aarc.nextstate);
const B& barc = (*mapper_)(aarc);
- AddArc(s, barc);
+ this->AddArc(s, barc);
}
// Check for superfinal arcs.
@@ -422,7 +429,7 @@ class MapFstImpl : public CacheImpl<B> {
if (superfinal_ == kNoStateId)
superfinal_ = nstates_++;
final_arc.nextstate = superfinal_;
- AddArc(s, final_arc);
+ this->AddArc(s, final_arc);
}
break;
}
@@ -431,12 +438,12 @@ class MapFstImpl : public CacheImpl<B> {
kNoStateId));
if (final_arc.ilabel != 0 || final_arc.olabel != 0 ||
final_arc.weight != B::Weight::Zero())
- AddArc(s, B(final_arc.ilabel, final_arc.olabel,
+ this->AddArc(s, B(final_arc.ilabel, final_arc.olabel,
final_arc.weight, superfinal_));
break;
}
}
- SetArcs(s);
+ this->SetArcs(s);
}
private:

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-src_include_fst_relabel.h,v 1.1 2013/05/06 14:53:16 joerg Exp $
--- src/include/fst/relabel.h.orig 2013-05-03 17:35:08.000000000 +0000
+++ src/include/fst/relabel.h
@@ -20,8 +20,15 @@
#ifndef FST_LIB_RELABEL_H__
#define FST_LIB_RELABEL_H__
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
+#endif
#include <string>
#include <utility>
#include <vector>

View File

@@ -0,0 +1,88 @@
$NetBSD: patch-src_include_fst_replace.h,v 1.2 2013/05/06 14:52:54 joerg Exp $
--- src/include/fst/replace.h.orig 2009-03-21 03:35:34.000000000 +0000
+++ src/include/fst/replace.h
@@ -21,8 +21,15 @@
#ifndef FST_LIB_REPLACE_H__
#define FST_LIB_REPLACE_H__
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
+#endif
#include <string>
#include <utility>
#include <vector>
@@ -424,16 +431,16 @@ class ReplaceFstImpl : public CacheImpl<
// return final weight of state (kInfWeight means state is not final)
Weight Final(StateId s) {
- if (!HasFinal(s)) {
+ if (!this->HasFinal(s)) {
const StateTuple& tuple = state_table_->Tuple(s);
const StackPrefix& stack = stackprefix_array_[tuple.prefix_id];
const Fst<A>* fst = fst_array_[tuple.fst_id];
StateId fst_state = tuple.fst_state;
if (fst->Final(fst_state) != Weight::Zero() && stack.Depth() == 0)
- SetFinal(s, fst->Final(fst_state));
+ this->SetFinal(s, fst->Final(fst_state));
else
- SetFinal(s, Weight::Zero());
+ this->SetFinal(s, Weight::Zero());
}
return CacheImpl<A>::Final(s);
}
@@ -471,7 +478,7 @@ class ReplaceFstImpl : public CacheImpl<
const Fst<A>* fst = fst_array_[tuple.fst_id];
StateId fst_state = tuple.fst_state;
if (fst_state == kNoStateId) {
- SetArcs(s);
+ this->SetArcs(s);
return;
}
@@ -483,7 +490,7 @@ class ReplaceFstImpl : public CacheImpl<
StateId nextstate = state_table_->FindState(
StateTuple(prefix_id, top.fst_id, top.nextstate));
- AddArc(s, A(0, 0, fst->Final(fst_state), nextstate));
+ this->AddArc(s, A(0, 0, fst->Final(fst_state), nextstate));
}
// extend arcs leaving the state
@@ -493,7 +500,7 @@ class ReplaceFstImpl : public CacheImpl<
if (arc.olabel == 0) { // expand local fst
StateId nextstate = state_table_->FindState(
StateTuple(tuple.prefix_id, tuple.fst_id, arc.nextstate));
- AddArc(s, A(arc.ilabel, arc.olabel, arc.weight, nextstate));
+ this->AddArc(s, A(arc.ilabel, arc.olabel, arc.weight, nextstate));
} else {
// check for non terminal
typename NonTerminalHash::const_iterator it =
@@ -511,17 +518,17 @@ class ReplaceFstImpl : public CacheImpl<
StateId nt_nextstate = state_table_->FindState(
StateTuple(nt_prefix, nonterminal, nt_start));
Label ilabel = (epsilon_on_replace_) ? 0 : arc.ilabel;
- AddArc(s, A(ilabel, 0, arc.weight, nt_nextstate));
+ this->AddArc(s, A(ilabel, 0, arc.weight, nt_nextstate));
}
} else {
StateId nextstate = state_table_->FindState(
StateTuple(tuple.prefix_id, tuple.fst_id, arc.nextstate));
- AddArc(s, A(arc.ilabel, arc.olabel, arc.weight, nextstate));
+ this->AddArc(s, A(arc.ilabel, arc.olabel, arc.weight, nextstate));
}
}
}
- SetArcs(s);
+ this->SetArcs(s);
}

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-src_include_fst_rmepsilon.h,v 1.1 2013/05/06 14:53:17 joerg Exp $
--- src/include/fst/rmepsilon.h.orig 2013-05-03 17:30:43.000000000 +0000
+++ src/include/fst/rmepsilon.h
@@ -20,8 +20,15 @@
#ifndef FST_LIB_RMEPSILON_H__
#define FST_LIB_RMEPSILON_H__
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
+#endif
#include <fst/slist.h>
#include <stack>
#include <string>

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-src_include_fst_rmfinalepsilon.h,v 1.1 2013/05/06 14:53:17 joerg Exp $
--- src/include/fst/rmfinalepsilon.h.orig 2013-05-03 17:24:31.000000000 +0000
+++ src/include/fst/rmfinalepsilon.h
@@ -20,8 +20,15 @@
#ifndef FST_LIB_RMFINALEPSILON_H__
#define FST_LIB_RMFINALEPSILON_H__
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_set>
+using std::unordered_set;
+#else
#include <tr1/unordered_set>
using std::tr1::unordered_set;
+#endif
#include <vector>
#include <fst/connect.h>

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-src_include_fst_slist.h,v 1.1 2013/05/06 14:53:17 joerg Exp $
--- src/include/fst/slist.h.orig 2013-05-03 17:49:34.000000000 +0000
+++ src/include/fst/slist.h
@@ -47,7 +47,7 @@ template <typename T> class slist : publ
iterator erase_after(iterator pos) {
iterator npos = pos;
- erase(++npos);
+ this->erase(++npos);
return pos;
}
};

View File

@@ -0,0 +1,76 @@
$NetBSD: patch-src_include_fst_synchronize.h,v 1.2 2013/05/06 14:52:54 joerg Exp $
--- src/include/fst/synchronize.h.orig 2009-03-21 03:35:34.000000000 +0000
+++ src/include/fst/synchronize.h
@@ -20,11 +20,21 @@
#ifndef FST_LIB_SYNCHRONIZE_H__
#define FST_LIB_SYNCHRONIZE_H__
-#include <algorithm>
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_map>
+using std::unordered_map;
+#include <unordered_set>
+using std::unordered_set;
+#else
#include <tr1/unordered_map>
using std::tr1::unordered_map;
#include <tr1/unordered_set>
using std::tr1::unordered_set;
+#endif
+
+#include <algorithm>
#include <string>
#include <utility>
#include <vector>
@@ -111,7 +121,7 @@ class SynchronizeFstImpl
return kNoStateId;
const String *empty = FindString(new String());
StateId start = FindState(Element(fst_->Start(), empty, empty));
- SetStart(start);
+ this->SetStart(start);
}
return CacheImpl<A>::Start();
}
@@ -121,9 +131,9 @@ class SynchronizeFstImpl
const Element &e = elements_[s];
Weight w = e.state == kNoStateId ? Weight::One() : fst_->Final(e.state);
if ((w != Weight::Zero()) && (e.istring)->empty() && (e.ostring)->empty())
- SetFinal(s, w);
+ this->SetFinal(s, w);
else
- SetFinal(s, Weight::Zero());
+ this->SetFinal(s, Weight::Zero());
}
return CacheImpl<A>::Final(s);
}
@@ -230,13 +240,13 @@ class SynchronizeFstImpl
const String *istring = Cdr(e.istring, arc.ilabel);
const String *ostring = Cdr(e.ostring, arc.olabel);
StateId d = FindState(Element(arc.nextstate, istring, ostring));
- AddArc(s, Arc(Car(e.istring, arc.ilabel),
+ this->AddArc(s, Arc(Car(e.istring, arc.ilabel),
Car(e.ostring, arc.olabel), arc.weight, d));
} else {
const String *istring = Concat(e.istring, arc.ilabel);
const String *ostring = Concat(e.ostring, arc.olabel);
StateId d = FindState(Element(arc.nextstate, istring, ostring));
- AddArc(s, Arc(0 , 0, arc.weight, d));
+ this->AddArc(s, Arc(0 , 0, arc.weight, d));
}
}
@@ -246,9 +256,9 @@ class SynchronizeFstImpl
const String *istring = Cdr(e.istring);
const String *ostring = Cdr(e.ostring);
StateId d = FindState(Element(kNoStateId, istring, ostring));
- AddArc(s, Arc(Car(e.istring), Car(e.ostring), w, d));
+ this->AddArc(s, Arc(Car(e.istring), Car(e.ostring), w, d));
}
- SetArcs(s);
+ this->SetArcs(s);
}
private:

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-src_include_fst_test-properties.h,v 1.1 2013/05/06 14:53:17 joerg Exp $
--- src/include/fst/test-properties.h.orig 2013-05-03 17:21:06.000000000 +0000
+++ src/include/fst/test-properties.h
@@ -20,8 +20,15 @@
#ifndef FST_LIB_TEST_PROPERTIES_H__
#define FST_LIB_TEST_PROPERTIES_H__
+#include <ciso646>
+
+#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
+#include <unordered_set>
+using std::unordered_set;
+#else
#include <tr1/unordered_set>
using std::tr1::unordered_set;
+#endif
#include <fst/mutable-fst.h>
#include <fst/dfs-visit.h>
#include <fst/connect.h>

View File

@@ -0,0 +1,101 @@
$NetBSD: patch-src_include_fst_vector-fst.h,v 1.1 2012/07/03 17:42:05 joerg Exp $
--- src/include/fst/vector-fst.h.orig 2012-07-03 09:43:16.000000000 +0000
+++ src/include/fst/vector-fst.h
@@ -199,9 +199,9 @@ class VectorFstImpl : public VectorFstBa
static VectorFstImpl<A> *Read(istream &strm, const FstReadOptions &opts);
- size_t NumInputEpsilons(StateId s) const { return GetState(s)->niepsilons; }
+ size_t NumInputEpsilons(StateId s) const { return this->GetState(s)->niepsilons; }
- size_t NumOutputEpsilons(StateId s) const { return GetState(s)->noepsilons; }
+ size_t NumOutputEpsilons(StateId s) const { return this->GetState(s)->noepsilons; }
bool Write(ostream &strm, const FstWriteOptions &opts) const;
@@ -213,7 +213,7 @@ class VectorFstImpl : public VectorFstBa
}
void SetFinal(StateId s, Weight w) {
- Weight ow = Final(s);
+ Weight ow = this->Final(s);
if (ow != Weight::Zero() && ow != Weight::One())
SetProperties(Properties() & ~kWeighted);
BaseImpl::SetFinal(s, w);
@@ -232,7 +232,7 @@ class VectorFstImpl : public VectorFstBa
}
void AddArc(StateId s, const A &arc) {
- VectorState<A> *state = GetState(s);
+ VectorState<A> *state = this->GetState(s);
if (arc.ilabel != arc.olabel) {
SetProperties(Properties() | kNotAcceptor);
SetProperties(Properties() & ~kAcceptor);
@@ -290,21 +290,21 @@ class VectorFstImpl : public VectorFstBa
}
void DeleteArcs(StateId s, size_t n) {
- const vector<A> &arcs = GetState(s)->arcs;
+ const vector<A> &arcs = this->GetState(s)->arcs;
for (size_t i = 0; i < n; ++i) {
size_t j = arcs.size() - i - 1;
if (arcs[j].ilabel == 0)
- --GetState(s)->niepsilons;
+ --this->GetState(s)->niepsilons;
if (arcs[j].olabel == 0)
- --GetState(s)->noepsilons;
+ --this->GetState(s)->noepsilons;
}
BaseImpl::DeleteArcs(s, n);
SetProperties(Properties() & kDeleteArcsProperties);
}
void DeleteArcs(StateId s) {
- GetState(s)->niepsilons = 0;
- GetState(s)->noepsilons = 0;
+ this->GetState(s)->niepsilons = 0;
+ this->GetState(s)->noepsilons = 0;
BaseImpl::DeleteArcs(s);
SetProperties(Properties() & kDeleteArcsProperties);
}
@@ -324,8 +324,8 @@ template <class A>
VectorFstImpl<A>::VectorFstImpl(const Fst<A> &fst) {
SetType("vector");
SetProperties(fst.Properties(kCopyProperties, false) | kStaticProperties);
- SetInputSymbols(fst.InputSymbols());
- SetOutputSymbols(fst.OutputSymbols());
+ this->SetInputSymbols(fst.InputSymbols());
+ this->SetOutputSymbols(fst.OutputSymbols());
BaseImpl::SetStart(fst.Start());
for (StateIterator< Fst<A> > siter(fst);
@@ -334,16 +334,16 @@ VectorFstImpl<A>::VectorFstImpl(const Fs
StateId s = siter.Value();
BaseImpl::AddState();
BaseImpl::SetFinal(s, fst.Final(s));
- ReserveArcs(s, fst.NumArcs(s));
+ this->ReserveArcs(s, fst.NumArcs(s));
for (ArcIterator< Fst<A> > aiter(fst, s);
!aiter.Done();
aiter.Next()) {
const A &arc = aiter.Value();
BaseImpl::AddArc(s, arc);
if (arc.ilabel == 0)
- ++GetState(s)->niepsilons;
+ ++this->GetState(s)->niepsilons;
if (arc.olabel == 0)
- ++GetState(s)->noepsilons;
+ ++this->GetState(s)->noepsilons;
}
}
}
@@ -427,7 +427,7 @@ bool VectorFstImpl<A>::Write(ostream &st
WriteHeader(strm, opts, kFileVersion, &hdr);
for (StateId s = 0; s < NumStates(); ++s) {
- const VectorState<A> *state = GetState(s);
+ const VectorState<A> *state = this->GetState(s);
state->final.Write(strm);
int64 narcs = state->arcs.size();
WriteType(strm, narcs);