This commit is contained in:
DavidOnTop 2025-03-27 12:16:29 +01:00
parent 828ce0a5c5
commit 54c026202d
Signed by: DavidOnTop
GPG key ID: 8D3E9A75E3E13D89
3 changed files with 28 additions and 0 deletions

1
slova.txt Normal file
View file

@ -0,0 +1 @@
Kde sa vzalo, tu sa vzalo, vo dvore vám zrazu stálo. Biele cudo, aká veda, spávat veru už mi nedá. A ty, chasník, cože kukáš? A ci nevieš, kto som ja? V snehu oci ako z pece, nos cervený, tucné líce.

26
ulohyfs/src/u30.fs Normal file
View file

@ -0,0 +1,26 @@
module UlohyFs.u30
open System.IO
open System.Text.RegularExpressions
open System.Text.Unicode
open UlohyFs.Attributes
open System
let (./.) l r = $"{l}{Path.PathSeparator}{r}"
let getSlova=
Environment.GetFolderPath(Environment.SpecialFolder.Desktop) ./. "maturita" ./. "ZADANIE č.20" ./. "slova.txt"
|> fun x -> if File.Exists x then Some(x) else None
|> function
| Some(v) -> File.ReadAllText v
| None ->
printfn "Nepodarilo sa najst hobit.txt zadaj cestu k hobit.txt"
let inp = Console.ReadLine()
File.ReadAllText inp
[<Uloha(30)>]
let uloha30() =
let h = getSlova
let out = System.Text.RegularExpressions.Regex("\s[a-zA-Z1-9][\s|.|,]").Replace(h, " ")
File.WriteAllText("./bez1.txt", out)

View file

@ -18,6 +18,7 @@
<Compile Include="src\u27.fs" />
<Compile Include="src\u28.fs" />
<Compile Include="src\u29.fs" />
<Compile Include="src\u30.fs" />
<Compile Include="src\u17.fs" />
<Compile Include="src\u18.fs" />
<Compile Include="src\u19.fs" />