lexicon_nrc() appears broken again
KyleOfCanada opened this issue · comments
It looks like the structural change in the source file that led to issue #50 has been rolled back, so lexicon_nrc() fails due to a missing file.
I think the path used in process_nrc() should once again be:
"NRC-Emotion-Lexicon/NRC-Emotion-Lexicon-v0.92/NRC-Emotion-Lexicon-Wordlevel-v0.92.txt"
Hello @KyleOfCanada 👋 I'm not able to reproduce this error, are you sure you are using the most up to date version of textdata (0.4.4)?
tmp_file <- tempfile()
tmp_dir <- tempdir()
download.file(
"http://saifmohammad.com/WebDocs/Lexicons/NRC-Emotion-Lexicon.zip",
destfile = tmp_file
)
unzip(tmp_file, exdir = tmp_dir)
fs::dir_ls(fs::path(tmp_dir, "NRC-Emotion-Lexicon"))
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/ListOfLanguages-For-Which-Lexicon-Availabale.txt
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/NRC-Emotion-Lexicon-ForVariousLanguages.txt
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/NRC-Emotion-Lexicon-Senselevel-v0.92.txt
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/NRC-Emotion-Lexicon-Wordlevel-v0.92.txt
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/OneFilePerEmotion
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/OneFilePerLanguage
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/Paper-Ethics-Sheet-Emotion-Recognition.pdf
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/Paper-Practical-Ethical-Considerations-Lexicons.pdf
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/Paper1_NRC_Emotion_Lexicon.pdf
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/Paper2_NRC_Emotion_Lexicon.pdf
#> /var/folders/t2/yn6r1mw93lq0r_2937fvjzbm0000gn/T/RtmpQoyhMe/NRC-Emotion-Lexicon/README.txt
Created on 2022-09-16 by the reprex package (v2.0.1)
Hi @EmilHvitfeldt, I figured out what was causing the error. I was downloading the .zip file from a slightly different link:
"http://saifmohammad.com/WebDocs/NRC-Emotion-Lexicon.zip"
instead of:
"http://saifmohammad.com/WebDocs/Lexicons/NRC-Emotion-Lexicon.zip"
The link I was using still has the old version of the .zip file and this was what caused my error.
Sorry for the trouble.