Search in sources :

Example 1 with BlackeningTag

use of eu.transkribus.core.model.beans.customtags.BlackeningTag in project TranskribusCore by Transkribus.

the class ExportCache method getTagsForShapeElement.

private void getTagsForShapeElement(ITrpShapeType element) throws IOException {
    String textStr = element.getUnicodeText();
    CustomTagList cl = element.getCustomTagList();
    if (textStr == null || cl == null)
        throw new IOException("Element has no text or custom tag list: " + element + ", class: " + element.getClass().getName());
    for (CustomTag nonIndexedTag : cl.getNonIndexedTags()) {
        // logger.debug("nonindexed tag found ");
        if (!nonIndexedTag.getTagName().equals("readingOrder")) {
            storeCustomTag(nonIndexedTag, textStr);
        }
    }
    /*
		 * blacken String if necessary
		 */
    if (doBlackening) {
        for (CustomTag indexedTag : cl.getIndexedTags()) {
            if (indexedTag instanceof BlackeningTag) {
                // logger.debug("blackening found " + textStr);
                textStr = ExportUtils.blackenString(indexedTag, textStr);
            }
        }
    }
    for (CustomTag indexedTag : cl.getIndexedTags()) {
        // logger.debug("tagname " + indexedTag.getTagName());
        storeCustomTag(indexedTag, textStr);
    }
}
Also used : BlackeningTag(eu.transkribus.core.model.beans.customtags.BlackeningTag) CustomTag(eu.transkribus.core.model.beans.customtags.CustomTag) CustomTagList(eu.transkribus.core.model.beans.customtags.CustomTagList) IOException(java.io.IOException)

Aggregations

BlackeningTag (eu.transkribus.core.model.beans.customtags.BlackeningTag)1 CustomTag (eu.transkribus.core.model.beans.customtags.CustomTag)1 CustomTagList (eu.transkribus.core.model.beans.customtags.CustomTagList)1 IOException (java.io.IOException)1