HFST - Helsinki Finite-State Transducer Technology - C++ API  version 3.9.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HfstEpsilonHandler.h
1 // Copyright (c) 2016 University of Helsinki
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 3 of the License, or (at your option) any later version.
7 // See the file COPYING included with this distribution for more
8 // information.
9 
10 #ifndef _HFST_EPSILON_HANDLER_H_
11 #define _HFST_EPSILON_HANDLER_H_
12 
13 #include "HfstDataTypes.h"
14 
15 namespace hfst {
16 
17  /* A class for handling input epsilon cycles in function lookup_fd. */
18  class HfstEpsilonHandler
19  {
20  protected:
21  typedef std::vector<hfst::implementations::HfstState> HfstStateVector;
22  // the path of consecutive input epsilon transitions
23  HfstStateVector epsilon_path;
24  size_t max_cycles; // maximum number of consecutive epsilon cycles allowed
25  size_t cycles; // number of cycles detected so far
26  public:
27  HfstEpsilonHandler(size_t cutoff);
28  void push_back(hfst::implementations::HfstState s);
29  void pop_back();
30  bool can_continue(hfst::implementations::HfstState s);
31  };
32 
33 }
34 
35 #endif // _HFST_EPSILON_HANDLER_H_
unsigned int HfstState
The number of a state in an HfstTransitionGraph.
Definition: HfstDataTypes.h:119
Datatypes that are needed when using the HFST API.