mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-06 05:10:21 +03:00
Reorder conditions to improve speed
This commit is contained in:
parent
2a8e0f0c37
commit
6abcbdeee6
|
@ -672,7 +672,7 @@ cdef action_t get_action(PatternStateC state,
|
|||
if is_match and is_final:
|
||||
# Yes, final: 1000
|
||||
return MATCH
|
||||
elif is_non_greedy_plus(state) and has_star_tail(state) and is_match and not is_final:
|
||||
elif is_match and not is_final and is_non_greedy_plus(state) and has_star_tail(state):
|
||||
# Yes, non-final: 1100
|
||||
# Modification for +?:
|
||||
# Having MATCH_ADVANCE handles the match at the 'ONE' part of the token instead of relying on MATCH_REJECT
|
||||
|
|
Loading…
Reference in New Issue
Block a user