Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Source_Code/text_preprocessing/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ def pos_tagging(self):
print(input_file_path + " Done!")
self.output_preprocessed_data(parsed_json, file_name)


def input_path(val):
if os.path.exists(val):
return val
raise ValueError("Invalid path: %s" % val)

def main():
# Define command line parameters
parser = argparse.ArgumentParser(description='Get terminal command line input')
parser.add_argument('--input', '-i', type=str, dest='input_path', action='store',
parser.add_argument('--input', '-i', type=input_path, dest='input_path', action='store',
default='../input/Raw_Text/BOOKS/',
help="type you input file/folder path through command line")

Expand Down