Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / scripts / importer / transcriber / compiler.groovy @ 1804

History | View | Annotate | Download (18.4 kB)

1
// Copyright © 2010-2013 ENS de Lyon.
2
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3
// Lyon 2, University of Franche-Comté, University of Nice
4
// Sophia Antipolis, University of Paris 3.
5
//
6
// The TXM platform is free software: you can redistribute it
7
// and/or modify it under the terms of the GNU General Public
8
// License as published by the Free Software Foundation,
9
// either version 2 of the License, or (at your option) any
10
// later version.
11
//
12
// The TXM platform is distributed in the hope that it will be
13
// useful, but WITHOUT ANY WARRANTY; without even the implied
14
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
// PURPOSE. See the GNU General Public License for more
16
// details.
17
//
18
// You should have received a copy of the GNU General
19
// Public License along with the TXM platform. If not, see
20
// http://www.gnu.org/licenses.
21
//
22
//
23
//
24
// $LastChangedDate:$
25
// $LastChangedRevision:$
26
// $LastChangedBy:$
27
//
28
package org.txm.scripts.importer.transcriber
29

    
30
import java.io.File;
31

    
32
import javax.xml.stream.*;
33

    
34
import java.io.OutputStreamWriter;
35
import java.util.LinkedHashMap;
36
import org.txm.objects.*
37
import org.txm.searchengine.cqp.corpus.*
38
import org.txm.importer.cwb.CwbEncode
39
import org.txm.importer.cwb.CwbMakeAll
40
import org.txm.importer.cwb.CwbProcess;
41
import org.txm.importer.cwb.PatchCwbRegistry;
42
import org.txm.utils.Pair;
43

    
44
/**
45
 * The Class compiler.
46
 */
