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; }