-
Notifications
You must be signed in to change notification settings - Fork 53
/
ParlaMint-TEI.ana.rnc
153 lines (131 loc) · 4.04 KB
/
ParlaMint-TEI.ana.rnc
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
default namespace = "http://www.tei-c.org/ns/1.0"
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
a:documentation [
"RelaxNG XML schema for ParlaMint corpora: schema\x{a}" ~
" for linguistically annotatated corpus component file."
]
a:documentation [
"The linguistic annotation markup covers sentences, tokens, lemmas,\x{a}" ~
" morphosyntactic tags, UD morphological features, UD dependency relations, and named\x{a}" ~
" entities."
]
include "ParlaMint-TEI.rnc" {
## Encoding description linguistically annotated corpus compoment.
encodingDesc =
element encodingDesc {
global.atts,
element projectDesc { paras },
tagsDecl
>> a:documentation [
"Definition of listPrefix for MTed corpora."
],
element listPrefixDef { prefixDef }?
}
## The only element that contains analysed text is the segment. It can,
## however, contain transcription commentary.
seg = element seg { global.atts, (comment | pb | sentence)+ }
}
## A sentence.
sentence =
element s {
global.atts, (comment | pb | ner | phr | word | punct)+, syntax?
}
## Multi-Word Unit
phr =
element phr {
global.atts,
attribute function { xsd:token },
attribute ana { xsd:anyURI }
>> a:documentation [
"Currently we only support phrases with semantic markers"
],
attribute type { "sem" },
mwe_tokens
}
## Named entity element
ner =
## Standard name element
(element name {
global.atts,
ref.att,
attribute ana { xsd:anyURI }?,
attribute type { "PER" | "LOC" | "ORG" | "MISC" }?,
attribute subtype { xsd:token }?,
ner_tokens
}
>> a:documentation [ "Additional content used by CZ:" ]
| element date { ner.atts, temporal.atts?, ner_tokens }
| element time { ner.atts, ner_tokens }
| element num { ner.atts, ner_tokens }
| element unit { ner.atts, ner_tokens }
| element email { ner.atts, ner_tokens }
| element ref { ner.atts, ner_tokens })
## Attributes for NEs.
ner.atts =
global.atts,
attribute ana { xsd:anyURI }
## Annotations that can appear in a MWE.
mwe_tokens = (word | punct)+
## Annotations that can appear in a NE.
ner_tokens = (word | punct | comment | pb | ner)+
## A series of tokens.
tokens = (word | punct)+
## Definition of word.
word =
## cf. https://clarin-eric.github.io/parla-clarin/#sec-ananorm
element w {
## Simple word:
((word.atts, normalized-space.string)
>> a:documentation [ "Word with several normalised words:" ]
| (word-optional.atts,
# This doesn't work: error: group of "string" or "data" element
# ref name="normalized-space.string"/
text,
element w { word.atts, empty }+)
>> a:documentation [
"Normalised word with several surface words:"
]
| (word.atts,
element w { normalized-space.string }+,
empty))
}
## A punctuation element.
punct = element pc { token.atts, non-empty.string }
## Dependency syntax as a link group (inside a sentence).
syntax =
element linkGrp {
attribute targFunc { "head argument" },
attribute type { "UD-SYN" },
element link {
attribute ana { xsd:anyURI },
attribute target { anyURIs },
empty
}+
}
## Attributes of token elements.
token.atts =
id.att?,
lang.att,
attribute join { "right" }?,
attribute norm { non-empty.string }?,
attribute msd { non-empty.string },
attribute ana { anyURIs }?,
attribute pos { non-empty.string }?,
attribute function {
# This is different from TEI, where it is a name token (which can't contain comma!?)
# ref name="normalized-space.string"/
xsd:token
}?
## Obligatory attributes of word.
word.atts =
token.atts,
attribute lemma { normalized-space.string }
## Optional attributes of word.
word-optional.atts =
id.att?,
lang.att,
attribute join { "right" }?,
## UD PoS and morph.features, e.g. "UPosTag=NUM|NumForm=Digit":
(attribute msd { non-empty.string }?),
attribute ana { anyURIs }?,
attribute lemma { normalized-space.string }?