We have tokens_remove(), which is a shortcut to tokens_select(x, selection = 'remove'), but not tokens_keep(). It makes our life easier, especially with regex patters.
For example, we have to write to keep capitalized words
tokens_select(toks, '^[A-Z]', 'keep', 'regex', FALSE)
# or
tokens_select(toks, '^[A-Z]', valuetype = 'regex', case_insensitive = FALSE)
These become just
tokens_keep(toks, '^[A-Z]', 'regex', FALSE)
The same apply to dfm_select().
Am I too lazy?
We have
tokens_remove(), which is a shortcut totokens_select(x, selection = 'remove'), but nottokens_keep(). It makes our life easier, especially with regex patters.For example, we have to write to keep capitalized words
These become just
The same apply to
dfm_select().Am I too lazy?