Skip to content

Commit

Permalink
Comptes les interventions skippées
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementCadieux committed Apr 6, 2023
1 parent e58d711 commit 187d758
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scrapers/parliament-mash/quebec-debates.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ list_urls <- doc_urls[grep("assemblee-nationale/4\\d-\\d/journal-debats", doc_ur
for (i in 1:length(list_urls)) {

intervention_count <<- 0
skipped_intervention <- 0
#if (opt$hub_mode != "skip") clessnhub::refresh_token(configuration$token, configuration$url)
if (opt$hub_mode != "skip") clessnhub::connect_with_token(Sys.getenv('HUB_TOKEN'))

Expand Down Expand Up @@ -401,6 +402,7 @@ for (i in 1:length(list_urls)) {
event_sentence_count <- clessnverse::countVecSentences(doc_text) - 1
speech_paragraph_count <- 0

skipped_intervention <- 0
for (j in 1:length(doc_text)) {
#cat(j, intervention_count, "\r")
cat(intervention_count, "\r")
Expand Down Expand Up @@ -469,6 +471,7 @@ for (i in 1:length(list_urls)) {
intervention_text <- gsub("(?<=[\\s])\\s*|^\\s+|\\s+$", "", intervention_text, perl=TRUE)
matching_row <- NULL
intervention_count <<- intervention_count - 1
skipped_intervention <<- skipped_intervention + 1
next
}

Expand Down Expand Up @@ -887,6 +890,8 @@ for (i in 1:length(list_urls)) {

} #if (grepl("actualites-salle-presse", event_url))
clessnverse::logit(scriptname, paste("intervention_count: ", intervention_count), logger)
clessnverse::logit(scriptname, paste("Skipped: ", skipped_intervention), logger)

if (intervention_count > 1) {
debate_count <- debate_count + 1
total_intervention_count <<- total_intervention_count + intervention_count
Expand Down

0 comments on commit 187d758

Please sign in to comment.