Skip to content

Philologic PlainTextParser.py causing error with longer words #86

@yann-ryan

Description

@yann-ryan

Hello, I have been using text-pair to generate text reuse for some EEBO-TCP files.

With some files I got the following error:


Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/local/lib/python3.10/dist-packages/philologic/loadtime/Loader.py", line 532, in parse_file
    parser.parse(input_file)
  File "/usr/local/lib/python3.10/dist-packages/philologic/loadtime/PlainTextParser.py", line 118, in parse
    print(f"Long word in {input.name}: {word}", file=sys.stderr)
AttributeError: 'builtin_function_or_method' object has no attribute 'name'

I believe this is an error in the line

print(f"Long word in {input.name}: {word}", file=sys.stderr)

in the script PlainTextParser.py.

input.name should be input_file.name.

When I edit the PlainTextParser in the Docker instance, it runs successfully and seems to fix the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions