You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expect(nlp.readDoc('to be or not to be').tokens().out(its.value,as.bow)).to.deep.equal({to: 2,be: 2,or: 1,not: 1});
@@ -73,9 +75,35 @@ describe( 'its functions for .out()', function () {
73
75
});
74
76
75
77
it('as.vector',function(){
76
-
vardoc=nlp.readDoc('the dog ran away');
78
+
constsent='the dog ran';
79
+
constdoc=nlp.readDoc(sent);
77
80
81
+
// Check exceptions when as.vector is combined with incompitable its helpers.
78
82
expect(doc.tokens().out.bind(null,its.negationFlag,as.vector)).to.throw('winkNLP: as.vector is allowed only with its value or normal or lemma.');
79
83
expect(doc.tokens().filter((t)=>t.out().length>0).out.bind(null,its.negationFlag,as.vector)).to.throw('winkNLP: as.vector is allowed only with its value or normal or lemma.');
84
+
85
+
// Test actual behaviour of as.helper by averaging the vectors of tokens
0 commit comments