Browse Source

Left notes for next session.

Removed dead code from script file.
master
Craig Oates 6 years ago
parent
commit
36ea86a57e
  1. 4
      WetPancake/ProductServices.fs
  2. 21
      WetPancake/Script.fsx
  3. 2
      WetPancakeCLI/ConsoleCommands.cs

4
WetPancake/ProductServices.fs

@ -33,6 +33,10 @@ module Pancake =
|> GenerateMap
GenerateMarkovText sentences data
// Add Checks to make sure the client is passing in a .txt file?
// Leave for the client to check?
// Give the client a function to check (and throw) if not handed a .txt file?
(* Should the library provide list of the available default txt files?
By doing so, the user can specify a particular file from the list available.

21
WetPancake/Script.fsx

@ -28,18 +28,6 @@ let ss_items2 =
let items = seq { for i in 0 .. 0 -> "." }
printfn "ss_items2 length is %i" (Seq.length items)
PickRandomItem items
(*
This is throwing errors so leaving as a comment for the moment.
let ss_items3 =
let items =
[ "Key 1", ["Value 1-1"; "Value 1-2"];
"Key 2", ["Value 2-1"; "Value 2-2"];
"Key 3", ["Value 3-1"; "Value 3-2"]; ]
|> Map.ofList
printfn "ss_items3 count is %i" items.Count
let result = PickStartWords items
printfn "ss_items3 final result is %s" result
*)
// Data Access
let da_sampleFilePath = CreateSampleTextFilesPath
@ -130,12 +118,9 @@ let dss_text =
|> ApplyStandardSetup
|> SortIntoGroups 2
|> GenerateMap
//let dss_startwords = SeperateStartWords dss_text
//let dss_sentences = GenerateMarkovText 2 dss_text
//printfn "Text: %A" dss_sentences
let dss_sentences2 = GenerateMarkovTextTesting 2 dss_text
printfn "Text: %A" dss_sentences2
let dss_startwords = SeperateStartWords dss_text
let dss_sentences = GenerateMarkovText 2 dss_text
printfn "Text: %A" dss_sentences
// (WetPancake) Pancake

2
WetPancakeCLI/ConsoleCommands.cs

@ -59,12 +59,14 @@ namespace WetPancakeCLI
}
}
// YOU ARE WORKING IN HERE... (0.5-P1)
[ListCommand]
[Description("Loads the specified .txt file and generates text based on it using the gibberish level and number of sentences specified by the user. Gibberish level must be greater the 1.")]
[Parameters("gibberish level: int, sentences: int, file path: string")]
[Usage("> RequestTextFromFile 3 6 C:/yourfile.txt")]
public static string GenerateTextFromFile(int gibberishLevel, int sentences, string filePath)
{
// Could do with checking if the file type is .txt...
if (gibberishLevel < 2) return "Please enter a gibberish level greater than 1.";
try
{ return RequestTextFromFile(gibberishLevel, sentences, filePath); }

Loading…
Cancel
Save