The purpose of this repository is to provide a way for people to generate random "placeholder text" -- with a Markov Chain.
https://www.craigoates.net/Software/project/12
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
505 B
19 lines
505 B
module internal DataAccess |
|
|
|
open System |
|
open System.IO |
|
|
|
let CreateSampleTextFilesPath = __SOURCE_DIRECTORY__ + "\\TextFiles\\" |
|
|
|
let FindSampleTextFiles path = |
|
Directory.GetFiles(path, "*", SearchOption.TopDirectoryOnly) |
|
|
|
let ListSampleFiles = |
|
CreateSampleTextFilesPath |
|
|> FindSampleTextFiles |
|
|
|
let SelectRandomSampleFile() = |
|
let files = ListSampleFiles |
|
files.[Random().Next(0, files.Length)] |
|
|
|
let LoadFile path = File.ReadAllText(path) |