gagolews / gagolews/stringi

vectorize_all for stri_detect_*

Open
#404 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
318
Forks
48
PR merge metrics
No merged PRs in 30d

Description

I very much like that option in `stri_replace_*` and am wondering why `stri_detect_*` does not have it.

I have built a function that does it for me and adds the functionality to combine matches with a logical operator, but It would be great to access this with full C++ speed.

```R
str_detect_multi <- function (string, multi_pattern, empty_is_true = T, logical_combine_infix = `&`)
{
if (is.null(multi_pattern) & empty_is_true) {
return(rep(T, length(string)))
}
Reduce(logical_combine_infix, x = lapply(multi_pattern,
function(this_pattern) {
stri_detect_regex(string, this_pattern)
}))
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.