Commit 0bd16b63 authored by Bruno Guillaume's avatar Bruno Guillaume

add page for transition state toward 1.4

parent 88e9ac03
+++
Description = ""
Tags = ["Development", "golang"]
Categories = ["Development", "GoLang"]
menu = "main"
+++
# Transition to version 1.4
A new version 1.4 of **Grew** will be available in the upcoming weeks with a few changes in the syntax.
For some technical reason, the [**Grew-match**](http://match.grew.fr) online tool is already based on the upcoming version and so already uses the new syntax.
The `dev` version of the **Grew** API for **Arborator-Grew** also uses the new syntax.
## Clustering on the label of an edge
With the pattern:
```grew
pattern { e: M -> N; N [upos=ADJ]}
```
if you want to cluster the result on the label of the edge `e`, the old syntax was `e`, the new one is `e.label` ([Try it!](http://match.grew.fr/?corpus=SUD_French-GSD@latest&clustering=e.label&pattern=pattern%20%7B%20N%20-%3E%20M;N%20[upos=ADJ]%20%7D)).
## Access to the label of an edge in the pattern
|Constraint | Old syntax | New syntax |
|:-----------------:|:-----------------:|:-----------------:|
| equality of two edge labels | `label(e1) = label(e2)` | `e1.label = e2.label` |
| inequality of two edge labels | `label(e1) <> label(e2)` | `e1.label <> e2.label` |
## Avoiding duplicate solutions
When several nodes are equivalent in a pattern, each occurrence is reported several times (up to permutation on the set of equivalent nodes).
For instance, to search for two relations `det` with the same governor, the pattern below will return twice each solution.
```grew
pattern {
G -[det]-> D1;
G -[det]-> D2;
}
```
To avoid this, it is possible to give an ordering constraint on some internal identifier:
* old_syntax: `id(D1) < id (D2)`
* new_syntax: `D1.__id__ < D2.__id__`
The complete pattern is:
```grew
pattern {
G -[det]-> D1;
G -[det]-> D2;
D1.__id__ < D2.__id__;
}
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment