change spelling of greens fraction, fix parsing issue in comments table
This commit is contained in:
@@ -173,7 +173,8 @@ parse_speech <- function(speech_xml, date) {
|
||||
}
|
||||
|
||||
fractionpattern <- "BÜNDNIS(SES)?\\W*90/DIE\\W*GRÜNEN|CDU/CSU|AfD|SPD|DIE LINKE|FDP|LINKEN"
|
||||
fractionnames <- c("BÜNDNIS 90/DIE GRÜNEN", "CDU/CSU", "AfD", "SPD", "DIE LINKE", "FDP")
|
||||
fractionnames <- c("BÜNDNIS 90/DIE GRÜNEN", "CDU/CSU", "AfD", "SPD", "DIE LINKE", "FDP",
|
||||
"Fraktionslos")
|
||||
|
||||
parse_comment <- function(comment, speech_id, on_speaker) {
|
||||
base <- c(speech_id = speech_id, on_speaker = on_speaker)
|
||||
@@ -187,7 +188,9 @@ parse_comment <- function(comment, speech_id, on_speaker) {
|
||||
c(base, type = "applause", fraction = by, commenter = NA_character_, content = comment)
|
||||
} else {
|
||||
ps <- str_match(comment, "(.*) \\[(.*?)\\]: (.*)")[1,]
|
||||
c(base, type = "comment", fraction = ps[3], commenter = ps[2], content = ps[4])
|
||||
fraction <- agrep(ps[3], fractionnames, max=0.2, value=T)
|
||||
if (all(is.na(fraction)) || length(fraction) == 0) fraction <- NA_character_
|
||||
c(base, type = "comment", fraction = fraction, commenter = ps[2], content = ps[4])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user