textAnalysisSuite
textAnalysisSuite copied to clipboard
fix ngrams constructor clash when word is constructor
When building ngrams from phrases with the word "constructor", I get unexpected behavior. This was because the dictionaries are created with var x = {}; which makes them inherit from the default object prototype with a constructor property. Creating an object with a null prototype Object.create(null); solves the problem.