Revision 1200

tmp/org.txm.analec.feature/.project (revision 1200)
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<projectDescription>
3
	<name>org.txm.analec.feature</name>
3
	<name>org.txm.annotation.urs.feature</name>
4 4
	<comment></comment>
5 5
	<projects>
6 6
	</projects>
tmp/org.txm.analec.feature/feature.xml (revision 1200)
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<feature
3
      id="org.txm.analec.feature"
3
      id="org.txm.annotation.urs.feature"
4 4
      label="Annotation URS (Unité-Relation-Schéma)"
5 5
      version="1.0.0.qualifier"
6 6
      provider-name="Textometrie.org">
......
83 83
   </requires>
84 84

  
85 85
   <plugin
86
         id="org.txm.analec.rcp"
86
         id="org.txm.annotation.urs.rcp"
87 87
         download-size="0"
88 88
         install-size="0"
89 89
         version="0.0.0"
tmp/org.txm.analec.rcp/OSGI-INF/l10n/bundle_ru.properties (revision 1200)
1
Bundle-Name.0=org.txm.analec.rcp
2
menu.label=Analec
1
Bundle-Name.0=org.txm.annotation.urs.rcp
2
menu.label=URS
3 3
command.name.16=N/A_ Edit view
4
page.name=Analec
4
page.name=URS
tmp/org.txm.analec.rcp/OSGI-INF/l10n/bundle_fr.properties (revision 1200)
2 2
command.name.16 = \u00C9diter la vue
3 3

  
4 4
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
5
#Properties file for AnalecRCP
5
#Properties file for Annotations URSRCP
6 6

  
7
Bundle-Name = Analec
7
Bundle-Name = Annotations URS
8 8

  
9 9
Bundle-Vendor = Textometrie.org
10 10

  
......
30 30

  
31 31
command.name.13 = Export XML-TEI URS...
32 32

  
33
command.name.14 = XML-TEI URS
33
command.name.14 = XML-TEI Analec
34 34

  
35 35
command.name.15 = Aligner les annotations Glozz avec les mots TXM
36 36

  
......
50 50

  
51 51
command.name.9 = Importer les annotations Glozz...
52 52

  
53
menu.label.0 = Analec
53
menu.label.0 = URS
54 54

  
55
menu.mnemonic = A
55
menu.mnemonic = U
56 56

  
57
menu.mnemonic.0 = A
57
menu.mnemonic.0 = U
58 58

  
59 59
view.name = Propri\u00E9t\u00E9s
60 60

  
tmp/org.txm.analec.rcp/OSGI-INF/l10n/bundle.properties (revision 1200)
1 1
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
2 2
#Properties file for AnalecRCP
3 3

  
4
Bundle-Name = AnalecRCP
4
Bundle-Name = URS Annotation
5 5

  
6
Bundle-Name.0 = org.txm.analec.rcp
6
Bundle-Name.0 = org.txm.annotation.urs.rcp
7 7

  
8 8
Bundle-Vendor = Textometrie.org
9 9

  
......
18 18
command.name.11 = Import XML-TEI URS annotations...
19 19
command.name.12 = Export to XML Glozz...
20 20
command.name.13 = Export to XML-TEI URS...
21
command.name.14 = XML-TEI URS
21
command.name.14 = XML-TEI Analec
22 22
command.name.15 = Align Glozz annotations with TXM corpus words
23 23
command.name.16 = Edit view
24 24
command.name.2  = Import Glozz model...
......
30 30
command.name.8  = Glozz
31 31
command.name.9  = Import Glozz annotations...
32 32

  
33
menu.label      = Analec
34
menu.label.0    = Analec
33
menu.label      = URS
34
menu.label.0    = URS
35 35
menu.mnemonic   = A
36 36
menu.mnemonic.0 = A
37 37

  
38
page.name = Analec
38
page.name = URS
39 39

  
40 40
view.name   = Properties
41 41
view.name.0 = Search
tmp/org.txm.analec.rcp/plugin.xml (revision 1200)
10 10
               label="%menu.label"
11 11
               mnemonic="%menu.mnemonic">
12 12
            <command
13
                  commandId="org.txm.analec.commands.LoadStructureFromGlozz"
13
                  commandId="org.txm.annotation.urs.commands.LoadStructureFromGlozz"
14 14
                  style="push">
15 15
               <visibleWhen
16 16
                     checkEnabled="false">
......
20 20
               </visibleWhen>
21 21
            </command>
22 22
            <command
23
                  commandId="org.txm.analec.commands.EditAnnotationStructure"
23
                  commandId="org.txm.annotation.urs.commands.EditAnnotationStructure"
24 24
                  style="push">
25 25
               <visibleWhen
26 26
                     checkEnabled="false">
......
30 30
               </visibleWhen>
31 31
            </command>
32 32
            <command
33
                  commandId="org.txm.analec.commands.EditVue"
33
                  commandId="org.txm.annotation.urs.commands.EditVue"
34 34
                  style="push">
35 35
               <visibleWhen
36 36
                     checkEnabled="false">
......
40 40
               </visibleWhen>
41 41
            </command>
42 42
            <command
43
                  commandId="org.txm.analec.commands.SaveCorpus"
43
                  commandId="org.txm.annotation.urs.commands.SaveCorpus"
44 44
                  style="push">
45 45
               <visibleWhen
46 46
                     checkEnabled="false">
......
54 54
                  visible="true">
55 55
            </separator>
56 56
            <command
57
                  commandId="org.txm.analec.commands.ImportTEIAnnotations"
57
                  commandId="org.txm.annotation.urs.commands.ImportTEIAnnotations"
58 58
                  style="push">
59 59
               <visibleWhen
60 60
                     checkEnabled="false">
......
72 72
               label="%menu.label.0"
73 73
               mnemonic="%menu.mnemonic.0">
74 74
            <command
75
                  commandId="org.txm.analec.commands.LoadStructureFromGlozz"
75
                  commandId="org.txm.annotation.urs.commands.LoadStructureFromGlozz"
76 76
                  style="push">
77 77
               <visibleWhen
78 78
                     checkEnabled="false">
......
82 82
               </visibleWhen>
83 83
            </command>
84 84
            <command
85
                  commandId="org.txm.analec.commands.EditAnnotationStructure"
85
                  commandId="org.txm.annotation.urs.commands.EditAnnotationStructure"
86 86
                  style="push">
87 87
               <visibleWhen
88 88
                     checkEnabled="false">
......
92 92
               </visibleWhen>
93 93
            </command>
94 94
            <command
95
                  commandId="org.txm.analec.commands.SaveCorpus"
95
                  commandId="org.txm.annotation.urs.commands.SaveCorpus"
96 96
                  style="push">
97 97
               <visibleWhen
98 98
                     checkEnabled="false">
......
102 102
               </visibleWhen>
103 103
            </command>
104 104
            <command
105
                  commandId="org.txm.analec.commands.ExportGlozzCorpus"
105
                  commandId="org.txm.annotation.urs.commands.ExportGlozzCorpus"
106 106
                  style="push">
107 107
               <visibleWhen
108 108
                     checkEnabled="false">
......
112 112
               </visibleWhen>
113 113
            </command>
114 114
            <command
115
                  commandId="org.txm.analec.commands.ExportTEICorpus"
115
                  commandId="org.txm.annotation.urs.commands.ExportTEICorpus"
116 116
                  style="push">
117 117
               <visibleWhen
118 118
                     checkEnabled="false">
......
122 122
               </visibleWhen>
123 123
            </command>
124 124
            <command
125
                  commandId="org.txm.analec.commands.ImportTEIAnnotations"
125
                  commandId="org.txm.annotation.urs.commands.ImportTEIAnnotations"
126 126
                  style="push">
127 127
               <visibleWhen
128 128
                     checkEnabled="false">
......
136 136
      <menuContribution
137 137
            locationURI="menu:menu.file.export">
138 138
         <command
139
               commandId="org.txm.analec.commands.ExportTEICorpus"
139
               commandId="org.txm.annotation.urs.commands.ExportTEICorpus"
140 140
               label="%command.label.0"
141 141
               style="push">
142 142
         </command>
143 143
         <command
144
               commandId="org.txm.analec.commands.ExportGlozzCorpus"
144
               commandId="org.txm.annotation.urs.commands.ExportGlozzCorpus"
145 145
               label="%command.label.1"
146 146
               style="push">
147 147
         </command>
