Skip to content

Commit 6be0da0

Browse files
committed
fixed group change regex for Android in create_chatlog
1 parent c02f48c commit 6be0da0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

R/create_chatlog.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ create_chatlog <- function(n_messages = 250,
205205

206206
#### Formatting Timestamps ####
207207

208-
# TODO: Fix the German ampm thing!
209-
210208
if (language == "german") {
211209
if (os == "android") {
212210
if (time_format == "24h") {
@@ -378,7 +376,7 @@ create_chatlog <- function(n_messages = 250,
378376

379377
WAStrings[9] <- gsub("?s*","",WAStrings[9],fixed = TRUE)
380378
WAStrings[9] <- gsub("(.+?)","\u201EBockwurst\u201C",WAStrings[9],fixed = TRUE)
381-
WAStrings[9] <- gsub("[\"\\u201E\\u201C\\u201D](.*?)[\"\\u201E\\u201C\\u201D]",'"Bockwurst"',WAStrings[9],fixed = TRUE)
379+
WAStrings[9] <- gsub('["\u201E\u201C\u201D](.*?)["\u201E\u201C\u201D]', "\u201EBockwurst\u201C", WAStrings[9], fixed = TRUE)
382380

383381
WAStrings[11] <- gsub("?s*","",WAStrings[11],fixed = TRUE)
384382

@@ -552,10 +550,12 @@ create_chatlog <- function(n_messages = 250,
552550
WAStrings[7] <- gsub(".*?","Bockwurst",WAStrings[7],fixed = TRUE)
553551
WAStrings[7] <- sample(unlist(strsplit(WAStrings[7],"|", fixed = TRUE)),1)
554552

553+
# TODO: Fix this so it's properly replaced
555554
WAStrings[9] <- gsub("?s*","",WAStrings[9],fixed = TRUE)
556555
WAStrings[9] <- gsub(" (.+?) "," \u201EBockwurst\u201C ",WAStrings[9],fixed = TRUE)
557556
WAStrings[9] <- gsub("[\"\\u201E\\u201C\\u201D](.*?)[\"\\u201E\\u201C\\u201D]","\u201EBockwurst\u201C",WAStrings[9],fixed = TRUE)
558557
WAStrings[9] <- gsub("(.+?) ","Bob ",WAStrings[9], fixed = TRUE)
558+
WAStrings[9] <- gsub(paste0('["', "\u201E\u201C\u201D", '](.*?)["', "\u201E\u201C\u201D", ']'),"\u201EBockwurst\u201C", WAStrings[9], fixed=TRUE)
559559

560560
WAStrings[11] <- gsub("?s*","",WAStrings[11],fixed = TRUE)
561561

0 commit comments

Comments
 (0)