(bayes-query) returns 0.5 or 1
I'm using the complex pattern in (parse) to split up german texts, too.
Here's my code:
Code: Select all
(setq textdata "Now think about your brain. It’s a long running program running on very complex and error prone hardware. How does your brain keep itself sane over time? The answer may be found in something we spend a third of our lives doing. Sleep.")
(setq text (parse (lower-case textdata) "[^a-z0-9äöüß]+" 0))
(bayes-train text 'DICT)
(bayes-query (parse (lower-case "dsd skjsd ksdjkds sdkj") "[^a-z0-9äöüß]+" 0) 'DICT)
Code: Select all
"Now think about your brain. It\226\128\153s a long running program running on very complex and error prone hardware. How does your brain keep itself sane over time? The answer may be found in something we spend a third of our lives doing. Sleep."
("now" "think" "about" "your" "brain" "it" "s" "a" "long" "running" "program" "running"
"on" "very" "complex" "and" "error" "prone" "hardware" "how" "does" "your" "brain"
"keep" "itself" "sane" "over" "time" "the" "answer" "may" "be" "found" "in" "something"
"we" "spend" "a" "third" "of" "our" "lives" "doing" "sleep" "")
(45)
(0.5)
Am I missing some switch?