diff --git a/WetPancake/DataServices.fs b/WetPancake/DataServices.fs index a18695f..73dfb3d 100644 --- a/WetPancake/DataServices.fs +++ b/WetPancake/DataServices.fs @@ -94,4 +94,16 @@ |> ConcatToString |> ReplaceArtifact " " |> TrimEnd [|' '|] - \ No newline at end of file + + 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 '?')." + *) diff --git a/WetPancake/Script.fsx b/WetPancake/Script.fsx index 4e0c751..e874ed0 100644 --- a/WetPancake/Script.fsx +++ b/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 ()