Map<AnnotationType, List<Annotation>> getReferencedAnnotations() { Map<AnnotationType, List<Annotation>> referenced = new HashMap<AnnotationType, List<Annotation>>(); referenced.put(AnnotationType.WF, (List<Annotation>)(List<?>) this.getSpan().getTargets()); return referenced; }
public Integer getSent() { return this.getSpan().getTargets().get(0).getSent(); /* if (!this.isComponent()) { return this.getSpan().getTargets().get(0).getSent(); } else { return this.getCompound().getSent(); } */ }
public Integer getSent() { Span<WF> wfs = this.getSpan(); List<WF> wfl = wfs.getTargets(); WF wf = wfl.get(0); // if (wf == null) System.out.println(wfl.size()); Integer sent = wf.getSent(); return this.getSpan().getTargets().get(0).getSent(); /* if (!this.isComponent()) { return this.getSpan().getTargets().get(0).getSent(); } else { return this.getCompound().getSent(); } */ }
public Integer getPara() { return this.getSpan().getTargets().get(0).getPara(); }
public Term newTerm(String id, Span<WF> span, boolean isComponent) { idManager.updateCounter(AnnotationType.TERM, id); Term newTerm = new Term(id, span, isComponent); if (!isComponent) { annotationContainer.add(newTerm, Layer.TERMS, AnnotationType.TERM); } addToWfTermIndex(newTerm.getSpan().getTargets(), newTerm); // Rodrirekin hitz egin hau kentzeko return newTerm; }
public Term newTerm(Span<WF> span, boolean isComponent) { String newId = idManager.getNextId(AnnotationType.TERM); Term newTerm = new Term(newId, span, isComponent); if (!isComponent) { annotationContainer.add(newTerm, Layer.TERMS, AnnotationType.TERM); } addToWfTermIndex(newTerm.getSpan().getTargets(), newTerm); // Rodrirekin hitz egin hau kentzeko return newTerm; }
public Term newTerm(String id, Span<WF> span, Integer position) { idManager.updateCounter(AnnotationType.TERM, id); Term newTerm = new Term(id, span, false); annotationContainer.add(newTerm, Layer.TERMS, AnnotationType.TERM, position); addToWfTermIndex(newTerm.getSpan().getTargets(), newTerm); // Rodrirekin hitz egin hau kentzeko return newTerm; }
/** Creates a new Term. It assigns an appropriate ID to it. The Term is added to the document object. * @param type the type of the term. There are two types of term: open and close. * @param lemma the lemma of the term. * @param pos part of speech of the term. * @param wfs the list of word forms this term is formed by. * @return a new term. */ public Term newTerm(Span<WF> span) { String newId = idManager.getNextId(AnnotationType.TERM); Term newTerm = new Term(newId, span, false); annotationContainer.add(newTerm, Layer.TERMS, AnnotationType.TERM); addToWfTermIndex(newTerm.getSpan().getTargets(), newTerm); // Rodrirekin hitz egin hau kentzeko return newTerm; }
/** Creates a Term object to load an existing term. It receives the ID as an argument. The Term is added to the document object. * @param id term's ID. * @param type type of term. There are two types of term: open and close. * @param lemma the lemma of the term. * @param pos part of speech of the term. * @param wfs the list of word forms this term is formed by. * @return a new term. */ public Term newTerm(String id, Span<WF> span) { idManager.updateCounter(AnnotationType.TERM, id); Term newTerm = new Term(id, span, false); annotationContainer.add(newTerm, Layer.TERMS, AnnotationType.TERM); addToWfTermIndex(newTerm.getSpan().getTargets(), newTerm); // Rodrirekin hitz egin hau kentzeko return newTerm; }
public Term newCompound(List<Term> terms, String lemma) { Span<WF> span = new Span<WF>(); for (Term term : terms) { span.addTargets(term.getSpan().getTargets()); } String newId = idManager.getNextId(AnnotationType.MW); Term compound = newTerm(newId, span, annotationContainer.getPosition(Layer.TERMS, terms.get(0))); compound.setLemma(lemma); for (Term term : terms) { compound.addComponent(term); term.setCompound(compound); this.annotationContainer.remove(term, Layer.TERMS, AnnotationType.TERM); } return compound; }
public Term newCompound(List<Term> terms, String lemma) { Span<WF> span = new Span<WF>(); for (Term term : terms) { span.addTargets(term.getSpan().getTargets()); } String newId = idManager.mws.getNext(); Term compound = newTerm(newId, span, annotationContainer.termPosition(terms.get(0))); compound.setLemma(lemma); for (Term term : terms) { compound.addComponent(term); term.setCompound(compound); this.annotationContainer.remove(term); } return compound; }
Span<WF> span = term.getSpan(); for (WF target : term.getWFs()) { Element targetElem = new Element("target");
Span<WF> span = term.getSpan(); for (WF target : term.getWFs()) { Element targetElem = new Element("target");