Sunday 30 March 2014

Week 10: Assignment 2

This week I was mainly dealing with assignment two, which is on hierarchy of classes and recursion. The difficult point is to split the string into regexes and get the most outward symbol to decide the sort of regex tree we need to do with.

is_regex and build_regex_tree are implemented in very similar way of thinking. So are all_regex_permutations and regex_match. With the help of the gen_perm funcion we discussed in the previous lecture, all_regex_permutaions is not hard to implement. What we are doing with regex_match is also getting all possible combinations of strings and filterring to see if there is a meaningful match. In terms of StarTree, the hint given in class to think of the breakdown of n strings equivalently as two separate strings helped a lot.

One last thing we should be careful with is to reduce redundancies in the code. How we organize the order of our conditions to sort out the type of regex tree to deal with needs consideration.

No comments:

Post a Comment