From ef8a3f6c3e20178ee520f1e6bedbc866e3c9b490 Mon Sep 17 00:00:00 2001 From: scratko Date: Sun, 3 Aug 2025 02:28:24 +0300 Subject: Initial commit: added source code, resources and README --- detectionalgorithm.h | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 detectionalgorithm.h (limited to 'detectionalgorithm.h') diff --git a/detectionalgorithm.h b/detectionalgorithm.h new file mode 100755 index 0000000..ac1ec58 --- /dev/null +++ b/detectionalgorithm.h @@ -0,0 +1,63 @@ +#ifndef DETECTIONALGORITHM_H +#define DETECTIONALGORITHM_H +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_LOCALE_HIDE_AUTO_PTR +#define BOOST_BIND_NO_PLACEHOLDERS +#pragma push_macro("slots") +#undef slots +#include +#include +#pragma pop_macro("slots") + +class DetectionAlgorithm : public QObject +{ + Q_OBJECT +public: + //DetectionAlgorithm(int chunk_size = 1000, int n_gram = 5, const std::string& d = nullptr); + DetectionAlgorithm(); + ~DetectionAlgorithm(){ } + void setOptions(int chunk = 1000, int n_g = 5, const std::string& d = nullptr, int select = 0); +private: + const static int T = 10, NUMBER_OF_GROUPS = 10; + int chunk_size, n_gram; + std::string target_doc; + std::vector robot_docs; + std::vector robot_chunks_count; + int human_chunks_count; + std::vector> robot_chunks; + std::vector human_chunks; + int total_robot_chunks; + std::vector real_lable; + std::string doc; + std::vector dictionary; + std::vector>>freq_of_robot_ngramm; + std::vector>freq_of_human_ngramm; + std::vector> dzv; + int selection_alg; +signals: + void value(int); + void run_chart(QList, QList, QList, QList); + void run_result(int, int); + void terminate(); +public slots: + void run_algorithm(); +}; + +#endif // DETECTIONALGORITHM_H -- cgit v1.2.3