|
|
|
@ -1,29 +1,4 @@
|
|
|
|
|
// Learn more about F# at http://fsharp.org |
|
|
|
|
// See the 'F# Tutorial' project for more help. |
|
|
|
|
|
|
|
|
|
#load "FileProcessing.fs" |
|
|
|
|
#load "TextProcessing.fs" |
|
|
|
|
#load "MapProcessing.fs" |
|
|
|
|
#load "CoOrdinator.fs" |
|
|
|
|
|
|
|
|
|
open FileProcessing |
|
|
|
|
open TextProcessing |
|
|
|
|
open MapProcessing |
|
|
|
|
open CoOrdinator |
|
|
|
|
|
|
|
|
|
IsStartOfSentence "bob" |
|
|
|
|
IsEndOfSentence "bill." |
|
|
|
|
|
|
|
|
|
let text = SelectRandomSampleFile |> LoadFile |
|
|
|
|
let wordGroups = GetWordPairs 4 text |
|
|
|
|
//let wordGroups = GetWordPairs (PickRandomNumber 13) text |
|
|
|
|
let map = BuildMarkovMap wordGroups |
|
|
|
|
let startWords = SeperateStartWords map |
|
|
|
|
//let temp = snd startWords |
|
|
|
|
let count = Map.count startWords |
|
|
|
|
let random = PickRandomNumber (Map.count startWords) |
|
|
|
|
let start = (GetRandomWord startWords).Key |
|
|
|
|
let sent = |
|
|
|
|
GenerateSentences 3 start map |
|
|
|
|
|> JoinWords// <---- You are up to here.... |
|
|
|
|
printfn "The result: %s" sent |
|
|
|
|