56#ifndef GUM_LEARNING_DB_TRANSLATOR_SET_H
57#define GUM_LEARNING_DB_TRANSLATOR_SET_H
200 const std::size_t column,
201 const bool unique_column =
true);
218 const std::size_t column,
219 const std::vector< std::string >& missing_symbols,
220 const bool unique_column =
true);
235 const std::size_t column,
236 const bool unique_column =
true);
245 template <
class Translator >
310 const std::size_t k)
const;
338 const std::size_t k)
const;
466#ifndef DOXYGEN_SHOULD_SKIP_THIS
470 std::vector< DBTranslator* > _translators_;
474 std::vector< std::size_t > _columns_;
477 std::size_t _highest_column_{std::size_t(0)};
The set of translators stored into a row filter.
Utilities for DBTranslators.
The class for generic Hash Tables.
Base class for every random variable.
the class for packing together the translators used to preprocess the datasets
const DBTranslator & operator[](const std::size_t k) const
returns the kth translator
DBTranslatedValue translateSafe(const std::vector< std::string > &row, const std::size_t k) const
similar to method translate, except that it checks that the kth translator exists
std::size_t inputColumn(const std::size_t k) const
returns the column of the input database that will be read by the kth translator
std::string translateBack(const DBTranslatedValue translated_val, const std::size_t k) const
returns the original string that was translated into translated_val
void changeTranslator(const Translator &new_translator, const std::size_t pos)
substitute a translator by another one
bool needsReordering(const std::size_t k) const
indicates whether a reordering is needed to make the kth translator sorted
const DBTranslator & translatorSafe(const std::size_t k) const
returns the kth translator
void eraseTranslator(const std::size_t k, const bool k_is_input_col=false)
erases either the kth translator or those parsing the kth column of the input database
const DBTranslator & translator(const std::size_t k) const
returns the kth translator
DBTranslatorSet & operator=(const DBTranslatorSet &from)
copy operator
std::size_t domainSizeSafe(const std::size_t k) const
returns the domain size of the variable stored into the kth translator
DBTranslator & operator[](const std::size_t k)
returns the kth translator
DBTranslatorSet & operator=(DBTranslatorSet &&from)
move operator
bool needsReorderingSafe(const std::size_t k) const
same as method needsReordering but checks that the kth translator exists
std::size_t size() const
returns the number of translators stored into the set
std::size_t insertTranslator(const Variable &var, const std::size_t column, const std::vector< std::string > &missing_symbols, const bool unique_column=true)
inserts a new translator for a given variable at the end of the translator set
DBTranslator & translator(const std::size_t k)
returns the kth translator
std::size_t insertTranslator(const Variable &var, const std::size_t column, const bool unique_column=true)
inserts a new translator for a given variable at the end of the translator set
const Variable & variable(const std::size_t k) const
returns the variable stored into the kth translator
std::size_t highestInputColumn() const
returns the largest input database column index read by the translators
bool isMissingValue(const DBTranslatedValue translated_val, const std::size_t k) const
indicates whether the kth translator considers a translated_val as a missing value
DBTranslatorSet()
default constructor
const std::vector< DBTranslator * > & translators() const
returns the set of translators
const Variable & variableSafe(const std::size_t k) const
returns the variable stored into the kth translator
void clear()
remove all the translators
HashTable< std::size_t, std::size_t > reorderSafe(const std::size_t k)
same as method reorder but checks that the kth translator exists
virtual ~DBTranslatorSet()
destructor
HashTable< std::size_t, std::size_t > reorder(const std::size_t k)
performs a reordering of the dictionary and returns a mapping from the old translated values to the n...
DBTranslator & translatorSafe(const std::size_t k)
returns the kth translator
DBTranslatorSet(DBTranslatorSet &&from)
move constructor
std::size_t nbTranslators() const
returns the number of translators stored into the set
DBTranslatedValue translate(const std::vector< std::string > &row, const std::size_t k) const
ask the kth translator to translate a string in a row of the database
std::size_t inputColumnSafe(const std::size_t k) const
returns the column of the input database that will be read by the kth translator
DBTranslatorSet(const DBTranslatorSet &from)
copy constructor
std::size_t domainSize(const std::size_t k) const
returns the domain size of the variable stored into the kth translator
std::string translateBackSafe(const DBTranslatedValue translated_val, const std::size_t k) const
similar to method translateBack, except that it checks that the kth translator exists
std::size_t insertTranslator(const DBTranslator &translator, const std::size_t column, const bool unique_column=true)
inserts a new translator at the end of the translator set
virtual DBTranslatorSet * clone() const
virtual copy constructor
bool isMissingValueSafe(const DBTranslatedValue translated_val, const std::size_t k) const
similar to method isMissingValue, except that it checks that the kth translator exists
The base class for all the tabular database cell translators.
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities
The union class for storing the translated values in learning databases.