Concordia
regex_rule.hpp
1 #ifndef REGEX_ANNOTATION_HDR
2 #define REGEX_ANNOTATION_HDR
3 
4 #include <string>
5 #include "concordia/common/config.hpp"
6 #include "concordia/tokenized_sentence.hpp"
7 #include "concordia/concordia_exception.hpp"
8 #include <boost/shared_ptr.hpp>
9 #include <boost/regex.hpp>
10 #include <boost/regex/icu.hpp>
11 #include <unicode/unistr.h>
12 
13 
14 typedef boost::error_info<struct my_tag, std::string> my_tag_error_info;
15 
23 class RegexRule {
24 public:
32  RegexRule(std::string patternString,
33  int annotationType,
34  std::string value,
35  bool caseSensitive = true)
36  throw(ConcordiaException);
37 
40  virtual ~RegexRule();
41 
45  void apply(TokenizedSentence & sentence);
46 
47 private:
48  int _annotationType;
49 
50  std::string _value;
51 
52  boost::u32regex _pattern;
53 };
54 
55 #endif
Definition: concordia_exception.hpp:11
RegexRule(std::string patternString, int annotationType, std::string value, bool caseSensitive=true)
Definition: regex_rule.cpp:8
Definition: regex_rule.hpp:23
virtual ~RegexRule()
Definition: regex_rule.cpp:37
Definition: tokenized_sentence.hpp:26
void apply(TokenizedSentence &sentence)
Definition: regex_rule.cpp:40