Kaffaljidhmah2 / Arxiv-Recommender

GNU General Public License v3.0
43 stars 1 forks source link

Got Assertion Error in assert len(ret) == 1, raw #2

Open thwu1 opened 1 year ago

thwu1 commented 1 year ago

`Traceback (most recent call last): File "/Users/xxx/arxiv/main.py", line 26, in papers_dict = get_today_paper(cate_list=CATEGORY_LIST, is_save=IS_SAVE) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/xxx/arxiv/arxiv_util.py", line 101, in get_today_paper papers = list(decode_arxiv_webpage(arxiv_raw)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/xxx/arxiv/arxiv_util.py", line 64, in decode_arxiv_webpage assert len(ret) == 1, raw AssertionError:   arXiv:1312.7832 (cross-list from math.LO) [pdf, ps, other]

Title: Defining implication relation for classical logic
Authors: Li Fu
Comments: 33 pages; 2 tables
Subjects: Logic (math.LO); Artificial Intelligence (cs.AI); Computation and Language (cs.CL); Logic in Computer Science (cs.LO)
python main.py failed`
thwu1 commented 1 year ago

Personally, I just use try, except to bypass this

Kaffaljidhmah2 commented 1 year ago

Thank you for your bug report! The assertion error is caused by the following reason:

(1) in the pattern matching, I use (\d\d\d\d.\d\d\d\d\d) to match arXiv ID. So the code anticipates 4 digits + one dot + 5 digits. (2) this ancient paper was first released 10 years ago when the arXiv ID only had 4 digits + one dot + 4 digits. (LOL)