kootenpv / textsearch

Find strings/words in text; convenience and C speed :fireworks:
126 stars 17 forks source link

Remove all the words at once [feature] #2

Open ahadafzal opened 4 years ago

ahadafzal commented 4 years ago

A feature to remove all word at once would be very helpful. something like: ts.removeall() or ts.reset()

plysytsya commented 3 years ago

Is it possible to adjust this in a way that it matches without whitespace-bounds, e.g. "hi" in "high"?

kootenpv commented 3 years ago

Is it possible to adjust this in a way that it matches without whitespace-bounds, e.g. "hi" in "high"?

Yes it is:

Textsearch(..., left_bound_chars=set(), right_bound_chars=set())

kootenpv commented 3 years ago

A feature to remove all word at once would be very helpful. something like: ts.removeall() or ts.reset()

Could simply create a new one, depending on how much you want to reset (handlers or not).

ts = TextSearch(ts_old.case, ts_old.returns)