Rhyme
In dieser Aufgabe beschäftigen wir uns .
> module Rhyme where
> import Data.Char
> import Data.List
> import Data.Maybe
> woerter :: String -> [String]
> woerter = []
> isVowel :: Char -> Bool
> isVowel = False
> vowels = "aeiouüöäAEIOUÜÖÄ"
> replace :: [([a],[a])] -> [a] -> [a]
> replace s1s2s str = str
> phonetics
> = [("ai","ei"),( "äu","eu"),( "aa","ah")
> ,( "oo","oh"),("ee","eh")]
> normalize = replace phonetics . map toLower
> doRhyme :: String -> String -> Bool
> doRhyme cs1 cs2 = False
> endsort :: [String] -> [String]
> endsort xs = xs
> rhymeGroups :: [String] -> [[String]]
> rhymeGroups _ = []
> ws1 = ["zart","haus","aal","butter","art","vater","bär"
> ,"maus","mär","wiese","klaus","zahl","mutter"
> ,"klein","mein","riese"]
> lookupBy :: (a->c->Bool) -> a -> [(c,b)] -> Maybe b
> lookupBy _ _key [] = Nothing
> findRhymes :: String -> [(String,[String])] -> [String]
> findRhymes w = (fromMaybe [])
> .(lookupBy (\x y->x==y||doRhyme x y) w)
> startConsonants :: String -> String -> (String,String)
> startConsonants ws1 ws2 = ("","")
> type SchuettelLexikon = [((String, String), [(String, String)])]
> schuettelGroups :: [[String]] -> SchuettelLexikon
> schuettelGroups xss = []
> generateRhymeLexicon inFile outReimFile outSchuettelFile = do
> xs <- readFile inFile
> let rg = rhymeGroups$woerter xs
> let grs = taggedRhymeGroups rg
> writeFile outReimFile (show grs)
> let schuettel = schuettelGroups rg
> writeFile outSchuettelFile (show schuettel)
> moin = generateRhymeLexicon
> "openthesaurus.txt" "reim.txt" "schuettel.txt"
lhs
You are not logged in and therefore you cannot submit a solution.