47
class compiler {
48

    
49
        boolean ADD_TEXTID_TO_REF = true
50
        
51
        /** The input data. */
52
        private def inputData;
53

    
54
        /** The factory. */
55
        private def factory;
56

    
57
        /** The parser. */
58
        private XMLStreamReader parser;
59

    
60
        /** The output. */
61
        OutputStreamWriter output;
62

    
63
        /** The basename. */
64
        String corpusname;
65

    
66
        /** The projectname. */
67
        String projectname
68

    
69
        /** The outdir. */
70
        String outdir;
71

    
72
        /** The debug. */
73
        boolean debug = false;
74

    
75
        /** The annotation succes. */
76
        boolean annotationSucces = false;
77

    
78
        /** The removeinterviewers. */
79
        boolean removeinterviewers = false;
80

    
81
        /** The trans. */
82
        HashMap<String, ArrayList<Pair<String, String>>> trans;
83

    
84
        /** The speakers. */
85
        HashMap<String, ArrayList<Pair<String, String>>> speakers;
86

    
87
        /** The speakersname. */
88
        HashMap<String, String> speakersname = new HashMap<String, String>();
89

    
90
        /** The topics. */
91
        HashMap<String, ArrayList<Pair<String, String>>> topics;
92

    
93

    
94
        /** The interviewers. */
95
        ArrayList<String> interviewers = [];
96
        static HashSet<String> sectionAttrs;
97

    
98
        /** The anatypes. */
99
        private static anatypes = []
100
        private static anavalues = [:]
101

    
102
        /**
103
         * Removes the interviewers.
104
         *
105
         * @param value the value
106
         * @return the java.lang. object
107
         */
108
        public removeInterviewers(boolean value) {
109
                this.removeinterviewers = value;
110
        }
111

    
112
        File cqpFile
113
        /**
114
         * Run.
115
         *
116
         * @param xmlfiles the xmlfiles
117
         * @param basename the basename
118
         * @param projectname the projectname
119
         * @param outdir the outdir
120
         * @return true, if successful
121
         */
122
        public boolean run(Project project, List<File> xmlfiles, String corpusname, String projectname, File binDir) {
123
                Collections.sort(xmlfiles);
124
                //println "run compiler with $xmlfiles, $basename and $outdir"
125
                this.outdir = binDir;
126
                this.corpusname = corpusname;
127
                this.projectname = projectname;
128

    
129
                anatypes = ["event"] // reset
130
                anavalues = [:] // reset
131

    
132
                sectionAttrs = new HashSet<String>() // reset section attributs set
133

    
134
                Project project = module.getProject();
135
                CorpusBuild corpus = project.getCorpusBuild(project.getName(), MainCorpus.class);
136
                if (corpus != null) {
137
                        if (project.getDoUpdate()) {
138
                                corpus.clean(); // remove old files
139
                        } else {
140
                                corpus.delete(); // remove old files and TXMResult children
141
                        }
142
                } else {
143
                        corpus = new MainCorpus(project);
144
                        corpus.setID(project.getName());
145
                        corpus.setName(project.getName());
146
                }
147
                corpus.setDescription("Built with the XML-TRS import module");
148
                
149
                cqpFile = new File(binDir,"cqp/"+corpusname+".cqp");
150
                new File(binDir,"cqp").mkdirs()
151
                new File(binDir,"data").mkdirs()
152
                new File(binDir,"registry").mkdirs()
153

    
154
                // get all anatypes
155
                for (File f : xmlfiles) {
156
                        getAnaTypes(f)
157
                }
158
                //println "ANATYPES: "+anatypes
159
                if (!createOutput(cqpFile)) return false;
160
                output.write("<txmcorpus lang=\"fr\">\n")
161
                output.close();
162

    
163
                println("Compiling "+xmlfiles.size()+" files")
164
                for (File f :xmlfiles) {
165
                        if (f.exists())
166
                                if (!process(f)) {
167
                                        println("Failed to compile "+f)
168
                                }
169
                }
170

    
171
                if (!createOutput(cqpFile)) return false;
172
                output.write("</txmcorpus>\n")
173
                output.close();
174

    
175
                //2- Import into CWB
176
                File registryFile = new File(binDir, "registry/"+corpusname.toLowerCase())
177
                File dataDir = new File(binDir, "data/$corpusname")
178

    
179
                new File(binDir, "registry").mkdir();
180
                if (!new File(binDir, "registry").exists()) {
181
                        println "Can't create registry directory"
182
                        return false;
183
                }
184

    
185
                if (!(CwbEncode.isExecutableAvailable() && CwbMakeAll.isExecutableAvailable())) {
186
                        println ("Error: CWB executables not well set.")
187
                        return false;
188
                }
189
                CwbEncode cwbEn = new CwbEncode();
190
                CwbMakeAll cwbMa = new CwbMakeAll();
191
                cwbEn.setDebug(debug);
192
                cwbMa.setDebug(debug);
193

    
194
                String uAttr = "u:0+spkid+spk+scope+accent+s+time+check+dialect+type";
195
                String textAttr ="text:0+base+project"
196
                if (trans != null) {
197
                        for (String key : trans.keySet()) {
198
                                for (Pair p : trans.get(key)) {
199
                                        if (ignoreTranscriberMetadata) {
200
                                                String meta =p.getFirst();
201
                                                if (        meta != "scribe" && meta != "audio_filename" &&
202
                                                meta != "version" && meta != "version_date")
203
                                                        textAttr+="+"+meta
204
                                        } else {
205
                                                textAttr+="+"+p.getFirst()
206
                                        }
207
                                }
208
                                break;
209
                        }
210
                }
211

    
212
                String sectionAttr = "div:0" // "div:0+id+topic+endtime+starttime+type"
213
                for (String attr : sectionAttrs) {
214
                        sectionAttr += "+"+attr
215
                }
216

    
217
                List<String> pargs = ["spk", "ref", "id", "entitytype", "entityid"]
218
                for (String ana : anatypes) pargs.add(ana)
219

    
220
                String[] pAttributes = pargs
221

    
222
                String[] sAttributes = ["txmcorpus:0+lang", uAttr , textAttr, "event:0+id+desc+type+extent", sectionAttr, "sp:0+id+speaker+endtime+starttime+overlap+time"];
223

    
224
                println "pAttributes: $pAttributes"
225
                println "sAttributes: $sAttributes"
226
                //return;
227
                try {
228
                        cwbEn.run(dataDir.getAbsolutePath(),
229
                                        cqpFile.getAbsolutePath(),
230
                                        registryFile.getAbsolutePath(), pAttributes, sAttributes);
231
                        if (!registryFile.exists()) {
232
                                println "Error: The registry file was not created: $regPath. See https://groupes.renater.fr/wiki/txm-users/public/faq"
233
                                return false;
234
                        }
235
                        cwbMa.run(corpusname, registryFile.getParent());
236

    
237
                } catch (Exception ex) {System.out.println(ex); return false;}
238

    
239
                return true;
240
        }
241

    
242
        /**
243
         * Creates the output.
244
         *
245
         * @param dirPathName the dir path name
246
         * @param fileName the file name
247
         * @return true, if successful
248
         */
249
        private boolean createOutput(File f){
250
                try {
251
                        //File f = new File(dirPathName, fileName)
252
                        output = new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(f,f.exists())) , "UTF-8");
253
                        return true;
254
                } catch (Exception e) {
255
                        System.out.println(e.getLocalizedMessage());
256
                        return false;
257
                }
