repaired tm matches

Former-commit-id: ee2e73ab1e37db051b8be36b97bc503241c798c0
This commit is contained in:
rjawor 2015-04-15 11:50:59 +02:00
parent 3a03b01f42
commit a09999c130
3 changed files with 23 additions and 17 deletions

View File

@ -19,10 +19,10 @@ IN PROGRESS 2. Wykonać anubis search na nowych markerach z długością zdania
zastanowić się nad optymalizacją: zastanowić się nad optymalizacją:
- tmMatchesMap jako normalna mapa (nie ptr_map) REJECTED - tmMatchesMap jako normalna mapa (nie ptr_map)
- REJECTED LCP array REJECTED - LCP array
- !important! rezygnacja z ptr_vector DONE - !important! rezygnacja z ptr_vector
- zwracanie wektorów DONE - zwracanie wektorów
- powyrzucać using namespace std - powyrzucać using namespace std
- profiling - profiling

View File

@ -2,13 +2,16 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <math.h> #include <math.h>
TmMatches::TmMatches() {
}
TmMatches::TmMatches(const SUFFIX_MARKER_TYPE exampleId, TmMatches::TmMatches(const SUFFIX_MARKER_TYPE exampleId,
const unsigned char exampleSize, const SUFFIX_MARKER_TYPE exampleSize,
const unsigned char patternSize): const SUFFIX_MARKER_TYPE patternSize):
_exampleId(exampleId), _exampleId(exampleId),
_exampleSize(exampleSize), _exampleSize(exampleSize),
_patternSize(patternSize), _patternSize(patternSize),
_score(0) { _score(0) {
} }
TmMatches::~TmMatches() { TmMatches::~TmMatches() {
@ -64,7 +67,7 @@ bool TmMatches::_alreadyIntersects(
double TmMatches::_getLogarithmicOverlay( double TmMatches::_getLogarithmicOverlay(
const vector<Interval> & intervalList, const vector<Interval> & intervalList,
unsigned char sentenceSize, SUFFIX_MARKER_TYPE sentenceSize,
double k) { double k) {
double overlayScore = 0; double overlayScore = 0;
BOOST_FOREACH(Interval interval, intervalList) { BOOST_FOREACH(Interval interval, intervalList) {

View File

@ -3,6 +3,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <map>
#include "concordia/common/config.hpp" #include "concordia/common/config.hpp"
#include "concordia/interval.hpp" #include "concordia/interval.hpp"
#include <boost/ptr_container/ptr_map.hpp> #include <boost/ptr_container/ptr_map.hpp>
@ -17,9 +18,11 @@ using namespace std;
class TmMatches { class TmMatches {
public: public:
explicit TmMatches(const SUFFIX_MARKER_TYPE exampleId, TmMatches();
const unsigned char exampleSize,
const unsigned char patternSize); TmMatches(const SUFFIX_MARKER_TYPE exampleId,
const SUFFIX_MARKER_TYPE exampleSize,
const SUFFIX_MARKER_TYPE patternSize);
/*! Destructor. /*! Destructor.
*/ */
@ -54,7 +57,7 @@ private:
int start, int end); int start, int end);
double _getLogarithmicOverlay(const vector<Interval> & intervalList, double _getLogarithmicOverlay(const vector<Interval> & intervalList,
unsigned char sentenceSize, SUFFIX_MARKER_TYPE sentenceSize,
double k); double k);
SUFFIX_MARKER_TYPE _exampleId; SUFFIX_MARKER_TYPE _exampleId;
@ -63,9 +66,9 @@ private:
vector<Interval> _patternMatchedRegions; vector<Interval> _patternMatchedRegions;
unsigned char _patternSize; SUFFIX_MARKER_TYPE _patternSize;
unsigned char _exampleSize; SUFFIX_MARKER_TYPE _exampleSize;
double _score; double _score;
}; };