Last active
November 27, 2019 17:22
-
-
Save manvillej/3ef9fa694a1b30c68c06547585498e51 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import pandas as pd | |
import random | |
import re | |
file_path = 'C:/Users/Jenny/Desktop/BU COM/Fall 2019/EM 855 Comp Assisted Text Analysis/Research Project/Data/Cursing_Lexicon_05.11.17.txt' | |
file_export = 'C:/Users/Jenny/Desktop/BU COM/Fall 2019/EM 855 Comp Assisted Text Analysis/Research Project/Data/Cursing_Lexicon_in_one_line.txt' | |
uncivil_dictionary = open(file_path, 'r') | |
dictionary = open(file_export, 'w+') | |
lines = uncivil_dictionary.readlines() | |
print(lines) | |
words = "|".join([re.escape(word) for word in test])[:-1] | |
dictionary.write(words) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment