Files
Rbm/source/RnnTextHelper.hpp
T
jens cb066a5a5f - use RnnTextHelper
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@837 b431acfa-c32f-4a4a-93f1-934dc6c82436
2022-01-18 20:14:56 +00:00

42 lines
860 B
C++

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: RnnTextHelper.hpp
* Author: jens
*
* Created on 18. Januar 2022, 19:12
*/
#ifndef RNNTEXTHELPER_HPP
#define RNNTEXTHELPER_HPP
#include <armadillo>
class RnnTextHelper
{
public:
RnnTextHelper();
RnnTextHelper(const RnnTextHelper& orig) = delete;
virtual ~RnnTextHelper();
const char punctuation[5] = {' ', '.', '!', '?', 0};
static constexpr int NUM_CODES = 1 + 26 + 10;
static constexpr int SEQ_LENGTH = 2;
static int char_is(char c, const char *pTable);
static int ch2idx(char c);
static char idx2ch(int index);
static arma::mat createTraining(const std::string &filename, size_t seq_len);
private:
};
#endif /* RNNTEXTHELPER_HPP */