258
        }
259

    
260
        /** The text_id. */
261
        String text_id
262

    
263
        /** The u opened. */
264
        boolean uOpened = false;
265

    
266
        /** The idturn. */
267
        int idturn = 1;
268

    
269
        /** The idsection. */
270
        int idsection = 1;
271

    
272
        /** The idu. */
273
        int idu = 1;
274

    
275
        /** The idevent. */
276
        int idevent = 1;
277

    
278
        /** The events. */
279
        List<String> events = [];
280
        static int vEntityId = 0;
281
        static int vEntityIdCount = 1;
282

    
283
        /**
284
         * Process.
285
         *
286
         * @param xmlfile the xmlfile
287
         * @return true, if successful
288
         */
289
        private boolean process(File xmlfile) {
290
                text_id = xmlfile.getName();
291
                text_id = text_id.substring(0, text_id.length() -4);
292

    
293
                idturn = 1;
294
                idsection = 1;
295
                idu = 1;
296

    
297
                boolean flagAna;
298
                boolean flagForm;
299
                boolean flagWord;
300
                String vWord="";
301
                String vForm="";
302
                String vAna="";
303
                String vEvents = "N/A";
304
                String vEntityType = "N/A"
305
                String wordid= "";
306
                //def wordattributes = [:];
307
                String anatype = "";
308
                String anavalue = "";
309

    
310
                String formatedTime;
311

    
312
                LinkedHashMap<String, String> anahash = new LinkedHashMap<String, String>();
313
                String currentType;
314

    
315
                URL url = xmlfile.toURI().toURL();
316
                inputData = url.openStream();
317
                factory = XMLInputFactory.newInstance();
318
                parser = factory.createXMLStreamReader(inputData);
319
                String filename = xmlfile.getName()
320
                String textid = filename.substring(0, filename.length() - 4);
321

    
322
                createOutput(cqpFile);
323
                String localname;
324

    
325
                //get all metadatas declared before Episode tag
326
                speakers = new HashMap<String, ArrayList<Pair<String, String>>>();
327
                trans = new HashMap<String, ArrayList<Pair<String, String>>>();
328
                topics = new HashMap<String, ArrayList<Pair<String, String>>>();
329
                //println "parse infos"
330
                parseInfos();
331

    
332
                //                println "Trans: $trans"
333
                //                println "Topics: $topics"
334
                //                println "Speakers: $speakers"
335
                //                def transproperties = ""
336
                //                for (String key : trans.keySet()) {
337
                //                        for (Pair p : trans.get(key))
338
                //                                transproperties+="\t"+p.getSecond();
339
                //                        break;
340
                //                }
341
                //                println "Trans properties: "+transproperties
342
                List<String> localspeakers;
343

    
344

    
345
                for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
346
                        //print "event: "+event +" "
347
                        switch (event) {
348
                                case XMLStreamConstants.START_ELEMENT:
349
                                        localname = parser.getLocalName();
350
                                //println localname
351
                                        switch(localname) {
352
                                                case "div":
353
                                                        output.write("<div");
354
                                                        for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
355
                                                                String name = parser.getAttributeLocalName(i).replace("_","").toLowerCase()
356
                                                                output.write(" "+name+"=\""+parser.getAttributeValue(i)+"\"");
357
                                                                sectionAttrs << name
358
                                                        }
359
                                                        output.write ">\n"
360
                                                        break;
361
                                                case "sp":
362
                                                        output.write("<sp");
363
                                                        writeAttributes();
364
                                                        output.write ">\n"
365
                                                        break;
366
                                                case "u":
367
                                                        output.write("<u");
368
                                                        for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
369
                                                                String name = parser.getAttributeLocalName(i).replace("_","").toLowerCase()
370
                                                                output.write(" "+name+"=\""+parser.getAttributeValue(i)+"\"");
371
                                                                if (name == "time") formatedTime = parser.getAttributeValue(i)
372
                                                                else if (name == "spk") u_name = parser.getAttributeValue(i)
373
                                                        }
374
                                                        output.write ">\n"
375
                                                        break;
376
                                                case "event":
377
                                                        output.write("<event");
378
                                                        writeAttributes();
379
                                                        output.write ">\n"
380

    
381
                                                        if (parser.getAttributeValue(null, "type") == "entities") {
382
                                                                if (parser.getAttributeValue(null, "extent") == "begin") {
383
                                                                        vEntityType = parser.getAttributeValue(null, "desc");
384
                                                                        vEntityId = vEntityIdCount++;
385
                                                                } else {
386
                                                                        vEntityType = "N/A";
387
                                                                        vEntityId = 0;
388
                                                                }
389
                                                        } else if (parser.getAttributeValue(null, "type") == "pronounce") {
390
                                                                if (parser.getAttributeValue(null, "extent") == "begin")
391
                                                                        events.add(parser.getAttributeValue(null, "desc"))
392
                                                                else if (parser.getAttributeValue(null, "extent") == "end")
393
                                                                        events.remove(parser.getAttributeValue(null, "desc"))
394
                                                                vEvents = "";
395
                                                                for (String s : events)
396
                                                                        vEvents += s+"#";
397
                                                                if (vEvents.length() > 0)
398
                                                                        vEvents = vEvents.substring(0, vEvents.length()-1);
399
                                                                else
400
                                                                        vEvents = ""
401
                                                        }
402
                                                        break;
403
                                                case "w":
404
                                                        for (int i = 0 ; i < parser.getAttributeCount(); i++) {
405
                                                                if (parser.getAttributeLocalName(i).equals("id")) {
406
                                                                        wordid = parser.getAttributeValue(i);
407
                                                                        break;
408
                                                                }
409
                                                        }
410
                                                        anavalues = [:];
411
                                                        break;
412
                                                case "form":
413
                                                        flagForm = true;
414
                                                        vForm = "";
415
                                                        vAna ="";
416
                                                        break;
417
                                                case "ana":
418
                                                        flagAna = true;
419
                                                        anavalue = "";
420
                                                        for (int i = 0 ; i < parser.getAttributeCount(); i++)
421
                                                                if (parser.getAttributeLocalName(i).equals("type")) {
422
                                                                        anatype = parser.getAttributeValue(i).substring(1);//remove the #
423
                                                                        break;
424
                                                                }
425
                                                        break;
426
                                        }
