diff --git a/parser/src/api.rs b/parser/src/api.rs index 329d6a19..55da6f75 100644 --- a/parser/src/api.rs +++ b/parser/src/api.rs @@ -303,6 +303,16 @@ impl StopReason { .unwrap() .to_string() } + + pub fn is_ok(&self) -> bool { + matches!( + self, + StopReason::NotStopped + | StopReason::EndOfSentence + | StopReason::NoExtension + | StopReason::NoExtensionBias + ) + } } #[derive(Clone, Serialize, Deserialize, Debug)]