Uncaught TypeError: Cannot read properties of undefined (reading 'map')
MarketingPip opened this issue · comments
Jared Van Valkengoed commented
There is an error with using .out()
.
Example of usage that throws error:
import nlp from "compromise"
let doc = nlp("some terms here")
console.log(doc.chunks().out("terms"))//
Line with error has been commented.
// some handy ad-hoc outputs
if (method === 'terms') {
let list = []
this.docs.forEach(s => {
let terms = s.terms.map(t => t.text) // ERROR COME'S FROM HERE
terms = terms.filter(t => t)
list = list.concat(terms)
})
return list
}
Adding this issue so I don't forget to resolve this (unless you get to it before me).
spencer kelly commented
Good catch! Thank you
Jared Van Valkengoed commented
@spencermountain - you're welcome! ps; check the gist I tagged you in!
spencer kelly commented
fixed in 14.10.1
- thanks!