70 lines
1.4 KiB
C++
70 lines
1.4 KiB
C++
#ifndef TOKEN_ANNOTATION_HDR
|
|
#define TOKEN_ANNOTATION_HDR
|
|
|
|
#include "concordia/common/config.hpp"
|
|
#include "concordia/interval.hpp"
|
|
|
|
#include <string>
|
|
|
|
/*!
|
|
Class representing annotation of char sequence as a token.
|
|
It is a type of interval that is also storing information
|
|
about the annoation type and value.
|
|
|
|
*/
|
|
|
|
class TokenAnnotation : public Interval {
|
|
public:
|
|
/*! Constructor.
|
|
\param start start index of the annotation (char-level, 0-based)
|
|
\param end end index of the annotation (char-level, 0-based)
|
|
\param annotationType annotation type
|
|
\param value annotation value
|
|
*/
|
|
TokenAnnotation(const SUFFIX_MARKER_TYPE start,
|
|
const SUFFIX_MARKER_TYPE end,
|
|
const int annotationType,
|
|
const std::string & value);
|
|
|
|
/*! Destructor.
|
|
*/
|
|
virtual ~TokenAnnotation();
|
|
|
|
/*! Getter for annotation type.
|
|
\returns annotation type
|
|
*/
|
|
int getType() const {
|
|
return _annotationType;
|
|
}
|
|
|
|
/*! Getter for annotation value.
|
|
\returns annotation value
|
|
*/
|
|
std::string getValue() const {
|
|
return _value;
|
|
}
|
|
|
|
/*! Named entity annotation type
|
|
*/
|
|
static int NE;
|
|
|
|
/*! Word annotation type
|
|
*/
|
|
static int WORD;
|
|
|
|
/*! Html tag annotation type
|
|
*/
|
|
static int HTML_TAG;
|
|
|
|
/*! Stop word annotation type
|
|
*/
|
|
static int STOP_WORD;
|
|
|
|
protected:
|
|
int _annotationType;
|
|
|
|
std::string _value;
|
|
};
|
|
|
|
#endif
|