Skip to content

Commit 821b8fd

Browse files
committed
Add documentation for some of the features recently added to Semgrex and Ssurgeon
1 parent dd511c4 commit 821b8fd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/edu/stanford/nlp/semgraph/semgrex/SemgrexPattern.java

+10
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@
5353
* The special case of an empty text can be tested for with an empty regex.
5454
* For example, words marked with {@code SpaceAfter=no} will have a blank {@code after} attribute.
5555
* {@code {after://}} will search for this.
56+
* <br>
57+
* It is now also possible to negate individual attributes in Semgrex with {@code !:}
58+
* For example, this expression will search for a NOUN which is not "boy":
59+
* {@code {lemma!:boy;pos:NOUN}}
60+
* <br>
61+
* Attributes which are maps, in particular the morphological
62+
* features, can be searched by writing a map, such as
63+
* {@code {morphofeatures:{Tense:Past;Person!:3}}}
64+
* This expression will
65+
* search for words which are past tense but are not in 3rd person.
5666
* <h3>Relations</h3>
5767
*
5868
* Relations are defined by a symbol representing the type of relationship and a

src/edu/stanford/nlp/semgraph/semgrex/ssurgeon/Ssurgeon.java

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
* {@code -updateMorphoFeatures ...} will edit or add the features without overwriting existing features.
141141
* TODO: if anyone needs the ability to remove features without resetting the entire features map,
142142
* please file an issue on github.
143+
* {@code -remove ...} will remove the attribute entirely, such as doing {@code -remove lemma} to remove the lemma.
143144
*</p><p>
144145
* {@code lemmatize} will put a lemma on a word.
145146
* {@code -node} is the node to edit.

0 commit comments

Comments
 (0)