1 package ixa.kaflib;
2
3
4
5
6 public class SSTspan {
7
8
9
10
11 private String sstID;
12
13
14
15
16 private String type;
17 private String label;
18
19
20
21
22 private Span<Term> mentions;
23
24 SSTspan(String linkedEntityId) {
25 this.sstID= linkedEntityId;
26 this.mentions = new Span<Term>();
27 }
28
29 SSTspan(String sstSpan, Span<Term> mentions) {
30 if (mentions.size() < 1) {
31 throw new IllegalStateException("SSTspan must contain at least one reference span");
32 }
33 this.sstID = sstSpan;
34 this.mentions = mentions;
35 }
36
37 public String getType() {
38 return type;
39 }
40
41 public void setType(String type) {
42 this.type = type;
43 }
44
45 public String getLabel() {
46 return label;
47 }
48
49 public void setLabel(String label) {
50 this.label = label;
51 }
52
53 public String getId() {
54 return sstID;
55 }
56
57 void setId(String id) {
58 this.sstID = id;
59 }
60
61 public String getSpanStr() {
62 String str = "";
63 for (Term term : mentions.getTargets()) {
64 if (!str.isEmpty()) {
65 str += " ";
66 }
67 str += term.getForm();
68 }
69 return str;
70 }
71
72
73
74
75
76 public Span<Term> getTerms() {
77 return mentions;
78
79
80
81
82
83
84 }
85
86 }