Comparing version 1.0.12 to 1.0.13
@@ -38,3 +38,3 @@ "use strict"; | ||
} | ||
else if (nx2 && ~oe.indexOf(new en_inflectors_1.Inflectors(nx1.tokens[0]).conjugate("VBP")) && ~vbs.indexOf(nx2.type)) | ||
else if (nx2 && ~oe.indexOf(new en_inflectors_1.Inflectors(deContract(nx1.tokens[0])).conjugate("VBP")) && ~vbs.indexOf(nx2.type)) | ||
continue; | ||
@@ -91,5 +91,5 @@ } | ||
continue; | ||
else if (rel.leftTokens.length && rel.leftTokens.indexOf(new en_inflectors_1.Inflectors(left.tokens[0]).conjugate("VBP")) === -1) | ||
else if (rel.leftTokens.length && rel.leftTokens.indexOf(new en_inflectors_1.Inflectors(deContract(left.tokens[0])).conjugate("VBP")) === -1) | ||
continue; | ||
else if (rel.rightTokens.length && rel.rightTokens.indexOf(new en_inflectors_1.Inflectors(right.tokens[0]).conjugate("VBP")) === -1) | ||
else if (rel.rightTokens.length && rel.rightTokens.indexOf(new en_inflectors_1.Inflectors(deContract(right.tokens[0])).conjugate("VBP")) === -1) | ||
continue; | ||
@@ -118,1 +118,10 @@ else { | ||
}; | ||
const contractions = ["'m", "'s", "'d", "'ll", "'re", "'ve"]; | ||
const replacements = ["am", "is", "would", "will", "are", "have"]; | ||
function deContract(token) { | ||
let ci = contractions.indexOf(token); | ||
if (~ci) | ||
return replacements[ci]; | ||
else | ||
return token; | ||
} |
@@ -17,16 +17,2 @@ "use strict"; | ||
(nodes) => { | ||
return nodes.map((node) => { | ||
const ATTRi = node.right.findIndex((x) => x.label === "ATTR"); | ||
if (!~ATTRi) | ||
return node; | ||
const hasW = node.left.find((x) => x.tags[0].charAt(0) === "W"); | ||
if (!hasW) { | ||
console.log(JSON.stringify(node)); | ||
return node; | ||
} | ||
node.right[ATTRi].label = "DOBJ"; | ||
return node; | ||
}); | ||
}, | ||
(nodes) => { | ||
var CCOMPi = nodes.findIndex(x => x.label === "CCOMP"); | ||
@@ -42,4 +28,3 @@ if (~CCOMPi) { | ||
var objs = nodes[CCOMPi].right.filter(x => x.label.endsWith("OBJ")); | ||
var attrs = nodes[CCOMPi].right.filter(x => x.label.endsWith("ATTR")); | ||
if (!(mods.length || subjs.length || objs.length || attrs.length)) | ||
if (!(mods.length || subjs.length || objs.length)) | ||
nodes[CCOMPi].label = "XCOMP"; | ||
@@ -55,5 +40,5 @@ else if (nodes[CCOMPi].right[0].type === "WDT" || nodes[CCOMPi].right[0].type === "WP") | ||
if (~hasEXPLi) { | ||
var ATTRorOBJi = nodes[hasEXPLi].right.findIndex(x => x.label.endsWith("OBJ") || x.label === "ATTR"); | ||
if (~ATTRorOBJi) | ||
nodes[hasEXPLi].right[ATTRorOBJi].label = "NSUBJ"; | ||
var OBJi = nodes[hasEXPLi].right.findIndex(x => x.label.endsWith("OBJ")); | ||
if (~OBJi) | ||
nodes[hasEXPLi].right[OBJi].label = "NSUBJ"; | ||
} | ||
@@ -95,3 +80,2 @@ return nodes; | ||
else { | ||
console.log(CASE.tokens[0]); | ||
x.label = "NMOD"; | ||
@@ -98,0 +82,0 @@ var newParent = n.findIndex(x => x.label.endsWith("SUBJ") || x.label.endsWith("OBL") || x.label.endsWith("OBJ")); |
{ | ||
"name": "en-parse", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "English language syntactic dependency parser", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -94,3 +94,2 @@ # English Parse | ||
**`NSUBJPASS`** | Nominal Subject (passive) | `I` have been given a chance | ||
**`ATTR`** | Attribute | This is `awesome` | ||
**`CCOMP`** | Clausal Complement | The boss ordered to `dig` the hole | ||
@@ -97,0 +96,0 @@ **`XCOMP`** | Open Clausal Complement | The boss told us to `dig` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41801
1154
124