Commit a9a19efc authored by Florent Jacquemard's avatar Florent Jacquemard
Browse files

undef schema for grammar

parent 30ffb5a1
......@@ -17,7 +17,7 @@ WFSM<Transition>()
SWTA::SWTA(Weight seed):
WFSM<Transition>(seed)
{
assert (! seed.unknown());
// assert (! seed.unknown());
}
......
......@@ -185,6 +185,9 @@ public:
/// (code of the letter weight if there is one or "UNKNOWN" otherwise).
bool hasWeightType(std::string code) const;
/// weight value of the weight type for this WFSM.
inline const Weight& seed() const { return _seed; }
/// @brief additive neutral value of the weight semiring.
/// @return the 0 value in the weight domain in this WFSM.
Weight weight_zero() const;
......
......@@ -26,7 +26,7 @@ _cpt_tr(0),
_cpt_size(0),
_next_id(0)
{
assert (! seed.unknown());
// assert (! seed.unknown());
}
......
......@@ -619,7 +619,20 @@ int main(int argc, char** argv)
ERROR("error importing schema from {}, abort", _schema_file);
return 2;
}
assert(_schema);
if (_schema->seed().unknown())
{
ERROR("undef weight type in schema imported from {}, abort", _schema_file);
return 2;
}
if (_schema->empty())
{
ERROR("empty schema imported from {}, abort", _schema_file);
return 2;
}
if (f_timesig)
{
INFO("Time Signature (from command line option) {}/{}",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment