Output time to stderr
This commit is contained in:
parent
b2bfa0c6e4
commit
e7f67d7f5e
1 changed files with 5 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
|
@ -54,10 +55,12 @@ namespace MarkovGrams
|
|||
words = File.ReadLines(wordlistFilename).SelectMany(word => word.Trim().Split(' '));
|
||||
ngrams = NGrams.GenerateFlat(words, order);
|
||||
|
||||
Stopwatch utimer = Stopwatch.StartNew();
|
||||
UnweightedMarkovChain chain = new UnweightedMarkovChain(ngrams);
|
||||
|
||||
for(int i = 0; i < count; i++)
|
||||
Console.WriteLine(chain.Generate(desiredStringLength));
|
||||
Console.Error.WriteLine($"{count} words in {utimer.ElapsedMilliseconds}ms");
|
||||
break;
|
||||
|
||||
case "markov-w":
|
||||
|
@ -81,10 +84,12 @@ namespace MarkovGrams
|
|||
words = File.ReadLines(wordlistFilename).SelectMany(word => word.Trim().Split(' '));
|
||||
ngrams = NGrams.GenerateFlat(words, order);
|
||||
|
||||
Stopwatch wtimer = Stopwatch.StartNew();
|
||||
WeightedMarkovChain weightedChain = new WeightedMarkovChain(ngrams);
|
||||
|
||||
for (int i = 0; i < weightedCount; i++)
|
||||
Console.WriteLine(weightedChain.Generate(weightedDesiredStringLength));
|
||||
Console.Error.WriteLine($"{weightedCount} words in {wtimer.ElapsedMilliseconds}ms");
|
||||
break;
|
||||
|
||||
case "ngrams":
|
||||
|
|
Loading…
Reference in a new issue