427
                                        break;
428
                                case XMLStreamConstants.END_ELEMENT:
429
                                        localname = parser.getLocalName();
430

    
431
                                        switch (localname) {
432
                                                case "text":
433
                                                        output.write("</text>\n")
434
                                                        break;
435
                                                case "Topics":
436
                                                        break;
437
                                                case "Topic":
438
                                                        break;
439
                                                case "Speakers":
440
                                                        break;
441
                                                case "Speaker":
442
                                                        break;
443
                                                case "Episode":
444
                                                        break;
445
                                                case "div":
446
                                                        output.write("</div>\n")
447
                                                        break;
448
                                                case "sp":
449
                                                        output.write("</sp>\n")
450
                                                        break;
451
                                                case "u":
452
                                                        output.write("</u>\n")
453
                                                        break;
454
                                                case "event":
455
                                                        output.write("</event>\n")
456
                                                        break;
457
                                                case "form":
458
                                                        flagForm = false;
459
                                                        break;
460
                                                case "ana":
461
                                                        anavalues.put(anatype, anavalue)
462
                                                        flagAna = false;
463
                                                        break;
464
                                                case "w":
465
                                                // concat spk id and ref
466
                                                        String isEnq = (interviewers.contains(u_name))?"*":"";
467
                                                        String ref = (u_name+", "+formatedTime+""+isEnq)
468
                                                        if (ADD_TEXTID_TO_REF) ref = textid+", "+ref
469
                                                        vForm +="\t"+u_name+"\t"+ref
470

    
471
                                                // concat entity and entity ID
472
                                                        vAna+= "\t"+vEntityType+"\t"+vEntityId;
473

    
474
                                                //concat ana values
475
                                                        for (String type : anatypes) {
476
                                                                def v = anavalues.get(type);
477
                                                                if (v == null) v = "";
478

    
479
                                                                if ("event" == type) {
480
                                                                        if (v.length() > 0)
481
                                                                                vAna+="\t#"+v;
482
                                                                        else
483
                                                                                vAna+="\t";
484

    
485
                                                                        //concat <Event> values
486
                                                                        if (vEvents != null && vEvents.length() > 0 && vEvents != "N/A")
487
                                                                                vAna += "#"+vEvents;
488
                                                                } else {
489
                                                                        vAna+="\t"+v;
490
                                                                }
491
                                                        }
492

    
493

    
494
                                                        vForm = vForm.replaceAll("\n", "").replaceAll("&", "&amp;").replaceAll("<", "&lt;");
495

    
496
                                                        if (removeinterviewers) {
497
                                                                if (!interviewers.contains(u_name))
498
                                                                        output.write(vForm+"\t"+wordid+vAna+"\n");
499
                                                        } else {
500
                                                                output.write(vForm+"\t"+wordid+vAna+"\n");
501
                                                        }
502

    
503
                                                        vAna = "";
504
                                                        vForm = "";
505
                                                        break;
506
                                        }
