def create()

in src/textract/extract-idcard/model.py [0:0]


  def create(owning_document:ITextractDocument, props:dict)->IDocumentBlock:
    block_type:BlockType = BlockType(props['BlockType'])
    
    if block_type == BlockType.PAGE:
      return DocumentPageBlock(owning_document, props)
    if block_type == BlockType.LINE:
      return DocumentLineBlock(owning_document, props)
    if block_type == BlockType.WORD:
      return DocumentWordBlock(props)
    if block_type == BlockType.KEY_VALUE_SET:
      return DocumentKeyValueBlock(owning_document, props)