Browse Source

Added TextContainsValidEndToken function.

Addes code to script.fsx to play with these bits.
master
Craig Oates 6 years ago
parent
commit
9db59aadbf
  1. 14
      WetPancake/DataServices.fs
  2. 6
      WetPancake/Script.fsx

14
WetPancake/DataServices.fs

@ -94,4 +94,16 @@
|> ConcatToString
|> ReplaceArtifact " "
|> TrimEnd [|' '|]
let TextContainsValidEndToken (text: string) =
let result = text.Contains "." || text.Contains"!" || text.Contains "?"
match result with
| true -> true
| false -> failwith "The text does not contain a valid end token ('.', '!' and/or '?')."
(*
match text with
| text when (text.Contains".") -> true
| text.Contains "!" -> true
| text.Contains "?" -> true
| _ -> failwith "The text does not contain a valid end token ('.', '!' and/or '?')."
*)

6
WetPancake/Script.fsx

@ -160,6 +160,12 @@ let dss_clean =
|> RemoveArtefactSentences 6 // Change the no. of sentences to test.
printfn "CLEANED TEXT: %s" dss_clean
let dss_sentences3 = "This is a test setence?"
let dss_validEndToken () =
let result = TextContainsValidEndToken dss_sentences3
result
printfn "Valid End Token: %b" (dss_validEndToken())
// Product Services (Pancake)
let ps_files = Pancake.RequestAllTemplateFilesAsync ()

Loading…
Cancel
Save