......
149 149
      <menuContribution
150 150
            locationURI="menu:menu.file.import?before=menu.file.import.separator.software">
151 151
         <command
152
               commandId="org.txm.analec.commands.ImportGlozzCorpus"
152
               commandId="org.txm.annotation.urs.commands.ImportGlozzCorpus"
153 153
               style="push">
154 154
         </command>
155 155
         <command
156
               commandId="org.txm.analec.commands.ImportTEICorpus"
156
               commandId="org.txm.annotation.urs.commands.ImportTEICorpus"
157 157
               label="%command.label.2"
158 158
               style="push">
159 159
         </command>
......
163 163
         point="org.eclipse.ui.commands">
164 164
      <command
165 165
            categoryId="org.txm.rcp.category.txm"
166
            defaultHandler="org.txm.analec.commands.LoadStructure"
167
            id="org.txm.analec.commands.LoadStructure"
166
            defaultHandler="org.txm.annotation.urs.commands.LoadStructure"
167
            id="org.txm.annotation.urs.commands.LoadStructure"
168 168
            name="%command.name">
169 169
      </command>
170 170
      <command
171 171
            categoryId="org.txm.rcp.category.txm"
172
            defaultHandler="org.txm.analec.commands.EditStructure"
173
            id="org.txm.analec.commands.EditAnnotationStructure"
172
            defaultHandler="org.txm.annotation.urs.commands.EditStructure"
173
            id="org.txm.annotation.urs.commands.EditAnnotationStructure"
174 174
            name="%command.name.0">
175 175
      </command>
176 176
      <command
177 177
            categoryId="org.txm.rcp.category.txm"
178
            defaultHandler="org.txm.analec.commands.SaveStructure"
179
            id="org.txm.analec.commands.SaveStructure"
178
            defaultHandler="org.txm.annotation.urs.commands.SaveStructure"
179
            id="org.txm.annotation.urs.commands.SaveStructure"
180 180
            name="%command.name.1">
181 181
      </command>
182 182
      <command
183 183
            categoryId="org.txm.rcp.category.txm"
184
            defaultHandler="org.txm.analec.commands.LoadStructureFromGlozz"
185
            id="org.txm.analec.commands.LoadStructureFromGlozz"
184
            defaultHandler="org.txm.annotation.urs.commands.LoadStructureFromGlozz"
185
            id="org.txm.annotation.urs.commands.LoadStructureFromGlozz"
186 186
            name="%command.name.2">
187 187
      </command>
188 188
      <command
189 189
            categoryId="org.txm.rcp.category.txm"
190
            defaultHandler="org.txm.analec.commands.LoadCorpus"
191
            id="org.txm.analec.commands.LoadCorpus"
190
            defaultHandler="org.txm.annotation.urs.commands.LoadCorpus"
191
            id="org.txm.annotation.urs.commands.LoadCorpus"
192 192
            name="%command.name.3">
193 193
      </command>
194 194
      <command
195 195
            categoryId="org.txm.rcp.category.txm"
196
            defaultHandler="org.txm.analec.commands.SaveCorpus"
197
            id="org.txm.analec.commands.SaveCorpus"
196
            defaultHandler="org.txm.annotation.urs.commands.SaveCorpus"
197
            id="org.txm.annotation.urs.commands.SaveCorpus"
198 198
            name="%command.name.4">
199 199
      </command>
200 200
      <command
201 201
            categoryId="org.txm.rcp.category.txm"
202
            defaultHandler="org.txm.analec.commands.LoadVue"
203
            id="org.txm.analec.commands.LoadVue"
202
            defaultHandler="org.txm.annotation.urs.commands.LoadVue"
203
            id="org.txm.annotation.urs.commands.LoadVue"
204 204
            name="%command.name.5">
205 205
      </command>
206 206
      <command
207 207
            categoryId="org.txm.rcp.category.txm"
208
            defaultHandler="org.txm.analec.commands.SaveVue"
209
            id="org.txm.analec.commands.SaveVue"
208
            defaultHandler="org.txm.annotation.urs.commands.SaveVue"
209
            id="org.txm.annotation.urs.commands.SaveVue"
210 210
            name="%command.name.6">
211 211
      </command>
212 212
      <command
213 213
            categoryId="org.txm.rcp.category.txm"
214
            defaultHandler="org.txm.analec.commands.SaveStructureAsGlozzModel"
215
            id="org.txm.analec.commands.SaveStructureAsGlozzModel"
214
            defaultHandler="org.txm.annotation.urs.commands.SaveStructureAsGlozzModel"
215
            id="org.txm.annotation.urs.commands.SaveStructureAsGlozzModel"
216 216
            name="%command.name.7">
217 217
      </command>
218 218
      <command
219 219
            categoryId="org.txm.rcp.category.txm"
220
            defaultHandler="org.txm.analec.commands.ImportGlozzCorpus"
221
            id="org.txm.analec.commands.ImportGlozzCorpus"
220
            defaultHandler="org.txm.annotation.urs.commands.ImportGlozzCorpus"
221
            id="org.txm.annotation.urs.commands.ImportGlozzCorpus"
222 222
            name="%command.name.8">
223 223
      </command>
224 224
      <command
225 225
            categoryId="org.txm.rcp.category.txm"
226
            defaultHandler="org.txm.analec.commands.ImportGlozzAnnotations"
227
            id="org.txm.analec.commands.ImportGlozzAnnotations"
226
            defaultHandler="org.txm.annotation.urs.commands.ImportGlozzAnnotations"
227
            id="org.txm.annotation.urs.commands.ImportGlozzAnnotations"
228 228
            name="%command.name.9">
229 229
      </command>
230 230
      <command
231
            defaultHandler="org.txm.analec.commands.DoInstallStep"
232
            id="org.txm.analec.commands.DoInstallStep"
231
            defaultHandler="org.txm.annotation.urs.commands.DoInstallStep"
232
            id="org.txm.annotation.urs.commands.DoInstallStep"
233 233
            name="%command.name.10">
234 234
      </command>
235 235
      <command
236 236
            categoryId="org.txm.rcp.category.txm"
237
            defaultHandler="org.txm.analec.commands.ExportGlozzCorpus"
238
            id="org.txm.analec.commands.ExportGlozzCorpus"
237
            defaultHandler="org.txm.annotation.urs.commands.ExportGlozzCorpus"
238
            id="org.txm.annotation.urs.commands.ExportGlozzCorpus"
239 239
            name="%command.name.12">
240 240
      </command>
241 241
      <command
242 242
            categoryId="org.txm.rcp.category.txm"
243
            defaultHandler="org.txm.analec.commands.ExportTEICorpus"
244
            id="org.txm.analec.commands.ExportTEICorpus"
243
            defaultHandler="org.txm.annotation.urs.commands.ExportTEICorpus"
244
            id="org.txm.annotation.urs.commands.ExportTEICorpus"
245 245
            name="%command.name.13">
246 246
      </command>
247 247
      <command
248 248
            categoryId="org.txm.rcp.category.txm"
249
            defaultHandler="org.txm.analec.commands.ImportTEICorpus"
250
            id="org.txm.analec.commands.ImportTEICorpus"
249
            defaultHandler="org.txm.annotation.urs.commands.ImportTEICorpus"
250
            id="org.txm.annotation.urs.commands.ImportTEICorpus"
251 251
            name="%command.name.14">
252 252
      </command>
253 253
      <command
254 254
            categoryId="org.txm.rcp.category.txm"
255
            defaultHandler="org.txm.analec.commands.ImportTEIAnnotations"
256
            id="org.txm.analec.commands.ImportTEIAnnotations"
255
            defaultHandler="org.txm.annotation.urs.commands.ImportTEIAnnotations"
256
            id="org.txm.annotation.urs.commands.ImportTEIAnnotations"
257 257
            name="%command.name.11">
258 258
      </command>
259 259
      <command
260 260
            categoryId="org.txm.rcp.category.txm"
261
            defaultHandler="org.txm.analec.commands.EditVue"
262
            id="org.txm.analec.commands.EditVue"
261
            defaultHandler="org.txm.annotation.urs.commands.EditVue"
262
            id="org.txm.annotation.urs.commands.EditVue"
263 263
            name="%command.name.16">
264 264
      </command>
265 265
   </extension>
......
268 268
      <view
269 269
            allowMultiple="false"
270 270
            category="org.txm.rcp"
271
            class="org.txm.analec.view.ElementPropertiesView"
