Search in sources :

Example 21 with TrpTranscriptMetadata

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

the class TrpLocation method initFromCustomTag.

// public boolean hasTranscriptMetadata() { return md != null; }
// 
// public boolean hasShapeType() { return r != null || l != null || w != null; }
// public ITrpShapeType getLowestShapeType() {
// if (w == null && l == null)
// return r;
// else if (w == null)
// return l;
// else
// return w;
// }
private void initFromCustomTag() {
    if (t == null)
        return;
    CustomTagList ctl = t.getCustomTagList();
    if (ctl != null) {
        ITrpShapeType s = ctl.getShape();
        TrpPageType p = s.getPage();
        TrpTranscriptMetadata md = p.getMd();
        // logger.debug("md = "+md);
        if (md != null) {
            docId = md.getDocId();
            localFolder = md.getLocalFolder();
            pageNr = md.getPageNr();
            pageId = md.getPageId();
        }
        shapeId = s.getId();
    // if (s instanceof TrpTextRegionType) {
    // r = (TrpTextRegionType) s;
    // }
    // else if (s instanceof TrpTextLineType) {
    // r = (TrpTextRegionType) s.getParent();
    // l = (TrpTextLineType) s;
    // }
    // else if (s instanceof TrpWordType) {
    // l = (TrpTextLineType) s.getParent();
    // r = l.getRegion();
    // w = (TrpWordType) s;
    // }
    // 
    // shapeId = hasShapeType() ? getLowestShapeType().getId() : null;
    }
}
Also used : TrpTranscriptMetadata(eu.transkribus.core.model.beans.TrpTranscriptMetadata) CustomTagList(eu.transkribus.core.model.beans.customtags.CustomTagList)

Aggregations

TrpTranscriptMetadata (eu.transkribus.core.model.beans.TrpTranscriptMetadata)21 TrpPage (eu.transkribus.core.model.beans.TrpPage)14 JAXBPageTranscript (eu.transkribus.core.model.beans.JAXBPageTranscript)11 TrpPageType (eu.transkribus.core.model.beans.pagecontent_trp.TrpPageType)7 IOException (java.io.IOException)7 File (java.io.File)6 URL (java.net.URL)4 PcGtsType (eu.transkribus.core.model.beans.pagecontent.PcGtsType)3 FileOutputStream (java.io.FileOutputStream)3 ArrayList (java.util.ArrayList)3 Date (java.util.Date)3 JAXBException (javax.xml.bind.JAXBException)3 Rtf (com.tutego.jrtf.Rtf)2 TrpDoc (eu.transkribus.core.model.beans.TrpDoc)2 CustomTag (eu.transkribus.core.model.beans.customtags.CustomTag)2 Fptr (eu.transkribus.core.model.beans.mets.DivType.Fptr)2 FileType (eu.transkribus.core.model.beans.mets.FileType)2 Mets (eu.transkribus.core.model.beans.mets.Mets)2 TextLineType (eu.transkribus.core.model.beans.pagecontent.TextLineType)2 WordType (eu.transkribus.core.model.beans.pagecontent.WordType)2