You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can check whether a vocabulary allows to build a sequence that matches a regex when initializing Regex. The check is currently implemented as:
states_with_transition= {x[1] forxinpstate_to_vocab.keys()}
iflen(self.regex_fsm.states.difference(states_with_transition)) >0:
raiseValueError(
"The vocabulary does not allow us to build a sequence that matches the input regex"
)
However this check might be too strict. While some states might be unreachable with a dictionary there could still be a path to terminal states. We should probably raise a warning when this happens, not an exception.
The text was updated successfully, but these errors were encountered:
rlouf
changed the title
Check for whether we can build a sequence that matches a regex with vocabulary
Relax check for whether we can build a sequence that matches a regex
Jul 13, 2023
We can check whether a vocabulary allows to build a sequence that matches a regex when initializing
Regex
. The check is currently implemented as:However this check might be too strict. While some states might be unreachable with a dictionary there could still be a path to terminal states. We should probably raise a warning when this happens, not an exception.
The text was updated successfully, but these errors were encountered: