FST
openfst-1.7.1
OpenFst Library
Main Page
Namespaces
Classes
Files
File List
File Members
src
fst
openfst-1.7.1
src
include
fst
script
arc-class.h
Go to the documentation of this file.
1
// See www.openfst.org for extensive documentation on this weighted
2
// finite-state transducer library.
3
4
#ifndef FST_SCRIPT_ARC_CLASS_H_
5
#define FST_SCRIPT_ARC_CLASS_H_
6
7
#include <
fst/script/weight-class.h
>
8
9
namespace
fst
{
10
namespace
script {
11
12
// A struct representing an arc while ignoring arc type. It is passed as an
13
// argument to AddArc.
14
15
struct
ArcClass
{
16
template
<
class
Arc>
17
explicit
ArcClass
(
const
Arc &arc)
18
:
ilabel
(arc.
ilabel
),
olabel
(arc.
olabel
),
weight
(arc.
weight
),
19
nextstate
(arc.
nextstate
) {}
20
21
ArcClass
(
int64
ilabel
,
int64
olabel
,
const
WeightClass
&
weight
,
22
int64
nextstate
)
23
: ilabel(ilabel), olabel(olabel), weight(weight), nextstate(nextstate) {}
24
25
template
<
class
Arc>
26
Arc
GetArc
()
const
{
27
return
Arc(
ilabel
,
olabel
, *(
weight
.
GetWeight
<
typename
Arc::Weight>()),
28
nextstate
);
29
}
30
31
int64
ilabel
;
32
int64
olabel
;
33
WeightClass
weight
;
34
int64
nextstate
;
35
};
36
37
}
// namespace script
38
}
// namespace fst
39
40
#endif // FST_SCRIPT_ARC_CLASS_H_
weight-class.h
fst::script::ArcClass::ArcClass
ArcClass(int64 ilabel, int64 olabel, const WeightClass &weight, int64 nextstate)
Definition:
arc-class.h:21
fst::script::ArcClass::ilabel
int64 ilabel
Definition:
arc-class.h:31
fst
Definition:
compact16_acceptor-fst.cc:7
fst::script::ArcClass
Definition:
arc-class.h:15
int64
int64_t int64
Definition:
types.h:27
fst::script::ArcClass::olabel
int64 olabel
Definition:
arc-class.h:32
fst::script::WeightClass::GetWeight
const W * GetWeight() const
Definition:
weight-class.h:133
fst::script::ArcClass::ArcClass
ArcClass(const Arc &arc)
Definition:
arc-class.h:17
fst::script::ArcClass::GetArc
Arc GetArc() const
Definition:
arc-class.h:26
fst::script::WeightClass
Definition:
weight-class.h:98
fst::script::ArcClass::weight
WeightClass weight
Definition:
arc-class.h:33
fst::script::ArcClass::nextstate
int64 nextstate
Definition:
arc-class.h:34
Generated by
1.8.11