Browse Source
They have produced good results in unit tests and clean enough to be used in the property tests, hence the moving out.master
Craig Oates
6 years ago
3 changed files with 19 additions and 23 deletions
@ -0,0 +1,17 @@
|
||||
module Helpers |
||||
|
||||
open System.Text.RegularExpressions |
||||
|
||||
let countSentences text = |
||||
let count = |
||||
Regex.Split(text, @"(?<=[\.\!\?]\s)") |
||||
|> Array.length |
||||
count |
||||
|
||||
let endsAsIntended (text: string) = |
||||
match text.Chars (text.Length - 1) with |
||||
| '.' -> true |
||||
| '!' -> true |
||||
| '?' -> true |
||||
| _ -> false |
||||
|
Loading…
Reference in new issue