2015-01-15 20:24:40 +01:00
|
|
|
# A tweet was falsely categorized
|
|
|
|
if(c_errcode == "1") {
|
|
|
|
repeat {
|
|
|
|
c_curissue <- readYN("Which issue is incorrect?: ")
|
|
|
|
if(c_curissue == "QUIT") {cat("Quitting this item without changes or entries.\n"); break}
|
2015-03-04 11:36:31 +01:00
|
|
|
c_curissue <- unlist(str_split(c_curissue, ","))
|
2015-01-15 20:24:40 +01:00
|
|
|
|
|
|
|
status <- checkAllIssues(c_curissue, c_issueheads)
|
|
|
|
|
|
|
|
# Only continue if every given issue really exists (all "status" have to be TRUE)
|
|
|
|
if(all(status)) {
|
|
|
|
# Revert str_split
|
2015-03-04 11:36:31 +01:00
|
|
|
c_curissue <- str_join(c_curissue,collapse = ",")
|
2015-01-15 20:24:40 +01:00
|
|
|
|
|
|
|
# <ID>,<all issues>,<faulty issue(s),<all tags>,<tweet text>
|
|
|
|
c_result <- str_c("\"",c_errid,"\",\"",c_errissue,"\",\"",c_curissue,"\",\"",c_errtags,"\",\"",c_errtext,"\"")
|
|
|
|
write(c_result, file = "issuecomp-codingsample-error1.csv", append = T)
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# A tweet should be categorized with an additional issue
|
|
|
|
} else if(c_errcode == "2") {
|
|
|
|
repeat {
|
|
|
|
c_curissue <- readYN("Which issue is missing?: ")
|
|
|
|
if(c_curissue == "QUIT") {cat("Quitting this item without changes or entries.\n"); break}
|
2015-03-04 11:36:31 +01:00
|
|
|
c_curissue <- unlist(str_split(c_curissue, ","))
|
2015-01-15 20:24:40 +01:00
|
|
|
|
|
|
|
status <- checkAllIssues(c_curissue, c_issueheads)
|
|
|
|
|
|
|
|
# Only continue if every given issue really exists (all "status" have to be TRUE)
|
|
|
|
if(all(status)) {
|
|
|
|
# Revert str_split
|
2015-03-04 11:36:31 +01:00
|
|
|
c_curissue <- str_join(c_curissue,collapse = ",")
|
2015-01-15 20:24:40 +01:00
|
|
|
|
|
|
|
# <ID>,<all issues>,<faulty issue(s),<all tags>,<tweet text>
|
|
|
|
c_result <- str_c("\"",c_errid,"\",\"",c_errissue,"\",\"",c_curissue,"\",\"",c_errtags,"\",\"",c_errtext,"\"")
|
|
|
|
write(c_result, file = "issuecomp-codingsample-error2.csv", append = T)
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# There is an issue missing AND a issue was wrong
|
|
|
|
} else if(c_errcode == "3") {
|
2015-03-04 11:36:31 +01:00
|
|
|
# #cat("Which issue is incorrect and which one is missing?\n")
|
|
|
|
# repeat {
|
|
|
|
# c_tag <- readYN("Which issue is incorrect?: ")
|
|
|
|
# c_tag <- unlist(str_split(c_tag, ","))
|
|
|
|
# for(i in 1:length(c_tag)) {
|
|
|
|
# if(checkIssue(c_tag[i], c_issueheads)) {} else {cat("Issue",c_tag[i],"does not exist. Please try again.\n")}
|
|
|
|
# }
|
|
|
|
|
2015-01-15 20:24:40 +01:00
|
|
|
repeat {
|
2015-03-04 11:36:31 +01:00
|
|
|
c_curissue <- readYN("Which issue is incorrect?: ")
|
|
|
|
if(c_curissue == "QUIT") {cat("Quitting this item without changes or entries.\n"); break}
|
|
|
|
c_curissue <- unlist(str_split(c_curissue, ","))
|
|
|
|
|
|
|
|
status <- checkAllIssues(c_curissue, c_issueheads)
|
|
|
|
|
|
|
|
# Only continue if every given issue really exists (all "status" have to be TRUE)
|
|
|
|
if(all(status)) {
|
|
|
|
# Revert str_split
|
|
|
|
c_curissue <- str_join(c_curissue,collapse = ",")
|
|
|
|
|
|
|
|
# <ID>,<all issues>,<faulty issue(s),<all tags>,<tweet text>
|
|
|
|
c_result <- str_c("\"",c_errid,"\",\"",c_errissue,"\",\"",c_curissue,"\",\"",c_errtags,"\",\"",c_errtext,"\"")
|
|
|
|
write(c_result, file = "issuecomp-codingsample-error1.csv", append = T)
|
|
|
|
break
|
2015-01-15 20:24:40 +01:00
|
|
|
}
|
|
|
|
}
|
2015-03-04 11:36:31 +01:00
|
|
|
|
|
|
|
repeat {
|
|
|
|
c_curissue <- readYN("Which issue is missing?: ")
|
|
|
|
if(c_curissue == "QUIT") {cat("Quitting this item without changes or entries.\n"); break}
|
|
|
|
c_curissue <- unlist(str_split(c_curissue, ","))
|
|
|
|
|
|
|
|
status <- checkAllIssues(c_curissue, c_issueheads)
|
|
|
|
|
|
|
|
# Only continue if every given issue really exists (all "status" have to be TRUE)
|
|
|
|
if(all(status)) {
|
|
|
|
# Revert str_split
|
|
|
|
c_curissue <- str_join(c_curissue,collapse = ",")
|
|
|
|
|
|
|
|
# <ID>,<all issues>,<faulty issue(s),<all tags>,<tweet text>
|
|
|
|
c_result <- str_c("\"",c_errid,"\",\"",c_errissue,"\",\"",c_curissue,"\",\"",c_errtags,"\",\"",c_errtext,"\"")
|
|
|
|
write(c_result, file = "issuecomp-codingsample-error2.csv", append = T)
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
2015-01-15 20:24:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
# If this triggers the hell freezes...
|
|
|
|
} else {
|
|
|
|
cat("Neither 1, 2 or 3 as error code...")
|
|
|
|
}
|