compromise
Version:
natural language processing in the browser
35 lines (32 loc) • 700 B
JavaScript
;
const Text = require('../../index');
class Terms extends Text {
data() {
//export all the main metadata-stuff for each term
return this.list.map((ts) => {
let t = ts.terms[0];
let o = {
normal: t.normal,
text: t.text,
tags: Object.keys(t.tag),
whitespace: t.whitespace,
};
if (t.silent_term) {
o.silent_term = t.silent_term;
}
if (t.dirty) {
o.dirty = true;
}
let punct = t.endPunctuation();
if (punct) {
o.endPunctuation = punct;
}
return o;
});
}
static find(r) {
let found = r.match('.');
return found;
}
}
module.exports = Terms;