Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / math / openfst / patches / patch-src_include_fst_replace.h
blobdc1b56f318957df6c5936eda0e81cf55810c5b8e
1 $NetBSD: patch-src_include_fst_replace.h,v 1.1 2012/07/03 17:42:05 joerg Exp $
3 --- src/include/fst/replace.h.orig 2009-03-21 03:35:34.000000000 +0000
4 +++ src/include/fst/replace.h
5 @@ -21,8 +21,15 @@
6 #ifndef FST_LIB_REPLACE_H__
7 #define FST_LIB_REPLACE_H__
9 +#include <ciso646>
11 +#if defined(_LIBCPP_VERSION) || __cplusplus >= 201103L
12 +#include <unordered_map>
13 +using std::unordered_map;
14 +#else
15 #include <tr1/unordered_map>
16 using std::tr1::unordered_map;
17 +#endif
18 #include <string>
19 #include <utility>
20 #include <vector>
21 @@ -424,16 +431,16 @@ class ReplaceFstImpl : public CacheImpl<
23 // return final weight of state (kInfWeight means state is not final)
24 Weight Final(StateId s) {
25 - if (!HasFinal(s)) {
26 + if (!this->HasFinal(s)) {
27 const StateTuple& tuple = state_table_->Tuple(s);
28 const StackPrefix& stack = stackprefix_array_[tuple.prefix_id];
29 const Fst<A>* fst = fst_array_[tuple.fst_id];
30 StateId fst_state = tuple.fst_state;
32 if (fst->Final(fst_state) != Weight::Zero() && stack.Depth() == 0)
33 - SetFinal(s, fst->Final(fst_state));
34 + this->SetFinal(s, fst->Final(fst_state));
35 else
36 - SetFinal(s, Weight::Zero());
37 + this->SetFinal(s, Weight::Zero());
39 return CacheImpl<A>::Final(s);
41 @@ -471,7 +478,7 @@ class ReplaceFstImpl : public CacheImpl<
42 const Fst<A>* fst = fst_array_[tuple.fst_id];
43 StateId fst_state = tuple.fst_state;
44 if (fst_state == kNoStateId) {
45 - SetArcs(s);
46 + this->SetArcs(s);
47 return;
50 @@ -483,7 +490,7 @@ class ReplaceFstImpl : public CacheImpl<
52 StateId nextstate = state_table_->FindState(
53 StateTuple(prefix_id, top.fst_id, top.nextstate));
54 - AddArc(s, A(0, 0, fst->Final(fst_state), nextstate));
55 + this->AddArc(s, A(0, 0, fst->Final(fst_state), nextstate));
58 // extend arcs leaving the state
59 @@ -493,7 +500,7 @@ class ReplaceFstImpl : public CacheImpl<
60 if (arc.olabel == 0) { // expand local fst
61 StateId nextstate = state_table_->FindState(
62 StateTuple(tuple.prefix_id, tuple.fst_id, arc.nextstate));
63 - AddArc(s, A(arc.ilabel, arc.olabel, arc.weight, nextstate));
64 + this->AddArc(s, A(arc.ilabel, arc.olabel, arc.weight, nextstate));
65 } else {
66 // check for non terminal
67 typename NonTerminalHash::const_iterator it =
68 @@ -511,17 +518,17 @@ class ReplaceFstImpl : public CacheImpl<
69 StateId nt_nextstate = state_table_->FindState(
70 StateTuple(nt_prefix, nonterminal, nt_start));
71 Label ilabel = (epsilon_on_replace_) ? 0 : arc.ilabel;
72 - AddArc(s, A(ilabel, 0, arc.weight, nt_nextstate));
73 + this->AddArc(s, A(ilabel, 0, arc.weight, nt_nextstate));
75 } else {
76 StateId nextstate = state_table_->FindState(
77 StateTuple(tuple.prefix_id, tuple.fst_id, arc.nextstate));
78 - AddArc(s, A(arc.ilabel, arc.olabel, arc.weight, nextstate));
79 + this->AddArc(s, A(arc.ilabel, arc.olabel, arc.weight, nextstate));
84 - SetArcs(s);
85 + this->SetArcs(s);