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

Use of plain objects prevents tokens or categories named "constructor" #14

Open
schue opened this issue May 23, 2017 · 0 comments · May be fixed by #15
Open

Use of plain objects prevents tokens or categories named "constructor" #14

schue opened this issue May 23, 2017 · 0 comments · May be fixed by #15

Comments

@schue
Copy link

schue commented May 23, 2017

The "vocabulary", "docCount", "wordCount", "wordFrequencyCount" and "categories" data structures in the classifier are defined as {} which means that "constructor" is a field. This causes problems for documents containing the word "constructor" as well as categories with that name. The solution is to use Object.create(null) as is already used elsewhere in the existing code.

@schue schue linked a pull request May 23, 2017 that will close this issue
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 a pull request may close this issue.

1 participant