The Battle for Wesnoth  1.19.0-dev
markov_generator.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2024
3  by David White <dave@whitevine.net>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
18 #include "utils/name_generator.hpp"
19 #include <map>
20 #include <vector>
21 
22 typedef std::map<std::u32string, std::u32string> markov_prefix_map;
23 
26  std::size_t chain_size_, max_len_;
27 public:
28  markov_generator(const std::vector<std::string>& items, std::size_t chain_size, std::size_t max_len);
29  std::string generate() const override;
30 };
markov_generator(const std::vector< std::string > &items, std::size_t chain_size, std::size_t max_len)
markov_prefix_map prefixes_
std::size_t chain_size_
std::string generate() const override
std::map< std::u32string, std::u32string > markov_prefix_map
const std::vector< std::string > items