29 #include <string_view> 37 std::ostream &ostrm = std::cout;
38 const auto old = ostrm.setf(std::ios::left);
40 ostrm <<
"fst type" <<
FstType() << std::endl;
42 ostrm <<
"arc type" <<
ArcType() << std::endl;
44 ostrm <<
"input symbol table" <<
InputSymbols() << std::endl;
46 ostrm <<
"output symbol table" <<
OutputSymbols() << std::endl;
52 ostrm <<
"# of states" <<
NumStates() << std::endl;
54 ostrm <<
"# of arcs" <<
NumArcs() << std::endl;
56 ostrm <<
"initial state" <<
Start() << std::endl;
58 ostrm <<
"# of final states" <<
NumFinal() << std::endl;
60 ostrm <<
"# of input/output epsilons" <<
NumEpsilons() << std::endl;
71 std::string arc_type =
"";
76 arc_type =
"epsilon ";
80 arc_type =
"input-epsilon ";
84 arc_type =
"output-epsilon ";
88 const auto accessible_label =
"# of " + arc_type +
"accessible states";
91 const auto coaccessible_label =
"# of " + arc_type +
"coaccessible states";
94 const auto connected_label =
"# of " + arc_type +
"connected states";
97 const auto numcc_label =
"# of " + arc_type +
"connected components";
99 ostrm << numcc_label <<
NumCc() << std::endl;
100 const auto numscc_label =
"# of " + arc_type +
"strongly conn components";
102 ostrm << numscc_label <<
NumScc() << std::endl;
104 ostrm <<
"input matcher" 110 ostrm <<
"output matcher" 116 ostrm <<
"input lookahead" << (
InputLookAhead() ?
'y' :
'n') << std::endl;
118 ostrm <<
"output lookahead" << (
OutputLookAhead() ?
'y' :
'n') << std::endl;
125 for (
auto i = 0; i < 64; ++i, prop <<= 1) {
127 const char value = properties & prop ?
'y' :
'n';
132 if (properties & prop) {
134 }
else if (properties & prop << 1) {
144 const auto old = ostrm.setf(std::ios::left);
146 ostrm <<
"fst type" << header.
FstType() << std::endl;
148 ostrm <<
"arc type" << header.
ArcType() << std::endl;
150 ostrm <<
"version" << header.
Version() << std::endl;
153 const auto flags = header.
GetFlags();
158 ostrm <<
"output symbol table" 165 ostrm <<
"initial state" << header.
Start() << std::endl;
167 ostrm <<
"# of states" << header.
NumStates() << std::endl;
169 ostrm <<
"# of arcs" << header.
NumArcs() << std::endl;
const std::string & OutputSymbols() const
constexpr uint64_t kBinaryProperties
MatchType InputMatchType() const
void PrintHeader(std::ostream &ostrm, const FstHeader &header)
void PrintProperties(std::ostream &ostrm, uint64_t properties)
size_t NumConnected() const
script::ArcFilterType ArcFilterType() const
bool InputLookAhead() const
double OutputLabelMultiplicity() const
int64_t NumStates() const
size_t NumOutputEpsilons() const
size_t NumInputEpsilons() const
size_t NumAccessible() const
double InputLabelMultiplicity() const
uint64_t Properties() const
const std::string & InputSymbols() const
size_t NumEpsilons() const
size_t NumCoAccessible() const
const std::string & FstType() const
const std::string & ArcType() const
bool OutputLookAhead() const
const std::string_view PropertyNames[]
constexpr uint64_t kPosTrinaryProperties
MatchType OutputMatchType() const