QT Training page class.
More...
#include <Train.h>
|
| Train (QWidget *parent=Q_NULLPTR) |
|
QT Training page class.
Definition at line 15 of file Train.h.
◆ Train()
Markov::GUI::Train::Train |
( |
QWidget * |
parent = Q_NULLPTR | ) |
|
Definition at line 22 of file Train.cpp.
29 QObject::connect(
ui.pushButton, &QPushButton::clicked,
this, [
this] {train(); });
30 QObject::connect(
ui.pushButton_2, &QPushButton::clicked,
this, [
this] {home(); });
References ui.
◆ home
void Markov::GUI::Train::home |
( |
| ) |
|
|
slot |
◆ train
void Markov::GUI::Train::train |
( |
| ) |
|
|
slot |
Definition at line 38 of file Train.cpp.
42 QString file_name = QFileDialog::getOpenFileName(
this,
"Open a File", QDir::homePath());
43 QFile file(file_name);
45 if (!file.open(QFile::ReadOnly | QFile::Text)) {
46 QMessageBox::warning(
this,
"Error",
"File Not Open!");
48 QTextStream in(&file);
49 QString text = in.readAll();
50 ui.plainTextEdit->setPlainText(text);
54 std::string fname = file_name.toStdString();
55 cstr =
new char[fname.size() + 1];
56 strcpy(cstr, fname.c_str());
62 mp.Import(
"models/2gram.mdl");
63 mp.Train(cstr, a, 10);
64 mp.Export(
"models/finished.mdl");
66 ui.label_2->setText(
"Training DONE!");
Markov::Model with char represented nodes.
References Markov::API::MarkovPasswords::Train(), and ui.
Referenced by Python.Markopy.BaseCLI::process().
◆ ui
Ui::Train Markov::GUI::Train::ui |
|
private |
The documentation for this class was generated from the following files: