|
40 | 40 | * loaded can reference these resources. |
41 | 41 | *<br> |
42 | 42 | * An Ssurgeon can be built from an XML pattern or by assembling the pieces by hand. |
| 43 | + *<br> |
| 44 | + * The XML format is as follows: |
| 45 | +<pre> |
| 46 | +{@code |
| 47 | +<ssurgeon-pattern-list> |
| 48 | + <ssurgeon-pattern> |
| 49 | + <uid>...</uid> |
| 50 | + <notes>...</notes> |
| 51 | + <semgrex>...</semgrex> |
| 52 | + <edit-list>...</edit-list> |
| 53 | + </ssurgeon-pattern> |
| 54 | +</ssurgeon-pattern-list> |
| 55 | +} |
| 56 | +</pre> |
| 57 | + * The {@code id} is the id of the Ssurgeon operation. <br> |
| 58 | + * The {@code notes} are comments on the Ssurgeon. <br> |
| 59 | + * The {@code semgrex} is a Semgrex pattern to use when matching for this operation. <br> |
| 60 | + * The {@code edit-list} is the actual Ssurgeon operation to execute. <br> |
| 61 | + * |
| 62 | + * Available operations and their arguments include: |
| 63 | + * <ul> |
| 64 | + * <li> {@code addEdge -gov a1 -dep a2 -reln dep -weight 0.5} |
| 65 | + * </ul> |
43 | 66 | * |
44 | 67 | * @author Eric Yeh |
45 | 68 | */ |
@@ -242,7 +265,7 @@ protected static class SsurgeonArgs { |
242 | 265 | // below are string representations of the intended values |
243 | 266 | public String nodeString = null; |
244 | 267 |
|
245 | | - public double weight = 1.0; |
| 268 | + public double weight = 0.0; |
246 | 269 |
|
247 | 270 | public String name = null; |
248 | 271 | } |
@@ -333,7 +356,7 @@ public static SsurgeonEdit parseEditLine(String editLine) { |
333 | 356 | } else if (command.equalsIgnoreCase(AddNode.LABEL)) { |
334 | 357 | retEdit = AddNode.createAddNode(argsBox.nodeString, argsBox.name); |
335 | 358 | } else if (command.equalsIgnoreCase(AddEdge.LABEL)) { |
336 | | - retEdit = AddEdge.createEngAddEdge(argsBox.govNodeName, argsBox.dep, argsBox.reln); |
| 359 | + retEdit = AddEdge.createEngAddEdge(argsBox.govNodeName, argsBox.dep, argsBox.reln, argsBox.weight); |
337 | 360 | } else if (command.equalsIgnoreCase(DeleteGraphFromNode.LABEL)) { |
338 | 361 | retEdit = new DeleteGraphFromNode(argsBox.node); |
339 | 362 | } else if (command.equalsIgnoreCase(RemoveEdge.LABEL)) { |
|
0 commit comments