271
            class="org.txm.annotation.urs.view.ElementPropertiesView"
272 272
            icon="icons/pencil.png"
273
            id="org.txm.analec.view.ElementPropertiesView"
273
            id="org.txm.annotation.urs.view.ElementPropertiesView"
274 274
            name="%view.name"
275 275
            restorable="true">
276 276
      </view>
277 277
      <view
278 278
            allowMultiple="false"
279 279
            category="org.txm.rcp"
280
            class="org.txm.analec.view.ElementSearchView"
280
            class="org.txm.annotation.urs.view.ElementSearchView"
281 281
            icon="platform:/plugin/org.txm.rcp/icons/functions/Search.png"
282
            id="org.txm.analec.view.ElementSearchView"
282
            id="org.txm.annotation.urs.view.ElementSearchView"
283 283
            name="%view.name.0"
284 284
            restorable="true">
285 285
      </view>
......
287 287
   <extension
288 288
         point="org.txm.rcp.extentionpoint.command">
289 289
      <installcommand
290
            class="org.txm.analec.commands.DoInstallStep"></installcommand>
290
            class="org.txm.annotation.urs.commands.DoInstallStep"></installcommand>
291 291
   </extension>
292 292
   <extension
293 293
         point="org.eclipse.core.expressions.definitions">
......
295 295
            id="CanAnnotateWithAnalec">
296 296
         <test
297 297
               forcePluginActivation="true"
298
               property="org.txm.analec.testers.canAnnotate">
298
               property="org.txm.annotation.urs.testers.canAnnotate">
299 299
         </test>
300 300
      </definition>
301 301
   </extension>
302 302
   <extension
303 303
         point="org.eclipse.core.expressions.propertyTesters">
304 304
      <propertyTester
305
            class="org.txm.analec.testers.IsCorpusAnnotated"
306
            id="org.txm.analec.testers.IsCorpusAnnotated"
307
            namespace="org.txm.analec.testers"
305
            class="org.txm.annotation.urs.testers.IsCorpusAnnotated"
306
            id="org.txm.annotation.urs.testers.IsCorpusAnnotated"
307
            namespace="org.txm.annotation.urs.testers"
308 308
            properties="canAnnotate"
309 309
            type="java.lang.Object">
310 310
      </propertyTester>
......
313 313
         point="org.eclipse.ui.preferencePages">
314 314
      <page
315 315
            category="org.txm.rcp.preferences.UserPreferencePage"
316
            class="org.txm.analec.preferences.AnalecPreferencePage"
317
            id="org.txm.analec.preferences.AnalecPreferencePage"
316
            class="org.txm.annotation.urs.preferences.AnalecPreferencePage"
317
            id="org.txm.annotation.urs.preferences.AnalecPreferencePage"
318 318
            name="%page.name">
319 319
      </page>
320 320
   </extension>
321 321
   <extension
322 322
         point="org.txm.annotation.rcp.editor.AnnotationArea">
323 323
      <annotationtoolbar
324
            class="org.txm.analec.toolbar.UnitToolbar"
324
            class="org.txm.annotation.urs.toolbar.UnitToolbar"
325 325
            position="1">
326 326
      </annotationtoolbar>
327 327
      <annotationtoolbar
328
            class="org.txm.analec.toolbar.SchemaToolbar"
328
            class="org.txm.annotation.urs.toolbar.SchemaToolbar"
329 329
            position="2">
330 330
      </annotationtoolbar>
331 331
   </extension>
332 332
   <extension
333 333
         point="org.txm.PostTXMHOMEInstallationStep">
334 334
      <PostTXMHOMEInstallationStep
335
            class="org.txm.analec.InstallAnalecFiles"
335
            class="org.txm.annotation.urs.InstallAnalecFiles"
336 336
            description="Install analec Files"
337 337
            name="Analec macro">
338 338
      </PostTXMHOMEInstallationStep>
......
340 340
   <extension
341 341
         point="org.txm.annotation.core.AnnotationEngine">
342 342
      <AnnotationEngine
343
            class="org.txm.analec.AnalecCorpora"
343
            class="org.txm.annotation.urs.AnalecCorpora"
344 344
            description="Analec annotations">
345 345
      </AnnotationEngine>
346 346
   </extension>
tmp/org.txm.analec.rcp/META-INF/MANIFEST.MF (revision 1200)
156 156
 org.jfree.xml.util,
157 157
 org.jfree.xml.writer,
158 158
 org.jfree.xml.writer.coretypes,
159
 org.txm.analec,
160
 org.txm.analec.commands,
161
 org.txm.analec.export,
162
 org.txm.analec.imports,
163
 org.txm.analec.preferences,
164
 org.txm.analec.testers,
165
 org.txm.analec.toolbar,
166
 org.txm.analec.view,
167
 org.txm.analec.widgets,
159
 org.txm.annotation.urs,
160
 org.txm.annotation.urs.commands,
161
 org.txm.annotation.urs.export,
162
 org.txm.annotation.urs.imports,
163
 org.txm.annotation.urs.preferences,
164
 org.txm.annotation.urs.testers,
165
 org.txm.annotation.urs.toolbar,
166
 org.txm.annotation.urs.view,
167
 org.txm.annotation.urs.widgets,
168 168
 org.txm.macro.analec,
169 169
 org.txm.macro.analec.edit,
170 170
 org.txm.macro.analec.exploit,
......
187 187
Bundle-Name: %Bundle-Name.0
188 188
Bundle-ManifestVersion: 2
189 189
Bundle-Activator: analecrcp.Activator
190
Bundle-SymbolicName: org.txm.analec.rcp;singleton:=true
190
Bundle-SymbolicName: org.txm.annotation.urs.rcp;singleton:=true
191 191
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
192 192

  
tmp/org.txm.analec.rcp/.project (revision 1200)
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<projectDescription>
3
	<name>org.txm.analec.rcp</name>
3
	<name>org.txm.annotation.urs.rcp</name>
4 4
	<comment></comment>
5 5
	<projects>
6 6
	</projects>
......
26 26
		<nature>org.eclipse.pde.PluginNature</nature>
27 27
		<nature>org.eclipse.jdt.core.javanature</nature>
28 28
	</natures>
29
	<filteredResources>
30
		
31
	</filteredResources>
