Class TextAnnotationImpl
java.lang.Object
org.opencastproject.metadata.mpeg7.TextAnnotationImpl
- All Implemented Interfaces:
org.opencastproject.mediapackage.XmlElement,TextAnnotation
Implementation of text annotations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatConfidence valueprotected List<FreeTextAnnotation> Free text annotationsprotected List<KeywordAnnotation> Keyword annotationsprotected StringLanguage identifierprotected floatRelevance value -
Constructor Summary
ConstructorsConstructorDescriptionTextAnnotationImpl(float confidence, float relevance, String language) Creates a new text annotation. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFreeText(String text) Adds free text to this annotation.voidaddFreeTextAnnotation(FreeTextAnnotation freeTextAnnotation) Adds a free text annotation.voidaddKeyword(String keyword) Adds the keyword to this annotation.voidaddKeyword(String keyword, KeywordAnnotation.Type type) Adds the keyword to this annotation.voidaddKeywordAnnotation(KeywordAnnotation keywordAnnotation) Adds a new keyword annotation.Returns an iteration of the free text annotations.floatReturns the confidence of the validity of this annotation.Returns the language of this annotation in ISO represenatation, e. g.floatReturns the relevance of this annotation.Returns an iteration of the keyword annotations.
-
Field Details
-
confidence
protected float confidenceConfidence value -
relevance
protected float relevanceRelevance value -
language
Language identifier -
keywordAnnotations
Keyword annotations -
freeTextAnnotations
Free text annotations
-
-
Constructor Details
-
TextAnnotationImpl
Creates a new text annotation.- Parameters:
confidence- the confidence value[0.0..1.0]relevance- the relevance value[0.0..1.0]language- the language identifier
-
-
Method Details
-
addKeyword
Adds the keyword to this annotation.- Parameters:
keyword- the keyword
-
addKeyword
Adds the keyword to this annotation.- Parameters:
keyword- the keywordtype- the keyword type
-
addKeywordAnnotation
Description copied from interface:TextAnnotationAdds a new keyword annotation.- Specified by:
addKeywordAnnotationin interfaceTextAnnotation- Parameters:
keywordAnnotation- the annotation- See Also:
-
addFreeText
Adds free text to this annotation.- Parameters:
text- the free text
-
addFreeTextAnnotation
Description copied from interface:TextAnnotationAdds a free text annotation.- Specified by:
addFreeTextAnnotationin interfaceTextAnnotation- Parameters:
freeTextAnnotation- the annotation- See Also:
-
getConfidence
public float getConfidence()Description copied from interface:TextAnnotationReturns the confidence of the validity of this annotation. The value will be in the range of0.0and1.0. The confidence may vary with the technique that was used to create the annotation. For example, extracting a word using optical character recognition usually has a better confidence value than speech recognition.- Specified by:
getConfidencein interfaceTextAnnotation- Returns:
- the confidence value
- See Also:
-
getLanguage
Description copied from interface:TextAnnotationReturns the language of this annotation in ISO represenatation, e. g.enfor annotations in English.- Specified by:
getLanguagein interfaceTextAnnotation- Returns:
- the language
- See Also:
-
getRelevance
public float getRelevance()Description copied from interface:TextAnnotationReturns the relevance of this annotation.- Specified by:
getRelevancein interfaceTextAnnotation- Returns:
- the relevance value
- See Also:
-
keywordAnnotations
Description copied from interface:TextAnnotationReturns an iteration of the keyword annotations.- Specified by:
keywordAnnotationsin interfaceTextAnnotation- Returns:
- the keyword annotations
- See Also:
-
freeTextAnnotations
Description copied from interface:TextAnnotationReturns an iteration of the free text annotations.- Specified by:
freeTextAnnotationsin interfaceTextAnnotation- Returns:
- the free text annotations
- See Also:
-
toXml
- Specified by:
toXmlin interfaceorg.opencastproject.mediapackage.XmlElement- See Also:
-