Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef LIBWCCL_VALUES_MATCHDATA_H
#define LIBWCCL_VALUES_MATCHDATA_H
#include <libwccl/values/position.h>
#include <libcorpus2/ann/annotatedsentence.h>
namespace Wccl {
/**
* Base abstract class for data held by a Match Value
* - VectorMatch, TokenMatch or AnnotationMatch.
* (empty VectorMatch should be default option)
*/
class MatchData// : boost::noncopyable
{
public:
/**
* Check if the match is empty (matches nothing). Match objects themselves
* are by definition empty, child classes are sometimes or always non-empty.
*/
virtual bool empty() const = 0;
/**
* Getter for the first token matched. If the match is empty, must return
* Nowhere.
*/
virtual Position first_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const = 0;
/**
* Getter for the last token matched. If the match is empty, must return
* Nowhere.
*/
virtual Position last_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const = 0;
boost::shared_ptr<MatchData> clone() const {
return boost::shared_ptr<MatchData>(clone_internal());
}
virtual std::string to_raw_string() const = 0;
protected:
virtual MatchData* clone_internal() const = 0;
};
}
#endif // LIBWCCL_VALUES_MATCHDATA_H