Closed yunyu closed 7 years ago
I see. Makes sense.
We could add options.whitespaceRegex
to createTrie
.
Would you like to submit a PR?
v2.1.0 ships with options.splitRegex
for createTrie
.
Could you please test it and let me know if it works for you as expected?
Works with /\s+|-/, thanks for merging
I have a use case where I need to regard hyphens as whitespace, and at the moment, there doesn't seem to be a way to change the whitespace regex without modifying the library. This is what I currently use:
It would be nice to have a less hacky approach.