compromise
Version:
natural language processing in the browser
21 lines (18 loc) • 553 B
JavaScript
;
const Text = require('../../index');
const Person = require('./person');
//this is used for pronoun and honorifics, and not intented for more-than grammatical use (see #117)
class People extends Text {
data() {
return this.list.map((ts) => ts.data());
}
static find(r) {
let people = r.splitAfter('#Comma');
people = people.match('#Person+');
people.list = people.list.map((ts) => {
return new Person(ts.terms, ts.lexicon, ts.parent, ts.parentTerms);
});
return people;
}
}
module.exports = People;