32 29
</projectDescription>
tmp/org.txm.analec.rcp/src/org/eclipse/jface/fieldassist/TXMSimpleContentProposalProvider.java (revision 1200)
13 13

  
14 14
import java.util.ArrayList;
15 15

  
16
import org.txm.analec.preferences.AnalecPreferencePage;
17
import org.txm.analec.preferences.AnalecPreferences;
16
import org.txm.annotation.urs.preferences.AnalecPreferencePage;
17
import org.txm.annotation.urs.preferences.AnalecPreferences;
18 18
import org.txm.core.preferences.TXMPreferences;
19 19
import org.txm.rcp.TxmPreferences;
20 20

  
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/Messages.java (revision 1200)
1
package org.txm.annotation.urs;
2

  
3
import org.eclipse.osgi.util.NLS;
4
import org.txm.utils.messages.Utf8NLS;
5

  
6
public class Messages extends NLS {
7

  
8
	public static String AnalecCorpora_3;
9
	public static String AnalecCorpora_4;
10
	
11
	public static String DoInstallStep_10;
12
	public static String DoInstallStep_11;
13
	public static String DoInstallStep_17;
14
	public static String DoInstallStep_18;
15
	public static String DoInstallStep_2;
16
	public static String DoInstallStep_5;
17
	public static String DoInstallStep_6;
18
	public static String DoInstallStep_7;
19
	public static String DoInstallStep_9;
20
	public static String EditStructure_0;
21
	public static String ExportGlozzCorpus_0;
22
	public static String ExportGlozzCorpus_1;
23
	public static String ExportGlozzCorpus_2;
24
	public static String ExportGlozzCorpus_3;
25
	public static String ExportGlozzCorpus_4;
26
	public static String ExportTEICorpus_0;
27
	public static String ExportTEICorpus_1;
28
	public static String ExportTEICorpus_2;
29
	public static String ExportTEICorpus_3;
30
	public static String ExportTEICorpus_4;
31
	public static String ImportGlozzAnnotations_0;
32
	public static String ImportGlozzAnnotations_1;
33
	public static String ImportGlozzAnnotations_10;
34
	public static String ImportGlozzAnnotations_2;
35
	public static String ImportGlozzAnnotations_3;
36
	public static String ImportGlozzAnnotations_4;
37
	public static String ImportGlozzAnnotations_5;
38
	public static String ImportGlozzAnnotations_6;
39
	public static String ImportGlozzAnnotations_7;
40
	public static String ImportGlozzAnnotations_8;
41
	public static String ImportGlozzAnnotations_9;
42
	public static String ImportGlozzCorpus_0;
43
	public static String ImportGlozzCorpus_1;
44
	public static String ImportGlozzCorpus_10;
45
	public static String ImportGlozzCorpus_11;
46
	public static String ImportGlozzCorpus_15;
47
	public static String ImportGlozzCorpus_17;
48
	public static String ImportGlozzCorpus_19;
49
	public static String ImportGlozzCorpus_22;
50
	public static String ImportGlozzCorpus_23;
51
	public static String ImportGlozzCorpus_24;
52
	public static String ImportGlozzCorpus_25;
53
	public static String ImportGlozzCorpus_26;
54
	public static String ImportGlozzCorpus_27;
55
	public static String ImportGlozzCorpus_28;
56
	public static String ImportGlozzCorpus_29;
57
	public static String ImportGlozzCorpus_3;
58
	public static String ImportGlozzCorpus_30;
59
	public static String ImportGlozzCorpus_32;
60
	public static String ImportGlozzCorpus_4;
61
	public static String ImportGlozzCorpus_5;
62
	public static String ImportGlozzCorpus_8;
63
	public static String ImportGlozzCorpus_9;
64
	public static String ImportTEIAnnotations_0;
65
	public static String ImportTEIAnnotations_1;
66
	public static String ImportTEIAnnotations_2;
67
	public static String ImportTEIAnnotations_3;
68
	public static String ImportTEIAnnotations_4;
69
	public static String ImportTEIAnnotations_5;
70
	public static String ImportTEIAnnotations_6;
71
	public static String ImportTEIAnnotations_7;
72
	public static String ImportTEIAnnotations_8;
73
	public static String ImportTEICorpus_0;
74
	public static String ImportTEICorpus_11;
75
	public static String ImportTEICorpus_14;
76
	public static String ImportTEICorpus_15;
77
	public static String ImportTEICorpus_16;
78
	public static String ImportTEICorpus_18;
79
	public static String ImportTEICorpus_19;
80
	public static String ImportTEICorpus_2;
81
	public static String ImportTEICorpus_20;
82
	public static String ImportTEICorpus_21;
83
	public static String ImportTEICorpus_22;
84
	public static String ImportTEICorpus_23;
85
	public static String ImportTEICorpus_24;
86
	public static String ImportTEICorpus_3;
87
	public static String ImportTEICorpus_5;
88
	public static String ImportTEICorpus_7;
89
	public static String ImportTEICorpus_9;
90
	public static String LoadCorpus_0;
91
	public static String LoadCorpus_1;
92
	public static String LoadCorpus_2;
93
	public static String LoadCorpus_3;
94
	public static String LoadCorpus_4;
95
	public static String LoadCorpus_5;
96
	public static String LoadStructure_0;
97
	public static String LoadStructure_1;
98
	public static String LoadStructure_2;
99
	public static String LoadStructure_3;
100
	public static String LoadStructureFromGlozz_0;
101
	public static String LoadStructureFromGlozz_1;
102
	public static String LoadStructureFromGlozz_2;
103
	public static String LoadStructureFromGlozz_3;
104
	public static String LoadStructureFromGlozz_4;
105
	public static String LoadVue_0;
106
	public static String LoadVue_1;
107
	public static String LoadVue_2;
108
	public static String LoadVue_3;
109
	public static String SaveCorpus_0;
110
	public static String SaveCorpus_1;
111
	public static String SaveCorpus_3;
112
	public static String SaveCorpus_5;
113
	public static String SaveStructure_0;
114
	public static String SaveStructure_3;
115
	public static String SaveStructure_4;
116
	public static String SaveStructure_5;
117
	public static String SaveStructureAsGlozzModel_0;
118
	public static String SaveStructureAsGlozzModel_1;
119
	public static String SaveStructureAsGlozzModel_2;
120
	public static String SaveStructureAsGlozzModel_3;
121
	public static String SaveVue_0;
122
	public static String SaveVue_3;
123
	public static String SaveVue_4;
124
	public static String SaveVue_5;
125
	
126
	public static String AnalecPreferencePage_3;
127
	public static String AnalecPreferencePage_4;
128
	public static String AnalecPreferencePage_9;
129
	
130
	public static String AnnotationToolbar_0;
131
	public static String AnnotationToolbar_6;
132
	public static String AnnotationToolbar_7;
133
	public static String UnitToolbar_10;
134
	public static String UnitToolbar_12;
135
	public static String UnitToolbar_14;
136
	public static String UnitToolbar_16;
137
	public static String UnitToolbar_27;
138
	public static String UnitToolbar_28;
139
	public static String UnitToolbar_29;
140
	public static String UnitToolbar_3;
141
	public static String UnitToolbar_32;
142
	public static String UnitToolbar_4;
143
	public static String UnitToolbar_44;
144
	public static String UnitToolbar_45;
145
	public static String UnitToolbar_46;
146
	public static String UnitToolbar_47;
147
	public static String UnitToolbar_48;
148
	public static String UnitToolbar_49;
149
	public static String UnitToolbar_5;
150
	public static String UnitToolbar_50;
151
	public static String UnitToolbar_51;
152
	public static String UnitToolbar_52;
153
	public static String UnitToolbar_53;
154
	public static String UnitToolbar_54;
155
	public static String UnitToolbar_59;
156
	public static String UnitToolbar_6;
157
	public static String UnitToolbar_60;
158
	public static String UnitToolbar_61;
159
	public static String UnitToolbar_62;
160
	public static String UnitToolbar_63;
161
	public static String UnitToolbar_7;
162
	public static String UnitToolbar_8;
163
	
164
	public static String StartButton_0;
165
	public static String StartButton_1;
166
	public static String StartButton_10;
167
	public static String StartButton_11;
168
	public static String StartButton_12;
169
	public static String StartButton_2;
170
	public static String StartButton_3;
171
	public static String StartButton_4;
172
	public static String StartButton_5;
173
	public static String StartButton_6;
174
	public static String StartButton_7;
175
	public static String StartButton_8;
176
	public static String StartButton_9;
177
	
178
	public static String NavigationField_0;
179
	public static String NavigationField_2;
180
	public static String NavigationField_3;
181
	public static String NavigationField_4;
182
	public static String NavigationField_5;
183
	
184
	static {
185
		// initialize resource bundle
186
		Utf8NLS.initializeMessages(Messages.class);
187
	}
188

  
189
	private Messages() {
190
	}
191
}
0 192

  
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/AnalecCorpora.java (revision 1200)
1
package org.txm.annotation.urs;
2

  
3
import java.io.File;
4
import java.util.HashMap;
5

  
6
import org.eclipse.core.runtime.IProgressMonitor;
7
import org.txm.Toolbox;
8
import org.txm.annotation.core.AnnotationEngine;
9
import org.txm.core.results.TXMResult;
10
import org.txm.objects.Project;
11
import org.txm.searchengine.cqp.corpus.MainCorpus;
12
import org.txm.utils.DeleteDir;
13

  
14
import visuAnalec.donnees.Corpus;
15
import visuAnalec.fichiers.FichiersJava;
16
import visuAnalec.vue.Vue;
17

  
18
/**
19
 * Manages Analec corpus: the corpus are associated with TXM MainCorpus objects
20
 * 
21
 * @author mdecorde
22
 *
23
 */
