Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

JuanIMartinezB
Copy link

There was a reported issue with the "longid()" and "shortid()" methods of the Verbnet.py file. Basically, there are two types of ID, short id (eg. 32.5) and long id(eg. example-32.5). The methods involved change a short id to a long id and vice versa. The problem was that verbnet.longid("114-1") is supposed to return the long id "act-114-1", but it instead returns "114-1". This issue was solved by changing the Regex pattern to match the id types while still passing the tests for all other cases.

The change in the long id Regex pattern was:

_LONGID_RE = re.compile(r"([^\-\.]*)-([\d+.-]+)$") ------> LONGID_RE = re.compile(r"([A-Za-z]+)-([\d.-]+)$")

The new pattern tries to match an alphabetic sequence first (without considering empty sequences), then to match a minus sign "-" and finally the associated short id.

@tomaarsen
Copy link
Member

tomaarsen commented Jul 18, 2022

Please have a look at the failing tests, e.g. these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.