#ifndef REGEX_ANNOTATION_HDR #define REGEX_ANNOTATION_HDR #include #include "concordia/common/config.hpp" #include "concordia/anonymized_sentence.hpp" #include "concordia/concordia_exception.hpp" #include #include #include #include typedef boost::error_info my_tag_error_info; /*! Class for representing a regular expression annotation rule. Holds regex pattern string for matching and replacement string for annotating found matches. */ class RegexRule { public: /*! Constructor. \param patternString regex pattern to match \param replacement string to substitute the found match \param caseSensitive case sensitivity of the pattern */ RegexRule(std::string patternString, std::string value, bool caseSensitive = true) throw(ConcordiaException); /*! Destructor. */ virtual ~RegexRule(); /*! Applies the operation on anonymized sentence. \param sentence the input sentence */ void apply(boost::shared_ptr sentence); private: boost::u32regex _pattern; std::string _value; }; #endif