diff --git a/zothers/apl.py b/zothers/apl.py index cfe14ab..e20705f 100644 --- a/zothers/apl.py +++ b/zothers/apl.py @@ -1,31 +1,47 @@ import sys, string import numpy as np -from itertools import count # Get an array of characters from the file, make sure it starts and ends with a space +# Example input: "Hello World! " characters = np.array([' '] + list(open(sys.argv[1]).read()) + [' ']) -# Stop words -stop_words = open('../stop_words.txt').read().split(',') -stop_words.extend(list(string.ascii_lowercase)) -stop_words = np.array(list(set(stop_words))) +# Result: array([' ', 'H', 'e', 'l', 'l', 'o', ' ', ' ', +# 'W', 'o', 'r', 'l', 'd', '!', ' ', ' '], dtype=' 1] +# Result: [array([' ', 'h', 'e', 'l', 'l', 'o'], dtype='