{"action":"created","issue":{"url":"https://api.github.com/repos/jekyll/classifier-reborn/issues/63","labels_url":"https://api.github.com/repos/jekyll/classifier-reborn/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/jekyll/classifier-reborn/issues/63/comments","events_url":"https://api.github.com/repos/jekyll/classifier-reborn/issues/63/events","html_url":"https://github.com/jekyll/classifier-reborn/issues/63","id":121022713,"number":63,"title":"Question regarding languages","user":{"login":"janorivera","id":11992408,"avatar_url":"https://avatars.githubusercontent.com/u/11992408?v=3","gravatar_id":"","url":"https://api.github.com/users/janorivera","html_url":"https://github.com/janorivera","followers_url":"https://api.github.com/users/janorivera/followers","following_url":"https://api.github.com/users/janorivera/following{/other_user}","gists_url":"https://api.github.com/users/janorivera/gists{/gist_id}","starred_url":"https://api.github.com/users/janorivera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janorivera/subscriptions","organizations_url":"https://api.github.com/users/janorivera/orgs","repos_url":"https://api.github.com/users/janorivera/repos","events_url":"https://api.github.com/users/janorivera/events{/privacy}","received_events_url":"https://api.github.com/users/janorivera/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-08T14:49:30Z","updated_at":"2015-12-09T01:11:38Z","closed_at":null,"body":"Hi\r\nI've seen that the classifier has the fast-stemmer as a dependency right?  I think that this stemmer doesn't support Spanish, would this mean that the classifier would not work properly with documents in Spanish?\r\n\r\nWhat if the text that I pass to the classifier has already been processed by a Spanish stemmer, would that work?\r\n\r\nBest\r\nAlejandro"},"comment":{"url":"https://api.github.com/repos/jekyll/classifier-reborn/issues/comments/163075109","html_url":"https://github.com/jekyll/classifier-reborn/issues/63#issuecomment-163075109","issue_url":"https://api.github.com/repos/jekyll/classifier-reborn/issues/63","id":163075109,"user":{"login":"Ch4s3","id":1943540,"avatar_url":"https://avatars.githubusercontent.com/u/1943540?v=3","gravatar_id":"","url":"https://api.github.com/users/Ch4s3","html_url":"https://github.com/Ch4s3","followers_url":"https://api.github.com/users/Ch4s3/followers","following_url":"https://api.github.com/users/Ch4s3/following{/other_user}","gists_url":"https://api.github.com/users/Ch4s3/gists{/gist_id}","starred_url":"https://api.github.com/users/Ch4s3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ch4s3/subscriptions","organizations_url":"https://api.github.com/users/Ch4s3/orgs","repos_url":"https://api.github.com/users/Ch4s3/repos","events_url":"https://api.github.com/users/Ch4s3/events{/privacy}","received_events_url":"https://api.github.com/users/Ch4s3/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T01:11:38Z","updated_at":"2015-12-09T01:11:38Z","body":"@janorivera If you look at our stop words, especially [here](https://github.com/jekyll/classifier-reborn/blob/master/data/stopwords/es) you'll see that we do have Spanish stop words.\r\n\r\nLook at how the classifier is initialized, English, 'en' is the default.\r\n\r\n```ruby\r\ndef initialize(*args)\r\n      @categories = Hash.new\r\n      options = { language: 'en', auto_categorize: false }\r\n      args.flatten.each do |arg|\r\n        if arg.kind_of?(Hash)\r\n          options.merge!(arg)\r\n        else\r\n          add_category(arg)\r\n        end\r\n      end\r\n      @total_words = 0\r\n      @category_counts = Hash.new(0)\r\n      @category_word_count = Hash.new(0)\r\n      @language = options[:language]\r\n      @auto_categorize = options[:auto_categorize]\r\nend\r\n```\r\n\r\nTry something like the following:\r\n\r\n```ruby\r\n> classifier = ClassifierReborn::Bayes.new(language: 'es', 'bueno', 'malo')\r\nSyntaxError: unexpected ')', expecting end-of-input\r\n> classifier = ClassifierReborn::Bayes.new('bueno', 'malo', language: 'es')\r\n=> #<ClassifierReborn::Bayes:0x007f85358ca200 @categories={:Bueno=>{}, :Malo=>{}}, @total_words=0, @category_counts={}, @category_word_count={}, @language=\"es\", @auto_categorize=false, @enable_threshold=false, @threshold=0.0>\r\n> classifier.train_bueno \"pastel ron gatos\"\r\n=> [\r\n    [0] \"pastel ron gatos\"\r\n]\r\n> classifier.train_malo \"cosas malas como lluvia, dolor, enfermidad\"\r\n=> [\r\n    [0] \"cosas malas como lluvia, dolor, enfermidad\"\r\n]\r\n> classifier.classify \"lluvia\"\r\n=> \"Malo\"\r\n```\r\n\r\nHope this helps!\r\n\r\n-Chase"}}