Code Monkey home page Code Monkey logo

Comments (5)

inukshuk avatar inukshuk commented on June 11, 2024

We're talking about the space after the | here, right?

While we can make the parser more lenient here, the reasoning behind this strictness was that we absolutely want to insure that the original input can be reconstructed. That means you should be able to strip the prefix on every line in order to get back the original input. If we allow variance here it becomes tricky: for example, for a line that has something like blank | \n in it, it will become impossible to know how many spaces there were before the newline in the original input.

In a sense it would be more useful to have no space after the | but with the space it's more pleasing on the eyes. The TTX format wasn't really planned as a format, it's something that evolved while trying to quickly tag documents by hand. So instead of trying to make this work I guess it would be better to switch to XML.

from anystyle.

cboulanger avatar cboulanger commented on June 11, 2024

My preference would still be allowing no space since it is just syntax, isn't it? No information is lost since no space means the line is blank, with or without the space. If that's not what you want, please add a rescue section which throws an error that indicates which line is the problem, so that one has a chance to find the document and fix it (maybe adding some context, since the name of the document is unavailable). As it is right now, I (and others) have no clue what is causing the problem, it took me quite a while to understand why the error occurred at all.

Switching to XML would certainl be preferrable since also this would allow to use transformed TEI documents (i.e. from GROBID). However, this would mean that I have to rewrite quite a bit of my app and I'd rather avoid that at this point.

from anystyle.

cboulanger avatar cboulanger commented on June 11, 2024

To be more precise: no space would mean that there aren't any additional spaces in the line. So in this regard
blank |\n and
blank | \n
are equivalent, they both would tranlate into \n when reconstructing the document.

from anystyle.

inukshuk avatar inukshuk commented on June 11, 2024

OK I added this as an exception. You can use it in 1.4.1

from anystyle.

cboulanger avatar cboulanger commented on June 11, 2024

great, thank you!

from anystyle.

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.