nlptoolkit-annotatedtree 1.0.2 → 1.0.4
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 +6 -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/package.json +14 -12
- 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
|
@@ -26,50 +26,106 @@
|
|
|
26
26
|
constructor(fileDescriptionOrPath, fileDescriptionOrFileName, index) {
|
|
27
27
|
super();
|
|
28
28
|
if (fileDescriptionOrPath instanceof FileDescription_1.FileDescription) {
|
|
29
|
-
this.
|
|
30
|
-
this.readFromFile(fileDescriptionOrPath.getPath());
|
|
29
|
+
this.constructor1(fileDescriptionOrPath);
|
|
31
30
|
}
|
|
32
31
|
else {
|
|
33
32
|
if (fileDescriptionOrFileName == undefined) {
|
|
34
|
-
|
|
35
|
-
this.readFromFile(path);
|
|
33
|
+
this.constructor2(fileDescriptionOrPath);
|
|
36
34
|
}
|
|
37
35
|
else {
|
|
38
36
|
if (fileDescriptionOrFileName instanceof FileDescription_1.FileDescription) {
|
|
39
|
-
|
|
40
|
-
let fileDescription = fileDescriptionOrFileName;
|
|
41
|
-
this.fileDescription = new FileDescription_1.FileDescription(path, fileDescription.getExtension(), fileDescription.getIndex());
|
|
42
|
-
this.readFromFile(this.fileDescription.getPath());
|
|
37
|
+
this.constructor3(fileDescriptionOrPath, fileDescriptionOrFileName);
|
|
43
38
|
}
|
|
44
39
|
else {
|
|
45
40
|
if (index == undefined) {
|
|
46
|
-
|
|
47
|
-
let rawFileName = fileDescriptionOrFileName;
|
|
48
|
-
this.fileDescription = new FileDescription_1.FileDescription(path, rawFileName);
|
|
49
|
-
this.readFromFile(this.fileDescription.getPath());
|
|
41
|
+
this.constructor4(fileDescriptionOrPath, fileDescriptionOrFileName);
|
|
50
42
|
}
|
|
51
43
|
else {
|
|
52
|
-
|
|
53
|
-
let extension = fileDescriptionOrFileName;
|
|
54
|
-
this.fileDescription = new FileDescription_1.FileDescription(path, extension, index);
|
|
55
|
-
this.readFromFile(this.fileDescription.getPath());
|
|
44
|
+
this.constructor5(fileDescriptionOrPath, fileDescriptionOrFileName, index);
|
|
56
45
|
}
|
|
57
46
|
}
|
|
58
47
|
}
|
|
59
48
|
}
|
|
60
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Another constructor for the ParseTreeDrawable. Sets the file description and reads the tree from the file
|
|
52
|
+
* description.
|
|
53
|
+
* @param fileDescription File description that contains the path, index and extension information.
|
|
54
|
+
*/
|
|
55
|
+
constructor1(fileDescription) {
|
|
56
|
+
this.fileDescription = fileDescription;
|
|
57
|
+
this.readFromFile(fileDescription.getPath());
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Another constructor for the ParseTreeDrawable. Sets the file description and reads the tree from the file
|
|
61
|
+
* description.
|
|
62
|
+
* @param path Path of the tree
|
|
63
|
+
*/
|
|
64
|
+
constructor2(path) {
|
|
65
|
+
this.readFromFile(path);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Another constructor for the ParseTreeDrawable. Sets the file description and reads the tree from the file
|
|
69
|
+
* description.
|
|
70
|
+
* @param path Path of the tree
|
|
71
|
+
* @param fileDescription File description that contains the path, index and extension information.
|
|
72
|
+
*/
|
|
73
|
+
constructor3(path, fileDescription) {
|
|
74
|
+
this.fileDescription = new FileDescription_1.FileDescription(path, fileDescription.getExtension(), fileDescription.getIndex());
|
|
75
|
+
this.readFromFile(this.fileDescription.getPath());
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Constructor for the ParseTreeDrawable. Sets the file description and reads the tree from the file description.
|
|
79
|
+
* @param path Path of the tree
|
|
80
|
+
* @param rawFileName File name of the tree such as 0123.train.
|
|
81
|
+
*/
|
|
82
|
+
constructor4(path, rawFileName) {
|
|
83
|
+
this.fileDescription = new FileDescription_1.FileDescription(path, rawFileName);
|
|
84
|
+
this.readFromFile(this.fileDescription.getPath());
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Another constructor for the ParseTreeDrawable. Sets the file description and reads the tree from the file
|
|
88
|
+
* description.
|
|
89
|
+
* @param path Path of the tree
|
|
90
|
+
* @param extension Extension of the file such as train, test or dev.
|
|
91
|
+
* @param index Index of the file such as 1235.
|
|
92
|
+
*/
|
|
93
|
+
constructor5(path, extension, index) {
|
|
94
|
+
this.fileDescription = new FileDescription_1.FileDescription(path, extension, index);
|
|
95
|
+
this.readFromFile(this.fileDescription.getPath());
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Mutator method for the fileDescription attribute.
|
|
99
|
+
* @param fileDescription New fileDescription value.
|
|
100
|
+
*/
|
|
61
101
|
setFileDescription(fileDescription) {
|
|
62
102
|
this.fileDescription = fileDescription;
|
|
63
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Accessor method for the fileDescription attribute.
|
|
106
|
+
* @return FileDescription attribute.
|
|
107
|
+
*/
|
|
64
108
|
getFileDescription() {
|
|
65
109
|
return this.fileDescription;
|
|
66
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Reloads the tree from the input file.
|
|
113
|
+
*/
|
|
67
114
|
reload() {
|
|
68
115
|
this.readFromFile(this.fileDescription.getPath());
|
|
69
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Mutator for the root attribute.
|
|
119
|
+
* @param newRootNode New root node.
|
|
120
|
+
*/
|
|
70
121
|
setRoot(newRootNode) {
|
|
71
122
|
this.root = newRootNode;
|
|
72
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Reads the parse tree from the given file description with path replaced with the currentPath. It sets the root
|
|
126
|
+
* node which calls ParseNodeDrawable constructor recursively.
|
|
127
|
+
* @param currentPath Path of the tree
|
|
128
|
+
*/
|
|
73
129
|
readFromFile(currentPath) {
|
|
74
130
|
let data = fs.readFileSync(currentPath, 'utf8');
|
|
75
131
|
let line = data.split("\n")[0];
|
|
@@ -78,31 +134,63 @@
|
|
|
78
134
|
this.root = new ParseNodeDrawable_1.ParseNodeDrawable(null, line, false, 0);
|
|
79
135
|
}
|
|
80
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Loads the next tree according to the index of the parse tree. For example, if the current
|
|
139
|
+
* tree fileName is 0123.train, after the call of nextTree(3), the method will load 0126.train. If the next tree
|
|
140
|
+
* does not exist, nothing will happen.
|
|
141
|
+
* @param count Number of trees to go forward
|
|
142
|
+
*/
|
|
81
143
|
nextTree(count) {
|
|
82
144
|
if (this.fileDescription.nextFileExists(count)) {
|
|
83
145
|
this.fileDescription.addToIndex(count);
|
|
84
146
|
this.reload();
|
|
85
147
|
}
|
|
86
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Loads the previous tree according to the index of the parse tree. For example, if the current
|
|
151
|
+
* tree fileName is 0123.train, after the call of previousTree(4), the method will load 0119.train. If the
|
|
152
|
+
* previous tree does not exist, nothing will happen.
|
|
153
|
+
* @param count Number of trees to go backward
|
|
154
|
+
*/
|
|
87
155
|
previousTree(count) {
|
|
88
156
|
if (this.fileDescription.previousFileExists(count)) {
|
|
89
157
|
this.fileDescription.addToIndex(-count);
|
|
90
158
|
this.reload();
|
|
91
159
|
}
|
|
92
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Calculates the maximum depth of the tree.
|
|
163
|
+
* @return The maximum depth of the tree.
|
|
164
|
+
*/
|
|
93
165
|
maxDepth() {
|
|
94
166
|
return this.root.maxDepth();
|
|
95
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Swaps the given child node of this node with the previous sibling of that given node. If the given node is the
|
|
170
|
+
* leftmost child, it swaps with the last node.
|
|
171
|
+
* @param node Node to be swapped.
|
|
172
|
+
*/
|
|
96
173
|
moveLeft(node) {
|
|
97
174
|
if (this.root != node) {
|
|
98
175
|
this.root.moveLeft(node);
|
|
99
176
|
}
|
|
100
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Swaps the given child node of this node with the next sibling of that given node. If the given node is the
|
|
180
|
+
* rightmost child, it swaps with the first node.
|
|
181
|
+
* @param node Node to be swapped.
|
|
182
|
+
*/
|
|
101
183
|
moveRight(node) {
|
|
102
184
|
if (this.root != node) {
|
|
103
185
|
this.root.moveRight(node);
|
|
104
186
|
}
|
|
105
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Divides the given node into multiple parse nodes if it contains more than one word. The parent node will be
|
|
190
|
+
* the same for the new nodes, original node is deleted from the children, the pos tags of the new parse nodes will
|
|
191
|
+
* be determined according to their morphological parses.
|
|
192
|
+
* @param parseNode Parse node to be divided
|
|
193
|
+
*/
|
|
106
194
|
divideIntoWords(parseNode) {
|
|
107
195
|
let layers = parseNode.getLayerInfo().divideIntoWords();
|
|
108
196
|
parseNode.getParent().removeChild(parseNode);
|
|
@@ -121,6 +209,12 @@
|
|
|
121
209
|
this.root.updateDepths(0);
|
|
122
210
|
}
|
|
123
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Moves the subtree rooted at fromNode as a child to the node toNode at position childIndex.
|
|
214
|
+
* @param fromNode Subtree root node to be moved.
|
|
215
|
+
* @param toNode Node to which a new subtree will be added.
|
|
216
|
+
* @param childIndex New child index of the toNode.
|
|
217
|
+
*/
|
|
124
218
|
moveNode(fromNode, toNode, childIndex) {
|
|
125
219
|
if (this.root != fromNode) {
|
|
126
220
|
let parent = fromNode.getParent();
|
|
@@ -129,6 +223,11 @@
|
|
|
129
223
|
this.root.updateDepths(0);
|
|
130
224
|
}
|
|
131
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* Removed the first child of the parent node and adds the given child node as a child to that node.
|
|
228
|
+
* @param parent Parent node.
|
|
229
|
+
* @param child New child node to be added.
|
|
230
|
+
*/
|
|
132
231
|
combineWords(parent, child) {
|
|
133
232
|
while (parent.numberOfChildren() > 0) {
|
|
134
233
|
parent.removeChild(parent.firstChild());
|
|
@@ -136,17 +235,36 @@
|
|
|
136
235
|
parent.addChild(child);
|
|
137
236
|
this.root.updateDepths(0);
|
|
138
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* The method checks if all nodes in the tree has the annotation in the given layer.
|
|
240
|
+
* @param viewLayerType Layer name
|
|
241
|
+
* @return True if all nodes in the tree has the annotation in the given layer, false otherwise.
|
|
242
|
+
*/
|
|
139
243
|
layerExists(viewLayerType) {
|
|
140
244
|
return (this.root).layerExists(viewLayerType);
|
|
141
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* Checks if all nodes in the tree has annotation with the given layer.
|
|
248
|
+
* @param viewLayerType Layer name
|
|
249
|
+
* @return True if all nodes in the tree has annotation with the given layer, false otherwise.
|
|
250
|
+
*/
|
|
142
251
|
layerAll(viewLayerType) {
|
|
143
252
|
return (this.root).layerAll(viewLayerType);
|
|
144
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Clears the given layer for all nodes in the tree
|
|
256
|
+
* @param layerType Layer name
|
|
257
|
+
*/
|
|
145
258
|
clearLayer(layerType) {
|
|
146
259
|
if (this.root != null) {
|
|
147
260
|
this.root.clearLayer(layerType);
|
|
148
261
|
}
|
|
149
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Returns the leaf node that comes one after the given parse node according to the inorder traversal.
|
|
265
|
+
* @param parseNode Input parse node.
|
|
266
|
+
* @return The leaf node that comes one after the given parse node according to the inorder traversal.
|
|
267
|
+
*/
|
|
150
268
|
nextLeafNode(parseNode) {
|
|
151
269
|
let nodeDrawableCollector = new NodeDrawableCollector_1.NodeDrawableCollector(this.root, new IsTurkishLeafNode_1.IsTurkishLeafNode());
|
|
152
270
|
let leafList = nodeDrawableCollector.collect();
|
|
@@ -157,6 +275,11 @@
|
|
|
157
275
|
}
|
|
158
276
|
return null;
|
|
159
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Returns the leaf node that comes one before the given parse node according to the inorder traversal.
|
|
280
|
+
* @param parseNode Input parse node.
|
|
281
|
+
* @return The leaf node that comes one before the given parse node according to the inorder traversal.
|
|
282
|
+
*/
|
|
160
283
|
previousLeafNode(parseNode) {
|
|
161
284
|
let nodeDrawableCollector = new NodeDrawableCollector_1.NodeDrawableCollector(this.root, new IsTurkishLeafNode_1.IsTurkishLeafNode());
|
|
162
285
|
let leafList = nodeDrawableCollector.collect();
|
|
@@ -167,6 +290,12 @@
|
|
|
167
290
|
}
|
|
168
291
|
return null;
|
|
169
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* Constructs an AnnotatedSentence object from the Turkish tree. Collects all leaf nodes, then for each leaf node
|
|
295
|
+
* converts layer info of all words at that node to AnnotatedWords. Layers are converted to the counterparts in the
|
|
296
|
+
* AnnotatedWord.
|
|
297
|
+
* @return AnnotatedSentence counterpart of the Turkish tree
|
|
298
|
+
*/
|
|
170
299
|
generateAnnotatedSentence(language) {
|
|
171
300
|
if (language == undefined) {
|
|
172
301
|
let sentence = new AnnotatedSentence_1.AnnotatedSentence();
|
|
@@ -192,6 +321,14 @@
|
|
|
192
321
|
return sentence;
|
|
193
322
|
}
|
|
194
323
|
}
|
|
324
|
+
/**
|
|
325
|
+
* Recursive method that generates a new parse tree by replacing the tag information of the all parse nodes (with all
|
|
326
|
+
* its descendants) with respect to the morphological annotation of all parse nodes (with all its descendants)
|
|
327
|
+
* of the current parse tree.
|
|
328
|
+
* @param surfaceForm If true, tag will be replaced with the surface form annotation.
|
|
329
|
+
* @return A new parse tree by replacing the tag information of the all parse nodes with respect to the
|
|
330
|
+
* morphological annotation of all parse nodes of the current parse tree.
|
|
331
|
+
*/
|
|
195
332
|
generateParseTree(surfaceForm) {
|
|
196
333
|
let rootNode = this.root;
|
|
197
334
|
let result = new ParseTree_1.ParseTree(new ParseNode_1.ParseNode(rootNode.getData()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParseTreeDrawable.js","sourceRoot":"","sources":["../source/ParseTreeDrawable.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,mEAA8D;IAC9D,4EAAuE;IACvE,mEAA8D;IAC9D,yBAAyB;IACzB,2DAAsD;IACtD,mFAA8E;IAC9E,6DAAwD;IACxD,6EAAwE;IACxE,+EAA0E;IAC1E,2FAAsF;IACtF,+EAA0E;IAC1E,mFAA8E;IAE9E,MAAa,iBAAkB,SAAQ,qBAAS;
|
|
1
|
+
{"version":3,"file":"ParseTreeDrawable.js","sourceRoot":"","sources":["../source/ParseTreeDrawable.ts"],"names":[],"mappings":";;;;;;;;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B,CAAoB,IAAI,CAAC,IAAI,EAAE,IAAI,qCAAiB,EAAE,CAAC,CAAC;gBAC7G,IAAI,QAAQ,GAAG,qBAAqB,CAAC,OAAO,EAAE,CAAC;gBAC/C,KAAK,IAAI,SAAS,IAAI,QAAQ,EAAC;oBAC3B,IAAI,OAAO,GAAG,IAAI,6BAAa,CAAC,GAAG,GAAG,QAAQ,GAAG,GAAG,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,WAAW;0BAC5F,SAAS,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,CAAC;oBACvD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;iBAC7B;gBACD,OAAO,QAAQ,CAAC;aACnB;QACL,CAAC;QAED;;;;;;;WAOG;QACH,iBAAiB,CAAC,WAAoB;YAClC,IAAI,QAAQ,GAAuB,IAAI,CAAC,IAAI,CAAA;YAC5C,IAAI,MAAM,GAAG,IAAI,qBAAS,CAAC,IAAI,qBAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;YAC7D,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAA;YACzD,OAAO,MAAM,CAAA;QACjB,CAAC;KACJ;IA/UD,8CA+UC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { NodeDrawableCondition } from "./NodeDrawableCondition";
|
|
2
2
|
import { ParseNodeDrawable } from "../../ParseNodeDrawable";
|
|
3
3
|
export declare class IsDoubleNode implements NodeDrawableCondition {
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the parse node is a double node, i.e., it has one child and his child has one or more children; its
|
|
6
|
+
* tag equals to its child tag.
|
|
7
|
+
* @param parseNode Parse node to check
|
|
8
|
+
* @return True if the tag of the parse node is equal to the tag of its child node, false otherwise.
|
|
9
|
+
*/
|
|
4
10
|
satisfies(parseNode: ParseNodeDrawable): boolean;
|
|
5
11
|
}
|
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.IsDoubleNode = void 0;
|
|
13
13
|
class IsDoubleNode {
|
|
14
|
+
/**
|
|
15
|
+
* Checks if the parse node is a double node, i.e., it has one child and his child has one or more children; its
|
|
16
|
+
* tag equals to its child tag.
|
|
17
|
+
* @param parseNode Parse node to check
|
|
18
|
+
* @return True if the tag of the parse node is equal to the tag of its child node, false otherwise.
|
|
19
|
+
*/
|
|
14
20
|
satisfies(parseNode) {
|
|
15
21
|
return parseNode.numberOfChildren() == 1
|
|
16
22
|
&& parseNode.getChild(0).numberOfChildren() >= 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsDoubleNode.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsDoubleNode.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,YAAY;QAErB,SAAS,CAAC,SAA4B;YAClC,OAAO,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC;mBACjC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,IAAI,CAAC;mBAC7C,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;mBAC/B,SAAS,CAAC,OAAO,EAAE,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAClE,CAAC;KAEJ;
|
|
1
|
+
{"version":3,"file":"IsDoubleNode.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsDoubleNode.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,YAAY;QAErB;;;;;WAKG;QACH,SAAS,CAAC,SAA4B;YAClC,OAAO,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC;mBACjC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,IAAI,CAAC;mBAC7C,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;mBAC/B,SAAS,CAAC,OAAO,EAAE,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAClE,CAAC;KAEJ;IAfD,oCAeC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { NodeDrawableCondition } from "./NodeDrawableCondition";
|
|
2
2
|
import { ParseNodeDrawable } from "../../ParseNodeDrawable";
|
|
3
3
|
export declare class IsDoubleNodeWithDifferentTags implements NodeDrawableCondition {
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the parse node is a double node, i.e., it has one child and his child has one or more children; and its
|
|
6
|
+
* tag is not equal to its child tag.
|
|
7
|
+
* @param parseNode Parse node to check
|
|
8
|
+
* @return True if the tag of the parse node is not equal to the tag of its child node, false otherwise.
|
|
9
|
+
*/
|
|
4
10
|
satisfies(parseNode: ParseNodeDrawable): boolean;
|
|
5
11
|
}
|
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.IsDoubleNodeWithDifferentTags = void 0;
|
|
13
13
|
class IsDoubleNodeWithDifferentTags {
|
|
14
|
+
/**
|
|
15
|
+
* Checks if the parse node is a double node, i.e., it has one child and his child has one or more children; and its
|
|
16
|
+
* tag is not equal to its child tag.
|
|
17
|
+
* @param parseNode Parse node to check
|
|
18
|
+
* @return True if the tag of the parse node is not equal to the tag of its child node, false otherwise.
|
|
19
|
+
*/
|
|
14
20
|
satisfies(parseNode) {
|
|
15
21
|
return parseNode.numberOfChildren() == 1
|
|
16
22
|
&& parseNode.getChild(0).numberOfChildren() >= 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsDoubleNodeWithDifferentTags.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsDoubleNodeWithDifferentTags.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,6BAA6B;QAEtC,SAAS,CAAC,SAA4B;YAClC,OAAO,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC;mBACjC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,IAAI,CAAC;mBAC7C,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;mBAC/B,SAAS,CAAC,OAAO,EAAE,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAClE,CAAC;KAEJ;
|
|
1
|
+
{"version":3,"file":"IsDoubleNodeWithDifferentTags.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsDoubleNodeWithDifferentTags.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,6BAA6B;QAEtC;;;;;WAKG;QACH,SAAS,CAAC,SAA4B;YAClC,OAAO,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC;mBACjC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,IAAI,CAAC;mBAC7C,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;mBAC/B,SAAS,CAAC,OAAO,EAAE,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAClE,CAAC;KAEJ;IAfD,sEAeC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { IsLeafNode } from "./IsLeafNode";
|
|
2
2
|
import { ParseNodeDrawable } from "../../ParseNodeDrawable";
|
|
3
3
|
export declare class IsEnglishLeafNode extends IsLeafNode {
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the parse node is a leaf node and contains a valid English word in its data.
|
|
6
|
+
* @param parseNode Parse node to check.
|
|
7
|
+
* @return True if the parse node is a leaf node and contains a valid English word in its data; false otherwise.
|
|
8
|
+
*/
|
|
4
9
|
satisfies(parseNode: ParseNodeDrawable): boolean;
|
|
5
10
|
}
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
const IsLeafNode_1 = require("./IsLeafNode");
|
|
14
14
|
const IsNullElement_1 = require("./IsNullElement");
|
|
15
15
|
class IsEnglishLeafNode extends IsLeafNode_1.IsLeafNode {
|
|
16
|
+
/**
|
|
17
|
+
* Checks if the parse node is a leaf node and contains a valid English word in its data.
|
|
18
|
+
* @param parseNode Parse node to check.
|
|
19
|
+
* @return True if the parse node is a leaf node and contains a valid English word in its data; false otherwise.
|
|
20
|
+
*/
|
|
16
21
|
satisfies(parseNode) {
|
|
17
22
|
if (super.satisfies(parseNode)) {
|
|
18
23
|
return !new IsNullElement_1.IsNullElement().satisfies(parseNode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsEnglishLeafNode.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsEnglishLeafNode.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAExC,mDAA8C;IAE9C,MAAa,iBAAkB,SAAQ,uBAAU;QAE7C,SAAS,CAAC,SAA4B;YAClC,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;gBAC5B,OAAO,CAAC,IAAI,6BAAa,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;aACpD;YACD,OAAO,KAAK,CAAC;QACjB,CAAC;KAEJ;
|
|
1
|
+
{"version":3,"file":"IsEnglishLeafNode.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsEnglishLeafNode.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAExC,mDAA8C;IAE9C,MAAa,iBAAkB,SAAQ,uBAAU;QAE7C;;;;WAIG;QACH,SAAS,CAAC,SAA4B;YAClC,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;gBAC5B,OAAO,CAAC,IAAI,6BAAa,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;aACpD;YACD,OAAO,KAAK,CAAC;QACjB,CAAC;KAEJ;IAdD,8CAcC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { NodeDrawableCondition } from "./NodeDrawableCondition";
|
|
2
2
|
import { ParseNodeDrawable } from "../../ParseNodeDrawable";
|
|
3
3
|
export declare class IsLeafNode implements NodeDrawableCondition {
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the parse node is a leaf node, i.e., it has no child.
|
|
6
|
+
* @param parseNode Parse node to check.
|
|
7
|
+
* @return True if the parse node is a leaf node, false otherwise.
|
|
8
|
+
*/
|
|
4
9
|
satisfies(parseNode: ParseNodeDrawable): boolean;
|
|
5
10
|
}
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.IsLeafNode = void 0;
|
|
13
13
|
class IsLeafNode {
|
|
14
|
+
/**
|
|
15
|
+
* Checks if the parse node is a leaf node, i.e., it has no child.
|
|
16
|
+
* @param parseNode Parse node to check.
|
|
17
|
+
* @return True if the parse node is a leaf node, false otherwise.
|
|
18
|
+
*/
|
|
14
19
|
satisfies(parseNode) {
|
|
15
20
|
return parseNode.numberOfChildren() == 0;
|
|
16
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsLeafNode.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsLeafNode.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,UAAU;QAEnB,SAAS,CAAC,SAA4B;YAClC,OAAO,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;KAEJ;
|
|
1
|
+
{"version":3,"file":"IsLeafNode.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsLeafNode.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,UAAU;QAEnB;;;;WAIG;QACH,SAAS,CAAC,SAA4B;YAClC,OAAO,SAAS,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;KAEJ;IAXD,gCAWC"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { IsNodeWithSynSetId } from "./IsNodeWithSynSetId";
|
|
2
2
|
import { ParseNodeDrawable } from "../../ParseNodeDrawable";
|
|
3
3
|
export declare class IsNodeWithPredicate extends IsNodeWithSynSetId {
|
|
4
|
+
/**
|
|
5
|
+
* Stores the synset id to check.
|
|
6
|
+
* @param id Synset id to check
|
|
7
|
+
*/
|
|
4
8
|
constructor(id: string);
|
|
9
|
+
/**
|
|
10
|
+
* Checks if at least one of the semantic ids of the parse node is equal to the given id and also the node is
|
|
11
|
+
* annotated as PREDICATE with semantic role.
|
|
12
|
+
* @param parseNode Parse node to check.
|
|
13
|
+
* @return True if at least one of the semantic ids of the parse node is equal to the given id and also the node is
|
|
14
|
+
* annotated as PREDICATE with semantic role, false otherwise.
|
|
15
|
+
*/
|
|
5
16
|
satisfies(parseNode: ParseNodeDrawable): boolean;
|
|
6
17
|
}
|
|
@@ -13,9 +13,20 @@
|
|
|
13
13
|
const IsNodeWithSynSetId_1 = require("./IsNodeWithSynSetId");
|
|
14
14
|
const ViewLayerType_1 = require("nlptoolkit-annotatedsentence/dist/ViewLayerType");
|
|
15
15
|
class IsNodeWithPredicate extends IsNodeWithSynSetId_1.IsNodeWithSynSetId {
|
|
16
|
+
/**
|
|
17
|
+
* Stores the synset id to check.
|
|
18
|
+
* @param id Synset id to check
|
|
19
|
+
*/
|
|
16
20
|
constructor(id) {
|
|
17
21
|
super(id);
|
|
18
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Checks if at least one of the semantic ids of the parse node is equal to the given id and also the node is
|
|
25
|
+
* annotated as PREDICATE with semantic role.
|
|
26
|
+
* @param parseNode Parse node to check.
|
|
27
|
+
* @return True if at least one of the semantic ids of the parse node is equal to the given id and also the node is
|
|
28
|
+
* annotated as PREDICATE with semantic role, false otherwise.
|
|
29
|
+
*/
|
|
19
30
|
satisfies(parseNode) {
|
|
20
31
|
let layerInfo = parseNode.getLayerInfo();
|
|
21
32
|
return super.satisfies(parseNode)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsNodeWithPredicate.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsNodeWithPredicate.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6DAAwD;IAExD,mFAA8E;IAE9E,MAAa,mBAAoB,SAAQ,uCAAkB;QAEvD,YAAY,EAAU;YAClB,KAAK,CAAC,EAAE,CAAC,CAAC;QACd,CAAC;QAED,SAAS,CAAC,SAA4B;YAClC,IAAI,SAAS,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;YACzC,OAAO,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC;mBAC1B,SAAS,IAAI,IAAI;mBACjB,SAAS,CAAC,YAAY,CAAC,6BAAa,CAAC,QAAQ,CAAC,IAAI,IAAI;mBACtD,SAAS,CAAC,YAAY,CAAC,6BAAa,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC;QACzE,CAAC;KAEJ;
|
|
1
|
+
{"version":3,"file":"IsNodeWithPredicate.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsNodeWithPredicate.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6DAAwD;IAExD,mFAA8E;IAE9E,MAAa,mBAAoB,SAAQ,uCAAkB;QAEvD;;;WAGG;QACH,YAAY,EAAU;YAClB,KAAK,CAAC,EAAE,CAAC,CAAC;QACd,CAAC;QAED;;;;;;WAMG;QACH,SAAS,CAAC,SAA4B;YAClC,IAAI,SAAS,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;YACzC,OAAO,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC;mBAC1B,SAAS,IAAI,IAAI;mBACjB,SAAS,CAAC,YAAY,CAAC,6BAAa,CAAC,QAAQ,CAAC,IAAI,IAAI;mBACtD,SAAS,CAAC,YAAY,CAAC,6BAAa,CAAC,QAAQ,CAAC,IAAI,WAAW,CAAC;QACzE,CAAC;KAEJ;IAzBD,kDAyBC"}
|
|
@@ -2,6 +2,15 @@ import { NodeDrawableCondition } from "./NodeDrawableCondition";
|
|
|
2
2
|
import { ParseNodeDrawable } from "../../ParseNodeDrawable";
|
|
3
3
|
export declare class IsNodeWithSymbol implements NodeDrawableCondition {
|
|
4
4
|
private symbol;
|
|
5
|
+
/**
|
|
6
|
+
* Stores the symbol to check.
|
|
7
|
+
* @param symbol Symbol to check
|
|
8
|
+
*/
|
|
5
9
|
constructor(symbol: string);
|
|
10
|
+
/**
|
|
11
|
+
* Checks if the tag of the parse node is equal to the given symbol.
|
|
12
|
+
* @param parseNode Parse node to check.
|
|
13
|
+
* @return True if the tag of the parse node is equal to the given symbol, false otherwise.
|
|
14
|
+
*/
|
|
6
15
|
satisfies(parseNode: ParseNodeDrawable): boolean;
|
|
7
16
|
}
|
|
@@ -11,9 +11,18 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.IsNodeWithSymbol = void 0;
|
|
13
13
|
class IsNodeWithSymbol {
|
|
14
|
+
/**
|
|
15
|
+
* Stores the symbol to check.
|
|
16
|
+
* @param symbol Symbol to check
|
|
17
|
+
*/
|
|
14
18
|
constructor(symbol) {
|
|
15
19
|
this.symbol = symbol;
|
|
16
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Checks if the tag of the parse node is equal to the given symbol.
|
|
23
|
+
* @param parseNode Parse node to check.
|
|
24
|
+
* @return True if the tag of the parse node is equal to the given symbol, false otherwise.
|
|
25
|
+
*/
|
|
17
26
|
satisfies(parseNode) {
|
|
18
27
|
if (parseNode.numberOfChildren() > 0) {
|
|
19
28
|
return parseNode.getData().toString() == this.symbol;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsNodeWithSymbol.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsNodeWithSymbol.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,gBAAgB;QAIzB,YAAY,MAAc;YACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACxB,CAAC;QAED,SAAS,CAAC,SAA4B;YAClC,IAAI,SAAS,CAAC,gBAAgB,EAAE,GAAG,CAAC,EAAC;gBACjC,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC;aACxD;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;KAEJ;
|
|
1
|
+
{"version":3,"file":"IsNodeWithSymbol.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsNodeWithSymbol.ts"],"names":[],"mappings":";;;;;;;;;;;;IAGA,MAAa,gBAAgB;QAIzB;;;WAGG;QACH,YAAY,MAAc;YACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACxB,CAAC;QAED;;;;WAIG;QACH,SAAS,CAAC,SAA4B;YAClC,IAAI,SAAS,CAAC,gBAAgB,EAAE,GAAG,CAAC,EAAC;gBACjC,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC;aACxD;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;KAEJ;IAzBD,4CAyBC"}
|
|
@@ -2,6 +2,15 @@ import { IsLeafNode } from "./IsLeafNode";
|
|
|
2
2
|
import { ParseNodeDrawable } from "../../ParseNodeDrawable";
|
|
3
3
|
export declare class IsNodeWithSynSetId extends IsLeafNode {
|
|
4
4
|
private id;
|
|
5
|
+
/**
|
|
6
|
+
* Stores the synset id to check.
|
|
7
|
+
* @param id Synset id to check
|
|
8
|
+
*/
|
|
5
9
|
constructor(id: string);
|
|
10
|
+
/**
|
|
11
|
+
* Checks if at least one of the semantic ids of the parse node is equal to the given id.
|
|
12
|
+
* @param parseNode Parse node to check.
|
|
13
|
+
* @return True if at least one of the semantic ids of the parse node is equal to the given id, false otherwise.
|
|
14
|
+
*/
|
|
6
15
|
satisfies(parseNode: ParseNodeDrawable): boolean;
|
|
7
16
|
}
|
|
@@ -12,10 +12,19 @@
|
|
|
12
12
|
exports.IsNodeWithSynSetId = void 0;
|
|
13
13
|
const IsLeafNode_1 = require("./IsLeafNode");
|
|
14
14
|
class IsNodeWithSynSetId extends IsLeafNode_1.IsLeafNode {
|
|
15
|
+
/**
|
|
16
|
+
* Stores the synset id to check.
|
|
17
|
+
* @param id Synset id to check
|
|
18
|
+
*/
|
|
15
19
|
constructor(id) {
|
|
16
20
|
super();
|
|
17
21
|
this.id = id;
|
|
18
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Checks if at least one of the semantic ids of the parse node is equal to the given id.
|
|
25
|
+
* @param parseNode Parse node to check.
|
|
26
|
+
* @return True if at least one of the semantic ids of the parse node is equal to the given id, false otherwise.
|
|
27
|
+
*/
|
|
19
28
|
satisfies(parseNode) {
|
|
20
29
|
if (super.satisfies(parseNode)) {
|
|
21
30
|
let layerInfo = parseNode.getLayerInfo();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsNodeWithSynSetId.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsNodeWithSynSetId.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAGxC,MAAa,kBAAmB,SAAQ,uBAAU;QAI9C,YAAY,EAAU;YAClB,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QAChB,CAAC;QAED,SAAS,CAAC,SAA4B;YAClC,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,EAAC;gBAC3B,IAAI,SAAS,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;gBACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,mBAAmB,EAAE,EAAE,CAAC,EAAE,EAAE;oBACtD,IAAI,QAAQ,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;oBAC1C,IAAI,QAAQ,IAAI,IAAI,CAAC,EAAE,EAAC;wBACpB,OAAO,IAAI,CAAC;qBACf;iBACJ;aACJ;YACD,OAAO,KAAK,CAAC;QACjB,CAAC;KAEJ;
|
|
1
|
+
{"version":3,"file":"IsNodeWithSynSetId.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsNodeWithSynSetId.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAGxC,MAAa,kBAAmB,SAAQ,uBAAU;QAI9C;;;WAGG;QACH,YAAY,EAAU;YAClB,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QAChB,CAAC;QAED;;;;WAIG;QACH,SAAS,CAAC,SAA4B;YAClC,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,EAAC;gBAC3B,IAAI,SAAS,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC;gBACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,mBAAmB,EAAE,EAAE,CAAC,EAAE,EAAE;oBACtD,IAAI,QAAQ,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;oBAC1C,IAAI,QAAQ,IAAI,IAAI,CAAC,EAAE,EAAC;wBACpB,OAAO,IAAI,CAAC;qBACf;iBACJ;aACJ;YACD,OAAO,KAAK,CAAC;QACjB,CAAC;KAEJ;IA/BD,gDA+BC"}
|
|
@@ -4,5 +4,10 @@ import { ParseNodeDrawable } from "../../ParseNodeDrawable";
|
|
|
4
4
|
export declare class IsNoneNode extends IsLeafNode {
|
|
5
5
|
private secondLanguage;
|
|
6
6
|
constructor(secondLanguage: ViewLayerType);
|
|
7
|
+
/**
|
|
8
|
+
* Checks if the data of the parse node is '*NONE*'.
|
|
9
|
+
* @param parseNode Parse node to check.
|
|
10
|
+
* @return True if the data of the parse node is '*NONE*', false otherwise.
|
|
11
|
+
*/
|
|
7
12
|
satisfies(parseNode: ParseNodeDrawable): boolean;
|
|
8
13
|
}
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
super();
|
|
17
17
|
this.secondLanguage = secondLanguage;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Checks if the data of the parse node is '*NONE*'.
|
|
21
|
+
* @param parseNode Parse node to check.
|
|
22
|
+
* @return True if the data of the parse node is '*NONE*', false otherwise.
|
|
23
|
+
*/
|
|
19
24
|
satisfies(parseNode) {
|
|
20
25
|
if (super.satisfies(parseNode)) {
|
|
21
26
|
let data = parseNode.getLayerData(this.secondLanguage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsNoneNode.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsNoneNode.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAIxC,MAAa,UAAW,SAAQ,uBAAU;QAItC,YAAY,cAA6B;YACrC,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACxC,CAAC;QAED,SAAS,CAAC,SAA4B;YAClC,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,EAAC;gBAC3B,IAAI,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gBACvD,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,QAAQ,CAAC;aAC3C;YACD,OAAO,KAAK,CAAC;QACjB,CAAC;KAEJ;
|
|
1
|
+
{"version":3,"file":"IsNoneNode.js","sourceRoot":"","sources":["../../../source/Processor/Condition/IsNoneNode.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,6CAAwC;IAIxC,MAAa,UAAW,SAAQ,uBAAU;QAItC,YAAY,cAA6B;YACrC,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACxC,CAAC;QAED;;;;WAIG;QACH,SAAS,CAAC,SAA4B;YAClC,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,EAAC;gBAC3B,IAAI,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;gBACvD,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,QAAQ,CAAC;aAC3C;YACD,OAAO,KAAK,CAAC;QACjB,CAAC;KAEJ;IAtBD,gCAsBC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { IsLeafNode } from "./IsLeafNode";
|
|
2
2
|
import { ParseNodeDrawable } from "../../ParseNodeDrawable";
|
|
3
3
|
export declare class IsNullElement extends IsLeafNode {
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the parse node is a leaf node and its data is '*' and its parent's data is '-NONE-'.
|
|
6
|
+
* @param parseNode Parse node to check.
|
|
7
|
+
* @return True if the parse node is a leaf node and its data is '*' and its parent's data is '-NONE-', false
|
|
8
|
+
* otherwise.
|
|
9
|
+
*/
|
|
4
10
|
satisfies(parseNode: ParseNodeDrawable): boolean;
|
|
5
11
|
}
|