Skip to content

Parenthesis issue #7

Description

@JenPrendki

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

Activity

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

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