Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def subStringMatchExactlyOneSub(target,key):
- exactMatch = list(subStringMatchExact(target,key))
- constrainedMatchOneSub = list(subStringMatchOneSub(key, target))
- # Now I have to compare each element of exactMatch list to each element of constrainedMatchOneSub list.
- # The goal is to drop own all elements of constrainedMatchOneSub list that are equal to elements of
- # exactMatch list
- # this is the idex of constrainedMatchOneSub list
- i = 0
- # the length of constrainedMatchOneSub list decreases as elements are removed
- for j in range(len(exactMatch)):
- while i < len(constrainedMatchOneSub):
- if exactMatch[j] == constrainedMatchOneSub[i]:
- constrainedMatchOneSub.pop(i)
- else:
- i += 1
- i = 0
- constrainedMatchOneSubTuple = tuple(constrainedMatchOneSub)
- return constrainedMatchOneSubTuple
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement