TEISentence.java
6.59 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
package ipipan.clarin.tei.api.entities;
import java.util.List;
/**
* A sentence.
*
* @author mlenart
*/
public interface TEISentence extends TEIEntity {
String getId(AnnotationLayer layer);
void setId(AnnotationLayer layer, String id);
String getOrth();
/**
*
* @return list of chosen (good) segments in this sentence
*/
List<TEISegment> getChosenSegments();
/**
*
* @return list of all segments in this sentence - including rejected ones
*/
List<TEISegment> getAllSegments();
/**
*
* @return list of morphs in this sentence
*/
List<TEIMorph> getMorphs();
/**
* Returs a list of <b>top-level</b> (not contained in other NEs) named
* entities in this sentence.
*
* In following example <code>getTopLevelNamedEntities()</code> will return
* only one named entity - named_5.6-s_n1
*
* <pre>
* <s xml:id="named_5.6-s" corresp="ann_morphosyntax.xml#morph_5.6-s">
* <seg xml:id="named_5.6-s_n1">
* <fs type="named">
* <f name="ne_type">
* <symbol value="persName"/>
* </f>
* <!-- ... -->
* </fs>
* <ptr target="named_5.6-s_n2"/>
* <ptr target="named_5.6-s_n3"/>
* </seg>
* <seg xml:id="named_5.6-s_n2">
* <fs type="named">
* <f name="ne_type">
* <symbol value="persName"/>
* </f>
* <!-- ... -->
* </fs>
* <ptr target="ann_morphosyntax.xml#morph_5.4-seg"/>
* </seg>
* <seg xml:id="named_5.6-s_n3">
* <fs type="named">
* <f name="ne_type">
* <symbol value="persName"/>
* </f>
* <!-- ... -->
* </fs>
* <ptr target="ann_morphosyntax.xml#morph_5.5-seg"/>
* </seg>
* </s>
* </pre>
*
* @return list of top-level named entities in this sentence
*/
List<TEINamedEntity> getTopLevelNamedEntities();
/**
* Returs a list of <b>all</b> named entities in this sentence.
*
* In following example <code>getAllNamedEntities()</code> will return 3
* named entities: - named_5.6-s_n1, named_5.6-s_n2, named_5.6-s_n3
*
* <pre>
* <s xml:id="named_5.6-s" corresp="ann_morphosyntax.xml#morph_5.6-s">
* <seg xml:id="named_5.6-s_n1">
* <fs type="named">
* <f name="ne_type">
* <symbol value="persName"/>
* </f>
* <!-- ... -->
* </fs>
* <ptr target="named_5.6-s_n2"/>
* <ptr target="named_5.6-s_n3"/>
* </seg>
* <seg xml:id="named_5.6-s_n2">
* <fs type="named">
* <f name="ne_type">
* <symbol value="persName"/>
* </f>
* <!-- ... -->
* </fs>
* <ptr target="ann_morphosyntax.xml#morph_5.4-seg"/>
* </seg>
* <seg xml:id="named_5.6-s_n3">
* <fs type="named">
* <f name="ne_type">
* <symbol value="persName"/>
* </f>
* <!-- ... -->
* </fs>
* <ptr target="ann_morphosyntax.xml#morph_5.5-seg"/>
* </seg>
* </s>
* </pre>
*
* @return list of all named entities in this sentence
*/
List<TEINamedEntity> getAllNamedEntities();
/**
* Returns top-level words in this sentence (that is - not contained in
* other words). See <code>getTopLevelNamedEntities()</code> for details.
*
* @return top-level words in this sentence
*/
List<TEIWord> getTopLevelWords();
/**
* Returns list of all syntactic words in this sentence (see
* <code>getAllNamedEntities()</code> for details).
*
* @return list of all syntactic words in this sentence
*/
List<TEIWord> getAllWords();
/**
* Returns top-level syntactic groups in this sentence (that is - not
* contained in other groups). See <code>getTopLevelNamedEntities()</code>
* for details.
*
* @return top-level syntactic groups in this sentence
*/
List<TEIGroup> getTopLevelGroups();
/**
* Returns list of all syntactic groups in this sentence (see
* <code>getAllNamedEntities()</code> for details).
*
* @return list of all syntactic groups in this sentence
*/
List<TEIGroup> getAllGroups();
/**
* Returns list of deep parsing trees
*
* @return list of tree roots
*/
List<TEIDeepParseTree> getDeepParsingRoots();
/**
* Returns list of mentions in sentence
*
* @return list of mentions
*/
List<TEIMention> getAllMentions();
/**
* Sets parse result. Adds a top-level syntactic words to this sentence
*
* @param words
* top-level syntactic words list (possibly containing nested
* words)
*/
void setSyntacticWords(List<TEIWord> words);
/**
* Sets parse result. Adds a top-level syntactic groups to this sentence
*
* @param groups
* top-level syntactic groups list (possibly containing nested
* groups)
*/
void setSyntacticGroups(List<TEIGroup> groups);
/**
* Sets named entity recognition result. Adds a top-level named entities to
* this sentence
*
* @param entities
* top-level named entities list
*/
void setNERResult(List<TEINamedEntity> entities);
/**
* Sets tagging result (that is list of morphs - each one corresponding to
* <code>TEISegment</code> at the same index.
*
* @param morphs
* morphs to set
*/
void setTaggingResult(List<TEIMorph> morphs);
/**
* Sets deep parsing result (that is list of tree roots)
*
* @param roots
* - tree roots
*/
void setDeepParsingResult(List<TEIDeepParseTree> roots);
/**
* Sets mention recognition result.
*
* @param mentions
* mentions list
*/
void setMentions(List<TEIMention> mentions);
/**
* Returns <code>TEIMorph</code> with given id (if it belongs to this
* sentence).
*
* @param morphId
* morph id
* @return TEIMorph instance or null if none exists
*/
TEIMorph getMorphById(String morphId);
}