|
|
|
|
@ -1,10 +1,14 @@
|
|
|
|
|
# file: read_plaintext.py
|
|
|
|
|
# module to read plaintext from a file into a string variable.
|
|
|
|
|
# Skips non-alphabetic characters and converts the rest to lower case
|
|
|
|
|
"""
|
|
|
|
|
module to encapsulate common functions for exercise01.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import string
|
|
|
|
|
|
|
|
|
|
def read_plaintext(file_path):
|
|
|
|
|
"""
|
|
|
|
|
funciton to read plaintext from a file into a string variable.
|
|
|
|
|
Skips non-alphabetic characters (including whitespace) and converts the rest to lower case.
|
|
|
|
|
"""
|
|
|
|
|
txt = ""
|
|
|
|
|
with open(file_path, "r") as _file:
|
|
|
|
|
for line in _file:
|
|
|
|
|
|