Package opennlp.tools.document
Class DocumentMerges
java.lang.Object
opennlp.tools.document.DocumentMerges
The argument and duplicate layer checks shared by the
merge implementations.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidcheckDuplicateLayer(Document base, LayerKey<?> layer, Document other, Document.DuplicateLayerPolicy duplicateLayers) Checks that a layer present on both documents of a merge can be kept as it is.(package private) static voidcheckMergeable(Document document, Document other, Document.DuplicateLayerPolicy duplicateLayers) Checks the arguments of a merge.
-
Constructor Details
-
DocumentMerges
private DocumentMerges()
-
-
Method Details
-
checkMergeable
static void checkMergeable(Document document, Document other, Document.DuplicateLayerPolicy duplicateLayers) Checks the arguments of a merge.- Parameters:
document- The document merged into.other- The document whose layers are added.duplicateLayers- How to treat a layer key present on both documents.- Throws:
IllegalArgumentException- Thrown ifotherorduplicateLayersisnull, or if the two documents carry different text content.
-
checkDuplicateLayer
static void checkDuplicateLayer(Document base, LayerKey<?> layer, Document other, Document.DuplicateLayerPolicy duplicateLayers) Checks that a layer present on both documents of a merge can be kept as it is.- Parameters:
base- The document merged into, which carrieslayer.layer- The layer key present on both documents.other- The document whose layers are added, which carrieslayer.duplicateLayers- How to treat a layer key present on both documents.- Throws:
IllegalArgumentException- Thrown ifduplicateLayersis notDocument.DuplicateLayerPolicy.KEEP_EQUAL, or if the two documents carry different contents forlayer; the exception names the key.
-