Commit 3d9775fc203832b3768dec8dcb1352a9033c11d6
1 parent
e2c1e1cd
release 1.1
Showing
7 changed files
with
25 additions
and
6 deletions
pom.xml
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | 4 | ||
5 | <groupId>pl.waw.ipipan.zil.nkjp</groupId> | 5 | <groupId>pl.waw.ipipan.zil.nkjp</groupId> |
6 | <artifactId>teiapi</artifactId> | 6 | <artifactId>teiapi</artifactId> |
7 | - <version>1.0</version> | 7 | + <version>1.1</version> |
8 | 8 | ||
9 | <name>TEI API</name> | 9 | <name>TEI API</name> |
10 | <url>http://zil.ipipan.waw.pl/TeiAPI</url> | 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,6 +83,6 @@ public abstract class EntitiesFactory { | ||
83 | List<TEIMorph> morphs, boolean isZeroSubject); | 83 | List<TEIMorph> morphs, boolean isZeroSubject); |
84 | 84 | ||
85 | public abstract TEICoreference createCoreference(String id, String type, | 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,6 +15,8 @@ public interface TEICoreference extends TEIEntity { | ||
15 | String getType(); | 15 | String getType(); |
16 | 16 | ||
17 | String getDominant(); | 17 | String getDominant(); |
18 | + | ||
19 | + String getFacet(); | ||
18 | 20 | ||
19 | boolean isIdent(); | 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,8 +135,8 @@ public class EntitiesFactoryImpl extends EntitiesFactory { | ||
135 | 135 | ||
136 | @Override | 136 | @Override |
137 | public TEICoreference createCoreference(String id, String type, | 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 | sourceMention); | 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 +14,16 @@ public class TEICoreferenceImpl implements TEICoreference { | ||
14 | private String id; | 14 | private String id; |
15 | private String type; | 15 | private String type; |
16 | private String dominant; | 16 | private String dominant; |
17 | + private String facet; | ||
17 | private List<TEIMention> mentions; | 18 | private List<TEIMention> mentions; |
18 | private TEIMention sourceMention; | 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 | List<TEIMention> mentions, TEIMention sourceMention) { | 22 | List<TEIMention> mentions, TEIMention sourceMention) { |
22 | this.id = id; | 23 | this.id = id; |
23 | this.type = type; | 24 | this.type = type; |
24 | this.dominant = dominant; | 25 | this.dominant = dominant; |
26 | + this.facet = facet; | ||
25 | this.mentions = mentions; | 27 | this.mentions = mentions; |
26 | this.sourceMention = sourceMention; | 28 | this.sourceMention = sourceMention; |
27 | } | 29 | } |
@@ -55,6 +57,11 @@ public class TEICoreferenceImpl implements TEICoreference { | @@ -55,6 +57,11 @@ public class TEICoreferenceImpl implements TEICoreference { | ||
55 | public String getDominant() { | 57 | public String getDominant() { |
56 | return dominant; | 58 | return dominant; |
57 | } | 59 | } |
60 | + | ||
61 | + @Override | ||
62 | + public String getFacet() { | ||
63 | + return facet; | ||
64 | + } | ||
58 | 65 | ||
59 | @Override | 66 | @Override |
60 | public boolean isIdent() { | 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,6 +59,7 @@ public class CoreferenceReader extends BodyReader { | ||
59 | String id; | 59 | String id; |
60 | String type; | 60 | String type; |
61 | String dominant = null; | 61 | String dominant = null; |
62 | + String facet = null; | ||
62 | List<TEIMention> mentions = new ArrayList<>(); | 63 | List<TEIMention> mentions = new ArrayList<>(); |
63 | TEIMention sourceMention = null; | 64 | TEIMention sourceMention = null; |
64 | 65 | ||
@@ -76,6 +77,9 @@ public class CoreferenceReader extends BodyReader { | @@ -76,6 +77,9 @@ public class CoreferenceReader extends BodyReader { | ||
76 | if (in.isStartF("dominant")) { | 77 | if (in.isStartF("dominant")) { |
77 | dominant = in.readFValue(); | 78 | dominant = in.readFValue(); |
78 | in.nextTag(); | 79 | in.nextTag(); |
80 | + } else if (in.isStartF("facet")) { | ||
81 | + facet = in.readFValue(); | ||
82 | + in.nextTag(); | ||
79 | } | 83 | } |
80 | 84 | ||
81 | in.requireEnd(); // fs coreference | 85 | in.requireEnd(); // fs coreference |
@@ -98,7 +102,7 @@ public class CoreferenceReader extends BodyReader { | @@ -98,7 +102,7 @@ public class CoreferenceReader extends BodyReader { | ||
98 | } | 102 | } |
99 | in.requireEnd(); // seg | 103 | in.requireEnd(); // seg |
100 | 104 | ||
101 | - return new TEICoreferenceImpl(id, type, dominant, mentions, | 105 | + return new TEICoreferenceImpl(id, type, dominant, facet, mentions, |
102 | sourceMention); | 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,6 +58,12 @@ public class CoreferenceWriter { | ||
58 | out.attr("name", "dominant"); | 58 | out.attr("name", "dominant"); |
59 | out.attr("fVal", coreference.getDominant()); | 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 | out.end(); // fs coreference | 68 | out.end(); // fs coreference |
63 | 69 |