Comments (5)
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.
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.
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.
OK I added this as an exception. You can use it in 1.4.1
from anystyle.
great, thank you!
from anystyle.
Related Issues (20)
- Add stripping of "by ..." to names normalizer HOT 1
- how can I make my gem installed version behave like the online anystyle.io HOT 5
- Anystyle "doing nothing". HOT 1
- anystyle find: File name too long @ rb_sysopen HOT 1
- Move CI to GitHub
- References in Danish (or other languages?) HOT 2
- pdftotext not found HOT 2
- Question: training different types of "ref" HOT 1
- Tokenizer doesn't parse Volume/issue typeset with no space. HOT 3
- Minimal amount of data for finder/parser model training? HOT 2
- Include Roman numerals in pages in Bibtex output
- training finder with xml documents HOT 10
- Input count wrong: limit yourself to 1000 references per request HOT 4
- Error: uninitialized constant AnyStyle::ParserCore::StringUtils in Ruby 3.2.2 HOT 4
- Consider normalizing whitespace HOT 3
- Is it possible to delete characters/words when editing the parsed citation? HOT 3
- Error collecting references from a pdf HOT 3
- Getting a 500 Internal Server Error HOT 5
- Reference not parsing for this Chinese Character 著 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anystyle.