8000 Use of plain objects prevents tokens or categories named "constructor" · Issue #14 · ttezel/bayes · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Use of plain objects prevents tokens or categories named "constructor" #14
Open
@schue

Description

@schue

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0