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

TypeError: Cannot read property 'forEach' of null #26

Open
stovenator opened this issue Sep 11, 2018 · 1 comment
Open

TypeError: Cannot read property 'forEach' of null #26

stovenator opened this issue Sep 11, 2018 · 1 comment

Comments

@stovenator
Copy link

stovenator commented Sep 11, 2018

This occurs only when you have a stop word, followed by multiple spaces, and then followed by a stop word.

For example:

> rake.generate("Please elaborate on planets of    the")
TypeError: Cannot read property 'forEach' of null
    at phraseList.forEach (/Users/mastover/git/rake-test/node_modules/node-rake/index.js:75:16)
    at Array.forEach (<anonymous>)
    at Rake.calculatePhraseScores (/Users/mastover/git/rake-test/node_modules/node-rake/index.js:71:16)
    at Rake.generate (/Users/mastover/git/rake-test/node_modules/node-rake/index.js:89:31)
    at Object.generate (/Users/mastover/git/rake-test/node_modules/node-rake/app.js:13:21)
> rake.generate("Please elaborate on planets   of the")
[ 'elaborate', 'planets' ]
> rake.generate("Please elaborate on     planets   of the")
[ 'elaborate', 'planets' ]
@mcthulhu
Copy link

I collapsed multiple spaces first; but I'm still getting this same error message when using stopwords.

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

No branches or pull requests

2 participants