File tree 2 files changed +16
-0
lines changed
src/edu/stanford/nlp/semgraph/semgrex/ssurgeon
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 11
11
import edu .stanford .nlp .semgraph .semgrex .SemgrexMatcher ;
12
12
import edu .stanford .nlp .util .StringUtils ;
13
13
14
+
15
+ /**
16
+ * Combines two or more words into one MWT
17
+ *<br>
18
+ * For the most part, the nodes themselves are unchanged, but the
19
+ * nodes now have the CoreAnnotations representing MWTness added
20
+ *<br>
21
+ * This is a convenience operation which exists because the basic
22
+ * version of it using EditNode is a bit of a pain
23
+ *
24
+ * @author John Bauer
25
+ */
14
26
public class CombineMWT extends SsurgeonEdit {
15
27
public static final String LABEL = "combineMWT" ;
16
28
final List <String > names ;
Original file line number Diff line number Diff line change 132
132
* {@code -node} is the node to edit.
133
133
* {@code ...attributes...} are the attributes to change, same as with {@code addDep}
134
134
*</p><p>
135
+ * {@code combineMWT} will add MWT attributes to a sequence of two or more words.
136
+ * {@code -node} (repeated) is the nodes to edit.
137
+ * {@code -word} is the optional text to use for the new MWT. If not set, the words will be concatenated.
138
+ *</p><p>
135
139
* {@code setRoots} sets the roots of the sentence to a new root.
136
140
* {@code n1, n2, ...} are the names of the nodes from the Semgrex to use as the root(s).
137
141
* This is best done in conjunction with other operations which actually manipulate the structure
You can’t perform that action at this time.
0 commit comments