Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bayes.rb #44

Merged
merged 7 commits into from
Sep 6, 2015
Merged

Conversation

MadBomber
Copy link
Contributor

Added ability to handle an array of classifications to the constructor.

with this patch you can now do things like:

Pathname.pwd.children.select{|c| c if c.directory?}.each do |dir|
  category                = dir.basename.to_s.downcase
  category_hash[category] = dir
end

classifier = ClassifierReborn::Bayes.new(category_hash.keys)

Added ability to handle and array of classifications to the constructor.
@Ch4s3
Copy link
Member

Ch4s3 commented Sep 4, 2015

@MadBomber can you include the example in the read me? @parkr I think this is fine, but do you think it needs any additional tests?

@MadBomber
Copy link
Contributor Author

Okay I will update the README and look at adding a test. It may be a day or two before I get back into it.

On Sep 3, 2015, at 10:51 PM, Chase Gilliam notifications@github.com wrote:

@MadBomber https://github.com/MadBomber can you include the example in the read me? @parkr https://github.com/parkr I think this is fine, but do you think it needs any additional tests?


Reply to this email directly or view it on GitHub #44 (comment).

@parkr
Copy link
Member

parkr commented Sep 4, 2015

Yeah this will require a test. I wonder if folks use arrays for the category key. I can't imagine they do, but I can't say definitively one way or another.

This mod makes it soe that you can train categories that have not been previously defined in the constructor.
I added some test cases but didn't test the test cases... too meta
@MadBomber
Copy link
Contributor Author

Well that was my nights entertainment. I didn't test the tests. I also notice at least one typo in a string that didn't make sense in English. #train 'Ruby', 'I sweet language' .... like what does that mean.

Dewayne
o-*

@Ch4s3
Copy link
Member

Ch4s3 commented Sep 4, 2015

Yeah, I've personally written code that does something similar to this, but from outside of the gem, so I like it. Once this passes tests, I'd be happy to merge it in. Then I think we need to address #42 and get a 2.0.4 out.

@MadBomber
Copy link
Contributor Author

just pushed a typo fix to the test file. tests are passing. ought to consider updating from test-unit to minitest

Ch4s3 added a commit that referenced this pull request Sep 6, 2015
@Ch4s3 Ch4s3 merged commit 3914ca3 into jekyll:master Sep 6, 2015
@Ch4s3
Copy link
Member

Ch4s3 commented Sep 6, 2015

Agreed on minitest, I'll add it to the list on #42.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants