2014-03-11 14:32:10 +01:00
|
|
|
#ifndef TM_MATCHES_HDR
|
|
|
|
#define TM_MATCHES_HDR
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "concordia/common/config.hpp"
|
|
|
|
#include "concordia/interval.hpp"
|
|
|
|
#include <boost/ptr_container/ptr_vector.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Class used within Anubis search algorithm to store partial results.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class TmMatches {
|
|
|
|
public:
|
|
|
|
explicit TmMatches(const SUFFIX_MARKER_TYPE exampleId,
|
|
|
|
const unsigned char exampleSize,
|
|
|
|
const unsigned char patternSize);
|
|
|
|
|
|
|
|
/*! Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~TmMatches();
|
|
|
|
|
|
|
|
double getScore() const {
|
|
|
|
return _score;
|
|
|
|
}
|
|
|
|
|
|
|
|
SUFFIX_MARKER_TYPE getExampleId() const {
|
|
|
|
return _exampleId;
|
|
|
|
}
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2014-03-11 14:32:10 +01:00
|
|
|
void calculateSimpleScore();
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2014-03-11 14:32:10 +01:00
|
|
|
void calculateScore();
|
|
|
|
|
|
|
|
void addExampleInterval(int start, int end);
|
|
|
|
|
|
|
|
void addPatternInterval(int start, int end);
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2014-03-11 14:32:10 +01:00
|
|
|
private:
|
|
|
|
bool _alreadyIntersects(boost::ptr_vector<Interval> intervalList,
|
|
|
|
int start, int end);
|
2014-04-29 14:46:04 +02:00
|
|
|
|
2014-03-14 12:05:06 +01:00
|
|
|
double _getLogarithmicOverlay(boost::ptr_vector<Interval> intervalList,
|
|
|
|
unsigned char sentenceSize,
|
|
|
|
double k);
|
2014-03-11 14:32:10 +01:00
|
|
|
|
2014-04-29 14:46:04 +02:00
|
|
|
SUFFIX_MARKER_TYPE _exampleId;
|
|
|
|
|
|
|
|
boost::ptr_vector<Interval> _exampleMatchedRegions;
|
2014-03-11 14:32:10 +01:00
|
|
|
|
|
|
|
boost::ptr_vector<Interval> _patternMatchedRegions;
|
|
|
|
|
2014-04-29 14:46:04 +02:00
|
|
|
unsigned char _patternSize;
|
2014-03-11 14:32:10 +01:00
|
|
|
|
2014-04-29 14:46:04 +02:00
|
|
|
unsigned char _exampleSize;
|
2014-03-11 14:32:10 +01:00
|
|
|
|
2014-04-29 14:46:04 +02:00
|
|
|
double _score;
|
2014-03-11 14:32:10 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|