507
                                        break
508
                                case XMLStreamConstants.CHARACTERS:
509
                                        if (flagForm)
510
                                                vForm += parser.getText().trim();
511
                                        if (flagAna) {
512
                                                anavalue += parser.getText().trim();
513
                                        }
514
                                        break;
515
                        }
516
                }
517

    
518
                parser.close();
519
                inputData.close();
520
                output.close();
521
                return true;
522
        }
523

    
524
        /** The u_name. */
525
        String u_name;
526

    
527
        /**
528
         * Write start tag.
529
         */
530
        private void writeStartTag() {
531
                output.write("<"+parser.getLocalName());
532
                writeAttributes();
533
                output.write ">\n"
534
        }
535

    
536
        /**
537
         * Write attributes.
538
         */
539
        private void writeAttributes() {
540
                for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
541
                        output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+parser.getAttributeValue(i)+"\"");
542
                }
543
        }
544

    
545
        private void getAnaTypes(File xmlFile) {
546
                inputData = xmlFile.toURI().toURL().openStream();
547
                factory = XMLInputFactory.newInstance();
548
                parser = factory.createXMLStreamReader(inputData);
549
                String ana = "ana"
550
                HashSet<String> types = new HashSet<String>();
551
                for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
552
                        if (event == XMLStreamConstants.START_ELEMENT) { // start elem
553
                                if (ana.equals(parser.getLocalName())) { // ana elem
554
                                        for (int i = 0 ; i < parser.getAttributeCount(); i++) { // find @type
555
                                                if ("type".equals(parser.getAttributeLocalName(i))) { // @type
556
                                                        types.add(parser.getAttributeValue(i).substring(1)); //remove the #
557
                                                        break;
558
                                                }
559
                                        }
560
                                }
561
                        }
562
                }
563
                if (parser != null) parser.close();
564
                if (inputData != null) inputData.close();
565
                
566
                for (String type : types)
567
                        if (!anatypes.contains(type))
568
                                anatypes << type
569
        }
570

    
571
        /**
572
         * Write start tag.
573
         *
574
         * @param id the id
575
         */
