From 11eea690d487b7e3a68511677cfcc5a442f35250 Mon Sep 17 00:00:00 2001 From: akiyamn Date: Mon, 3 May 2021 23:29:08 +1000 Subject: Ass 2: Finally done --- ass2/ukkonen.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'ass2/ukkonen.py') diff --git a/ass2/ukkonen.py b/ass2/ukkonen.py index 5aa94e7..eb49820 100644 --- a/ass2/ukkonen.py +++ b/ass2/ukkonen.py @@ -1,4 +1,5 @@ """ +Alexander Occhipinti - 29994705 This file is imported into questions 2 and 3. """ @@ -39,12 +40,12 @@ class OrderedDict(dict): """ Define a number value to an alphabet letter, including special characters so they can fit in a list """ - if char == "$": - return 26 - elif char == "&": - return 27 + if char == "$": # Designates end of string + return 0 + elif char == "&": # Designates break in two strings (Used for Q3) + return 1 else: - return ord(char) - 96 + return ord(char) - 95 # Letters a-z class Node: -- cgit v1.2.3