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

different number of open and close parentheses #17

Open
Hareem-E-Sahar opened this issue May 26, 2020 · 2 comments
Open

different number of open and close parentheses #17

Hareem-E-Sahar opened this issue May 26, 2020 · 2 comments

Comments

@Hareem-E-Sahar
Copy link

Hareem-E-Sahar commented May 26, 2020

When I call setDataFromText function using the following tree representation
((ROOT (S (NP (NNP KeLP)) (VP (VBZ is) (ADJP (JJ very amazing)))))
it works fine but a few extra spaces here and there(shown using asteriks *) e.g. as shown below
(ROOT (S (NP (NNP****** KeLP)) (VP (VBZ is) (ADJP (JJ very amazing)))))
gives the error that parentheses are not equal and following is printed
Error in analyzing: (ROOT(S(NP(NNP((((((KeLP))))(VP(VBZ(is))(ADJP(JJ(very(amazing))))))))))

Another example:
((ROOT (S (NP (NNP KeLP)) (VP******(VBZ is) (ADJP (JJ very amazing)))))
Error in analyzing: (ROOT(S(NP(NNP(KeLP)))(VP(((VBZ(((is))(ADJP(JJ(very(amazing)))))))))).
So extra spaces are replaced by arbitrary number of parenthesis which creates a problem during analysis. Since I have source code lines i.e. entire sentences instead of words I cannot control the spaces. Hence any workaround or suggestions welcome. thanks

@kamei86i kamei86i assigned kamei86i and unassigned kamei86i Jun 19, 2020
@kamei86i
Copy link
Member

We will evaluate this for sure. In the meanwhile, can you make me an example of one tree of yours?

@Hareem-E-Sahar
Copy link
Author

So the following statement would raise an exception
t2.setDataFromText("(ROOT (S (NP (NNP KeLP)) (VP (VBZ is) (ADJP (JJ very amazing)))))");
Error in analyzing: (ROOT(S(NP(NNP(((((((KeLP))))(VP(VBZ(is))(ADJP(JJ(very(amazing)))))))))).
The number of opened and close parentheses are different.

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

2 participants