mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-07 21:54:54 +03:00
Minor formatting
This commit is contained in:
parent
ed889db5ee
commit
102fb8a8a1
|
@ -438,7 +438,7 @@ cdef void transition_states(vector[PatternStateC]& states, vector[MatchC]& match
|
||||||
# 'MatchAlignmentC' maps 'original token index of current pattern' to 'current matching length'
|
# 'MatchAlignmentC' maps 'original token index of current pattern' to 'current matching length'
|
||||||
if with_alignments != 0:
|
if with_alignments != 0:
|
||||||
align_states[q].push_back(MatchAlignmentC(states[q].pattern.token_idx, states[q].length))
|
align_states[q].push_back(MatchAlignmentC(states[q].pattern.token_idx, states[q].length))
|
||||||
if action in [RETRY_EXTEND, RETRY_OR_EXTEND]:
|
if action in (RETRY_EXTEND, RETRY_OR_EXTEND):
|
||||||
# This handles the 'extend'
|
# This handles the 'extend'
|
||||||
new_states.push_back(
|
new_states.push_back(
|
||||||
PatternStateC(pattern=states[q].pattern, start=state.start,
|
PatternStateC(pattern=states[q].pattern, start=state.start,
|
||||||
|
@ -736,6 +736,7 @@ cdef action_t get_action(PatternStateC state,
|
||||||
# No, non-final 0010
|
# No, non-final 0010
|
||||||
return RETRY
|
return RETRY
|
||||||
|
|
||||||
|
|
||||||
cdef int8_t get_is_match(PatternStateC state,
|
cdef int8_t get_is_match(PatternStateC state,
|
||||||
const TokenC* token, const attr_t* extra_attrs,
|
const TokenC* token, const attr_t* extra_attrs,
|
||||||
const int8_t* predicate_matches) nogil:
|
const int8_t* predicate_matches) nogil:
|
||||||
|
@ -785,7 +786,7 @@ cdef action_t cast_to_non_greedy_action(action_t action, action_t next_action, v
|
||||||
- MATCH_DOUBLE adds 2 matches, one with the last token and one without the token, casting the action to MATCH
|
- MATCH_DOUBLE adds 2 matches, one with the last token and one without the token, casting the action to MATCH
|
||||||
- removes the match without the last token which is the match that ends with a '*?' pattern token.
|
- removes the match without the last token which is the match that ends with a '*?' pattern token.
|
||||||
- E.g. pattern = "a* b?" doc = "a b"
|
- E.g. pattern = "a* b?" doc = "a b"
|
||||||
- MATCH_DOUBLE will add add the following 2 matches ['a' and 'a b']
|
- MATCH_DOUBLE will add the following 2 matches ['a' and 'a b']
|
||||||
- and casting MATCH_DOUBLE to MATCH removes 'a'.
|
- and casting MATCH_DOUBLE to MATCH removes 'a'.
|
||||||
"""
|
"""
|
||||||
if action == RETRY_OR_EXTEND and next_action == MATCH:
|
if action == RETRY_OR_EXTEND and next_action == MATCH:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user