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: tv.getVector is not a function #1

Open
CognitiveClouds-Prasad opened this issue Aug 8, 2019 · 4 comments
Open

TypeError: tv.getVector is not a function #1

CognitiveClouds-Prasad opened this issue Aug 8, 2019 · 4 comments

Comments

@CognitiveClouds-Prasad
Copy link

I did npm install term-frequency. Then, there were complaints about other modules like stopword and term-vector not installed. I did install them via npm install. However, I am unable to get the example up and running.

@fergiemcdowall
Copy link
Owner

Thanks for the feedback. Which example is not working? Can you copy it here?

@CognitiveClouds-Prasad
Copy link
Author

CognitiveClouds-Prasad commented Aug 12, 2019

var tf = require('term-frequency');
var sw = require('stopword');
var tv = require('term-vector');

var vec = tv.getVector(
  sw.removeStopwords(
    'This is a really, really cool vector. I like this VeCTor'
      .toLowerCase()
      .split(/[ ,\.]+/) 
  )
)
var freq = tf.getTermFrequency(vec);

This one.

@fergiemcdowall
Copy link
Owner

ah yes, term-frequency is looking for an older version of term-vector in this example.

try npm install stopword term-vector@0.1.2 term-frequency and then run the example

@CognitiveClouds-Prasad
Copy link
Author

Yes. It works.

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