diff --git a/source/poet.cpp b/source/poet.cpp index 1e6f5a2..3d7fad2 100644 --- a/source/poet.cpp +++ b/source/poet.cpp @@ -16,6 +16,8 @@ using namespace std; using namespace arma; +static const char *DEFAULT_START_WORD = "CHAP"; + class RbmListener : public Rbm::IListener { public: @@ -40,7 +42,7 @@ class RbmListener : public Rbm::IListener std::cout << "L1 = " << status.L1 << std::endl; std::cout << "L2 = " << status.L2 << std::endl; m_last_progress = status.progress; - forward("Chap"); + forward(DEFAULT_START_WORD); } return true; @@ -157,7 +159,12 @@ int main(int argc, char *argv[]) if (command == Command::Forward) { - char *start = argv[2]; + std::string start(DEFAULT_START_WORD); + + if (argv[2] != nullptr) + { + start = std::string(argv[2]); + } listener.forward(start); } printf("\nEnd of program\n");