Skip to content

Commit e58637d

Browse files
authored
Merge pull request #53 from hadley/dev-stringr
Fix for dev stringr
2 parents 8d1c448 + 527a566 commit e58637d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/kansuji.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,20 +206,20 @@ kansuji2arabic_str_single <- function(str, consecutive = c("convert", "non"), wi
206206

207207
j <- 1
208208
for(i in 1:length(doc_cha)){
209-
if(!stringr::str_detect(doc_cha[i], pattern = "") && i == 1){
209+
if(doc_cha[i] == "" && i == 1){
210210
doc_cha[i] <- str_num[j]
211211
j <- j + 1
212212
}
213213
else if(consecutive == "non"){
214214
if((stringr::str_detect(doc_cha[i - 1], pattern = "[^0123456789]")
215215
&& stringr::str_detect(doc_cha[i - 1], pattern = "[^\u96f6\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]"))
216-
&& !stringr::str_detect(doc_cha[i], pattern = "")){
216+
&& doc_cha[i] == ""){
217217
doc_cha[i] <- str_num[j]
218218
j <- j + 1
219219
}
220220
}
221221
else if(stringr::str_detect(doc_cha[i - 1], pattern = "[^0123456789]")
222-
&& !stringr::str_detect(doc_cha[i], pattern = "")){
222+
&& doc_cha[i] == ""){
223223
doc_cha[i] <- str_num[j]
224224
j <- j + 1
225225
}

0 commit comments

Comments
 (0)