|
|
|
@ -2,12 +2,13 @@
|
|
|
|
|
|
|
|
|
|
open System.Text.RegularExpressions |
|
|
|
|
open DataCleaning |
|
|
|
|
open System |
|
|
|
|
|
|
|
|
|
let MatchText pattern text = Regex.IsMatch(text, pattern) |
|
|
|
|
|
|
|
|
|
let ConcatToString words = String.concat " " words |
|
|
|
|
|
|
|
|
|
let SortIntoWordPairs pairSize text = |
|
|
|
|
let SortIntoPairs pairSize text = |
|
|
|
|
SplitText @"\s+" text // Splits text where there is a space. |
|
|
|
|
|> Seq.windowed pairSize |
|
|
|
|
|
|
|
|
@ -17,4 +18,9 @@
|
|
|
|
|
words |
|
|
|
|
|> Seq.take (length - 1) |
|
|
|
|
|> ConcatToString |
|
|
|
|
(start, words.[length - 1]) |
|
|
|
|
(start, words.[length - 1]) |
|
|
|
|
|
|
|
|
|
let CombineWords prev next = |
|
|
|
|
[prev; next] |
|
|
|
|
|> List.filter(fun s -> not (String.IsNullOrWhiteSpace s)) |
|
|
|
|
|> ConcatToString |