#ifndef TOKENIZED_SENTENCE_HDR #define TOKENIZED_SENTENCE_HDR #include "concordia/common/config.hpp" #include "concordia/token_annotation.hpp" #include "concordia/word_map.hpp" #include #include #include #include /*! A sentence after anonymization operations. The class holds the current string represenation of the sentence along with the annotations list. */ class TokenizedSentence { public: /*! Constructor. */ TokenizedSentence(std::string sentence); /*! Destructor. */ virtual ~TokenizedSentence(); /*! Getter for sentence \returns sentence */ std::string getSentence() const { return _sentence; } /*! Getter for annotations list \returns annotations list */ std::list getAnnotations() const { return _tokenAnnotations; } std::vector getCodes() const { return _codes; } std::vector getTokens() const { return _tokens; } void generateHash(boost::shared_ptr wordMap); /*! Transform the sentence to lower case. */ void toLowerCase(); /*! Add new annotations to the existing annotations list. Assumptions: 1. existing _tokenAnnotations vector contains disjoint, sorted intervals; 2. the annotations to be added list also has the above properties. The below algorithm will only add the annotations that do not intersect with any of the existing ones. \param annotations list of annotations to be added */ void addAnnotations(std::vector annotations); private: std::string _sentence; std::list _tokenAnnotations; std::vector _codes; std::vector _tokens; }; #endif