Решенеия на задачите от упражненията

10.11.2006

10.11.2006

by Елеонора Янева -
Number of replies: 0
whiteSpaces=[' ','\n']
myGetWords l
 |null l =[]
 |elem (head l) whiteSpaces = []
 |otherwise =(head l):(myGetWords (tail l))
myDropWords l
 |null l = []
 |elem (head l) whiteSpaces = l
 |otherwise = myDropWords (tail l)
myDropSpaces l
 |null l = []
 |elem (head l) whiteSpaces =myDropSpaces (tail l)
 |otherwise =l
mySplitWords l
 |null l =[]
 |elem (head l) whiteSpaces =mySplitWords (tail l)
 |otherwise = (myGetWords l) :( mySplitWords (myDropWords l))
udivlenie=[' ','.','!',',','?']
myClearWord l
 |null l = []
 |elem (head l) udivlenie =myClearWord (tail l)
 |otherwise =(head l):(myClearWord (tail l))
myUniqueWords l
 |null l = []
 |elem (head l) (tail l) =tail l
 |otherwise = myUniqueWords (tail l)