static void GenMarkov(string from, string to) { var markov = new NodeChain(); int x = 0; from .LoadAneksWithLemmas() .ForEach(a => { Console.WriteLine(x++); for (var i = 0; i < a.Like / 10 + 1; i++) { markov.ParseSentence(SentenceParser.ParseText(a.Text)); } }); File.WriteAllText(to, JsonSerializer.Serialize(markov)); }
public NodeChainOptimized(NodeChain nc) { original = nc; Keys = nc.Nodes.Keys.OrderBy(s => s).ToArray(); Values = Keys.Select(k => nc.Nodes[k]).ToArray(); }