| 846 | } |
| 847 | |
| 848 | ColumnPtr generate(const IColumn & column) override |
| 849 | { |
| 850 | const ColumnString & column_string = assert_cast<const ColumnString &>(column); |
| 851 | size_t size = column_string.size(); |
| 852 | |
| 853 | auto res_column = ColumnString::create(); |
| 854 | res_column->reserve(size); |
| 855 | |
| 856 | std::string new_string; |
| 857 | for (size_t i = 0; i < size; ++i) |
| 858 | { |
| 859 | StringRef src_string = column_string.getDataAt(i); |
| 860 | size_t desired_string_size = transform(src_string.size, seed); |
| 861 | new_string.resize(desired_string_size * 2); |
| 862 | |
| 863 | size_t actual_size = 0; |
| 864 | if (desired_string_size != 0) |
| 865 | actual_size = markov_model.generate(new_string.data(), desired_string_size, new_string.size(), seed, src_string.data, src_string.size); |
| 866 | |
| 867 | res_column->insertData(new_string.data(), actual_size); |
| 868 | } |
| 869 | |
| 870 | return res_column; |
| 871 | } |
| 872 | |
| 873 | void updateSeed() override |
| 874 | { |