Comments (10)
stri_locate_all_class() DONE in commit 7037202
Examples:
> stri_locate_all_class(" xxx\n\t \v \n", stri_char_getpropertyid("WHITE_SPACE"))
[[1]]
start end
[1,] 1 4
[2,] 8 15
> stri_locate_all_class(
+ c("abc", "a\u0105b", "a1B2c3", "1\u01052b3C", "123"),
+ stri_char_getcategoryid("L"))
[[1]]
start end
[1,] 1 3
[[2]]
start end
[1,] 1 3
[[3]]
start end
[1,] 1 1
[2,] 3 3
[3,] 5 5
[[4]]
start end
[1,] 2 2
[2,] 4 4
[3,] 6 6
[[5]]
start end
> stri_locate_all_class(
+ c("abc", "a\u0105b", "a1B2c3", "1\u01052b3C", "123"),
+ stri_char_getcategoryid("Ll"))
[[1]]
start end
[1,] 1 3
[[2]]
start end
[1,] 1 3
[[3]]
start end
[1,] 1 1
[2,] 5 5
[[4]]
start end
[1,] 2 2
[2,] 4 4
[[5]]
start end
from stringi.
UPDATED stri_locate_all_class()
in commit 1073566
Added complement classes option, e.g. ^WHITE_SPACE
== not a whitespace character, ^Lu
== not an upper-case letter, etc.
Examples:
> stri_locate_all_class(
c("abc", "a\u0105b", "a1B2c3", "1\u01052b3C", "123"),
stri_char_getcategoryid("^L"))
[[1]]
start end
[[2]]
start end
[[3]]
start end
[1,] 2 2
[2,] 4 4
[3,] 6 6
[[4]]
start end
[1,] 1 1
[2,] 3 3
[3,] 5 5
[[5]]
start end
[1,] 1 3
> stri_locate_all_class(" xxx\n\t \v \n", stri_char_getpropertyid("^WHITE_SPACE"))
[[1]]
start end
[1,] 5 7
from stringi.
*_first_*
and *_last_*
added in commit 7eb62a5
from stringi.
Why stri_locate_all_class returns empty matrix when there is no match and stri_locate_first/last_class returs NA
?
from stringi.
Yep, this should be NA, NA.
Fixed in commit e652434
We now have:
> stri_locate_all_class(
+ c("abc", "a\u0105b", "a1B2c3", "1\u01052b3C", "123"),
+ stri_char_getcategoryid("^L"))
[[1]]
start end
[1,] NA NA
[[2]]
start end
[1,] NA NA
[[3]]
start end
[1,] 2 2
[2,] 4 4
[3,] 6 6
[[4]]
start end
[1,] 1 1
[2,] 3 3
[3,] 5 5
[[5]]
start end
[1,] 1 3
from stringi.
stri_locate_all_class("",stri_char_getpropertyid("^WHITE_SPACE"))
returns empty matrix and this also should be NA NA
, right?
stri_locate_first_class("",stri_char_getpropertyid("^WHITE_SPACE")) == NA
, last also working good.
DONE in commit c9467e6
from stringi.
stri_locate_all_class(NA, stri_char_getpropertyid("^WHITE_SPACE"))
causes a fatal error
It works fine with e.g. c(NA, "a")
or c(NA_character_, 0)
but single NA
crashes RStudio...
from stringi.
Fixed @ ba56c33
Now stri_locate_all_class(NA, stri_char_getpropertyid("^WHITE_SPACE")) returns (NA, NA)
from stringi.
New version of first & last @ 574c1a0
Still to be done: all
Use StriContainerUTF8 & new charclass definitions
from stringi.
ALL done in dff176a
from stringi.
Related Issues (20)
- The tip information when install the stringi: stringi cannot be built with these settings in place. HOT 2
- Unable to build stringi: βisNullβ was not declared in this scope HOT 6
- neither conda R version nor base R installed stringi successfully HOT 9
- Unable to install stringi HOT 1
- DOI not found: https://dx.doi.org/10.18637/jss.v103.i02 HOT 2
- Timout downloading ICU at stringi installation HOT 12
- unable to install stringi via http_proxy HOT 7
- libicui18n.so.71: cannot open shared object file HOT 2
- stri_detect_regex gives non-intuitive error (U_ILLEGAL_ARGUMENT_ERROR) with strings longer than 858993457 characters HOT 1
- `stri_(any|all)_(regex|fixed)` HOT 1
- stri_split_boundaries() returns slightly different tokens when the ICU rules are supplied HOT 3
- [Feature] Convert String to Code Points HOT 2
- [Feature] Extract Non-ASCII Characters HOT 3
- Unable to install stringi in R 4.3 HOT 10
- install issue, no internet HOT 2
- Behavior of `stri_sub()` when `from = 0` HOT 2
- Cannot install stringi on linux (CENTOS 7) machine HOT 1
- installation of package 'stringi' had non-zero exit status HOT 2
- Fails to build with clang on Windows HOT 2
- Calling stringi C functions without Rcpp HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stringi.