2014-02-20 10:49:17 +01:00
|
|
|
#include "concordia/example.hpp"
|
2015-04-09 22:17:19 +02:00
|
|
|
#include <climits>
|
|
|
|
#include <iostream>
|
2014-02-20 10:49:17 +01:00
|
|
|
|
2014-03-14 11:30:17 +01:00
|
|
|
Example::Example(const string & sentence, const SUFFIX_MARKER_TYPE & id)
|
2014-04-29 14:46:04 +02:00
|
|
|
throw(ConcordiaException):
|
2014-03-14 11:30:17 +01:00
|
|
|
_sentence(sentence),
|
|
|
|
_id(id) {
|
2014-04-29 14:46:04 +02:00
|
|
|
// check if the example id exceeds space
|
|
|
|
// reserved for it in the suffix marker
|
2015-04-09 22:17:19 +02:00
|
|
|
if (id >= SUFFIX_MARKER_TYPE_MAX_VALUE >> 8) {
|
2014-03-14 11:30:17 +01:00
|
|
|
throw ConcordiaException("Example id too large.");
|
|
|
|
}
|
2014-02-20 10:49:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Example::~Example() {
|
|
|
|
}
|
|
|
|
|