Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stanfordnlp/stanza.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Bauer <horatio@gmail.com>2022-11-10 16:53:15 +0300
committerJohn Bauer <horatio@gmail.com>2022-11-11 12:53:53 +0300
commitafc3b218c24c719506248cca7331af885e342387 (patch)
tree8886cef3c856cf14f0932ffafa8b5b1ac3c50b3c
parentc8bd31423272bdec843251e38231c4695d7848a9 (diff)
will combine PreterminalUnary with CompoundUnaryinorder_unary
-rw-r--r--stanza/models/constituency/parse_transitions.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/stanza/models/constituency/parse_transitions.py b/stanza/models/constituency/parse_transitions.py
index 88a6f9a9..a354feca 100644
--- a/stanza/models/constituency/parse_transitions.py
+++ b/stanza/models/constituency/parse_transitions.py
@@ -302,7 +302,8 @@ class CompoundUnary(Transition):
Disallow consecutive CompoundUnary transitions, force final transition to go to ROOT
"""
# can't unary transition nothing
- if model.get_top_constituent(state.constituents) is None:
+ tree = model.get_top_constituent(state.constituents)
+ if tree is None:
return False
# don't unary transition a dummy, dummy
# and don't stack CompoundUnary transitions