nlptoolkit-annotatedtree 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Layer/DependencyLayer.d.ts +4 -0
- package/dist/Layer/DependencyLayer.js +4 -0
- package/dist/Layer/DependencyLayer.js.map +1 -1
- package/dist/Layer/EnglishPropbankLayer.d.ts +9 -0
- package/dist/Layer/EnglishPropbankLayer.js +9 -0
- package/dist/Layer/EnglishPropbankLayer.js.map +1 -1
- package/dist/Layer/EnglishSemanticLayer.d.ts +5 -0
- package/dist/Layer/EnglishSemanticLayer.js +5 -0
- package/dist/Layer/EnglishSemanticLayer.js.map +1 -1
- package/dist/Layer/EnglishWordLayer.d.ts +4 -0
- package/dist/Layer/EnglishWordLayer.js +4 -0
- package/dist/Layer/EnglishWordLayer.js.map +1 -1
- package/dist/Layer/MetaMorphemeLayer.d.ts +19 -0
- package/dist/Layer/MetaMorphemeLayer.js +19 -0
- package/dist/Layer/MetaMorphemeLayer.js.map +1 -1
- package/dist/Layer/MetaMorphemesMovedLayer.d.ts +20 -0
- package/dist/Layer/MetaMorphemesMovedLayer.js +20 -0
- package/dist/Layer/MetaMorphemesMovedLayer.js.map +1 -1
- package/dist/Layer/MorphologicalAnalysisLayer.d.ts +32 -0
- package/dist/Layer/MorphologicalAnalysisLayer.js +32 -0
- package/dist/Layer/MorphologicalAnalysisLayer.js.map +1 -1
- package/dist/Layer/MultiWordLayer.d.ts +9 -0
- package/dist/Layer/MultiWordLayer.js +9 -0
- package/dist/Layer/MultiWordLayer.js.map +1 -1
- package/dist/Layer/NERLayer.d.ts +14 -0
- package/dist/Layer/NERLayer.js +14 -0
- package/dist/Layer/NERLayer.js.map +1 -1
- package/dist/Layer/PersianWordLayer.d.ts +4 -0
- package/dist/Layer/PersianWordLayer.js +4 -0
- package/dist/Layer/PersianWordLayer.js.map +1 -1
- package/dist/Layer/ShallowParseLayer.d.ts +11 -0
- package/dist/Layer/ShallowParseLayer.js +11 -0
- package/dist/Layer/ShallowParseLayer.js.map +1 -1
- package/dist/Layer/SingleWordLayer.d.ts +4 -0
- package/dist/Layer/SingleWordLayer.js +4 -0
- package/dist/Layer/SingleWordLayer.js.map +1 -1
- package/dist/Layer/SourceLanguageWordLayer.d.ts +4 -0
- package/dist/Layer/SourceLanguageWordLayer.js +4 -0
- package/dist/Layer/SourceLanguageWordLayer.js.map +1 -1
- package/dist/Layer/TargetLanguageWordLayer.d.ts +10 -1
- package/dist/Layer/TargetLanguageWordLayer.js +9 -0
- package/dist/Layer/TargetLanguageWordLayer.js.map +1 -1
- package/dist/Layer/TurkishPropbankLayer.d.ts +18 -0
- package/dist/Layer/TurkishPropbankLayer.js +18 -0
- package/dist/Layer/TurkishPropbankLayer.js.map +1 -1
- package/dist/Layer/TurkishSemanticLayer.d.ts +11 -0
- package/dist/Layer/TurkishSemanticLayer.js +11 -0
- package/dist/Layer/TurkishSemanticLayer.js.map +1 -1
- package/dist/Layer/TurkishWordLayer.d.ts +4 -0
- package/dist/Layer/TurkishWordLayer.js +4 -0
- package/dist/Layer/TurkishWordLayer.js.map +1 -1
- package/dist/Layer/WordLayer.d.ts +12 -0
- package/dist/Layer/WordLayer.js +12 -0
- package/dist/Layer/WordLayer.js.map +1 -1
- package/dist/LayerInfo.d.ts +188 -0
- package/dist/LayerInfo.js +229 -63
- package/dist/LayerInfo.js.map +1 -1
- package/dist/ParseNodeDrawable.d.ts +102 -0
- package/dist/ParseNodeDrawable.js +102 -0
- package/dist/ParseNodeDrawable.js.map +1 -1
- package/dist/ParseTreeDrawable.d.ts +134 -0
- package/dist/ParseTreeDrawable.js +153 -16
- package/dist/ParseTreeDrawable.js.map +1 -1
- package/dist/Processor/Condition/IsDoubleNode.d.ts +6 -0
- package/dist/Processor/Condition/IsDoubleNode.js +6 -0
- package/dist/Processor/Condition/IsDoubleNode.js.map +1 -1
- package/dist/Processor/Condition/IsDoubleNodeWithDifferentTags.d.ts +6 -0
- package/dist/Processor/Condition/IsDoubleNodeWithDifferentTags.js +6 -0
- package/dist/Processor/Condition/IsDoubleNodeWithDifferentTags.js.map +1 -1
- package/dist/Processor/Condition/IsEnglishLeafNode.d.ts +5 -0
- package/dist/Processor/Condition/IsEnglishLeafNode.js +5 -0
- package/dist/Processor/Condition/IsEnglishLeafNode.js.map +1 -1
- package/dist/Processor/Condition/IsLeafNode.d.ts +5 -0
- package/dist/Processor/Condition/IsLeafNode.js +5 -0
- package/dist/Processor/Condition/IsLeafNode.js.map +1 -1
- package/dist/Processor/Condition/IsNodeWithPredicate.d.ts +11 -0
- package/dist/Processor/Condition/IsNodeWithPredicate.js +11 -0
- package/dist/Processor/Condition/IsNodeWithPredicate.js.map +1 -1
- package/dist/Processor/Condition/IsNodeWithSymbol.d.ts +9 -0
- package/dist/Processor/Condition/IsNodeWithSymbol.js +9 -0
- package/dist/Processor/Condition/IsNodeWithSymbol.js.map +1 -1
- package/dist/Processor/Condition/IsNodeWithSynSetId.d.ts +9 -0
- package/dist/Processor/Condition/IsNodeWithSynSetId.js +9 -0
- package/dist/Processor/Condition/IsNodeWithSynSetId.js.map +1 -1
- package/dist/Processor/Condition/IsNoneNode.d.ts +5 -0
- package/dist/Processor/Condition/IsNoneNode.js +5 -0
- package/dist/Processor/Condition/IsNoneNode.js.map +1 -1
- package/dist/Processor/Condition/IsNullElement.d.ts +6 -0
- package/dist/Processor/Condition/IsNullElement.js +6 -0
- package/dist/Processor/Condition/IsNullElement.js.map +1 -1
- package/dist/Processor/Condition/IsNumber.d.ts +6 -0
- package/dist/Processor/Condition/IsNumber.js +6 -0
- package/dist/Processor/Condition/IsNumber.js.map +1 -1
- package/dist/Processor/Condition/IsPredicateVerbNode.d.ts +11 -0
- package/dist/Processor/Condition/IsPredicateVerbNode.js +11 -0
- package/dist/Processor/Condition/IsPredicateVerbNode.js.map +1 -1
- package/dist/Processor/Condition/IsProperNoun.d.ts +5 -0
- package/dist/Processor/Condition/IsProperNoun.js +5 -0
- package/dist/Processor/Condition/IsProperNoun.js.map +1 -1
- package/dist/Processor/Condition/IsPunctuationNode.d.ts +5 -0
- package/dist/Processor/Condition/IsPunctuationNode.js +5 -0
- package/dist/Processor/Condition/IsPunctuationNode.js.map +1 -1
- package/dist/Processor/Condition/IsTransferable.d.ts +5 -0
- package/dist/Processor/Condition/IsTransferable.js +5 -0
- package/dist/Processor/Condition/IsTransferable.js.map +1 -1
- package/dist/Processor/Condition/IsTurkishLeafNode.d.ts +5 -0
- package/dist/Processor/Condition/IsTurkishLeafNode.js +5 -0
- package/dist/Processor/Condition/IsTurkishLeafNode.js.map +1 -1
- package/dist/Processor/Condition/IsVPNode.d.ts +5 -0
- package/dist/Processor/Condition/IsVPNode.js +5 -0
- package/dist/Processor/Condition/IsVPNode.js.map +1 -1
- package/dist/Processor/Condition/IsVerbNode.d.ts +10 -0
- package/dist/Processor/Condition/IsVerbNode.js +10 -0
- package/dist/Processor/Condition/IsVerbNode.js.map +1 -1
- package/dist/Processor/LayerExist/ContainsLayerInformation.d.ts +9 -0
- package/dist/Processor/LayerExist/ContainsLayerInformation.js +9 -0
- package/dist/Processor/LayerExist/ContainsLayerInformation.js.map +1 -1
- package/dist/Processor/LayerExist/NotContainsLayerInformation.d.ts +9 -0
- package/dist/Processor/LayerExist/NotContainsLayerInformation.js +9 -0
- package/dist/Processor/LayerExist/NotContainsLayerInformation.js.map +1 -1
- package/dist/Processor/LayerExist/SemiContainsLayerInformation.d.ts +10 -0
- package/dist/Processor/LayerExist/SemiContainsLayerInformation.js +10 -0
- package/dist/Processor/LayerExist/SemiContainsLayerInformation.js.map +1 -1
- package/dist/Processor/LeafConverter/LeafToEnglish.d.ts +3 -0
- package/dist/Processor/LeafConverter/LeafToEnglish.js +3 -0
- package/dist/Processor/LeafConverter/LeafToEnglish.js.map +1 -1
- package/dist/Processor/LeafConverter/LeafToLanguageConverter.d.ts +7 -0
- package/dist/Processor/LeafConverter/LeafToLanguageConverter.js +7 -0
- package/dist/Processor/LeafConverter/LeafToLanguageConverter.js.map +1 -1
- package/dist/Processor/LeafConverter/LeafToPersian.d.ts +3 -0
- package/dist/Processor/LeafConverter/LeafToPersian.js +3 -0
- package/dist/Processor/LeafConverter/LeafToPersian.js.map +1 -1
- package/dist/Processor/LeafConverter/LeafToRootFormConverter.d.ts +7 -0
- package/dist/Processor/LeafConverter/LeafToRootFormConverter.js +7 -0
- package/dist/Processor/LeafConverter/LeafToRootFormConverter.js.map +1 -1
- package/dist/Processor/LeafConverter/LeafToTurkish.d.ts +3 -0
- package/dist/Processor/LeafConverter/LeafToTurkish.js +3 -0
- package/dist/Processor/LeafConverter/LeafToTurkish.js.map +1 -1
- package/dist/Processor/NodeDrawableCollector.d.ts +16 -0
- package/dist/Processor/NodeDrawableCollector.js +16 -0
- package/dist/Processor/NodeDrawableCollector.js.map +1 -1
- package/dist/Processor/TreeToStringConverter.d.ts +15 -0
- package/dist/Processor/TreeToStringConverter.js +15 -0
- package/dist/Processor/TreeToStringConverter.js.map +1 -1
- package/dist/TreeBankDrawable.d.ts +20 -0
- package/dist/TreeBankDrawable.js +20 -0
- package/dist/TreeBankDrawable.js.map +1 -1
- package/dist/index.d.ts +58 -0
- package/dist/index.js +81 -0
- package/dist/index.js.map +1 -0
- package/package.json +14 -14
- package/source/Layer/DependencyLayer.ts +4 -0
- package/source/Layer/EnglishPropbankLayer.ts +9 -0
- package/source/Layer/EnglishSemanticLayer.ts +5 -0
- package/source/Layer/EnglishWordLayer.ts +4 -0
- package/source/Layer/MetaMorphemeLayer.ts +19 -0
- package/source/Layer/MetaMorphemesMovedLayer.ts +20 -0
- package/source/Layer/MorphologicalAnalysisLayer.ts +32 -0
- package/source/Layer/MultiWordLayer.ts +9 -0
- package/source/Layer/NERLayer.ts +14 -0
- package/source/Layer/PersianWordLayer.ts +4 -0
- package/source/Layer/ShallowParseLayer.ts +11 -0
- package/source/Layer/SingleWordLayer.ts +4 -0
- package/source/Layer/SourceLanguageWordLayer.ts +4 -0
- package/source/Layer/TargetLanguageWordLayer.ts +10 -1
- package/source/Layer/TurkishPropbankLayer.ts +18 -0
- package/source/Layer/TurkishSemanticLayer.ts +11 -0
- package/source/Layer/TurkishWordLayer.ts +4 -0
- package/source/Layer/WordLayer.ts +12 -0
- package/source/LayerInfo.ts +333 -155
- package/source/ParseNodeDrawable.ts +102 -0
- package/source/ParseTreeDrawable.ts +158 -16
- package/source/Processor/Condition/IsDoubleNode.ts +6 -0
- package/source/Processor/Condition/IsDoubleNodeWithDifferentTags.ts +6 -0
- package/source/Processor/Condition/IsEnglishLeafNode.ts +5 -0
- package/source/Processor/Condition/IsLeafNode.ts +5 -0
- package/source/Processor/Condition/IsNodeWithPredicate.ts +11 -0
- package/source/Processor/Condition/IsNodeWithSymbol.ts +9 -0
- package/source/Processor/Condition/IsNodeWithSynSetId.ts +9 -0
- package/source/Processor/Condition/IsNoneNode.ts +5 -0
- package/source/Processor/Condition/IsNullElement.ts +6 -0
- package/source/Processor/Condition/IsNumber.ts +6 -0
- package/source/Processor/Condition/IsPredicateVerbNode.ts +11 -0
- package/source/Processor/Condition/IsProperNoun.ts +5 -0
- package/source/Processor/Condition/IsPunctuationNode.ts +5 -0
- package/source/Processor/Condition/IsTransferable.ts +5 -0
- package/source/Processor/Condition/IsTurkishLeafNode.ts +5 -0
- package/source/Processor/Condition/IsVPNode.ts +5 -0
- package/source/Processor/Condition/IsVerbNode.ts +10 -0
- package/source/Processor/LayerExist/ContainsLayerInformation.ts +9 -0
- package/source/Processor/LayerExist/NotContainsLayerInformation.ts +9 -0
- package/source/Processor/LayerExist/SemiContainsLayerInformation.ts +10 -0
- package/source/Processor/LeafConverter/LeafToEnglish.ts +3 -0
- package/source/Processor/LeafConverter/LeafToLanguageConverter.ts +7 -0
- package/source/Processor/LeafConverter/LeafToPersian.ts +3 -0
- package/source/Processor/LeafConverter/LeafToRootFormConverter.ts +7 -0
- package/source/Processor/LeafConverter/LeafToTurkish.ts +3 -0
- package/source/Processor/NodeDrawableCollector.ts +16 -0
- package/source/Processor/TreeToStringConverter.ts +15 -0
- package/source/TreeBankDrawable.ts +20 -0
- package/source/index.ts +58 -0
- package/source/tsconfig.json +1 -1
- package/tsconfig.json +1 -2
- package/index.js +0 -58
|
@@ -3,7 +3,23 @@ import { ParseNodeDrawable } from "../ParseNodeDrawable";
|
|
|
3
3
|
export declare class NodeDrawableCollector {
|
|
4
4
|
private condition;
|
|
5
5
|
private rootNode;
|
|
6
|
+
/**
|
|
7
|
+
* Constructor for the NodeDrawableCollector class. NodeDrawableCollector's main aim is to collect a set of
|
|
8
|
+
* ParseNode's from a subtree rooted at rootNode, where the ParseNode's satisfy a given NodeCondition, which is
|
|
9
|
+
* implemented by other interface class.
|
|
10
|
+
* @param rootNode Root node of the subtree
|
|
11
|
+
* @param condition The condition interface for which all nodes in the subtree rooted at rootNode will be checked
|
|
12
|
+
*/
|
|
6
13
|
constructor(rootNode: ParseNodeDrawable, condition: NodeDrawableCondition);
|
|
14
|
+
/**
|
|
15
|
+
* Private recursive method to check all descendants of the parseNode, if they ever satisfy the given node condition
|
|
16
|
+
* @param parseNode Root node of the subtree
|
|
17
|
+
* @param collected The {@link ArrayList} where the collected ParseNode's will be stored.
|
|
18
|
+
*/
|
|
7
19
|
private collectNodes;
|
|
20
|
+
/**
|
|
21
|
+
* Collects and returns all ParseNodes satisfying the node condition.
|
|
22
|
+
* @return All ParseNodes satisfying the node condition.
|
|
23
|
+
*/
|
|
8
24
|
collect(): Array<ParseNodeDrawable>;
|
|
9
25
|
}
|
|
@@ -11,10 +11,22 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.NodeDrawableCollector = void 0;
|
|
13
13
|
class NodeDrawableCollector {
|
|
14
|
+
/**
|
|
15
|
+
* Constructor for the NodeDrawableCollector class. NodeDrawableCollector's main aim is to collect a set of
|
|
16
|
+
* ParseNode's from a subtree rooted at rootNode, where the ParseNode's satisfy a given NodeCondition, which is
|
|
17
|
+
* implemented by other interface class.
|
|
18
|
+
* @param rootNode Root node of the subtree
|
|
19
|
+
* @param condition The condition interface for which all nodes in the subtree rooted at rootNode will be checked
|
|
20
|
+
*/
|
|
14
21
|
constructor(rootNode, condition) {
|
|
15
22
|
this.rootNode = rootNode;
|
|
16
23
|
this.condition = condition;
|
|
17
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Private recursive method to check all descendants of the parseNode, if they ever satisfy the given node condition
|
|
27
|
+
* @param parseNode Root node of the subtree
|
|
28
|
+
* @param collected The {@link ArrayList} where the collected ParseNode's will be stored.
|
|
29
|
+
*/
|
|
18
30
|
collectNodes(parseNode, collected) {
|
|
19
31
|
if (this.condition == null || this.condition.satisfies(parseNode)) {
|
|
20
32
|
collected.push(parseNode);
|
|
@@ -23,6 +35,10 @@
|
|
|
23
35
|
this.collectNodes(parseNode.getChild(i), collected);
|
|
24
36
|
}
|
|
25
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Collects and returns all ParseNodes satisfying the node condition.
|
|
40
|
+
* @return All ParseNodes satisfying the node condition.
|
|
41
|
+
*/
|
|
26
42
|
collect() {
|
|
27
43
|
let result = new Array();
|
|
28
44
|
this.collectNodes(this.rootNode, result);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeDrawableCollector.js","sourceRoot":"","sources":["../../source/Processor/NodeDrawableCollector.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,qBAAqB;QAK9B,YAAY,QAA2B,EAAE,SAAgC;YACrE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;YACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC9B,CAAC;
|
|
1
|
+
{"version":3,"file":"NodeDrawableCollector.js","sourceRoot":"","sources":["../../source/Processor/NodeDrawableCollector.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,qBAAqB;QAK9B;;;;;;WAMG;QACH,YAAY,QAA2B,EAAE,SAAgC;YACrE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;YACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC9B,CAAC;QAED;;;;WAIG;QACK,YAAY,CAAC,SAA4B,EAAE,SAAmC;YAClF,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,EAAC;gBAC9D,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aAC7B;YACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,gBAAgB,EAAE,EAAE,CAAC,EAAE,EAAC;gBAClD,IAAI,CAAC,YAAY,CAAoB,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;aAC1E;QACL,CAAC;QAED;;;WAGG;QACH,OAAO;YACH,IAAI,MAAM,GAAG,IAAI,KAAK,EAAqB,CAAC;YAC5C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YACzC,OAAO,MAAM,CAAC;QAClB,CAAC;KACJ;IAxCD,sDAwCC"}
|
|
@@ -3,7 +3,22 @@ import { ParseTreeDrawable } from "../ParseTreeDrawable";
|
|
|
3
3
|
export declare class TreeToStringConverter {
|
|
4
4
|
private converter;
|
|
5
5
|
private parseTree;
|
|
6
|
+
/**
|
|
7
|
+
* Constructor of the TreeToStringConverter class. Sets the attributes.
|
|
8
|
+
* @param parseTree Parse tree to be converted.
|
|
9
|
+
* @param converter Node to string converter interface.
|
|
10
|
+
*/
|
|
6
11
|
constructor(parseTree: ParseTreeDrawable, converter: LeafToStringConverter);
|
|
12
|
+
/**
|
|
13
|
+
* Converts recursively a parse node to a string. If it is a leaf node, calls the converter's leafConverter method,
|
|
14
|
+
* otherwise concatenates the converted strings of its children.
|
|
15
|
+
* @param parseNode Parse node to convert to string.
|
|
16
|
+
* @return String form of the parse node and all of its descendants.
|
|
17
|
+
*/
|
|
7
18
|
private convertToString;
|
|
19
|
+
/**
|
|
20
|
+
* Calls the convertToString method with root of the tree to convert the parse tree to string.
|
|
21
|
+
* @return String form of the parse tree.
|
|
22
|
+
*/
|
|
8
23
|
convert(): string;
|
|
9
24
|
}
|
|
@@ -11,10 +11,21 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TreeToStringConverter = void 0;
|
|
13
13
|
class TreeToStringConverter {
|
|
14
|
+
/**
|
|
15
|
+
* Constructor of the TreeToStringConverter class. Sets the attributes.
|
|
16
|
+
* @param parseTree Parse tree to be converted.
|
|
17
|
+
* @param converter Node to string converter interface.
|
|
18
|
+
*/
|
|
14
19
|
constructor(parseTree, converter) {
|
|
15
20
|
this.converter = converter;
|
|
16
21
|
this.parseTree = parseTree;
|
|
17
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Converts recursively a parse node to a string. If it is a leaf node, calls the converter's leafConverter method,
|
|
25
|
+
* otherwise concatenates the converted strings of its children.
|
|
26
|
+
* @param parseNode Parse node to convert to string.
|
|
27
|
+
* @return String form of the parse node and all of its descendants.
|
|
28
|
+
*/
|
|
18
29
|
convertToString(parseNode) {
|
|
19
30
|
if (parseNode.isLeaf()) {
|
|
20
31
|
return this.converter.leafConverter(parseNode);
|
|
@@ -27,6 +38,10 @@
|
|
|
27
38
|
return st;
|
|
28
39
|
}
|
|
29
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Calls the convertToString method with root of the tree to convert the parse tree to string.
|
|
43
|
+
* @return String form of the parse tree.
|
|
44
|
+
*/
|
|
30
45
|
convert() {
|
|
31
46
|
return this.convertToString(this.parseTree.getRoot());
|
|
32
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeToStringConverter.js","sourceRoot":"","sources":["../../source/Processor/TreeToStringConverter.ts"],"names":[],"mappings":";;;;;;;;;;;;IAIA,MAAa,qBAAqB;QAK9B,YAAY,SAA4B,EAAE,SAAgC;YACtE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;YAC1B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC9B,CAAC;
|
|
1
|
+
{"version":3,"file":"TreeToStringConverter.js","sourceRoot":"","sources":["../../source/Processor/TreeToStringConverter.ts"],"names":[],"mappings":";;;;;;;;;;;;IAIA,MAAa,qBAAqB;QAK9B;;;;WAIG;QACH,YAAY,SAA4B,EAAE,SAAgC;YACtE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;YAC1B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC9B,CAAC;QAED;;;;;WAKG;QACK,eAAe,CAAC,SAA4B;YAChD,IAAI,SAAS,CAAC,MAAM,EAAE,EAAC;gBACnB,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;aAClD;iBAAM;gBACH,IAAI,EAAE,GAAG,EAAE,CAAC;gBACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,gBAAgB,EAAE,EAAE,CAAC,EAAE,EAAE;oBACnD,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,eAAe,CAAqB,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC7E;gBACD,OAAO,EAAE,CAAC;aACb;QACL,CAAC;QAED;;;WAGG;QACH,OAAO;YACH,OAAO,IAAI,CAAC,eAAe,CAAqB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9E,CAAC;KAEJ;IAzCD,sDAyCC"}
|
|
@@ -3,9 +3,29 @@ import { ParseTreeDrawable } from "./ParseTreeDrawable";
|
|
|
3
3
|
import { ParseTree } from "nlptoolkit-parsetree/dist/ParseTree";
|
|
4
4
|
import { ViewLayerType } from "nlptoolkit-annotatedsentence/dist/ViewLayerType";
|
|
5
5
|
export declare class TreeBankDrawable extends TreeBank {
|
|
6
|
+
/**
|
|
7
|
+
* A constructor of {@link TreeBankDrawable} class which reads all {@link ParseTreeDrawable} files with the file
|
|
8
|
+
* name satisfying the given pattern inside the given folder. For each file inside that folder, the constructor
|
|
9
|
+
* creates a ParseTreeDrawable and puts in inside the list parseTrees.
|
|
10
|
+
* @param folder Folder where all parseTrees reside.
|
|
11
|
+
* @param pattern File pattern such as "." ".train" ".test".
|
|
12
|
+
*/
|
|
6
13
|
constructor(folder?: string, pattern?: string);
|
|
14
|
+
/**
|
|
15
|
+
* Accessor for the parseTrees attribute
|
|
16
|
+
* @return ParseTrees attribute
|
|
17
|
+
*/
|
|
7
18
|
getParseTrees(): Array<ParseTree>;
|
|
19
|
+
/**
|
|
20
|
+
* Accessor for a specific tree with the given position in the array.
|
|
21
|
+
* @param index Index of the parseTree.
|
|
22
|
+
* @return Tree that is in the position index
|
|
23
|
+
*/
|
|
8
24
|
get(index: number): ParseTreeDrawable;
|
|
25
|
+
/**
|
|
26
|
+
* Clears the given layer for all nodes in all trees
|
|
27
|
+
* @param layerType Layer name
|
|
28
|
+
*/
|
|
9
29
|
clearLayer(layerType: ViewLayerType): void;
|
|
10
30
|
removeTree(index: number): void;
|
|
11
31
|
}
|
package/dist/TreeBankDrawable.js
CHANGED
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
const fs = require("fs");
|
|
15
15
|
const ParseTreeDrawable_1 = require("./ParseTreeDrawable");
|
|
16
16
|
class TreeBankDrawable extends TreeBank_1.TreeBank {
|
|
17
|
+
/**
|
|
18
|
+
* A constructor of {@link TreeBankDrawable} class which reads all {@link ParseTreeDrawable} files with the file
|
|
19
|
+
* name satisfying the given pattern inside the given folder. For each file inside that folder, the constructor
|
|
20
|
+
* creates a ParseTreeDrawable and puts in inside the list parseTrees.
|
|
21
|
+
* @param folder Folder where all parseTrees reside.
|
|
22
|
+
* @param pattern File pattern such as "." ".train" ".test".
|
|
23
|
+
*/
|
|
17
24
|
constructor(folder, pattern) {
|
|
18
25
|
super();
|
|
19
26
|
let files = fs.readdirSync(folder);
|
|
@@ -31,12 +38,25 @@
|
|
|
31
38
|
}
|
|
32
39
|
}
|
|
33
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Accessor for the parseTrees attribute
|
|
43
|
+
* @return ParseTrees attribute
|
|
44
|
+
*/
|
|
34
45
|
getParseTrees() {
|
|
35
46
|
return this.parseTrees;
|
|
36
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Accessor for a specific tree with the given position in the array.
|
|
50
|
+
* @param index Index of the parseTree.
|
|
51
|
+
* @return Tree that is in the position index
|
|
52
|
+
*/
|
|
37
53
|
get(index) {
|
|
38
54
|
return this.parseTrees[index];
|
|
39
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Clears the given layer for all nodes in all trees
|
|
58
|
+
* @param layerType Layer name
|
|
59
|
+
*/
|
|
40
60
|
clearLayer(layerType) {
|
|
41
61
|
for (let tree of this.parseTrees) {
|
|
42
62
|
let parseTree = tree;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeBankDrawable.js","sourceRoot":"","sources":["../source/TreeBankDrawable.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,iEAA4D;IAC5D,yBAAyB;IACzB,2DAAsD;IAItD,MAAa,gBAAiB,SAAQ,mBAAQ;QAE1C,YAAY,MAAe,EAAE,OAAgB;YACzC,KAAK,EAAE,CAAC;YACR,IAAI,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACnC,KAAK,CAAC,IAAI,EAAE,CAAA;YACZ,KAAK,IAAI,IAAI,IAAI,KAAK,EAAC;gBACnB,IAAI,OAAO,IAAI,SAAS,EAAC;oBACrB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAC;wBACxB,SAAQ;qBACX;iBACJ;gBACD,IAAI,SAAS,GAAG,IAAI,qCAAiB,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,CAAA;gBAC1D,IAAI,SAAS,CAAC,OAAO,EAAE,IAAI,SAAS,EAAC;oBACjC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;oBACxB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBACnC;aACJ;QACL,CAAC;QAED,aAAa;YACT,OAAO,IAAI,CAAC,UAAU,CAAA;QAC1B,CAAC;QAED,GAAG,CAAC,KAAa;YACb,OAA2B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACtD,CAAC;QAED,UAAU,CAAC,SAAwB;YAC/B,KAAK,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,EAAC;gBAC7B,IAAI,SAAS,GAAuB,IAAI,CAAC;gBACzC,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;aACnC;QACL,CAAC;QAED,UAAU,CAAC,KAAa;YACpB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACnC,CAAC;KAEJ;
|
|
1
|
+
{"version":3,"file":"TreeBankDrawable.js","sourceRoot":"","sources":["../source/TreeBankDrawable.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,iEAA4D;IAC5D,yBAAyB;IACzB,2DAAsD;IAItD,MAAa,gBAAiB,SAAQ,mBAAQ;QAE1C;;;;;;WAMG;QACH,YAAY,MAAe,EAAE,OAAgB;YACzC,KAAK,EAAE,CAAC;YACR,IAAI,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACnC,KAAK,CAAC,IAAI,EAAE,CAAA;YACZ,KAAK,IAAI,IAAI,IAAI,KAAK,EAAC;gBACnB,IAAI,OAAO,IAAI,SAAS,EAAC;oBACrB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAC;wBACxB,SAAQ;qBACX;iBACJ;gBACD,IAAI,SAAS,GAAG,IAAI,qCAAiB,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,CAAA;gBAC1D,IAAI,SAAS,CAAC,OAAO,EAAE,IAAI,SAAS,EAAC;oBACjC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;oBACxB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBACnC;aACJ;QACL,CAAC;QAED;;;WAGG;QACH,aAAa;YACT,OAAO,IAAI,CAAC,UAAU,CAAA;QAC1B,CAAC;QAED;;;;WAIG;QACH,GAAG,CAAC,KAAa;YACb,OAA2B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACtD,CAAC;QAED;;;WAGG;QACH,UAAU,CAAC,SAAwB;YAC/B,KAAK,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,EAAC;gBAC7B,IAAI,SAAS,GAAuB,IAAI,CAAC;gBACzC,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;aACnC;QACL,CAAC;QAED,UAAU,CAAC,KAAa;YACpB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QACnC,CAAC;KAEJ;IA3DD,4CA2DC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export * from "./Layer/DependencyLayer";
|
|
2
|
+
export * from "./Layer/EnglishPropbankLayer";
|
|
3
|
+
export * from "./Layer/EnglishSemanticLayer";
|
|
4
|
+
export * from "./Layer/EnglishWordLayer";
|
|
5
|
+
export * from "./Layer/MetaMorphemeLayer";
|
|
6
|
+
export * from "./Layer/MetaMorphemesMovedLayer";
|
|
7
|
+
export * from "./Layer/MorphologicalAnalysisLayer";
|
|
8
|
+
export * from "./Layer/MultiWordLayer";
|
|
9
|
+
export * from "./Layer/MultiWordMultiItemLayer";
|
|
10
|
+
export * from "./Layer/NERLayer";
|
|
11
|
+
export * from "./Layer/PersianWordLayer";
|
|
12
|
+
export * from "./Layer/ShallowParseLayer";
|
|
13
|
+
export * from "./Layer/SingleWordLayer";
|
|
14
|
+
export * from "./Layer/SingleWordMultiItemLayer";
|
|
15
|
+
export * from "./Layer/SourceLanguageWordLayer";
|
|
16
|
+
export * from "./Layer/TargetLanguageWordLayer";
|
|
17
|
+
export * from "./Layer/TurkishPropbankLayer";
|
|
18
|
+
export * from "./Layer/TurkishSemanticLayer";
|
|
19
|
+
export * from "./Layer/TurkishWordLayer";
|
|
20
|
+
export * from "./Layer/WordLayer";
|
|
21
|
+
export * from "./Processor/Condition/IsDoubleNode";
|
|
22
|
+
export * from "./Processor/Condition/IsDoubleNodeWithDifferentTags";
|
|
23
|
+
export * from "./Processor/Condition/IsEnglishLeafNode";
|
|
24
|
+
export * from "./Processor/Condition/IsLeafNode";
|
|
25
|
+
export * from "./Processor/Condition/IsNodeWithPredicate";
|
|
26
|
+
export * from "./Processor/Condition/IsNodeWithSymbol";
|
|
27
|
+
export * from "./Processor/Condition/IsNodeWithSynSetId";
|
|
28
|
+
export * from "./Processor/Condition/IsNoneNode";
|
|
29
|
+
export * from "./Processor/Condition/IsNullElement";
|
|
30
|
+
export * from "./Processor/Condition/IsNumber";
|
|
31
|
+
export * from "./Processor/Condition/IsPredicateVerbNode";
|
|
32
|
+
export * from "./Processor/Condition/IsProperNoun";
|
|
33
|
+
export * from "./Processor/Condition/IsPunctuationNode";
|
|
34
|
+
export * from "./Processor/Condition/IsTransferable";
|
|
35
|
+
export * from "./Processor/Condition/IsTurkishLeafNode";
|
|
36
|
+
export * from "./Processor/Condition/IsVerbNode";
|
|
37
|
+
export * from "./Processor/Condition/IsVPNode";
|
|
38
|
+
export * from "./Processor/Condition/NodeDrawableCondition";
|
|
39
|
+
export * from "./Processor/LayerExist/ContainsLayerInformation";
|
|
40
|
+
export * from "./Processor/LayerExist/LeafListCondition";
|
|
41
|
+
export * from "./Processor/LayerExist/NotContainsLayerInformation";
|
|
42
|
+
export * from "./Processor/LayerExist/SemiContainsLayerInformation";
|
|
43
|
+
export * from "./Processor/LeafConverter/LeafToEnglish";
|
|
44
|
+
export * from "./Processor/LeafConverter/LeafToLanguageConverter";
|
|
45
|
+
export * from "./Processor/LeafConverter/LeafToPersian";
|
|
46
|
+
export * from "./Processor/LeafConverter/LeafToRootFormConverter";
|
|
47
|
+
export * from "./Processor/LeafConverter/LeafToStringConverter";
|
|
48
|
+
export * from "./Processor/LeafConverter/LeafToTurkish";
|
|
49
|
+
export * from "./Processor/NodeModification/ConvertToLayeredFormat";
|
|
50
|
+
export * from "./Processor/NodeModification/NodeModifier";
|
|
51
|
+
export * from "./Processor/NodeDrawableCollector";
|
|
52
|
+
export * from "./Processor/TreeModifier";
|
|
53
|
+
export * from "./Processor/TreeToStringConverter";
|
|
54
|
+
export * from "./ChunkType";
|
|
55
|
+
export * from "./LayerInfo";
|
|
56
|
+
export * from "./ParseNodeDrawable";
|
|
57
|
+
export * from "./ParseTreeDrawable";
|
|
58
|
+
export * from "./TreeBankDrawable";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
+
if (k2 === undefined) k2 = k;
|
|
3
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
4
|
+
}) : (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
o[k2] = m[k];
|
|
7
|
+
}));
|
|
8
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
9
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
10
|
+
};
|
|
11
|
+
(function (factory) {
|
|
12
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
13
|
+
var v = factory(require, exports);
|
|
14
|
+
if (v !== undefined) module.exports = v;
|
|
15
|
+
}
|
|
16
|
+
else if (typeof define === "function" && define.amd) {
|
|
17
|
+
define(["require", "exports", "./Layer/DependencyLayer", "./Layer/EnglishPropbankLayer", "./Layer/EnglishSemanticLayer", "./Layer/EnglishWordLayer", "./Layer/MetaMorphemeLayer", "./Layer/MetaMorphemesMovedLayer", "./Layer/MorphologicalAnalysisLayer", "./Layer/MultiWordLayer", "./Layer/MultiWordMultiItemLayer", "./Layer/NERLayer", "./Layer/PersianWordLayer", "./Layer/ShallowParseLayer", "./Layer/SingleWordLayer", "./Layer/SingleWordMultiItemLayer", "./Layer/SourceLanguageWordLayer", "./Layer/TargetLanguageWordLayer", "./Layer/TurkishPropbankLayer", "./Layer/TurkishSemanticLayer", "./Layer/TurkishWordLayer", "./Layer/WordLayer", "./Processor/Condition/IsDoubleNode", "./Processor/Condition/IsDoubleNodeWithDifferentTags", "./Processor/Condition/IsEnglishLeafNode", "./Processor/Condition/IsLeafNode", "./Processor/Condition/IsNodeWithPredicate", "./Processor/Condition/IsNodeWithSymbol", "./Processor/Condition/IsNodeWithSynSetId", "./Processor/Condition/IsNoneNode", "./Processor/Condition/IsNullElement", "./Processor/Condition/IsNumber", "./Processor/Condition/IsPredicateVerbNode", "./Processor/Condition/IsProperNoun", "./Processor/Condition/IsPunctuationNode", "./Processor/Condition/IsTransferable", "./Processor/Condition/IsTurkishLeafNode", "./Processor/Condition/IsVerbNode", "./Processor/Condition/IsVPNode", "./Processor/Condition/NodeDrawableCondition", "./Processor/LayerExist/ContainsLayerInformation", "./Processor/LayerExist/LeafListCondition", "./Processor/LayerExist/NotContainsLayerInformation", "./Processor/LayerExist/SemiContainsLayerInformation", "./Processor/LeafConverter/LeafToEnglish", "./Processor/LeafConverter/LeafToLanguageConverter", "./Processor/LeafConverter/LeafToPersian", "./Processor/LeafConverter/LeafToRootFormConverter", "./Processor/LeafConverter/LeafToStringConverter", "./Processor/LeafConverter/LeafToTurkish", "./Processor/NodeModification/ConvertToLayeredFormat", "./Processor/NodeModification/NodeModifier", "./Processor/NodeDrawableCollector", "./Processor/TreeModifier", "./Processor/TreeToStringConverter", "./ChunkType", "./LayerInfo", "./ParseNodeDrawable", "./ParseTreeDrawable", "./TreeBankDrawable"], factory);
|
|
18
|
+
}
|
|
19
|
+
})(function (require, exports) {
|
|
20
|
+
"use strict";
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
__exportStar(require("./Layer/DependencyLayer"), exports);
|
|
23
|
+
__exportStar(require("./Layer/EnglishPropbankLayer"), exports);
|
|
24
|
+
__exportStar(require("./Layer/EnglishSemanticLayer"), exports);
|
|
25
|
+
__exportStar(require("./Layer/EnglishWordLayer"), exports);
|
|
26
|
+
__exportStar(require("./Layer/MetaMorphemeLayer"), exports);
|
|
27
|
+
__exportStar(require("./Layer/MetaMorphemesMovedLayer"), exports);
|
|
28
|
+
__exportStar(require("./Layer/MorphologicalAnalysisLayer"), exports);
|
|
29
|
+
__exportStar(require("./Layer/MultiWordLayer"), exports);
|
|
30
|
+
__exportStar(require("./Layer/MultiWordMultiItemLayer"), exports);
|
|
31
|
+
__exportStar(require("./Layer/NERLayer"), exports);
|
|
32
|
+
__exportStar(require("./Layer/PersianWordLayer"), exports);
|
|
33
|
+
__exportStar(require("./Layer/ShallowParseLayer"), exports);
|
|
34
|
+
__exportStar(require("./Layer/SingleWordLayer"), exports);
|
|
35
|
+
__exportStar(require("./Layer/SingleWordMultiItemLayer"), exports);
|
|
36
|
+
__exportStar(require("./Layer/SourceLanguageWordLayer"), exports);
|
|
37
|
+
__exportStar(require("./Layer/TargetLanguageWordLayer"), exports);
|
|
38
|
+
__exportStar(require("./Layer/TurkishPropbankLayer"), exports);
|
|
39
|
+
__exportStar(require("./Layer/TurkishSemanticLayer"), exports);
|
|
40
|
+
__exportStar(require("./Layer/TurkishWordLayer"), exports);
|
|
41
|
+
__exportStar(require("./Layer/WordLayer"), exports);
|
|
42
|
+
__exportStar(require("./Processor/Condition/IsDoubleNode"), exports);
|
|
43
|
+
__exportStar(require("./Processor/Condition/IsDoubleNodeWithDifferentTags"), exports);
|
|
44
|
+
__exportStar(require("./Processor/Condition/IsEnglishLeafNode"), exports);
|
|
45
|
+
__exportStar(require("./Processor/Condition/IsLeafNode"), exports);
|
|
46
|
+
__exportStar(require("./Processor/Condition/IsNodeWithPredicate"), exports);
|
|
47
|
+
__exportStar(require("./Processor/Condition/IsNodeWithSymbol"), exports);
|
|
48
|
+
__exportStar(require("./Processor/Condition/IsNodeWithSynSetId"), exports);
|
|
49
|
+
__exportStar(require("./Processor/Condition/IsNoneNode"), exports);
|
|
50
|
+
__exportStar(require("./Processor/Condition/IsNullElement"), exports);
|
|
51
|
+
__exportStar(require("./Processor/Condition/IsNumber"), exports);
|
|
52
|
+
__exportStar(require("./Processor/Condition/IsPredicateVerbNode"), exports);
|
|
53
|
+
__exportStar(require("./Processor/Condition/IsProperNoun"), exports);
|
|
54
|
+
__exportStar(require("./Processor/Condition/IsPunctuationNode"), exports);
|
|
55
|
+
__exportStar(require("./Processor/Condition/IsTransferable"), exports);
|
|
56
|
+
__exportStar(require("./Processor/Condition/IsTurkishLeafNode"), exports);
|
|
57
|
+
__exportStar(require("./Processor/Condition/IsVerbNode"), exports);
|
|
58
|
+
__exportStar(require("./Processor/Condition/IsVPNode"), exports);
|
|
59
|
+
__exportStar(require("./Processor/Condition/NodeDrawableCondition"), exports);
|
|
60
|
+
__exportStar(require("./Processor/LayerExist/ContainsLayerInformation"), exports);
|
|
61
|
+
__exportStar(require("./Processor/LayerExist/LeafListCondition"), exports);
|
|
62
|
+
__exportStar(require("./Processor/LayerExist/NotContainsLayerInformation"), exports);
|
|
63
|
+
__exportStar(require("./Processor/LayerExist/SemiContainsLayerInformation"), exports);
|
|
64
|
+
__exportStar(require("./Processor/LeafConverter/LeafToEnglish"), exports);
|
|
65
|
+
__exportStar(require("./Processor/LeafConverter/LeafToLanguageConverter"), exports);
|
|
66
|
+
__exportStar(require("./Processor/LeafConverter/LeafToPersian"), exports);
|
|
67
|
+
__exportStar(require("./Processor/LeafConverter/LeafToRootFormConverter"), exports);
|
|
68
|
+
__exportStar(require("./Processor/LeafConverter/LeafToStringConverter"), exports);
|
|
69
|
+
__exportStar(require("./Processor/LeafConverter/LeafToTurkish"), exports);
|
|
70
|
+
__exportStar(require("./Processor/NodeModification/ConvertToLayeredFormat"), exports);
|
|
71
|
+
__exportStar(require("./Processor/NodeModification/NodeModifier"), exports);
|
|
72
|
+
__exportStar(require("./Processor/NodeDrawableCollector"), exports);
|
|
73
|
+
__exportStar(require("./Processor/TreeModifier"), exports);
|
|
74
|
+
__exportStar(require("./Processor/TreeToStringConverter"), exports);
|
|
75
|
+
__exportStar(require("./ChunkType"), exports);
|
|
76
|
+
__exportStar(require("./LayerInfo"), exports);
|
|
77
|
+
__exportStar(require("./ParseNodeDrawable"), exports);
|
|
78
|
+
__exportStar(require("./ParseTreeDrawable"), exports);
|
|
79
|
+
__exportStar(require("./TreeBankDrawable"), exports);
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;IAAA,0DAAuC;IACvC,+DAA4C;IAC5C,+DAA4C;IAC5C,2DAAwC;IACxC,4DAAyC;IACzC,kEAA+C;IAC/C,qEAAkD;IAClD,yDAAsC;IACtC,kEAA+C;IAC/C,mDAAgC;IAChC,2DAAwC;IACxC,4DAAyC;IACzC,0DAAuC;IACvC,mEAAgD;IAChD,kEAA+C;IAC/C,kEAA+C;IAC/C,+DAA4C;IAC5C,+DAA4C;IAC5C,2DAAwC;IACxC,oDAAiC;IACjC,qEAAkD;IAClD,sFAAmE;IACnE,0EAAuD;IACvD,mEAAgD;IAChD,4EAAyD;IACzD,yEAAsD;IACtD,2EAAwD;IACxD,mEAAgD;IAChD,sEAAmD;IACnD,iEAA8C;IAC9C,4EAAyD;IACzD,qEAAkD;IAClD,0EAAuD;IACvD,uEAAoD;IACpD,0EAAuD;IACvD,mEAAgD;IAChD,iEAA8C;IAC9C,8EAA2D;IAC3D,kFAA+D;IAC/D,2EAAwD;IACxD,qFAAkE;IAClE,sFAAmE;IACnE,0EAAuD;IACvD,oFAAiE;IACjE,0EAAuD;IACvD,oFAAiE;IACjE,kFAA+D;IAC/D,0EAAuD;IACvD,sFAAmE;IACnE,4EAAyD;IACzD,oEAAiD;IACjD,2DAAwC;IACxC,oEAAiD;IACjD,8CAA2B;IAC3B,8CAA2B;IAC3B,sDAAmC;IACnC,sDAAmC;IACnC,qDAAkC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nlptoolkit-annotatedtree",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "index.
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "Mocha"
|
|
9
9
|
},
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
"typescript": "^4.5.5"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"nlptoolkit-annotatedsentence": "^1.0.
|
|
28
|
-
"nlptoolkit-corpus": "^1.0.
|
|
29
|
-
"nlptoolkit-dependencyparser": "^1.0.
|
|
30
|
-
"nlptoolkit-dictionary": "^1.0.
|
|
31
|
-
"nlptoolkit-framenet": "^1.0.
|
|
32
|
-
"nlptoolkit-morphologicalanalysis": "^1.0.
|
|
33
|
-
"nlptoolkit-namedentityrecognition": "^1.0.
|
|
34
|
-
"nlptoolkit-parsetree": "^1.0.
|
|
35
|
-
"nlptoolkit-propbank": "^1.0.
|
|
36
|
-
"nlptoolkit-sentinet": "^1.0.
|
|
37
|
-
"nlptoolkit-wordnet": "^1.0.
|
|
27
|
+
"nlptoolkit-annotatedsentence": "^1.0.8",
|
|
28
|
+
"nlptoolkit-corpus": "^1.0.11",
|
|
29
|
+
"nlptoolkit-dependencyparser": "^1.0.9",
|
|
30
|
+
"nlptoolkit-dictionary": "^1.0.13",
|
|
31
|
+
"nlptoolkit-framenet": "^1.0.4",
|
|
32
|
+
"nlptoolkit-morphologicalanalysis": "^1.0.18",
|
|
33
|
+
"nlptoolkit-namedentityrecognition": "^1.0.2",
|
|
34
|
+
"nlptoolkit-parsetree": "^1.0.5",
|
|
35
|
+
"nlptoolkit-propbank": "^1.0.6",
|
|
36
|
+
"nlptoolkit-sentinet": "^1.0.2",
|
|
37
|
+
"nlptoolkit-wordnet": "^1.0.6"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -2,6 +2,10 @@ import {SingleWordLayer} from "./SingleWordLayer";
|
|
|
2
2
|
|
|
3
3
|
export class DependencyLayer extends SingleWordLayer<string>{
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Constructor for the dependency layer. Dependency layer stores the dependency information of a node.
|
|
7
|
+
* @param layerValue Value of the dependency layer.
|
|
8
|
+
*/
|
|
5
9
|
constructor(layerValue: string) {
|
|
6
10
|
super();
|
|
7
11
|
this.layerName = "dependency"
|
|
@@ -3,12 +3,21 @@ import {Argument} from "nlptoolkit-propbank/dist/Argument";
|
|
|
3
3
|
|
|
4
4
|
export class EnglishPropbankLayer extends SingleWordMultiItemLayer<Argument>{
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Constructor for the propbank layer for English language.
|
|
8
|
+
* @param layerValue Value for the English propbank layer.
|
|
9
|
+
*/
|
|
6
10
|
constructor(layerValue: string) {
|
|
7
11
|
super();
|
|
8
12
|
this.layerName = "englishPropbank"
|
|
9
13
|
this.setLayerValue(layerValue)
|
|
10
14
|
}
|
|
11
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Sets the value for the propbank layer in a node. Value may consist of multiple propbank information separated via
|
|
18
|
+
* '#' character. Each propbank value consists of argumentType and id info separated via '$' character.
|
|
19
|
+
* @param layerValue New layer info
|
|
20
|
+
*/
|
|
12
21
|
setLayerValue(layerValue: string) {
|
|
13
22
|
this.items = new Array<Argument>();
|
|
14
23
|
this.layerValue = layerValue;
|
|
@@ -2,6 +2,11 @@ import {SingleWordLayer} from "./SingleWordLayer";
|
|
|
2
2
|
|
|
3
3
|
export class EnglishSemanticLayer extends SingleWordLayer<string>{
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Constructor for the semantic layer for English language. Sets the layer value to the synset id defined in English
|
|
7
|
+
* WordNet.
|
|
8
|
+
* @param layerValue Value for the English semantic layer.
|
|
9
|
+
*/
|
|
5
10
|
constructor(layerValue: string) {
|
|
6
11
|
super();
|
|
7
12
|
this.layerName = "englishSemantics"
|
|
@@ -2,6 +2,10 @@ import {SourceLanguageWordLayer} from "./SourceLanguageWordLayer";
|
|
|
2
2
|
|
|
3
3
|
export class EnglishWordLayer extends SourceLanguageWordLayer{
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Constructor for the word layer for English language. Sets the surface form.
|
|
7
|
+
* @param layerValue Value for the word layer.
|
|
8
|
+
*/
|
|
5
9
|
constructor(layerValue: string) {
|
|
6
10
|
super(layerValue);
|
|
7
11
|
this.layerName = "english"
|
|
@@ -4,11 +4,20 @@ import {ViewLayerType} from "nlptoolkit-annotatedsentence/dist/ViewLayerType";
|
|
|
4
4
|
|
|
5
5
|
export class MetaMorphemeLayer extends MetaMorphemesMovedLayer{
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Constructor for the metamorpheme layer. Sets the metamorpheme information for multiple words in the node.
|
|
9
|
+
* @param layerValue Layer value for the metamorpheme information. Consists of metamorpheme information of multiple
|
|
10
|
+
* words separated via space character.
|
|
11
|
+
*/
|
|
7
12
|
constructor(layerValue: string) {
|
|
8
13
|
super(layerValue);
|
|
9
14
|
this.layerName = "metaMorphemes"
|
|
10
15
|
}
|
|
11
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Sets the layer value to the string form of the given parse.
|
|
19
|
+
* @param parse New metamorphic parse.
|
|
20
|
+
*/
|
|
12
21
|
setLayerValue(parse: any): void{
|
|
13
22
|
this.layerValue = parse.toString();
|
|
14
23
|
this.items = new Array<MetamorphicParse>();
|
|
@@ -20,6 +29,11 @@ export class MetaMorphemeLayer extends MetaMorphemesMovedLayer{
|
|
|
20
29
|
}
|
|
21
30
|
}
|
|
22
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Constructs metamorpheme information starting from the position index.
|
|
34
|
+
* @param index Position of the morpheme to start.
|
|
35
|
+
* @return Metamorpheme information starting from the position index.
|
|
36
|
+
*/
|
|
23
37
|
getLayerInfoFrom(index: number): string{
|
|
24
38
|
let size = 0;
|
|
25
39
|
for (let parse of this.items){
|
|
@@ -37,6 +51,11 @@ export class MetaMorphemeLayer extends MetaMorphemesMovedLayer{
|
|
|
37
51
|
return null;
|
|
38
52
|
}
|
|
39
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Removes metamorphemes from the given index. Index shows the position of the metamorpheme in the metamorphemes list.
|
|
56
|
+
* @param index Position of the metamorpheme from which the other metamorphemes will be removed.
|
|
57
|
+
* @return New metamorphic parse not containing the removed parts.
|
|
58
|
+
*/
|
|
40
59
|
metaMorphemeRemoveFromIndex(index: number): MetamorphicParse{
|
|
41
60
|
if (index >= 0 && index < this.getLayerSize(ViewLayerType.META_MORPHEME)){
|
|
42
61
|
let size = 0;
|
|
@@ -4,12 +4,23 @@ import {ViewLayerType} from "nlptoolkit-annotatedsentence/dist/ViewLayerType";
|
|
|
4
4
|
|
|
5
5
|
export class MetaMorphemesMovedLayer extends MultiWordMultiItemLayer<MetamorphicParse>{
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Constructor for the metaMorphemesMoved layer. Sets the metamorpheme information for multiple words in the node.
|
|
9
|
+
* @param layerValue Layer value for the metaMorphemesMoved information. Consists of metamorpheme information of
|
|
10
|
+
* multiple words separated via space character.
|
|
11
|
+
*/
|
|
7
12
|
constructor(layerValue: string) {
|
|
8
13
|
super();
|
|
9
14
|
this.layerName = "metaMorphemesMoved"
|
|
10
15
|
this.setLayerValue(layerValue)
|
|
11
16
|
}
|
|
12
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Returns the metamorpheme at position index in the metamorpheme list.
|
|
20
|
+
* @param viewLayer Not used.
|
|
21
|
+
* @param index Position in the metamorpheme list.
|
|
22
|
+
* @return The metamorpheme at position index in the metamorpheme list.
|
|
23
|
+
*/
|
|
13
24
|
getLayerInfoAt(viewLayer: ViewLayerType, index: number): string {
|
|
14
25
|
let size = 0;
|
|
15
26
|
for (let parse of this.items){
|
|
@@ -21,6 +32,11 @@ export class MetaMorphemesMovedLayer extends MultiWordMultiItemLayer<Metamorphic
|
|
|
21
32
|
return null;
|
|
22
33
|
}
|
|
23
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Returns the total number of metamorphemes in the words in the node.
|
|
37
|
+
* @param viewLayer Not used.
|
|
38
|
+
* @return Total number of metamorphemes in the words in the node.
|
|
39
|
+
*/
|
|
24
40
|
getLayerSize(viewLayer: ViewLayerType): number {
|
|
25
41
|
let size = 0;
|
|
26
42
|
for (let parse of this.items){
|
|
@@ -29,6 +45,10 @@ export class MetaMorphemesMovedLayer extends MultiWordMultiItemLayer<Metamorphic
|
|
|
29
45
|
return size;
|
|
30
46
|
}
|
|
31
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Sets the layer value to the string form of the given parse.
|
|
50
|
+
* @param layerValue New metamorphic parse.
|
|
51
|
+
*/
|
|
32
52
|
setLayerValue(layerValue: string): void {
|
|
33
53
|
this.items = new Array<MetamorphicParse>();
|
|
34
54
|
this.layerValue = layerValue;
|
|
@@ -4,12 +4,25 @@ import {ViewLayerType} from "nlptoolkit-annotatedsentence/dist/ViewLayerType";
|
|
|
4
4
|
|
|
5
5
|
export class MorphologicalAnalysisLayer extends MultiWordMultiItemLayer<MorphologicalParse>{
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Constructor for the morphological analysis layer. Sets the morphological parse information for multiple words in
|
|
9
|
+
* the node.
|
|
10
|
+
* @param layerValue Layer value for the morphological parse information. Consists of morphological parse information
|
|
11
|
+
* of multiple words separated via space character.
|
|
12
|
+
*/
|
|
7
13
|
constructor(layerValue: string) {
|
|
8
14
|
super();
|
|
9
15
|
this.layerName = "morphologicalAnalysis"
|
|
10
16
|
this.setLayerValue(layerValue)
|
|
11
17
|
}
|
|
12
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Returns the morphological tag (for PART_OF_SPEECH) or inflectional group (for INFLECTIONAL_GROUP) at position
|
|
21
|
+
* index.
|
|
22
|
+
* @param viewLayer Layer type.
|
|
23
|
+
* @param index Position of the morphological tag (for PART_OF_SPEECH) or inflectional group (for INFLECTIONAL_GROUP)
|
|
24
|
+
* @return The morphological tag (for PART_OF_SPEECH) or inflectional group (for INFLECTIONAL_GROUP)
|
|
25
|
+
*/
|
|
13
26
|
getLayerInfoAt(viewLayer: ViewLayerType, index: number): string {
|
|
14
27
|
let size;
|
|
15
28
|
switch (viewLayer){
|
|
@@ -35,6 +48,13 @@ export class MorphologicalAnalysisLayer extends MultiWordMultiItemLayer<Morpholo
|
|
|
35
48
|
return null;
|
|
36
49
|
}
|
|
37
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Returns the total number of morphological tags (for PART_OF_SPEECH) or inflectional groups
|
|
53
|
+
* (for INFLECTIONAL_GROUP) in the words in the node.
|
|
54
|
+
* @param viewLayer Layer type.
|
|
55
|
+
* @return Total number of morphological tags (for PART_OF_SPEECH) or inflectional groups (for INFLECTIONAL_GROUP)
|
|
56
|
+
* in the words in the node.
|
|
57
|
+
*/
|
|
38
58
|
getLayerSize(viewLayer: ViewLayerType): number {
|
|
39
59
|
let size
|
|
40
60
|
switch (viewLayer){
|
|
@@ -55,6 +75,10 @@ export class MorphologicalAnalysisLayer extends MultiWordMultiItemLayer<Morpholo
|
|
|
55
75
|
}
|
|
56
76
|
}
|
|
57
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Sets the layer value to the string form of the given morphological parse.
|
|
80
|
+
* @param layerValue New morphological parse.
|
|
81
|
+
*/
|
|
58
82
|
setLayerValue(layerValue: any): void {
|
|
59
83
|
if (layerValue instanceof MorphologicalParse){
|
|
60
84
|
let parse = layerValue
|
|
@@ -73,6 +97,10 @@ export class MorphologicalAnalysisLayer extends MultiWordMultiItemLayer<Morpholo
|
|
|
73
97
|
}
|
|
74
98
|
}
|
|
75
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Checks if the last inflectional group contains VERB tag.
|
|
102
|
+
* @return True if the last inflectional group contains VERB tag, false otherwise.
|
|
103
|
+
*/
|
|
76
104
|
isVerbal(): boolean{
|
|
77
105
|
let dbLabel = "^DB+";
|
|
78
106
|
let needle = "VERB+";
|
|
@@ -85,6 +113,10 @@ export class MorphologicalAnalysisLayer extends MultiWordMultiItemLayer<Morpholo
|
|
|
85
113
|
return haystack.includes(needle);
|
|
86
114
|
}
|
|
87
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Checks if the last verbal inflectional group contains ZERO tag.
|
|
118
|
+
* @return True if the last verbal inflectional group contains ZERO tag, false otherwise.
|
|
119
|
+
*/
|
|
88
120
|
isNominal(): boolean{
|
|
89
121
|
let dbLabel = "^DB+VERB+";
|
|
90
122
|
let needle = "ZERO+";
|