576
        private void writeStartTag(int id) {
577
                output.write("<"+parser.getLocalName().toLowerCase());
578
                output.write(" id=\""+id+"\"");
579
                writeAttributes();
580
                output.write ">\n"
581
        }
582

    
583
        /**
584
         * Write end tag.
585
         */
586
        private void writeEndTag() {
587
                output.write("</"+parser.getLocalName().toLowerCase()+">\n");
588
        }
589

    
590
        /** The ignore transcriber metadata. */
591
        boolean ignoreTranscriberMetadata = false;
592

    
593
        /**
594
         * Sets the ignore transcriber metadata.
595
         *
596
         * @param state the new ignore transcriber metadata
597
         */
598
        public void setIgnoreTranscriberMetadata(boolean state) {
599
                this.ignoreTranscriberMetadata = state;
600
        }
601

    
602
        /**
603
         * Parses the infos.
604
         */
605
        private void parseInfos() { //until tag Episode
606
                String localname;
607
                //assert(parser != null);
608
                for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
609
                        if (event == XMLStreamConstants.START_ELEMENT) {
610
                                localname = parser.getLocalName();
611
                                switch (localname) {
612
                                        case "text":
613
                                                output.write("<text project=\""+projectname+"\" base=\""+corpusname+"\"")
614
                                                for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
615
                                                        if (ignoreTranscriberMetadata) {
616
                                                                if (parser.getAttributeLocalName(i) != "scribe" &&
617
                                                                parser.getAttributeLocalName(i) != "audio_filename" &&
618
                                                                parser.getAttributeLocalName(i) != "version" &&
619
                                                                parser.getAttributeLocalName(i) != "version_date")
620
                                                                        output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+parser.getAttributeValue(i)+"\"");
621
                                                        } else {
622
                                                                output.write(" "+parser.getAttributeLocalName(i).replace("_","").toLowerCase()+"=\""+parser.getAttributeValue(i)+"\"");
623
                                                        }
624
                                                }
625

    
626
                                                output.write ">\n"
627

    
628
                                                ArrayList list = new ArrayList<Pair<String, String>>()
629
                                                trans.put("trans", list);
630

    
631
                                                for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
632
                                                        list.add(new Pair(parser.getAttributeLocalName(i).replace("_","").toLowerCase(), parser.getAttributeValue(i)));
633
                                                        if(parser.getAttributeLocalName(i).startsWith("enq"))
634
                                                                interviewers.add(parser.getAttributeValue(i));
635
                                                }
636
                                                return
637
                                        case "Topic":
638
                                                String id = parser.getAttributeValue(null, "id");
639
                                                if (id != null) {
640
                                                        ArrayList list = new ArrayList<Pair<String, String>>()
641
                                                        topics.put(id, list);
642
                                                } else {
643
                                                        println "found tag $localname with no id"
644
                                                }
645
                                                break;
646
                                        case "Speaker":
647
                                        //case "Trans":
648
                                                String id = parser.getAttributeValue(null, "id");
649
                                                String name = parser.getAttributeValue(null, "name");
650
                                                if (id != null && name != null) {
651
                                                        speakersname.put(id, name);
652
                                                } else {
653
                                                        println "found tag $localname with no id ($id)or name ($name)"
654
                                                        return;
655
                                                }
656
                                                if (id != null) {
657
                                                        ArrayList list = new ArrayList<Pair<String, String>>()
658
                                                        speakers.put(id, list);
659

    
660
                                                        for (int i = 0 ; i < parser.getAttributeCount() ; i ++) {
661
                                                                list.add(new Pair(parser.getAttributeLocalName(i), parser.getAttributeValue(i)));
662
                                                        }
663
                                                } else {
664
                                                        println "found tag $localname with no id"
665
                                                        return;
666
                                                }
667
                                                break;
668
                                }
669
                        }
670
                }
671
        }
672

    
673
        /**
674
         * Sets the debug.
675
         */
676
        public void setDebug() {
677
                debug = true;
678
        }
679

    
680
        /**
681
         * Sets the annotation success.
682
         *
683
         * @param val the new annotation success
684
         */
685
        public void setAnnotationSuccess(boolean val) {
686
                annotationSucces = val
687
        }
688
}