2024-02-2024

Question: Can a dictionary method pick up on what’s happening in Pride and Prejudice?

Cleaning the data

pp_book <- austen_books() %>%
  filter(book == "Pride & Prejudice", text != "") %>%
  mutate(chapter = 
           cumsum(str_detect(text, regex("^chapter [\\divxlc]", 
                                         ignore_case = TRUE)))) %>% 
  ungroup() %>% unnest_tokens(word,text) %>%
  anti_join(stop_words) %>%
  select(book, chapter, word) %>% filter(chapter != 0)

Downloading Sentiment Data and Joining

afinn <- get_sentiments("afinn")
sent_pp_book <- inner_join(afinn, pp_book)

Calculating sentiment by Chapter

sent_by_chapter <- sent_pp_book %>% group_by(chapter) %>%
  summarise(mean = mean(value)) %>% mutate(book_unit = "chapter") %>% 
  rename(unit_num = chapter)

Where do the maximum and minimum mean positive sentiment take place?

  • Maximum: Chapter 14
  • Minimum: Chapter 46
  • Note: The last chapter has second highest positive sentiment!

Question: Do these max and min sentiments line up with what’s happening in the book?

Answer

Chapter 14 Summary: “Over dinner, Mr. Collins spends a great deal of time describing the woman who has helped him establish his career in the clergy, Lady Catherine de Bourgh. He glowingly describes the widow and her daughter, who is apparently rather sickly.”

Chapter 46 Summary: “When she returns to the inn where she is staying, Elizabeth finds two letters from Jane. They are filled with upsetting information. Lydia has run away from Brighton with Wickham, and they are both missing. Elizabeth is dumbfounded. Lydia’s reputation will be destroyed, along with the family’s.”

Source:https://www.coursehero.com/lit/Pride-and-Prejudice/

Can a dictionary method pick up on what’s happening in Pride and Prejudice?

  • To an extent
  • Captured the darkest part of the book
  • However, bragging is not differentiated from words stemming from a happy situation (from the last chapter)