| 967 | } |
| 968 | |
| 969 | ColumnPtr generate(const IColumn & column) override |
| 970 | { |
| 971 | const ColumnString & column_string = assert_cast<const ColumnString &>(column); |
| 972 | size_t size = column_string.size(); |
| 973 | |
| 974 | auto res_column = ColumnString::create(); |
| 975 | res_column->reserve(size); |
| 976 | |
| 977 | std::string new_string; |
| 978 | for (size_t i = 0; i < size; ++i) |
| 979 | { |
| 980 | auto src_string = column_string.getDataAt(i); |
| 981 | size_t desired_string_size = transform(src_string.size(), seed); |
| 982 | new_string.resize(desired_string_size * 2); |
| 983 | |
| 984 | size_t actual_size = 0; |
| 985 | if (desired_string_size != 0) |
| 986 | actual_size = markov_model.generate(new_string.data(), desired_string_size, new_string.size(), seed, src_string.data(), src_string.size()); |
| 987 | |
| 988 | res_column->insertData(new_string.data(), actual_size); |
| 989 | } |
| 990 | |
| 991 | return res_column; |
| 992 | } |
| 993 | |
| 994 | void updateSeed() override |
| 995 | { |