Comments (2)
Thanks for the easy instructions for reproducing this!
The whitespace here is returned by the underlying arXiv API. It seems to be a ragged line wrap at 80 characters arXiv introduces themselves, but authors can validly include newlines of their own to break paragraphs (at least in abstracts):
So if you want a new paragraph or a table of contents, be sure to indent the lines after the carriage return.
I'd like to find an example paper with a multiparagraph abstract to confirm how this is represented by the API; "strip all newlines that aren't followed by whitespace" may be a valid rule here.
As far as I know, titles can never include user input newlines, so this might be a more straightforward place to strip them. I'm a little concerned about introducing a find-and-replace operation on every query result. I'll shoot an email to the arXiv API Google Group about this behavior.
In the mean time, a small function for stripping newlines that aren't followed by whitespace from strings:
import re
def rm_newlines(entry):
rm_newlines = lambda s: re.sub(r'\n[^\s]', ' ', res)
entry.title = rm_newlines(entry.title)
entry.summary = rm_newlines(entry.summary)
return entry
from arxiv.py.
Sounds like this was a bug introduced into the API itself (link to the Google Group message), but the arXiv API is likely frozen while they work on a new JSON API to replace the current Atom API.
from arxiv.py.
Related Issues (20)
- CI: `docs` workflow depends on Platform, breaking check HOT 1
- Cannot download PDF HOT 1
- Error when downloading paper with '/' in short id HOT 2
- arxiv.Search returns empty result HOT 9
- Missing "start" param HOT 2
- Add unencoded nontrivial query example to README.md HOT 4
- max_results: float vs. int HOT 4
- Module 'arxiv' has no attribute 'Search' HOT 1
- Investigating: arXiv API flakiness HOT 10
- Log full request URLs rather than just parameters
- Extreme noob encountering error while fetching arxiv api HOT 3
- Replace status-only network calls in tests with HTTP mocks
- Requesting further publications exceeding max_results? HOT 3
- How to search for specific strings within the different areas? HOT 1
- Proposal for Adding Asynchronous Support HOT 6
- Number of download for a paper HOT 1
- Request for help HOT 2
- Inquiry about setting options for HTTP/HTTPS HOT 1
- Empty response HOT 2
- Empty Response after few requests HOT 2
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 arxiv.py.