|
crawlserv++
[under development]
Application for crawling and analyzing textual content of websites.
|
Text map entry. More...
#include <TextMap.hpp>
Properties | |
| std::size_t | p {} |
| The position of the annotated part inside the text. More... | |
| std::size_t | l {} |
| The length of the annotated part inside the text. More... | |
| std::string | value |
| Value of the annotation. More... | |
Construction | |
| TextMapEntry ()=default | |
| Default constructor. More... | |
| TextMapEntry (std::size_t setPos, std::size_t setLength) | |
| Constructor creating an empty annotation. More... | |
| TextMapEntry (std::size_t setPos, std::size_t setLength, const std::string &setValue) | |
| Constructor creating a non-empty annotation. More... | |
Swap | |
| void | swap (TextMapEntry &other) |
| Swaps the text map entry with another. More... | |
Cleanup | |
| void | free () |
| Resets its properties to their default values and frees the memory used by the entry. More... | |
String Conversion | |
| std::string | str () const |
| Converts the text map entry into a string. More... | |
Static Access Functions | |
| static std::size_t & | pos (TextMapEntry &entry) |
| Gets a reference to the position of a text map entry. More... | |
| static std::size_t & | pos (std::pair< std::size_t, std::size_t > &entry) |
| Gets a reference to the position of a sentence map entry. More... | |
| static std::size_t | pos (const TextMapEntry &entry) |
| Gets the position of a text map entry. More... | |
| static std::size_t | pos (const std::pair< std::size_t, std::size_t > &entry) |
| Gets the position of a sentence map entry. More... | |
| template<typename T > | |
| static std::size_t | end (const T &entry) |
| Gets the end of a map entry. More... | |
| static std::size_t & | length (TextMapEntry &entry) |
| Gets a reference to the length of a text map entry. More... | |
| static std::size_t & | length (std::pair< std::size_t, std::size_t > &entry) |
| Gets a reference to the length of a sentence map entry. More... | |
| static std::size_t | length (const TextMapEntry &entry) |
| Gets the length of a text map entry. More... | |
| static std::size_t | length (const std::pair< std::size_t, std::size_t > &entry) |
| Gets the length of a sentence map entry. More... | |
Text map entry.
A text map entry annotates one part of a text, defined by its position and length, with a string value.
|
default |
Default constructor.
|
inline |
Constructor creating an empty annotation.
| setPos | The position of the annotated part of the text, starting with zero at the beginning of the text. |
| setLength | The length of the annotated part of the text. |
|
inline |
Constructor creating a non-empty annotation.
| setPos | The position of the annotated part of the text, starting with zero at the beginning of the text. |
| setLength | The length of the annotated part of the text. |
| setValue | Const reference to a string containing the value of the annotation. |
|
inlinestatic |
Gets the end of a map entry.
| entry | Constant reference to the map entry to get the end of. |
References length(), and pos().
Referenced by crawlservpp::Data::Corpus::clear(), crawlservpp::Data::Corpus::combineTokenized(), crawlservpp::Data::Corpus::copyChunksContinuous(), crawlservpp::Data::Corpus::filterArticles(), crawlservpp::Data::Corpus::filterByDate(), crawlservpp::Data::Corpus::getArticles(), crawlservpp::Data::Corpus::getTokenized(), crawlservpp::Module::Analyzer::Algo::CorpusGenerator::resetAlgo(), crawlservpp::Module::Analyzer::Algo::WordsOverTime::resetAlgo(), crawlservpp::Module::Analyzer::Algo::Assoc::resetAlgo(), crawlservpp::Module::Analyzer::Algo::AssocOverTime::resetAlgo(), crawlservpp::Module::Analyzer::Algo::AllTokens::resetAlgo(), and crawlservpp::Module::Analyzer::Algo::SentimentOverTime::resetAlgo().
|
inline |
Resets its properties to their default values and frees the memory used by the entry.
References crawlservpp::Helper::Memory::free(), l, and p.
|
inlinestatic |
Gets a reference to the length of a text map entry.
| entry | Reference to the text map entry to get the length of. |
References l.
Referenced by crawlservpp::Data::Corpus::clear(), crawlservpp::Data::Corpus::combineContinuous(), crawlservpp::Data::Corpus::combineTokenized(), crawlservpp::Data::Corpus::copyChunksContinuous(), end(), crawlservpp::Data::Corpus::get(), crawlservpp::Data::Corpus::getArticles(), crawlservpp::Data::Corpus::getTokenized(), crawlservpp::Module::Analyzer::Algo::Assoc::resetAlgo(), crawlservpp::Module::Analyzer::Algo::AssocOverTime::resetAlgo(), crawlservpp::Module::Analyzer::Algo::SentimentOverTime::resetAlgo(), and crawlservpp::Module::Analyzer::Algo::TopicModelling::resetAlgo().
|
inlinestatic |
Gets a reference to the length of a sentence map entry.
| entry | Reference to the sentence map entry to get the length of. |
|
inlinestatic |
Gets the length of a text map entry.
| entry | Constant reference to the text map entry to get the length of. |
References l.
|
inlinestatic |
Gets the length of a sentence map entry.
| entry | Constant reference to the sentence map entry to get the length of. |
|
inlinestatic |
Gets a reference to the position of a text map entry.
| entry | Reference to the text map entry to get the position of. |
References p.
Referenced by crawlservpp::Data::Corpus::clear(), crawlservpp::Data::Corpus::combineContinuous(), crawlservpp::Data::Corpus::combineTokenized(), end(), crawlservpp::Data::Corpus::filterArticles(), crawlservpp::Data::Corpus::filterByDate(), crawlservpp::Data::Corpus::get(), crawlservpp::Data::Corpus::getArticles(), crawlservpp::Data::Corpus::getTokenized(), crawlservpp::Module::Analyzer::Algo::WordsOverTime::resetAlgo(), crawlservpp::Module::Analyzer::Algo::Assoc::resetAlgo(), crawlservpp::Module::Analyzer::Algo::AssocOverTime::resetAlgo(), crawlservpp::Module::Analyzer::Algo::AllTokens::resetAlgo(), crawlservpp::Module::Analyzer::Algo::SentimentOverTime::resetAlgo(), and crawlservpp::Module::Analyzer::Algo::TopicModelling::resetAlgo().
|
inlinestatic |
Gets a reference to the position of a sentence map entry.
| entry | Reference to the sentence map entry to get the position of. |
|
inlinestatic |
Gets the position of a text map entry.
| entry | Constant reference to the text map entry to get the position of. |
References p.
|
inlinestatic |
Gets the position of a sentence map entry.
| entry | Constant reference to the sentence map entry to get the position of. |
|
inline |
|
inline |
Swaps the text map entry with another.
| other | Reference to the other text map entry to be swapped with. |
| std::size_t crawlservpp::Struct::TextMapEntry::l {} |
| std::size_t crawlservpp::Struct::TextMapEntry::p {} |
| std::string crawlservpp::Struct::TextMapEntry::value |
Value of the annotation.
For example, an article ID or a date for an entry of the article or date map belonging to a text corpus.
Referenced by crawlservpp::Data::Corpus::clear(), crawlservpp::Data::Corpus::create(), crawlservpp::Module::Analyzer::Algo::Assoc::resetAlgo(), crawlservpp::Module::Analyzer::Algo::AssocOverTime::resetAlgo(), crawlservpp::Module::Analyzer::Algo::AllTokens::resetAlgo(), and str().