Skip to content

Fails on *+* #34

@mansayk

Description

@mansayk

Hello!

Streamparser always fails while trying to parse this output of apertium's tagger:
'^*+*/*+*$'

Original string is '*+*'.

Traceback (most recent call last):
File "apertium2fastmorph.py", line 137, in parse_apertium
pos = mainpos(r)
File "streamparser/streamparser.py", line 90, in mainpos
return reading[-1].tags[0] # type: ignore
IndexError: list index out of range

I parsed the entire corpus consisting of hundreds of millions tokens, and this is the only part where it fails. If I change *+* to +* or *+ or ** or *** it works.

It seems that it is a bug.

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