Browse Source

Began cleaning up the duplicate code.

master
Craig Oates 6 years ago
parent
commit
1efe52c22a
  1. 15
      WetPancake/ProductServices.fs
  2. 4
      WetPancakeCLI/ConsoleCommands.cs

15
WetPancake/ProductServices.fs

@ -22,22 +22,7 @@ module Pancake =
|> SplitText @"\s+"
|> ConcatToString
// MOVE THIS INTO AN OBJECT (OF SORTS)
let RequestRandomText() =
let data =
LoadFile SelectRandomSampleFile
|> ReplaceArtifact "\""
|> ReplaceArtifact "\n\nIn"
|> ReplaceArtifact "\r"
|> ReplaceArtifact "\n"
|> SplitText @"\s+"
|> ConcatToString
|> SortIntoGroups (PickRandomNumber 10)
|> GenerateMap
GenerateMarkovText (PickRandomNumber 10) data
// MOVE THIS INTO AN OBJECT (OF SORTS)
let RequestRandomText2() =
let data2 =
LoadFile SelectRandomSampleFile
|> ApplyStandardSetup

4
WetPancakeCLI/ConsoleCommands.cs

@ -32,9 +32,7 @@ namespace WetPancakeCLI
[Usage("> GenerateRandomText")]
public static string GenerateRandomText()
{
// need to make new objects.
// the static class just hold onto the initial data generated.
var result = RequestRandomText2();
var result = RequestRandomText();
return result;
}

Loading…
Cancel
Save