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.learnCustomEntities.bind(null,[{name: 'ok',patterns: ['[a#]']}])).to.throw('wink-nlp: incorrect token "a#" encountered in examples of learnCustomEntities() API.');
577
577
});
578
578
579
+
it('should throw error if mark is empty',function(){
580
+
expect(nlp.learnCustomEntities.bind(null,[{name: 'ok',patterns: ['a b'],mark: []}])).to.throw('wink-nlp: mark should be an array containing start & end indexes, instead found:');
581
+
});
582
+
583
+
it('should throw error if mark contains real numbers',function(){
584
+
expect(nlp.learnCustomEntities.bind(null,[{name: 'ok',patterns: ['a b'],mark: [1,1.2]}])).to.throw('wink-nlp: mark should be an array containing start & end indexes, instead found:');
585
+
});
586
+
587
+
it('should throw error if within mark start index > end index',function(){
588
+
expect(nlp.learnCustomEntities.bind(null,[{name: 'ok',patterns: ['a b'],mark: [2,1]}])).to.throw('wink-nlp: mark should be an array containing start & end indexes, instead found:');
589
+
});
590
+
591
+
it('should throw error if mark contains non integer',function(){
592
+
expect(nlp.learnCustomEntities.bind(null,[{name: 'ok',patterns: ['a b'],mark: ['a']}])).to.throw('wink-nlp: mark should be an array containing start & end indexes, instead found:');
593
+
});
594
+
579
595
it('correct examples should return the count of examples learned',function(){
0 commit comments