Add a function that will help with UE1 A.3
This commit is contained in:
parent
1416d2f1f6
commit
64bb0164c9
@ -78,7 +78,18 @@ tzr_zeugen :: Zeichenreihe -> Teilzeichenreihe -> Zerlegungszeugen
|
|||||||
tzr_zeugen [] [] = []
|
tzr_zeugen [] [] = []
|
||||||
tzr_zeugen z t
|
tzr_zeugen z t
|
||||||
| not (ist_tzr z t) = []
|
| not (ist_tzr z t) = []
|
||||||
| otherwise = []
|
| wieOft z t == 1 = [tzr_zeuge z t]
|
||||||
|
| otherwise = get_all_substring_variants z t []
|
||||||
|
|
||||||
|
get_all_substring_variants :: Zeichenreihe -> Teilzeichenreihe -> Zerlegungszeugen -> Zerlegungszeugen
|
||||||
|
get_all_substring_variants z t r
|
||||||
|
| not (ist_tzr z t) = r
|
||||||
|
| otherwise =
|
||||||
|
let
|
||||||
|
pos = (find_tzr_position z t 0) - 1
|
||||||
|
new_res = r ++ [(tzr_zeuge z t)]
|
||||||
|
in
|
||||||
|
get_all_substring_variants (take pos z) t new_res
|
||||||
|
|
||||||
|
|
||||||
-- Aufgabe A.4
|
-- Aufgabe A.4
|
||||||
|
Reference in New Issue
Block a user