24
public class AnalecCorpora extends AnnotationEngine {
25

  
26
	private static final HashMap<MainCorpus, Corpus> corpora = new HashMap<MainCorpus, Corpus>();
27
	private static final HashMap<MainCorpus, Vue> vues = new HashMap<MainCorpus, Vue>();
28

  
29
	/**
30
	 * Create the ec file if needed, store a reference to the corpus if not already done.
31
	 * 
32
	 * @param mcorpus
33
	 * @return the Corpus loaded and stored
34
	 */
35
	public static Corpus getCorpus(MainCorpus mcorpus) {
36
		File fichierCorpus = new File(mcorpus.getProjectDirectory(), "analec/"+mcorpus.getID()+".ec"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
37
		File fichierVue = new File(mcorpus.getProjectDirectory(), "analec/"+mcorpus.getID()+".ecv");
38
		Corpus corpus = null;
39
		if (AnalecCorpora.corpora.containsKey(mcorpus)) {
40
			corpus = AnalecCorpora.corpora.get(mcorpus);
41
		} else {
42
			corpus = new Corpus();
43

  
44
			if (fichierCorpus.exists()) {
45
				if (!FichiersJava.ouvrirCorpus(corpus, fichierCorpus, false)) {
46
					System.out.println(Messages.AnalecCorpora_3+fichierCorpus);
47
					return null;
48
				}
49
			} else {
50
				fichierCorpus.getParentFile().mkdirs();
51

  
52
				if (!FichiersJava.enregistrerCorpus(corpus, fichierCorpus)) {
53
					System.out.println(Messages.AnalecCorpora_4+fichierCorpus);
54
					return null;
55
				}
56
			}
57

  
58
			AnalecCorpora.corpora.put(mcorpus, corpus);
59

  
60
			Vue vue = getVue(mcorpus);
61

  
62
			//TODO: does not work :( 
63
			if (fichierVue.exists()) {
64
				if (!FichiersJava.ouvrirVue(vue, fichierVue)) {
65
					System.out.println("Warning: Fail to open corpus Vue file: "+fichierVue);
66
					//return null;
67
				}
68
				String[] types = vue.getTypesUnitesAVoir();
69
				if (types == null || types.length == 0) {
70
					vue.retablirVueParDefaut();
71
				}
72
			} else {
73
				vue.retablirVueParDefaut(); // 
74
				if (!FichiersJava.enregistrerVue(vue, fichierVue)) {
75
					System.out.println("Warning: Fail to create corpus Vue file: "+fichierVue);
76
					//return null;
77
				}
78
			}
79
		}
80
		return corpus;
81
	}
82

  
83
	public static boolean isAnnotationStructureReady(org.txm.searchengine.cqp.corpus.CQPCorpus corpus) {
84
		return isAnnotationStructureReady(corpus.getMainCorpus());
85
	}
86

  
87
	public static boolean isAnnotationStructureReady(MainCorpus name) {
88
		if (AnalecCorpora.corpora.containsKey(name)) {
89
			return !AnalecCorpora.corpora.get(name).getStructure().isVide();
90
		} else {
91
			File fichierCorpus = new File(Toolbox.getTxmHomePath(), "corpora/"+name+"/analec/"+name+".ec"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
92
			if (fichierCorpus.exists()) {
93
				return !getCorpus(name).getStructure().isVide();
94
			} else {
95
				return false;
96
			}
97
		}
98
	}
99

  
100
	/**
101
	 * need the corpus to be loaded
102
	 * 
103
	 * @param name
104
	 * @return the corpus Vue
105
	 */
106
	public static Vue getVue(MainCorpus name) {
107
		if (!vues.containsKey(name)) {
108
			if (!corpora.containsKey(name)) {
109
				getCorpus(name);
110
			}
111
			Corpus corpus = getCorpus(name);
112
			Vue vue = new Vue(corpus);
113
			vues.put(name, vue);
114
		}
115
		return vues.get(name);
116
	}
117

  
118
	public static boolean saveCorpus(MainCorpus mcorpus) {
119
		Corpus corpus = getCorpus(mcorpus);
120
		Vue vue = getVue(mcorpus);
121
		File dir = new File(mcorpus.getProjectDirectory(), "analec/"); //$NON-NLS-1$ //$NON-NLS-2$
122
		dir.mkdir();
123
		File fichierCorpus = new File(dir, mcorpus+".ec"); //$NON-NLS-1$
124
		File fichierVueCorpus = new File(dir, mcorpus+".ecv"); //$NON-NLS-1$
125
		return FichiersJava.enregistrerCorpus(corpus, fichierCorpus) 
126
				&& FichiersJava.enregistrerVue(vue, fichierVueCorpus);
127
	}
128

  
129
	public static Vue getVue(Corpus corpus) {
130
		for (MainCorpus mcorpus : corpora.keySet()) {
131
			if (corpora.get(mcorpus) == corpus) return vues.get(mcorpus);
132
		}
133
		return null;
134
	}
135

  
136
	public static boolean saveCorpus(Corpus corpus) {
137
		for (MainCorpus mcorpus : corpora.keySet()) {
138
			if (corpora.get(mcorpus) == corpus) return saveCorpus(mcorpus);
139
		}
140
		return false;
141
	}
142

  
143
	public static void removeCorpus(MainCorpus mcorpus) {
144
		if (!vues.containsKey(mcorpus)) {vues.remove(mcorpus);}
145
		if (!corpora.containsKey(mcorpus)) {corpora.remove(mcorpus);}
146
	}
147

  
148
	public static void revert(MainCorpus corpus) {
149
		corpora.remove(corpus);
150
		vues.remove(corpus);
151
		corpus.setIsModified(false);
152
	}
153

  
154
	@Override
155
	public boolean isRunning() {
156
		return true;
157
	}
158

  
159
	@Override
160
	public boolean initialize() throws Exception {
161
		return true;
162
	}
163

  
164
	@Override
165
	public boolean start(IProgressMonitor monitor) throws Exception {
166
		return true;
167
	}
168

  
169
	@Override
170
	public boolean stop() throws Exception {
171
		return true;
172
	}
173

  
174
	@Override
175
	public void notify(TXMResult r, String state) {
176
		if (r instanceof MainCorpus && "clean".equals(state)) {
177
			MainCorpus mcorpus = (MainCorpus)r;
178

  
179
			AnalecCorpora.removeCorpus(mcorpus);
180

  
181
			File fichierCorpus = new File(mcorpus.getProjectDirectory(), "analec/"+mcorpus.getID()+".ec"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
182
			File fichierVue = new File(mcorpus.getProjectDirectory(), "analec/"+mcorpus.getID()+".ecv");
183
			fichierCorpus.delete();
184
			fichierVue.delete();
185
		} else if (r instanceof Project) {
186
			Project project = ((Project)r);
187
			if ("clean".equals(state)) {
188
				File analecDir = new File(project.getProjectDirectory(), "analec");
189
				if (analecDir.exists()) {
190
					DeleteDir.deleteDirectory(analecDir);
191
				}
192
			} else if ("save".equals(state)) {
193
				for (TXMResult c : project.getChildren(MainCorpus.class)) {
194
					AnalecCorpora.saveCorpus((MainCorpus)c);
195
				}
196
			}
197
		}
198
	}
199

  
200
	@Override
201
	public String getName() {
202
		return "Analec";
203
	}
204

  
205
	@Override
206
	public boolean isAutomatic() {
207
		return false;
208
	}
209

  
210
	@Override
211
	public boolean processFile(File xmlFile, File binaryCorpusDirectory, HashMap<String, Object> parameters) {
212
		return false;
213
	}
214

  
215
	@Override
216
	public String getDetails() {
217
		return corpora.toString();
218
	}
219
}
0 220

  
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/messages_fr.properties (revision 1200)
1
AnalecCorpora_3=N/A_Fail to open corpus file: 
2
AnalecCorpora_4=N/A_Fail to create corpus file: 
3
DoInstallStep_10=N/A_. Aborting
4
DoInstallStep_11=N/A_Previous version of Analec macros are moved to: 
5
DoInstallStep_17=N/A_Error while coping Analec org/txm/macro/analec in 
6
DoInstallStep_18=N/A_Analec post-installation done.
7
DoInstallStep_2=N/A_Analec.DoInstallStep.install()
8
DoInstallStep_5=N/A_No post-installation of Analec to do
9
DoInstallStep_6=N/A_Post-installing Analec version=
10
DoInstallStep_7=N/A_scripts/macro/org/txm/macro/analec
11
DoInstallStep_9=N/A_Analec previous macro backup directory already exists: 
12
EditStructure_0=N/A_Selection is not a corpus: 
13
ExportGlozzCorpus_0=N/A_Selection is not a main corpus: 
14
ExportGlozzCorpus_1=N/A_\ Glozz export
15
ExportGlozzCorpus_2=N/A_Canceled.
16
ExportGlozzCorpus_3=N/A_Error while exporting annotations : 
17
ExportGlozzCorpus_4=N/A_Error while exporting annotations : 
18
ExportTEICorpus_0=N/A_Selection is not a corpus: 
19
ExportTEICorpus_1=N/A_\ annotations export...
20
ExportTEICorpus_2=N/A_Error while exporting corpus.
21
ExportTEICorpus_3=N/A_Error while exporting corpus to XML-Analec: 
22
ExportTEICorpus_4=N/A_Error while exporting annotations: 
23
ImportGlozzAnnotations_0=N/A_The AA AAM and AC files must exists.
24
ImportGlozzAnnotations_1=N/A_Selection is not a main corpus: 
25
ImportGlozzAnnotations_10=N/A_Done.
26
ImportGlozzAnnotations_2=N/A_Importing Glozz model from: 
27
ImportGlozzAnnotations_3=N/A_error while importing Glozz model.
28
ImportGlozzAnnotations_4=N/A_Importing Glozz corpus from: 
29
ImportGlozzAnnotations_5=N/A_\ and 
30
ImportGlozzAnnotations_6=N/A_error while importing Glozz corpus.
31
ImportGlozzAnnotations_7=N/A_Reindexing annotations with TXM words
32
ImportGlozzAnnotations_8=N/A_error while re-indexing Analec annotations.
33
ImportGlozzAnnotations_9=N/A_Saving annotations.
34
ImportGlozzCorpus_0=N/A_The glozzDirectory directory must exists.
35
ImportGlozzCorpus_1=N/A_Creating source directory: $srcDir
36
ImportGlozzCorpus_10=N/A_No .aa files found in 
37
ImportGlozzCorpus_11=N/A_Importing Glozz data from: 
38
ImportGlozzCorpus_15=N/A_Error while importing Glozz data.
39
ImportGlozzCorpus_17=N/A_Could not create the TXT source file $txtFile
40
ImportGlozzCorpus_19=N/A_ERROR: could not save import configuration: 
41
ImportGlozzCorpus_22=N/A_Error: no script found for import name ${importName}: $script
42
ImportGlozzCorpus_23=N/A_Error during import
43
ImportGlozzCorpus_24=N/A_Finalize Analec corpus import
44
ImportGlozzCorpus_25=N/A_Importing Glozz model from: 
45
ImportGlozzCorpus_26=N/A_Error while importing Glozz model.
46
ImportGlozzCorpus_27=N/A_Reindexing annotations with TXM words.
47
ImportGlozzCorpus_28=N/A_error while re-indexing Analec annotations.
48
ImportGlozzCorpus_29=N/A_Saving annotations.
49
ImportGlozzCorpus_3=N/A_Creating ec directory: $ecDir
50
ImportGlozzCorpus_30=N/A_Done.
51
ImportGlozzCorpus_32=N/A_ERROR while finalizing corpus import: 
52
ImportGlozzCorpus_4=N/A_Could not create the source directory $srcDir
53
ImportGlozzCorpus_5=N/A_Could not create the ec directory $ecDir
54
ImportGlozzCorpus_8=N/A_No .aa files found in 
55
ImportGlozzCorpus_9=N/A_No .ac files found in 
56
ImportTEIAnnotations_0=N/A_Selection is not a corpus: 
57
ImportTEIAnnotations_1=N/A_\ annotations import...
58
ImportTEIAnnotations_2=N/A_Error while importing annotations.
59
ImportTEIAnnotations_3=N/A_Error while importing annotations: 
60
ImportTEIAnnotations_4=N/A_Error while exporting annotations: 
61
ImportTEIAnnotations_5=N/A_Done: 
62
ImportTEIAnnotations_6=N/A_\ unites 
63
ImportTEIAnnotations_7=N/A_\ relations 
64
ImportTEIAnnotations_8=N/A_\ schemas.
65
ImportTEICorpus_0=N/A_The XML files must exists: 
66
ImportTEICorpus_11=N/A_ERROR: could not save import configuration: 
67
ImportTEICorpus_14=N/A_Error: no script found for import name ${importName}: $script
68
ImportTEICorpus_15=N/A_Error during import
69
ImportTEICorpus_16=N/A_Finalize Analec corpus import
70
ImportTEICorpus_18=N/A_Importing TEI model from: 
71
ImportTEICorpus_19=N/A_Error while importing TEI model.
72
ImportTEICorpus_2=N/A_Creating source directory: $srcDir
73
ImportTEICorpus_20=N/A_Reindexing annotations with TXM words.
74
ImportTEICorpus_21=N/A_error while re-indexing Analec annotations.
75
ImportTEICorpus_22=N/A_Saving annotations.
76
ImportTEICorpus_23=N/A_Done.
77
ImportTEICorpus_24=N/A_Error while finalizing corpus import: 
78
ImportTEICorpus_3=N/A_Could not create the source directory $srcDir
79
ImportTEICorpus_5=N/A_Importing TEI data from: 
80
ImportTEICorpus_7=N/A_Error while importing TEI data.
81
ImportTEICorpus_9=N/A_Could not create the TXT source file $txtFile
82
LoadCorpus_0=N/A_Selection is not a main corpus: 
83
LoadCorpus_1=N/A_Loading corpus from file...
84
LoadCorpus_2=N/A_The EC files must exists.
85
LoadCorpus_3=N/A_Loading corpus from file: 
86
LoadCorpus_4=N/A_Fail to load structure.
87
LoadCorpus_5=N/A_Done: 
88
LoadStructure_0=N/A_Selection is not a main corpus: 
89
LoadStructure_1=N/A_Loading structure for corpus=
90
LoadStructure_2=N/A_Fail to load structure.
91
LoadStructure_3=N/A_Done: 
92
LoadStructureFromGlozz_0=N/A_Selection is not a main corpus: 
93
LoadStructureFromGlozz_1=N/A_Importing Glozz model for corpus=
94
LoadStructureFromGlozz_2=N/A_The AAM file must exists.
95
LoadStructureFromGlozz_3=N/A_Fail to load structure from Glozz model.
96
LoadStructureFromGlozz_4=N/A_Done.
97
LoadVue_0=N/A_Selection is not a main corpus: 
98
LoadVue_1=N/A_Loading vue for corpus=
99
LoadVue_2=N/A_Fail to load structure.
100
LoadVue_3=N/A_Done: 
101
SaveCorpus_0=N/A_Selection is not a main corpus: 
102
SaveCorpus_1=N/A_\ in 
103
SaveCorpus_3=N/A_Saving structure for corpus=
104
SaveCorpus_5=N/A_Erreur lors de la sauvegarde du corpus.
105
SaveStructure_0=N/A_Selection is not a main corpus: 
106
SaveStructure_3=N/A_Saving structure for corpus=
107
SaveStructure_4=N/A_\ in 
108
SaveStructure_5=N/A_Erreur lors de la sauvegarde de la structure.
109
SaveStructureAsGlozzModel_0=N/A_Selection is not a main corpus: 
110
SaveStructureAsGlozzModel_1=N/A_Saving structure as Glozz model for corpus=
111
SaveStructureAsGlozzModel_2=N/A_Erreur lors de la sauvegarde de la structure.
112
SaveStructureAsGlozzModel_3=N/A_Done.
113
SaveVue_0=N/A_Selection is not a main corpus: 
114
SaveVue_3=N/A_Saving vue for corpus=
115
SaveVue_4=N/A_\ in 
116
SaveVue_5=N/A_Erreur lors de la sauvegarde de la vue.
117
AnalecPreferencePage_3=N/A_Use Analec scheme to fix unit limits
118
AnalecPreferencePage_4=N/A_Autocompletion search pattern of field is prefix (instead of infixe)
119
AnalecPreferencePage_9=N/A_Unit highlight color palette
120
AnnotationToolbar_0=N/A_No selection found. Aborting.
121
AnnotationToolbar_6=N/A_Error: QueryResult matches size is 
122
AnnotationToolbar_7=N/A_\ query was 
123
UnitToolbar_10=N/A_Supprimer
124
UnitToolbar_12=N/A_Corriger la limite gauche en cliquant sur un mot
125
UnitToolbar_14=N/A_Corriger les limites gauche et droite avec une nouvelle s?lection de mot
126
UnitToolbar_16=N/A_Corriger la limite droite en cliquant sur un mot
127
UnitToolbar_27=N/A_You must select a word. Try again\!
128
UnitToolbar_28=N/A_An error occured when updating unit limits with id=
129
UnitToolbar_29=N/A_Select 
130
UnitToolbar_3=N/A_** Could not retrieve 
131
UnitToolbar_32=N/A_Select 
132
UnitToolbar_4=N/A_\ size: 
133
UnitToolbar_44=N/A_Creating unit with start=
134
UnitToolbar_45=N/A_\ end=
135
UnitToolbar_46=N/A_org.txm.analec.delete
136
UnitToolbar_47=N/A_Delete unit 
137
UnitToolbar_48=N/A_Do you really want to delete unit 
138
UnitToolbar_49=N/A_\ ?
139
UnitToolbar_5=N/A_Type d'unit? :
140
UnitToolbar_50=N/A_Aborting annotation limit update
141
UnitToolbar_51=N/A_Identifiants SelectionListener: 
142
UnitToolbar_52=N/A_Types SelectionListener: 
143
UnitToolbar_53=N/A_Reloading identifiants combo values.
144
UnitToolbar_54=N/A_< type d'unit? >
145
UnitToolbar_59=N/A_Error no word found for id=
146
UnitToolbar_6=N/A_Type d'unit?
147
UnitToolbar_60=N/A_Updating annotation limits: 
148
UnitToolbar_61=N/A_\ -> 
149
UnitToolbar_62=N/A_\ with word id=
150
UnitToolbar_63=N/A_\ with pos=
151
UnitToolbar_7=N/A_Type d'unit?
152
UnitToolbar_8=N/A_Cr?er
153
StartButton_0=N/A_Units
154
StartButton_1=N/A_Schemas
155
StartButton_10=N/A_), then call the Analec > Import Structure command
156
StartButton_11=N/A_Save and close annotation tools: 
157
StartButton_12=N/A_D?marrer l'annotation Analec
158
StartButton_2=N/A_Saving analec annotations...
159
StartButton_3=N/A_Saving analec annotations...
160
StartButton_4=N/A_Error: corpus not saved.
161
StartButton_5=N/A_Done.
162
StartButton_6=N/A_You need to import an annotation structure before starting to annotate. Select the edition main corpus (
163
StartButton_7=N/A_), then call the Analec > Import Structure command
164
StartButton_8=N/A_Save and close annotation tools: 
165
StartButton_9=N/A_You need to import an annotation structure before starting to annotate. Select the edition main corpus (
166
NavigationField_0=N/A_<identifiant>
167
NavigationField_2=N/A_Wrong unit ID: 
168
NavigationField_3=N/A_Wrong unit ID: 
169
NavigationField_4=N/A_Rechercher par les propri?t?s de ce type d'unit?
170
NavigationField_5=N/A_<identifiant>
0 171

  
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/testers/IsCorpusAnnotated.java (revision 1200)
1
package org.txm.annotation.urs.testers;
2

  
3
import java.util.List;
4

  
5
import org.eclipse.core.expressions.PropertyTester;
6
import org.txm.annotation.urs.AnalecCorpora;
7
import org.txm.searchengine.cqp.corpus.CQPCorpus;
8
import org.txm.searchengine.cqp.corpus.MainCorpus;
9

  
10
public class IsCorpusAnnotated extends PropertyTester {
11

  
12
	public static final String PROPERTY_NAMESPACE = "org.txm.analec.testers"; //$NON-NLS-1$
13
	public static final String PROPERTY_CAN_SAVE = "canAnnotate";
14
	
15
	@Override
16
	public boolean test(Object receiver, String property, Object[] args,
17
			Object expectedValue) {
18

  
19
		if (receiver instanceof List) {
20
			@SuppressWarnings("unchecked")
21
			List<Object> list = (List<Object>)receiver;
22
			if (list.size() == 0) return false;
23
			receiver = list.get(0);
24
		}
25
		
26
		//System.out.println("test org.txm.analec.testers.canAnnotate with "+receiver.getClass());
27
		if (receiver instanceof CQPCorpus) {
28
			return testCorpus((CQPCorpus)receiver);
29
		}
30
		return false;
31
	}
32

  
33
	protected boolean testCorpus(CQPCorpus c) {
34
		MainCorpus mc = c.getMainCorpus();
35
		boolean ret = AnalecCorpora.isAnnotationStructureReady(mc);
36
		//System.out.println(" Corpus:"+c+" org.txm.analec.testers.canAnnotate: "+ret);
37
		return ret;
38
	}
39
}
0 40

  
tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/imports/AnalecAnnotationsImporter.java (revision 1200)
1
package org.txm.annotation.urs.imports;
2

  
3
import java.io.File;
4
import java.io.FilenameFilter;
5
import java.io.IOException;
6
import java.io.InputStream;
7
import java.net.MalformedURLException;
8
import java.util.ArrayList;
9
import java.util.Arrays;
10
import java.util.HashMap;
11
import java.util.List;
12

  
13
import javax.xml.stream.XMLInputFactory;
14
import javax.xml.stream.XMLStreamConstants;
15
import javax.xml.stream.XMLStreamException;
16
import javax.xml.stream.XMLStreamReader;
17

  
18
import org.apache.commons.lang.StringUtils;
19
import org.eclipse.core.runtime.IProgressMonitor;
20
import org.txm.Toolbox;
21
import org.txm.importer.PersonalNamespaceContext;
22
import org.txm.searchengine.cqp.AbstractCqiClient;
23
import org.txm.searchengine.cqp.CQPSearchEngine;
24
import org.txm.searchengine.cqp.corpus.MainCorpus;
25
import org.txm.searchengine.cqp.corpus.QueryResult;
26
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
27
import org.txm.utils.logger.Log;
28

  
29
import visuAnalec.donnees.Corpus;
30
import visuAnalec.elements.Relation;
31
import visuAnalec.elements.Schema;
32
import visuAnalec.elements.Unite;
33
import visuAnalec.fichiers.FichiersGlozz;
34
import visuAnalec.vue.Vue;
35

  
36
public class AnalecAnnotationsImporter {
37

  
38
	protected MainCorpus mainCorpus;
39
	protected Corpus analecCorpus;
40
	protected File annotationsDirectory;
41
	protected Vue analecVue;
42
	protected IProgressMonitor monitor;
43
	protected XMLInputFactory factory;
44
	protected File aamFile;
45
	protected static PersonalNamespaceContext Nscontext = new PersonalNamespaceContext();
46

  
47
	public AnalecAnnotationsImporter(IProgressMonitor monitor, File outputDirectory, File aamFile, MainCorpus mainCorpus, Corpus analecCorpus, Vue analecVue) {
48
		this.annotationsDirectory = outputDirectory;
49
		this.aamFile = aamFile;
50
		this.mainCorpus = mainCorpus;
51
		this.analecCorpus = analecCorpus;
52
		this.analecVue = analecVue;
53
		this.monitor = monitor;
54
	}
55

  
56
	public boolean process() throws Exception {
57
		if (!annotationsDirectory.exists()) {
58
			System.out.println("Error: annotationsDirectory does not exist: "+annotationsDirectory.getAbsolutePath());
59
			return false;
60
		}
61
		if (!annotationsDirectory.isDirectory()) {
62
			System.out.println("Error: annotationsDirectory is not a directory: "+annotationsDirectory.getAbsolutePath());
63
			return false;
64
		}
65
		if (!aamFile.exists()) {
66
			System.out.println("Error: aamFile does not exist: "+aamFile.getAbsolutePath());
67
			return false;
68
		}
69
		
70
		if (!FichiersGlozz.importerModeleGlozz(analecCorpus, aamFile)) {
71
			System.out.println("Error while importing Glozz model: "+aamFile);
72
			return false;
73
		}
74
		
75
		File[] ursFiles = annotationsDirectory.listFiles(new FilenameFilter() {
76
			@Override
77
			public boolean accept(File dir, String name) {
78
				return name.matches(".+-urs\\.xml");
79
			}
80
		});
81

  
82
		if (ursFiles == null) {
83
			System.out.println("No XML files found in "+annotationsDirectory);
84
			return false;
85
		}
86
		if (ursFiles.length == 0) {
87
			System.out.println("No XML files found in "+annotationsDirectory);
88
			return false;
89
		}
90
		Arrays.sort(ursFiles);
91

  
92
		factory = XMLInputFactory.newInstance();
93
		List<String> cqpTextIds = mainCorpus.getProject().getTextsID();
94

  
95
		List<Integer> all_result_summary = Arrays.asList(0,0,0,0,0,0,0,0);
96
		
97
		if (monitor != null) monitor.subTask("Processing "+ursFiles.length+" texts...");
98
		for (File xmlTXMFile : ursFiles) {
99
			String textid = xmlTXMFile.getName().substring(0, xmlTXMFile.getName().length() - 8);
100
			System.out.println("Processing text: "+textid);
101
			if (cqpTextIds.contains(textid)) {
102
				if (monitor != null) monitor.subTask("Processing "+textid+" text...");
103
				// N unit, N unit error, N unit no match error, N unit too much match error, N Relation, N Relation error, N Schema, N Schema error
104
				List<Integer> result_summary = processText(textid, xmlTXMFile);
105
				
106
				System.out.println(textid+" import report: ");
107
				System.out.println(" N Units added: "+result_summary.get(0));
108
				System.out.println(" N Units error: "+result_summary.get(1));
109
				System.out.println(" N Units no match error: "+result_summary.get(2));
110
				System.out.println(" N Units too much match error: "+result_summary.get(3));
111
				System.out.println(" N Relations added: "+result_summary.get(4));
112
				System.out.println(" N Relations error: "+result_summary.get(5));
113
				System.out.println(" N Schemas added: "+result_summary.get(6));
114
				System.out.println(" N Schemas error: "+result_summary.get(7));
115
				
116
				for (int i = 0 ; i < all_result_summary.size() ; i++) all_result_summary.set(i, all_result_summary.get(i)+result_summary.get(i));
117

  
118
			} else {
119
				System.out.println("Warning: cannot found text with ID="+textid+" in current CQP corpus.");
120
			}
121
		}
122
		
123
		System.out.println("Final import report: ");
124
		System.out.println(" N Units added: "+all_result_summary.get(0));
125
		System.out.println(" N Units error: "+all_result_summary.get(1));
126
		System.out.println(" N Units no match error: "+all_result_summary.get(2));
127
		System.out.println(" N Units too much match error: "+all_result_summary.get(3));
128
		System.out.println(" N Relations added: "+all_result_summary.get(4));
129
		System.out.println(" N Relations error: "+all_result_summary.get(5));
130
		System.out.println(" N Schemas added: "+all_result_summary.get(6));
131
		System.out.println(" N Schemas error: "+all_result_summary.get(7));
132

  
133
		return true;
134
	}
135

  
136
	private List<Integer> processText(String textid, File xmlTXMFile) throws Exception {
137
		AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
138
		// N unit, N unit error, N unit no match error, N unit too much match error, N Relation, N Relation error, N Schema, N Schema error
139
		int nUnitsAdded = 0;
140
		int nUnitsError = 0;
141
		int nUnitsNoMatchError = 0;
142
		int nUnitsTooMuchMatchError = 0;
143
		int nRelationsAdded = 0;
144
		int nRelationsError = 0;
145
		int nSchemaAdded = 0;
146
		int nSchemaError = 0;
147
		
148
		unites.clear();
149
		relations.clear();
150
		schemas.clear();
151
		elementProperties.clear();
152

  
153
		if (!parseXMLTXMFile(xmlTXMFile)) return null;
154

  
155
//		if (unites.size() > 0) System.out.println(unites);
156
//		if (relations.size() > 0) System.out.println(relations);
157
//		if (schemas.size() > 0) System.out.println(schemas);
158
//		if (elementProperties.size() > 0) System.out.println(elementProperties);
159
//		for (String u : unites.keySet()) if (!elementProperties.containsKey(u+"-fs")) System.out.println("MISSIGN ELEM PROPERTIES: "+u);
160
//		for (String u : relations.keySet()) if (!elementProperties.containsKey(u+"-fs")) System.out.println("MISSIGN ELEM PROPERTIES: "+u);
161
//		for (String u : schemas.keySet()) if (!elementProperties.containsKey(u+"-fs")) System.out.println("MISSIGN ELEM PROPERTIES: "+u);
162

  
163
		for (String id : unites.keySet()) {
164
			String ana = unites.get(id)[0];
165
			String type = unites.get(id)[1];
166
			String deb = unites.get(id)[2];
167
			String fin = unites.get(id)[3];
168
			if (elementProperties.containsKey(ana)) {
169

  
170
				try {
171
					CQLQuery query = new CQLQuery("[_.text_id=\""+textid+"\" & id=\""+deb+"|"+fin+"\"]");
172
					QueryResult result = mainCorpus.query(query, "TMP", true);
173
					int[] starts = result.getStarts();
174
					result.drop();
175
					if (starts.length == 1) {
176
						//System.out.println("create unite: "+type+" ["+deb+", "+fin+"]");
177
						Unite unite = analecCorpus.addUniteSaisie(type, starts[0], starts[0]);
178
						HashMap<String, String> props = elementProperties.get(ana);
179
						for (String prop : props.keySet()) {
180
							unite.putProp(prop, props.get(prop));
181
						}
182
						unitesRef.put(id, unite);
183
						nUnitsAdded++;
184
					} else if (starts.length == 2) {
185
						Unite unite = analecCorpus.addUniteSaisie(type, starts[0], starts[1]);
186
						//System.out.println("create unite: "+type+" ["+deb+", "+fin+"]");
187
						HashMap<String, String> props = elementProperties.get(ana);
188
						for (String prop : props.keySet()) {
189
							unite.putProp(prop, props.get(prop));
190
						}
191
						unitesRef.put(id, unite);
192
						nUnitsAdded++;
193
					} else {
194
						nUnitsError++;
195
						if (starts.length == 0) {
196
							System.out.println("WARNING: no position found for query "+query+".");
197
							nUnitsNoMatchError++;
198
						} else {
199
							System.out.println("WARNING: too many positions found for query "+query+" -> "+Arrays.toString(starts));
200
							nUnitsTooMuchMatchError++;
201
						}
202
					}
203
				} catch(Exception e) {
204
					System.out.println("Error while getting word positions of id="+deb+" and id="+fin+": "+e.getLocalizedMessage());
205
					Log.printStackTrace(e);
206
				}
207
			} else {
208
				System.out.println("Warning no properties found for element id="+id+" and ana="+ana);
209
			}
210
		}
211

  
212
		for (String id : relations.keySet()) {
213
			String ana = relations.get(id)[0];
214
			String type = relations.get(id)[1];
215
			String target = relations.get(id)[2];
216

  
217
			if (elementProperties.containsKey(ana)) {
218

  
219
				String[] wordsref = target.split(" ");
220
				String[] wordsid = new String[wordsref.length];
221
				for (int i = 0 ; i < wordsref.length ; i++) wordsid[i] = wordsref[i].substring(1);
222
				try {
223
					Unite elt1 = unitesRef.get(wordsid[0]);
224
					Unite elt2 = unitesRef.get(wordsid[1]);
225
					if (elt1 != null && elt2 != null) {
226
						//System.out.println("create relation: "+type+" ["+deb+", "+fin+"]");
227

  
228
						Relation relation = analecCorpus.addRelationSaisie(type, elt1, elt2);
229
						HashMap<String, String> props = elementProperties.get(ana);
230
						for (String prop : props.keySet()) {
231
							relation.putProp(prop, props.get(prop));
232
						}
233
						nRelationsAdded++;
234
					} else {
235
						System.out.println("ERROR: relation element not found "+Arrays.toString(wordsref));
236
						nRelationsError++;
237
					}
238
				} catch(Exception e) {
239

  
240
				}
241
			} else {
242
				System.out.println("Warning no properties found for element id="+id);
243
			}
244
		}
245

  
246
		for (String id : schemas.keySet()) {
247
			String ana = schemas.get(id)[0];
248
			String type = schemas.get(id)[1];
249
			String target = schemas.get(id)[2];
250
			if (elementProperties.containsKey(ana)) {
251
				String[] unitsref = target.split(" ");
252
				try {
253
					//System.out.println("create relation: "+type+" ["+deb+", "+fin+"]");
254
					Schema schema = new Schema(type);
255
					for (String unitid : unitsref) {
256
						unitid = unitid.substring(1); // remove '#'
257
						if (unitesRef.containsKey(unitid)) {
258
							Unite unite = unitesRef.get(unitid);
259
							schema.ajouter(unite);
260
						} else {
261
							System.out.println("Warning: missing unit id: "+unitid);
262
							nSchemaError++;
263
						}
264
					}
265
					analecCorpus.addSchemaLu(schema);
266
					HashMap<String, String> props = elementProperties.get(ana);
267
					for (String prop : props.keySet()) {
268
						schema.putProp(prop, props.get(prop));
269
					}
270
					nSchemaAdded++;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff