Révision 3034
tmp/org.txm.core/src/java/org/txm/xml/xmltxm/XMLTXMWordPropertiesInjection.java (revision 3034) | ||
---|---|---|
44 | 44 |
import org.txm.xml.XPathsHookActivator; |
45 | 45 |
|
46 | 46 |
/** |
47 |
* The Class AnnotationInjection.
|
|
47 |
* The Class XMLTXMWordPropertiesInjection.
|
|
48 | 48 |
* |
49 | 49 |
* @author mdecorde |
50 | 50 |
* |
... | ... | |
54 | 54 |
public class XMLTXMWordPropertiesInjection extends XMLProcessor { |
55 | 55 |
|
56 | 56 |
HashMap<String, HashMap<String, String>> rules; |
57 |
HashSet<String> nonActivatedRules = new HashSet<String>(); |
|
58 | 57 |
|
58 |
HashSet<String> nonActivatedRules = new HashSet<>(); |
|
59 |
|
|
59 | 60 |
XPathHookActivator activator; |
60 | 61 |
|
61 | 62 |
IdentityHook hook; |
tmp/org.txm.core/src/java/org/txm/importer/scripts/xmltxm/AnnotationInjection.groovy (revision 3034) | ||
---|---|---|
31 | 31 |
|
32 | 32 |
import org.txm.importer.StaxIdentityParser |
33 | 33 |
import org.txm.importer.filters.* |
34 |
import org.txm.importer.PersonalNamespaceContext |
|
35 |
import java.io.File |
|
36 |
import java.io.IOException |
|
37 | 34 |
|
38 |
import javax.xml.stream.XMLStreamException |
|
39 |
|
|
40 | 35 |
/** |
41 | 36 |
* The Class AnnotationInjection. |
42 | 37 |
* |
... | ... | |
113 | 108 |
} |
114 | 109 |
} |
115 | 110 |
|
116 |
private void getHeaderInfos(String containertag, boolean captureTheTag) |
|
117 |
{ |
|
111 |
private void getHeaderInfos(String containertag, boolean captureTheTag) {
|
|
112 |
|
|
118 | 113 |
anainputData = new BufferedInputStream(anaurl.openStream()); |
119 | 114 |
headerparser = anafactory.createXMLStreamReader(anainputData); |
120 | 115 |
boolean start = false; |
121 | 116 |
String localname; |
122 |
for (int event = headerparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = headerparser.next()) |
|
123 |
{ |
|
117 |
for (int event = headerparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = headerparser.next()) {
|
|
118 |
|
|
124 | 119 |
//String prefix = headerparser.getNamespaceURI(); |
125 | 120 |
if (event == XMLStreamConstants.START_ELEMENT) { |
126 | 121 |
localname = headerparser.getLocalName(); |
... | ... | |
368 | 363 |
writeAnaTags(wordId); |
369 | 364 |
flagW = false |
370 | 365 |
break; |
366 |
|
|
371 | 367 |
case "ana": |
372 | 368 |
if (flagAna && type != null && resp != null && anaValue != null) { |
373 | 369 |
anaValues.put(resp+":"+type, anaValue) |
... | ... | |
451 | 447 |
File pos2file = new File(rootDir, "/pos/", "rolandTT2-w-ana.xml"); |
452 | 448 |
|
453 | 449 |
println("process file : " + srcfile + " with : " + pos1file); |
454 |
def builder = new AnnotationInjection(srcfile.toURI().toURL(), |
|
455 |
pos1file.toURI().toURL(), milestones); |
|
450 |
def builder = new AnnotationInjection(srcfile.toURI().toURL(), pos1file.toURI().toURL(), milestones); |
|
456 | 451 |
builder.transfomFile(new File(rootDir + "/injection/", "roland.xml")); |
457 | 452 |
|
458 | 453 |
println("process file : " + src2file + " with : " + pos1file); |
459 |
builder = new AnnotationInjection(src2file.toURI().toURL(), pos2file.toURI().toURL(), |
|
460 |
milestones); |
|
454 |
builder = new AnnotationInjection(src2file.toURI().toURL(), pos2file.toURI().toURL(), milestones); |
|
461 | 455 |
builder.transfomFile(rootDir + "/injection/", "roland-FINAL.xml"); |
462 | 456 |
|
463 | 457 |
return; |
tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationInjector.java (revision 3034) | ||
---|---|---|
241 | 241 |
value = "ERROR"; |
242 | 242 |
} |
243 | 243 |
try { |
244 |
writer.writeStartElement("form"); |
|
244 |
writer.writeStartElement(TXMNS, "form");
|
|
245 | 245 |
writer.writeCharacters(value); |
246 | 246 |
mustChangeWordValue = true; |
247 | 247 |
} |
tmp/org.txm.groovy.core/src/groovy/org/txm/macro/annotation/AnnotationInjectionFilter.groovy (revision 3034) | ||
---|---|---|
7 | 7 |
import org.txm.scripts.importer.graal.PersonalNamespaceContext |
8 | 8 |
|
9 | 9 |
/** |
10 |
* The Class AnnotationInjection. |
|
10 |
* The Class AnnotationInjectionFilter.
|
|
11 | 11 |
* |
12 | 12 |
* @author mdecorde |
13 | 13 |
* |
14 |
* inject annotation from a stand-off file into a xml-tei-txm |
|
15 |
* file |
|
14 |
* inject annotation from a stand-off file into a xml-tei-txm file |
|
15 |
* |
|
16 |
* TODO stop using this class and use XMLTXMWordPropertiesInjection |
|
16 | 17 |
*/ |
17 | 18 |
|
18 | 19 |
public class AnnotationInjectionFilter extends StaxIdentityParser { |
Formats disponibles : Unified diff