Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parenthesis issue #7

Open
JenPrendki opened this issue Oct 16, 2016 · 3 comments
Open

Parenthesis issue #7

JenPrendki opened this issue Oct 16, 2016 · 3 comments

Comments

@JenPrendki
Copy link

Hi,

It seems that there is issue with parenthesis handling.

import PyDictionary
mydict = PyDictionary.PyDictionary()
mydict.meaning("scholar")

... gets me:
{u'Noun': ['a learned person (especially in the humanities', 'someone (especially a child', 'as from a teacher', 'a student who holds a scholarship']}

To avoid the issue, I changed:
for x in re.findall(r'\((.*?)\)', reg): (line 135 in core.py)
by:
for x in re.findall(r'>\s\((.*?)\)\s<', reg):

Now getting:

{u'Noun': ['a learned person (especially in the humanities); someone who by long study has gained mastery in one or more disciplines', 'someone (especially a child) who learns (as from a teacher) or takes up knowledge or beliefs', 'a student who holds a scholarship']}

as expected.

Thanks,
Jennifer

@chynes2
Copy link

chynes2 commented Aug 23, 2018

This is really awesome! Quick and easy fix to prevent the parser from cutting off close parens. FYI It was on line 130 in my version of core.py. Thanks for this!

@b1tninja
Copy link

#40 fixed here

@ahollist
Copy link

Are there any plans to merge the fix shown here?

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

No branches or pull requests

4 participants