31 #ifndef MODULE_ANALYZER_ALGO_TERMSOVERTIME_HPP_ 32 #define MODULE_ANALYZER_ALGO_TERMSOVERTIME_HPP_ 34 #include "../Thread.hpp" 36 #include "../../../Data/Corpus.hpp" 37 #include "../../../Helper/Memory.hpp" 38 #include "../../../Main/Database.hpp" 39 #include "../../../Struct/StatusSetter.hpp" 40 #include "../../../Struct/ThreadOptions.hpp" 41 #include "../../../Struct/ThreadStatus.hpp" 46 #include <string_view> 47 #include <unordered_map> 71 using DateOccurrences = std::unordered_map<std::string, std::uint64_t>;
72 using DateArticlesOccurrences = std::unordered_map<std::string, DateOccurrences>;
92 std::string_view
getName()
const override;
122 bool firstTick{
true};
125 std::vector<DateArticlesOccurrences> dateCounts;
void onAlgoClear() override
Does nothing.
Definition: TermsOverTime.cpp:179
TermsOverTime(Main::Database &dbBase, const ThreadOptions &threadOptions, const ThreadStatus &threadStatus)
Continues a previously interrupted algorithm run.
Definition: TermsOverTime.cpp:43
void onAlgoUnpause() override
Does nothing.
Definition: TermsOverTime.cpp:176
Namespace for algorithm classes.
Definition: All.cpp:52
void parseAlgoOption() override
Parses a configuration option for the algorithm.
Definition: TermsOverTime.cpp:186
void checkAlgoOptions() override
Does nothing.
Definition: TermsOverTime.cpp:195
std::string_view getName() const override
Returns the name of the algorithm.
Definition: TermsOverTime.cpp:75
Abstract class providing thread functionality to algorithm (child) classes.
Definition: Thread.hpp:84
Thread status containing its ID, status message, pause state, and progress.
Definition: ThreadStatus.hpp:54
Thread options containing the name of the module run, as well as the IDs of the website, URL list, and configuration used.
Definition: ThreadOptions.hpp:40
void onAlgoInitTarget() override
Initializes the target table for the algorithm.
Definition: TermsOverTime.cpp:89
Class handling database access for the command-and-control and its threads.
Definition: Database.hpp:366
Type
Data types.
Definition: Data.hpp:66
Class for analyzer exceptions to be used by algorithms.
Definition: Thread.hpp:242
void onAlgoPause() override
Does nothing.
Definition: TermsOverTime.cpp:173
Structure containing all the data needed to keep the status of a thread updated.
Definition: StatusSetter.hpp:57
void onAlgoTick() override
Counts the terms in the text corpus.
Definition: TermsOverTime.cpp:159
void onAlgoInit() override
Generates the corpus.
Definition: TermsOverTime.cpp:102
A generic value.
Definition: Data.hpp:96
Algorithm counting specific terms in a text corpus over time.
Definition: TermsOverTime.hpp:60
void resetAlgo() override
Resets the algorithm.
Definition: TermsOverTime.cpp:203