First I identify ‘foundat’. This variable is a list of falses that is the length of the target string I’m interpreting. Then I identify an empty list as ‘finallist’. Then I identify key1 as the list created when the function (explained in Problem Set 3, Problem 2), ‘breakup’ is run.
The ‘breakup’ function creates a list of combined prefixes and suffixes. Then I run each item of this list through the for loop, by stating ‘for p, s in key1’. Therefore each prefix (p) and suffix (s) is then passed through the constrainedSubStringMatch function (see Problem Set 3, Problem 1). Each of these prefix and suffixes create lists via this function, with the identifying locations of where they occur in the target string.
Then, for the last section I process each of these lists through the final function I recently created (see Problem Set 3, Problem 3). This takes the lists and creates a list of locations where the prefix plus one space, plus suffix occurs. In the next line I state that each time an location is found, the list created at the beginning (foundat), is then edited. For each location found, the false is changed to true. Then a list is created of all the locations where true occurs in the target string. Thusly is a function created that returns a tuple of all starting points of matches of the key to the target, such that at exactly one element of the key is incorrectly matched to the target.