/* * encoder.cpp * * Created on: 2016/8/31 * Author: Tsukasa Fukunaga */ #include "encoder.h" void Encoder::Encode(vector &sequences, vector &encoded_sequences, int r){ for(int i = 0; i < sequences.size(); i++){ if(r == 0){ for(int j = 0; j(sequences[i][j])]); } }else{ for(int j = sequences[i].size()-1; j>= 0; j--){ encoded_sequences.push_back(_code_table[static_cast(sequences[i][j])]); } } encoded_sequences.push_back(_sentinel_character); } } void Encoder::Encode(string &sequence, vector &encoded_sequence, int r){ if(r == 0){ for(int i = 0; i(sequence[i])]); } }else{ for(int i = sequence.size()-1; i>= 0; i--){ encoded_sequence.push_back(_code_table[static_cast(sequence[i])]); } } encoded_sequence.push_back(_sentinel_character); }