Coder Social home page Coder Social logo

Comments (11)

bertsky avatar bertsky commented on July 23, 2024

I totally agree. We have started to make this a pattern in the processors (preprocessing, OCR), but IMO core should lead by good example in Workspace.add_file – at least if no local_filename was already specified by the caller – and in the bagger (see OCR-D/core#258).

from assets.

kba avatar kba commented on July 23, 2024

Implementing OCR-D/core#258 will most likely fix this since the extensions are present until bagging...

from assets.

bertsky avatar bertsky commented on July 23, 2024

Yes, but processors that do not care about this and do not use local_filename when doing their Workspace.add_file currently also effectively suppress extensions. This case is still in core's responsibility.

from assets.

kba avatar kba commented on July 23, 2024

You're right, I just meant that for our provided GT the problem is the bagger. Workspace.add_file must be fixed too ofc.

from assets.

bertsky avatar bertsky commented on July 23, 2024

Oh, now I got it. We just keep agreeing you know!

from assets.

wrznr avatar wrznr commented on July 23, 2024

@kba Fixed?

from assets.

kba avatar kba commented on July 23, 2024

It's fixed for the bagger but I'm still evaluating whether

when doing their Workspace.add_file currently also effectively suppress extensions. This case is still in core's responsibility.

is still an issue in core.

from assets.

kba avatar kba commented on July 23, 2024

Yes, but processors that do not care about this and do not use local_filename when doing their Workspace.add_file currently also effectively suppress extensions.

Not sure whether I can follow. Can you give me an example when this might happen @bertsky ?

from assets.

bertsky avatar bertsky commented on July 23, 2024

Yes, but processors that do not care about this and do not use local_filename when doing their Workspace.add_file currently also effectively suppress extensions.

Not sure whether I can follow. Can you give me an example when this might happen @bertsky ?

I can't see it myself right now. What I do understand is that Workspace.add_file does not in itself require either the local_filename or url kwarg, especially if it does not pass a content with it. So OcrdMets.add_file will instantiate a new OcrdFile and then set local_filename=None.

So it all depends on what then happens with that file reference later-on in the processor. If content was passed to Workspace.add_file, then an exception will come up. (I have already complained about this as a documentation issue.) Otherwise, the processor might use OcrdMets.find_files to get a reference and then do things to it. Somewhere along that path local_filename will/must be set. There we have to look whether it is in core's responsibility to ensure filename extensions.

Sorry, that's all I can offer ATM.

from assets.

cneud avatar cneud commented on July 23, 2024

It appears all file extensions are available now in assets/data, a related issue OCR-D/core#332 in core was closed - can this be closed too?

from assets.

kba avatar kba commented on July 23, 2024

Yes, fixed in assets and we're doing file extensions in the processors now as well.

from assets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.