---------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------- -------------------------------THIS SECTION DEALS WITH SPLITTING UP WORDS -------------------- ---------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------- import "fixwords" ignore = "\n \t" --Variable for the whitespace that we ignore splitWords :: String -> [Word] --This takes the big string splitWords text = split (dropSpace text)--and splits it into a list of words split :: String -> [Word] --This does the same as above, split [] = [] --expect there can be no whitespace in front split text = fixWord(getWord text) : split (dropSpace (dropWord text)) getWord ::String->Word --Takes the first word off the big string getWord [] = [] getWord (c:cs) |c `elem` ignore =[] --Ignores any whitespace | otherwise = c: getWord cs dropWord ::String->String --Drops the first word off of the big string dropWord [] = [] dropWord (c:cs) |c `elem` ignore = (c:cs) |otherwise = dropWord cs dropSpace ::String->String --removes whitespace dropSpace [] = [] dropSpace (c:cs) |c `elem` ignore = dropSpace cs |otherwise = c:cs