Comparing version 1.0.7 to 1.0.9
@@ -1,2 +0,3 @@ | ||
export declare const parse: (tags: string[], tokens: string[], o?: true | undefined) => NodeInterface[] | ResultNode[]; | ||
export declare const tree: (tags: string[], tokens: string[]) => NodeInterface[]; | ||
export declare const parse: (tags: string[], tokens: string[]) => ResultNode[]; | ||
export interface NodeInterface { | ||
@@ -3,0 +4,0 @@ left: Array<NodeInterface>; |
@@ -5,3 +5,3 @@ "use strict"; | ||
const typing_1 = require("./typing"); | ||
exports.parse = function (tags, tokens, o) { | ||
exports.tree = function (tags, tokens) { | ||
let nodes = tags.map((tag, i) => nodeFactory(tag, tokens[i], i)); | ||
@@ -11,6 +11,7 @@ nodes = typing_1.default(nodes); | ||
nodes = repairing_1.default(nodes); | ||
if (o) | ||
return nodes; | ||
return toArray(nodes[0]); | ||
return nodes; | ||
}; | ||
exports.parse = function (tags, tokens) { | ||
return toArray(exports.tree(tags, tokens)[0]); | ||
}; | ||
function nodeFactory(tag, token, index) { | ||
@@ -17,0 +18,0 @@ return { |
{ | ||
"name": "en-parse", | ||
"version": "1.0.7", | ||
"version": "1.0.9", | ||
"description": "English language syntactic dependency parser", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
45137
956