Craig Oates
6 years ago
7 changed files with 38 additions and 15 deletions
@ -1,11 +0,0 @@
|
||||
module internal Assistants |
||||
|
||||
open System |
||||
open System.IO |
||||
open System.Text.RegularExpressions |
||||
|
||||
let CountSampleTextFiles = |
||||
let path = __SOURCE_DIRECTORY__ + "\TextFiles" |
||||
Directory.GetFiles(path, ".txt", SearchOption.TopDirectoryOnly).Length |
||||
|
||||
let MakeTestPath = "" |
@ -0,0 +1,25 @@
|
||||
module internal FileProcessing |
||||
|
||||
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) |
||||
.Replace("\"", " ") |
||||
.Replace("\n\nIn", " ") |
||||
.Replace("\r", " ") |
||||
.Replace("\n", " ") |
||||
.Replace(" ", " ") |
@ -0,0 +1,3 @@
|
||||
module internal TextProcessing |
||||
|
||||
open FileProcessing |
Loading…
Reference in new issue