Commit 3d9775fc203832b3768dec8dcb1352a9033c11d6

Authored by Bartłomiej Nitoń
1 parent e2c1e1cd

release 1.1

... ... @@ -4,7 +4,7 @@
4 4  
5 5 <groupId>pl.waw.ipipan.zil.nkjp</groupId>
6 6 <artifactId>teiapi</artifactId>
7   - <version>1.0</version>
  7 + <version>1.1</version>
8 8  
9 9 <name>TEI API</name>
10 10 <url>http://zil.ipipan.waw.pl/TeiAPI</url>
... ...
src/main/java/pl/waw/ipipan/zil/nkjp/teiapi/api/entities/EntitiesFactory.java
... ... @@ -83,6 +83,6 @@ public abstract class EntitiesFactory {
83 83 List<TEIMorph> morphs, boolean isZeroSubject);
84 84  
85 85 public abstract TEICoreference createCoreference(String id, String type,
86   - String dominant, List<TEIMention> mentions, TEIMention sourceMention);
  86 + String dominant, String facet, List<TEIMention> mentions, TEIMention sourceMention);
87 87  
88 88 }
... ...
src/main/java/pl/waw/ipipan/zil/nkjp/teiapi/api/entities/TEICoreference.java
... ... @@ -15,6 +15,8 @@ public interface TEICoreference extends TEIEntity {
15 15 String getType();
16 16  
17 17 String getDominant();
  18 +
  19 + String getFacet();
18 20  
19 21 boolean isIdent();
20 22  
... ...
src/main/java/pl/waw/ipipan/zil/nkjp/teiapi/impl/entities/EntitiesFactoryImpl.java
... ... @@ -135,8 +135,8 @@ public class EntitiesFactoryImpl extends EntitiesFactory {
135 135  
136 136 @Override
137 137 public TEICoreference createCoreference(String id, String type,
138   - String dominant, List<TEIMention> mentions, TEIMention sourceMention) {
139   - return new TEICoreferenceImpl(id, type, dominant, mentions,
  138 + String dominant, String facet, List<TEIMention> mentions, TEIMention sourceMention) {
  139 + return new TEICoreferenceImpl(id, type, dominant, facet, mentions,
140 140 sourceMention);
141 141 }
142 142  
... ...
src/main/java/pl/waw/ipipan/zil/nkjp/teiapi/impl/entities/TEICoreferenceImpl.java
... ... @@ -14,14 +14,16 @@ public class TEICoreferenceImpl implements TEICoreference {
14 14 private String id;
15 15 private String type;
16 16 private String dominant;
  17 + private String facet;
17 18 private List<TEIMention> mentions;
18 19 private TEIMention sourceMention;
19 20  
20   - public TEICoreferenceImpl(String id, String type, String dominant,
  21 + public TEICoreferenceImpl(String id, String type, String dominant, String facet,
21 22 List<TEIMention> mentions, TEIMention sourceMention) {
22 23 this.id = id;
23 24 this.type = type;
24 25 this.dominant = dominant;
  26 + this.facet = facet;
25 27 this.mentions = mentions;
26 28 this.sourceMention = sourceMention;
27 29 }
... ... @@ -55,6 +57,11 @@ public class TEICoreferenceImpl implements TEICoreference {
55 57 public String getDominant() {
56 58 return dominant;
57 59 }
  60 +
  61 + @Override
  62 + public String getFacet() {
  63 + return facet;
  64 + }
58 65  
59 66 @Override
60 67 public boolean isIdent() {
... ...
src/main/java/pl/waw/ipipan/zil/nkjp/teiapi/impl/io/read/CoreferenceReader.java
... ... @@ -59,6 +59,7 @@ public class CoreferenceReader extends BodyReader {
59 59 String id;
60 60 String type;
61 61 String dominant = null;
  62 + String facet = null;
62 63 List<TEIMention> mentions = new ArrayList<>();
63 64 TEIMention sourceMention = null;
64 65  
... ... @@ -76,6 +77,9 @@ public class CoreferenceReader extends BodyReader {
76 77 if (in.isStartF("dominant")) {
77 78 dominant = in.readFValue();
78 79 in.nextTag();
  80 + } else if (in.isStartF("facet")) {
  81 + facet = in.readFValue();
  82 + in.nextTag();
79 83 }
80 84  
81 85 in.requireEnd(); // fs coreference
... ... @@ -98,7 +102,7 @@ public class CoreferenceReader extends BodyReader {
98 102 }
99 103 in.requireEnd(); // seg
100 104  
101   - return new TEICoreferenceImpl(id, type, dominant, mentions,
  105 + return new TEICoreferenceImpl(id, type, dominant, facet, mentions,
102 106 sourceMention);
103 107 }
104 108 }
... ...
src/main/java/pl/waw/ipipan/zil/nkjp/teiapi/impl/io/write/CoreferenceWriter.java
... ... @@ -58,6 +58,12 @@ public class CoreferenceWriter {
58 58 out.attr("name", "dominant");
59 59 out.attr("fVal", coreference.getDominant());
60 60 }
  61 +
  62 + if (coreference.getFacet() != null) {
  63 + out.startEmpty("f");
  64 + out.attr("name", "facet");
  65 + out.attr("fVal", coreference.getFacet());
  66 + }
61 67  
62 68 out.end(); // fs coreference
63 69  
... ...