Closed drahnr closed 1 year ago
Thanks for this issue, I agree. I also think thiserror
is the best choice.
By the way, just to make sure you know: nlprule does sentence boundary detection internally using srx
now: https://github.com/bminixhofer/nlprule/pull/22
In any case this is a valid issue. PRs are welcome, I might also implement this myself.
Thanks, I missed that PR. That simplifies life for me significantly :)
There is a bit of an issue with the error bounds in rust when being as lax as
Box<dyn Error>
- most error frameworks expect the error type bounded to beError + Send + 'static
.For a library it's common to implement a custom error type which is then exposed to the user, which wraps all possible internal error types. Currently the tool of choice (imho) is
thiserror
.Moving to concrete error types rather than dyn boxes would be auch appreciated step.