Commit d271b094 authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

Adapt snippets to new 1.4 syntax

parent 3417b719
% The requests looks for a node 'G' with two different objects 'O1' and 'O2'
% The requests looks for a node 'G' with two different objects 'O_1' and 'O_2'
% An additional constraint is needed to avoid duplicate solutions:
% If some occurrence is found, the swaping of 'O1' and 'O2' in the solution is also one,
% The constraint on line 9 imposes to given only one the two solutions
% If some occurrence is found, the swapping of 'O_1' and 'O_2' in the solution is also one,
% The constraint on line 9 imposes to given only one the two solutions.
pattern {
G -[comp:obj]-> O1;
G -[comp:obj]-> O2;
id(O1) < id(O2); % <-- Avoid to duplicate solutions
G -[comp:obj]-> O_1;
G -[comp:obj]-> O_2;
O_1.__id__ < O_2.__id__; % <-- Avoid to duplicate solutions
}
% NB: 'id' refers to some internal identifier for node which is not relevant for the user in general
% NB: '__id__' refers to some internal identifier for node which is not relevant for the user in general
......@@ -51,7 +51,7 @@
<li><a href="#" clustering="GOV.upos" snippet-file="../snippets_clusters/upos.pat" class="inter">Cluster results by one node "upos"</a></li>
<li><a href="#" clustering="N.lemma" snippet-file="../snippets_clusters/lemma.pat" class="inter">Cluster results by one node "lemma"</a></li>
<li><a href="#" clustering="N.VerbForm" snippet-file="../snippets_clusters/verbform.pat" class="inter">Other clustering on nodes</a></li>
<li><a href="#" clustering="e" snippet-file="../snippets_clusters/edge.pat" class="inter">Cluster results by edge label</a></li>
<li><a href="#" clustering="e.label" snippet-file="../snippets_clusters/edge.pat" class="inter">Cluster results by edge label</a></li>
</ul>
</div>
......@@ -63,7 +63,7 @@
<li><a href="#" snippet-file="../snippets_global/other.pat" class="inter">Other global constraints</a></li>
<li><a href="#" snippet-file="../snippets_global/combined.pat" class="inter">Global constraints can be combined with other clauses</a></li>
</ul>
<b>A few other examples of more complex requests:</b>
<ul>
<li><a href="#" snippet-file="misc/verb_wo_subj.pat" class="inter">Search for verbs without subject</a></li>
......
......@@ -42,7 +42,7 @@
<li><a href="#" clustering="GOV.upos" snippet-file="../snippets_clusters/upos.pat" class="inter">Cluster results by one node "upos"</a></li>
<li><a href="#" clustering="N.lemma" snippet-file="../snippets_clusters/lemma.pat" class="inter">Cluster results by one node "lemma"</a></li>
<li><a href="#" clustering="N.VerbForm" snippet-file="../snippets_clusters/verbform.pat" class="inter">Other clustering on nodes</a></li>
<li><a href="#" clustering="e" snippet-file="../snippets_clusters/edge.pat" class="inter">Cluster results by edge label</a></li>
<li><a href="#" clustering="e.label" snippet-file="../snippets_clusters/edge.pat" class="inter">Cluster results by edge label</a></li>
</ul>
</div>
......@@ -54,7 +54,7 @@
<li><a href="#" snippet-file="../snippets_global/other.pat" class="inter">Other global constraints</a></li>
<li><a href="#" snippet-file="../snippets_global/combined.pat" class="inter">Global constraints can be combined with other clauses</a></li>
</ul>
<b>A few other examples of more complex requests:</b>
<ul>
<li><a href="#" snippet-file="misc/verb_wo_subj.pat" class="inter">Search for verbs without subject</a></li>
......
% Search a node N which is in two different MWE
% Search a node N which is in two different MWEs
pattern {
MWE1 -[MWE]-> N;
MWE1 -[MWE]-> N;
MWE2 -[MWE]-> N;
id(MWE1) < id(MWE2);
MWE1.__id__ < MWE2.__id__; % <-- Avoid to duplicate solutions
}
% What are the dependency relations between a VERB and a NOUN?
% NOTE: it is required to give a name ('e' here) to the edge to make reference to it as a cluster key
% NOTE: it is required to give a name ('e' here) to the edge to make reference to it in the cluster key
pattern { e: GOV -> DEP; GOV[upos=VERB]; DEP[upos=NOUN] }
% What are the dependency relations between a VERB and a NOUN?
% NOTE: it is required to give a name ('e' here) to the edge to make reference to it as a cluster key
% NOTE: it is required to give a name ('e' here) to the edge to make reference to it in the cluster key
pattern { e: GOV -> DEP; GOV[upos=VERB]; DEP[upos=NOUN] }
......@@ -70,7 +70,7 @@
<li><a href="#" clustering="GOV.upos" snippet-file="lesson5/upos.pat" class="inter">Cluster results by one node "upos"</a></li>
<li><a href="#" clustering="N.lemma" snippet-file="lesson5/lemma.pat" class="inter">Cluster results by one node "lemma"</a></li>
<li><a href="#" clustering="N.VerbForm" snippet-file="lesson5/verbform.pat" class="inter">Other clustering on nodes</a></li>
<li><a href="#" clustering="e" snippet-file="lesson5/edge.pat" class="inter">Cluster results by edge label</a></li>
<li><a href="#" clustering="e.label" snippet-file="lesson5/edge.pat" class="inter">Cluster results by edge label</a></li>
</ul>
</div>
......
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