|
|
|
|
|
|
|
|
content = file.read() |
|
|
content = file.read() |
|
|
#text = rtf_to_text(content) |
|
|
#text = rtf_to_text(content) |
|
|
words = content.split() |
|
|
words = content.split() |
|
|
|
|
|
substring = '\\' |
|
|
|
|
|
# remove elements from list that contain given string |
|
|
|
|
|
words = [item for item in words if substring not in item] |
|
|
|
|
|
substring = '}' |
|
|
|
|
|
# remove elements from list that contain given string |
|
|
|
|
|
words = [item for item in words if substring not in item] |
|
|
|
|
|
substring = '{' |
|
|
|
|
|
# remove elements from list that contain given string |
|
|
|
|
|
words = [item for item in words if substring not in item] |
|
|
|
|
|
substring = '/' |
|
|
|
|
|
# remove elements from list that contain given string |
|
|
|
|
|
words = [item for item in words if substring not in item] |
|
|
|
|
|
substring = '(' |
|
|
|
|
|
# remove elements from list that contain given string |
|
|
|
|
|
words = [item for item in words if substring not in item] |
|
|
total += len(words) |
|
|
total += len(words) |
|
|
#print(text) |
|
|
|
|
|
|
|
|
#print(words) |
|
|
|
|
|
|
|
|
print(total) |
|
|
print(total) |