Browse Source

Can generate sentences but it the same one over and over again.

The total sentence count is specified in the GenerateSentences function.
master
Craig Oates 6 years ago
parent
commit
65807d9fb5
  1. 4
      WetPancake/CoOrdinator.fs
  2. 7
      WetPancake/MapProcessing.fs
  3. 5
      WetPancake/Script.fsx

4
WetPancake/CoOrdinator.fs

@ -10,7 +10,9 @@
let map = BuildMarkovMap wordGroups
let startWords = SeperateStartWords map
let start = (GetRandomWord startWords).Key
let sent = GetMarkovSentence start // <---- You are up to here....
let sent =
GenerateSentences 10 start map
|> JoinWords// <---- You are up to here....
0
let GenerateText gibberishLevel sentences = 0

7
WetPancake/MapProcessing.fs

@ -23,4 +23,9 @@
let GetMarkovSentence startWords map =
MarkovChain startWords map [startWords]
|> List.rev
|> JoinWords
|> JoinWords
let GenerateSentences sentenceCount words map =
seq {
for i in 0 .. sentenceCount do
yield GetMarkovSentence words map }

5
WetPancake/Script.fsx

@ -23,4 +23,7 @@ let startWords = SeperateStartWords map
let count = Map.count startWords
let random = PickRandomNumber (Map.count startWords)
let start = (GetRandomWord startWords).Key
let sent = GetMarkovSentence start
let sent =
GenerateSentences 3 start map
|> JoinWords// <---- You are up to here....
printfn "The result: %s" sent

Loading…
Cancel
Save