summaryrefslogtreecommitdiff
path: root/math/openfst/patches/patch-src_include_fst_replace.h
blob: 5e87721e435ae6c7fa9a384c1ca726ed13c37685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
$NetBSD: patch-src_include_fst_replace.h,v 1.1 2012/07/03 17:42:05 joerg Exp $

--- src/include/fst/replace.h.orig	2012-07-03 10:02:47.000000000 +0000
+++ src/include/fst/replace.h
@@ -424,16 +424,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 +471,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 +483,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 +493,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 +511,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);
   }