Package com.basistech.rosette.dm.util
Class WholeDocumentLanguageDispatchAnnotatorBuilder
java.lang.Object
com.basistech.rosette.dm.util.WholeDocumentLanguageDispatchAnnotatorBuilder
Fluent builder for annotators that delegate to other annotators based
on the language from
AnnotatedText.getWholeTextLanguageDetection()
.
You supply this builder with pairs of LanguageCode
, Annotator
,
and then call build()
to build an Annotator
. The resulting annotator
handles only Annotator.annotate(com.basistech.rosette.dm.AnnotatedText)
.
It looks at the first LanguageDetection.DetectionResult
from
AnnotatedText.getWholeTextLanguageDetection()
,
and selects the annotator corresponding to the language in that
detection result, delegating the call to that annotator.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
WholeDocumentLanguageDispatchAnnotatorBuilder
public WholeDocumentLanguageDispatchAnnotatorBuilder()Create a builder.
-
-
Method Details
-
delegate
public WholeDocumentLanguageDispatchAnnotatorBuilder delegate(com.basistech.util.LanguageCode language, Annotator delegate) Add a delegate- Parameters:
language
- the language to process.delegate
- the annotator to process it.- Returns:
- this.
-
build
Create the annotator.- Returns:
- the annotator.
-