Skip to content

bug: Abstract identification error when 'abstract' is not explicitly written #9

@MasterYip

Description

@MasterYip
PS C:\Users\Steven\ChatPaper2Xmind> python paper2xmind.py --path "D:\123.pdf"
Traceback (most recent call last):
  File "C:\Users\Steven\ChatPaper2Xmind\paper2xmind.py", line 54, in <module>
    pdf_batch_processing(argparser.parse_args().path)
  File "C:\Users\Steven\ChatPaper2Xmind\paper2xmind.py", line 42, in pdf_batch_processing
    pdf_processing(pdf_path, xmind_path)
  File "C:\Users\Steven\ChatPaper2Xmind\paper2xmind.py", line 15, in pdf_processing
    paper = PDFPaperParser(pdf_file_path)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Steven\ChatPaper2Xmind\pdf_parser.py", line 23, in __init__
    self.section_textdict = self.get_section_textdict()
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Steven\ChatPaper2Xmind\pdf_parser.py", line 182, in get_section_textdict
    section_title = self.get_section_titles(withlevel=False)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Steven\ChatPaper2Xmind\pdf_parser.py", line 158, in get_section_titles
    section_title = [(re.search(ABS_MATCHSTR, self.all_text).group(), 1)]\
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

TODO: Robust abstract detection mechanism & error raising with clear explanation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions