1f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// pdt.h
2f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
3f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// Licensed under the Apache License, Version 2.0 (the "License");
4f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// you may not use this file except in compliance with the License.
5f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// You may obtain a copy of the License at
6f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson//
7f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson//     http://www.apache.org/licenses/LICENSE-2.0
8f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson//
9f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// Unless required by applicable law or agreed to in writing, software
10f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// distributed under the License is distributed on an "AS IS" BASIS,
11f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// See the License for the specific language governing permissions and
13f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// limitations under the License.
14f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson//
15f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// Copyright 2005-2010 Google, Inc.
16f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// Author: riley@google.com (Michael Riley)
17f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson//
18f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// \file
19f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// Common classes for PDT expansion/traversal.
20f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
21f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson#ifndef FST_EXTENSIONS_PDT_PDT_H__
22f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson#define FST_EXTENSIONS_PDT_PDT_H__
23f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
243da1eb108d36da35333b2d655202791af854996bPrzemyslaw Szczepaniak#include <tr1/unordered_map>
25f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsonusing std::tr1::unordered_map;
26f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsonusing std::tr1::unordered_multimap;
27f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson#include <map>
28f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson#include <set>
29f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
305b6dc79427b8f7eeb6a7ff68034ab8548ce670eaAlexander Gutkin#include <fst/compat.h>
31f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson#include <fst/state-table.h>
32f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson#include <fst/fst.h>
33f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
34f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsonnamespace fst {
35f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
36f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// Provides bijection between parenthesis stacks and signed integral
37f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// stack IDs. Each stack ID is unique to each distinct stack.  The
38f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// open-close parenthesis label pairs are passed in 'parens'.
39f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsontemplate <typename K, typename L>
40f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsonclass PdtStack {
41f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson public:
42f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  typedef K StackId;
43f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  typedef L Label;
44f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
45f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // The stacks are stored in a tree. The nodes are stored in vector
46f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // 'nodes_'. Each node represents the top of some stack and is
47f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // ID'ed by its position in the vector. Its parent node represents
48f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // the stack with the top 'popped' and its children are stored in
49f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // 'child_map_' accessed by stack_id and label. The paren_id is
50f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // the position in 'parens' of the parenthesis for that node.
51f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  struct StackNode {
52f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    StackId parent_id;
53f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    size_t paren_id;
54f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
55f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    StackNode(StackId p, size_t i) : parent_id(p), paren_id(i) {}
56f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  };
57f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
58f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  PdtStack(const vector<pair<Label, Label> > &parens)
59f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      : parens_(parens), min_paren_(kNoLabel), max_paren_(kNoLabel) {
60f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    for (size_t i = 0; i < parens.size(); ++i) {
61f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      const pair<Label, Label>  &p = parens[i];
62f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      paren_map_[p.first] = i;
63f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      paren_map_[p.second] = i;
64f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
65f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      if (min_paren_ == kNoLabel || p.first < min_paren_)
66f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson        min_paren_ = p.first;
67f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      if (p.second < min_paren_)
68f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson        min_paren_ = p.second;
69f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
70f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      if (max_paren_ == kNoLabel || p.first > max_paren_)
71f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson        max_paren_ = p.first;
72f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      if (p.second > max_paren_)
73f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson        max_paren_ = p.second;
74f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    }
75f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    nodes_.push_back(StackNode(-1, -1));  // Tree root.
76f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  }
77f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
78f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // Returns stack ID given the current stack ID (0 if empty) and
79f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // label read. 'Pushes' onto a stack if the label is an open
80f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // parenthesis, returning the new stack ID. 'Pops' the stack if the
81f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // label is a close parenthesis that matches the top of the stack,
82f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // returning the parent stack ID. Returns -1 if label is an
83f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // unmatched close parenthesis. Otherwise, returns the current stack
84f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // ID.
85f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  StackId Find(StackId stack_id, Label label) {
86f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    if (min_paren_ == kNoLabel || label < min_paren_ || label > max_paren_)
87f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      return stack_id;                       // Non-paren.
88f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
89f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    typename unordered_map<Label, size_t>::const_iterator pit
90f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson        = paren_map_.find(label);
91f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    if (pit == paren_map_.end())             // Non-paren.
92f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      return stack_id;
93f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    ssize_t paren_id = pit->second;
94f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
95f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    if (label == parens_[paren_id].first) {  // Open paren.
96f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      StackId &child_id = child_map_[make_pair(stack_id, label)];
97f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      if (child_id == 0) {                   // Child not found, push label.
98f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson        child_id = nodes_.size();
99f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson        nodes_.push_back(StackNode(stack_id, paren_id));
100f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      }
101f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      return child_id;
102f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    }
103f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
104f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    const StackNode &node = nodes_[stack_id];
105f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    if (paren_id == node.paren_id)           // Matching close paren.
106f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      return node.parent_id;
107f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
108f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    return -1;                               // Non-matching close paren.
109f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  }
110f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
111f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // Returns the stack ID obtained by "popping" the label at the top
112f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // of the current stack ID.
113f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  StackId Pop(StackId stack_id) const {
114f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    return nodes_[stack_id].parent_id;
115f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  }
116f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
117f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  // Returns the paren ID at the top of the stack for 'stack_id'
118f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  ssize_t Top(StackId stack_id) const {
119f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    return nodes_[stack_id].paren_id;
120f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  }
121f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
122f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  ssize_t ParenId(Label label) const {
123f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    typename unordered_map<Label, size_t>::const_iterator pit
124f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson        = paren_map_.find(label);
125f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    if (pit == paren_map_.end())  // Non-paren.
126f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      return -1;
127f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    return pit->second;
128f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  }
129f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
130f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson private:
131f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  struct ChildHash {
132f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    size_t operator()(const pair<StackId, Label> &p) const {
133f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      return p.first + p.second * kPrime;
134f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    }
135f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  };
136f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
137f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  static const size_t kPrime;
138f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
139f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  vector<pair<Label, Label> > parens_;
140f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  vector<StackNode> nodes_;
141f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  unordered_map<Label, size_t> paren_map_;
142f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  unordered_map<pair<StackId, Label>,
143f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson           StackId, ChildHash> child_map_;   // Child of stack node wrt label
144f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  Label min_paren_;                          // For faster paren. check
145f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  Label max_paren_;                          // For faster paren. check
146f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson};
147f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
148f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsontemplate <typename T, typename L>
149f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsonconst size_t PdtStack<T, L>::kPrime = 7853;
150f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
151f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
152f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// State tuple for PDT expansion
153f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsontemplate <typename S, typename K>
154f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsonstruct PdtStateTuple {
155f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  typedef S StateId;
156f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  typedef K StackId;
157f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
158f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  StateId state_id;
159f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  StackId stack_id;
160f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
161f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  PdtStateTuple()
162f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      : state_id(kNoStateId), stack_id(-1) {}
163f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
164f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  PdtStateTuple(StateId fs, StackId ss)
165f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson      : state_id(fs), stack_id(ss) {}
166f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson};
167f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
168f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// Equality of PDT state tuples.
169f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsontemplate <typename S, typename K>
170f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsoninline bool operator==(const PdtStateTuple<S, K>& x,
171f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson                       const PdtStateTuple<S, K>& y) {
172f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  if (&x == &y)
173f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    return true;
174f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  return x.state_id == y.state_id && x.stack_id == y.stack_id;
175f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson}
176f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
177f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
178f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// Hash function object for PDT state tuples
179f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsontemplate <class T>
180f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsonclass PdtStateHash {
181f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson public:
182f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  size_t operator()(const T &tuple) const {
183f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    return tuple.state_id + tuple.stack_id * kPrime;
184f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  }
185f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
186f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson private:
187f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  static const size_t kPrime;
188f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson};
189f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
190f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsontemplate <typename T>
191f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsonconst size_t PdtStateHash<T>::kPrime = 7853;
192f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
193f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
194f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson// Tuple to PDT state bijection.
195f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsontemplate <class S, class K>
196f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodsonclass PdtStateTable
197f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson    : public CompactHashStateTable<PdtStateTuple<S, K>,
198f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson                                   PdtStateHash<PdtStateTuple<S, K> > > {
199f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson public:
200f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  typedef S StateId;
201f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  typedef K StackId;
202f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
203f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  PdtStateTable() {}
204f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
205f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  PdtStateTable(const PdtStateTable<S, K> &table) {}
206f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
207f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson private:
208f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson  void operator=(const PdtStateTable<S, K> &table);  // disallow
209f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson};
210f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
211f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson}  // namespace fst
212f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson
213f4c12fce1ee58e670f9c3fce46c40296ba9ee8a2Ian Hodson#endif  // FST_EXTENSIONS_PDT_PDT_H__
214