Commit 9f7531d8 authored by Florent Jacquemard's avatar Florent Jacquemard
Browse files

debug KeySIP and Key SIO:

- do not create binary bar run in final bar
- call terminalWeight on complete new key  in KeySIP::RunTerminal
parent d0fe2a42
......@@ -305,11 +305,7 @@ void KeySI::RunsTerminal(const Transition& t,
_interval->align(env.segment);
}
if (SymbLabel::dummy(a))
{
ERROR("KeySI: dummy symbol in tr.");
}
else if (SymbLabel::continuation(a) || SymbLabel::dot(a))
if (SymbLabel::continuation(a) || SymbLabel::dot(a))
{
if ((_interval->lsize() == 0) && (_interval->rsize() == 0))
{
......@@ -354,10 +350,14 @@ void KeySI::RunsTerminal(const Transition& t,
{
// 0 or -1 point to read in interval
Weight w = terminalWeight(a, t, env);
size_t len = 0;
RunFactory<KeySI>::terminalRun(*this, t, a, w, len, st);
assert(! w.unknown());
RunFactory<KeySI>::terminalRun(*this, t, a, w, 0, st);
}
}
else if (SymbLabel::dummy(a))
{
ERROR("KeySI: dummy symbol in tr.");
}
else
{
ERROR("KeySI: unexpected terminal symbol {}", SymbLabel::to_string(a));
......
......@@ -552,7 +552,6 @@ void KeySIO::RunsInner(const Transition& t,
std::stack<RunInner<KeySIO>*>& si,
const ParsingEnv& env) const
{
// assert(State::isWTA(_state));
const label_t& a = t.label();
assert(SymbLabel::inner(a));
......@@ -562,6 +561,8 @@ void KeySIO::RunsInner(const Transition& t,
// we do not divide empty intervals
if (_interval->inhabited())
RunFactory<KeySIO>::innerRun(*this, t, si);
else
TRACE("RunsInner: empy interval, do not divide {}", *this);
}
else if (SymbLabel::grace(a))
{
......@@ -578,7 +579,11 @@ void KeySIO::RunsInner(const Transition& t,
else if (SymbLabel::bar(a))
{
assert(SymbLabel::arity(a) == 2);
RunFactory<KeySIO>::innerRun(*this, t, si);
assert(_interval);
if ((_interval->rduration() >= _barlen) || _interval->inhabited())
RunFactory<KeySIO>::innerRun(*this, t, si);
else
TRACE("RunsInner: do not add bar (fine) {}", *this);
}
else
{
......
......@@ -294,7 +294,7 @@ void KeySIP::RunsTerminal(const Transition& t,
size_t n = SymbLabel::nbEvents(a);
if (n == _pre + _interval->lsize())
{
Weight w = terminalWeight(a, t, env); // terminalWeight(a, t, env);
Weight w = knew->terminalWeight(a, t, env);
assert(! w.unknown());
// n points = grace-notes + grace-rests + 1 note or -1
RunFactory<KeySIP>::terminalRun(*knew, t, a, w, n, st);
......@@ -310,7 +310,7 @@ void KeySIP::RunsTerminal(const Transition& t,
// && (DBL_APPROX_EQUAL(_interval->rend(), _interval->rbegin()))
if ((_interval->rduration() < _barlen) && (! _interval->inhabited()))
{
Weight w = terminalWeight(a, t, env); // terminalWeight(a, t, env);
Weight w = knew->terminalWeight(a, t, env);
assert(! w.unknown());
// 0 or -1 point to read in interval
RunFactory<KeySIP>::terminalRun(*knew, t, a, w, 0, st);
......@@ -393,7 +393,6 @@ void KeySIP::RunsInner(const Transition& t,
std::stack<RunInner<KeySIP>*>& si,
const ParsingEnv& env) const
{
assert(State::isWTA(_state));
const label_t& a = t.label();
assert(SymbLabel::inner(a));
......@@ -419,7 +418,11 @@ void KeySIP::RunsInner(const Transition& t,
else if (SymbLabel::bar(a))
{
assert(SymbLabel::arity(a) == 2);
RunFactory<KeySIP>::innerRun(*this, t, si);
assert(_interval);
if ((_interval->rduration() >= _barlen) || _interval->inhabited())
RunFactory<KeySIP>::innerRun(*this, t, si);
else
TRACE("RunsInner: do not add bar (fine) {}", *this);
}
else
{
......
......@@ -815,9 +815,7 @@ typename MapRecord<K,R,H>::iterator TableParse<K,R,H>::addemplace(const K& k,
initRecord(&(pret.first->first), &(pret.first->second));
}
else
{
ERROR("Table.addemplace: key {} already in table", k);
}
TRACE("Table.addemplace: key {} already in table", k);
return pret.first;
}
......
......@@ -1207,7 +1207,6 @@ int main(int argc, char** argv)
_iseg->print(std::cout);
}
#if QUANT_SCENARIO == QUANT_INPUTLESS
typedef parsing::KeyS KeyS;
......
Markdown is supported
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