File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -825,7 +825,7 @@ class BasicRule(object):
825825 # for SPDX license expression dynamic rules or testing
826826 stored_text = attr .ib (default = None , repr = False )
827827
828- key_phrase_spans = attr .ib (default = [] , repr = False )
828+ key_phrase_spans = attr .ib (default = attr . Factory ( list ) , repr = False )
829829
830830 # These attributes are computed upon text loading or setting the thresholds
831831 ###########################################################################
@@ -1679,11 +1679,10 @@ def get_key_phrases(text):
16791679 # keep appending key phrase until we hit KEY_PHRASE_CLOSE
16801680 for key_phrase in key_phrase_iterator :
16811681 if key_phrase .endswith (KEY_PHRASE_CLOSE ):
1682+ if span_positions :
1683+ yield Span (span_positions )
16821684 break
16831685 span_positions .append (key_phrase_index )
16841686 key_phrase_index += 1
1685-
1686- if span_positions :
1687- yield Span (span_positions )
16881687 else :
16891688 key_phrase_index += 1
You can’t perform that action at this time.
0 commit comments