module Main where import NLP.Hext.NaiveBayes import Data.Char ---- TEST DATA ---- data Class = Positive | Negative deriving (Eq, Show) doc1 = "I loved the movie" doc2 = "I hated the movie" doc3 = "a great movie. good movie" doc4 = "poor acting" doc5 = "great acting. a good movie" docs = [doc1, doc2, doc3, doc4, doc5] correspondingClasses = [Positive, Negative, Positive, Negative, Positive] classifiedDocs = zip docs correspondingClasses ------------------- main :: IO () main = do let material = makeMaterial classifiedDocs let review = "I loved the great acting" let result = runBayes material review putStrLn "To run the naive bayes algorithm on\ \ the test data found in the main file, enter '1'" n <- getChar if (digitToInt n :: Int) == 1 then putStrLn $ "The review '" ++ review ++ "' is " ++ show result else return ()