From b3d0210d1a423eb87010267d365edf0f9573ddbe Mon Sep 17 00:00:00 2001 From: Benjamin Adovasio Date: Sat, 31 Jan 2026 12:20:03 -0500 Subject: [PATCH] Finished main --- HW 3/dcs211_hw3.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/HW 3/dcs211_hw3.py b/HW 3/dcs211_hw3.py index 4b38ec6..8db0d27 100644 --- a/HW 3/dcs211_hw3.py +++ b/HW 3/dcs211_hw3.py @@ -38,4 +38,33 @@ def histCaseInsensitive(word_dict: Dict[str, List[int]]) -> None: totals = [sum(word_dict[word]) for word in keys] plt.simple_bar(keys, totals, width=80) - plt.show() \ No newline at end of file + plt.show() + + +def main() -> None: + + """ + Main function to call other functions. Functions can also be called directly from terminal. + """ + + print("=== Test File 1 ===") + d1 = parseWords("test1.txt") + print(d1) + histCaseSensitive(d1) + histCaseInsensitive(d1) + + print("=== Test File 2 ===") + d2 = parseWords("test2.txt") + print(d2) + histCaseSensitive(d2) + histCaseInsensitive(d2) + + print("=== Test File 3 ===") + d3 = parseWords("test3.txt") + print(d3) + histCaseSensitive(d3) + histCaseInsensitive(d3) + + +if __name__ == "__main__": + main() \ No newline at end of file