Have `extractNgramsFromDocument` catch the right exception in case extraction fails
Fixes #481 (closed).
@cgenie here is a demo that shows that now ctrl^c
is back to sensible behavior:
At the moment, given that we have only a single exception to throw, I have defined and picked MultitermsExtractionException
, but if our ngrams extraction become more powerful and with more things that can go wrong, we can define an ExtractNgramsException
that serves as an umbrella type.
Mind reviewing this one?