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

simplified constructors of tables

1 arg = parsing env
parent dc8f2643
......@@ -22,9 +22,9 @@ _comp(comp),
_nb_cand(0),
_nb_best_rejected(0)
{
assert(k != nullptr);
assert(k->complete());
assert(comp != nullptr);
assert(k);
//assert(k->complete());
assert(comp);
TRACE("new empty Record[{}]", *k);
}
......
......@@ -60,9 +60,9 @@ class TableParse : public TableA<K>
public:
/// concrete table.
/// @param env the parsing environment must not be NULL
/// @param comp binary function for comparing runs
TableParse(ParsingEnv& env, const RunOrder& comp);
/// @param env the parsing environment.
/// contains a binary function for comparing runs
TableParse(ParsingEnv& env);
/// delete all the complete keys and associated records
/// stored in the table.
......
......@@ -11,9 +11,9 @@ namespace parsing{
template<class K, class R, class H>
TableParse<K,R,H>::TableParse(ParsingEnv& env, const RunOrder& comp):
TableA<K>(env, comp),
_table(env, comp), // empty
TableParse<K,R,H>::TableParse(ParsingEnv& env):
TableA<K>(env, env.comparer()),
_table(env), // empty
_instances() // empty
//_pool(new RecordQueue<K>(comp, nullptr)) /// @todo make local var. in bestPartial
{ }
......
......@@ -49,8 +49,8 @@ public:
/// concrete table.
/// @param env the parsing environment.
/// @param comp binary function for comparing runs.
TableRecords(ParsingEnv& env, const RunOrder& comp);
/// It includes a binary function for comparing runs.
TableRecords(ParsingEnv& env);
/// delete all the complete keys and associated records
/// stored in the table.
......
......@@ -12,9 +12,9 @@ namespace parsing{
template <class K, class R, class H>
TableRecords<K,R,H>::TableRecords(ParsingEnv& env, const RunOrder& comp):
TableRecords<K,R,H>::TableRecords(ParsingEnv& env):
_env(env),
_comparer(comp),
_comparer(env.comparer()),
_table(), // empty
_nb_rows(0),
_nb_runs(0)
......
......@@ -53,7 +53,7 @@
#define QUANT_MULTIBAR_1BEST_SIPFLAT 11
/// current scenario
#define QUANT_SCENARIO QUANT_MULTIBAR_1BEST_SIO
#define QUANT_SCENARIO QUANT_MULTIBAR_1BEST_SIP
#include <stdio.h>
......@@ -782,12 +782,12 @@ parsing::TableA<K>* parse(const K& init,
// initialize table (empty)
if (n == 1) // 1-best
{
tab = new parsing::TableParse<K, parsing::RecordOne<K>, H>(env, env.runenum);
tab = new parsing::TableParse<K, parsing::RecordOne<K>, H>(env);
}
else // k-best
{
assert(n > 1); // cannot be 0
tab = new parsing::TableParse<K, parsing::RecordQueue<K>, H>(env, env.runenum);
tab = new parsing::TableParse<K, parsing::RecordQueue<K>, H>(env);
}
// fill table up to n-best
......
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