-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.dat
53 lines (38 loc) · 1.36 KB
/
test.dat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Example JSON-NLP to Triple Mapper
*
* (C) 2020 by Semiring Inc., Damir Cavar
*
* This is a random test implementation of Macro definition and Rules in
* the JRML format.
*
* The goal of this language is to use a JSON-NLP output
*/
// Macros renders: Verb3rdSg.subjectPhrase[num="sg",pers=3]
Macro Verb3rdSg: subjectPhrase[num="sg"] [pers=3] ;
// comment
Rule myRule:
X[dep="nsubj",pos="NNP",type="PERSON"]
Y[pos="VBZ"] // test
Z[dep="dobj"] // Z is the object
--> // this can be -> or => of any length
(X, Y, Z) ;
Rule yourRule: // another line comment
X [ dep="nsubj",
pos="NNP",
type="PERSON",
num = 2 ]
Y [pos="VBZ"]
Z [dep="dobj"] -->
(X, Y, Z) ;
Rule yourRule: X[dep="nsubj"] Y Z -> ( (X, Y, Z) ) ;
Rule yourRule : X[ dep = "nsubj" ] Y Z -> ( (X, Y[directional=true], Z), (X, "hasColor", Z) ) ;
Rule yourRule :
X.subject X[num="pl"] X[sent="pos"] Y Z ->
( (X, Y[directional=true], Z), (Z, Y, X) ) ;
Rule yourRule : X.subjectPhrase Y Z -> ( (X, Y[directional=true], Z), (X, Y, Z) ) ;
Rule yourRule : X.subjectCompound Y Z -> ( (X, Y[directional=true], Z), (X, Y, Z) ) ;
Rule yourRule[domain="med"] : X[ num ] Y Z -> ( (X, Y[directional], Z), (X.lemma, Y.text, Z.pos) ) ;
Rule yourRule[domain="gen"] :
X[ num ] X[lemma="be"] Z ->
( (X, Y[directional], Z), (X.lemma, Y.text, Z.pos) ) ;