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

Fix TypeError: _pretty() takes 1 positional argument but 2 were given in sem/drt.py #2854

Merged
merged 5 commits into from Oct 13, 2021

Conversation

RnDevelover
Copy link
Contributor

@RnDevelover RnDevelover commented Oct 12, 2021

Should fix #2853 .
Added as an author.

@tomaarsen
Copy link
Member

@tomaarsen tomaarsen commented Oct 13, 2021

LGTM, now this aligns it with:

nltk/nltk/sem/drt.py

Lines 487 to 491 in 90fa546

if self.consequent:
return DrtBinaryExpression._assemble_pretty(
drs, DrtTokens.IMP, self.consequent._pretty()
)
return drs

Your code now prints:

         __________________________                ________                                 ____________                            ___                              ________                               __________                         _________                                                           __       
 \      |                          |  \      \    |        |      \      \           \     |            |           \      \       | X |                 \     \    |        |     \     \           \     |          |           \     \     | E       |          \               \                  \      \    |  |      
 /\ P Q.|--------------------------|( /\ Y1. /\ X.|--------|(Y1), /\ Z1. /\ P X F.P( /\ E.(|------------| + F(E)))( /\ X2. /\ P Q.(|---| + P(X) + Q(X))( /\ X. /\ X.|--------|(X), /\ Y. /\ P X F.P( /\ E.(|----------| + F(E)))( /\ Z. /\ F.(|---------| + F(E))( /\ Z2.Z(Z2)),Y, /\ X1.X2(X1))),Z1, /\ Y2. /\ F.|--|(Y2)))
        |    ___                   |              | dog(X) |                               | nsubj(E,X) |                          |___|                            | cow(X) |                             | obj(E,X) |                       | help(E) |                                                         |__|      
        |   | X |                  |              |________|                               |____________|                                                           |________|                             |__________|                       |_________|                                                                   
        | ((|---| + P(X)) -> Q(X)) |                                                                                                                                                                                                                                                                                        
        |   |___|                  |                                                                                                                                                                                                                                                                                        
        |__________________________|                                                                                                                                                                                                                                                                                        

@tomaarsen tomaarsen merged commit 87e8b7a into nltk:develop Oct 13, 2021
16 checks passed
@tomaarsen
Copy link
Member

@tomaarsen tomaarsen commented Oct 13, 2021

@RnDevelover Thank you!

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