Skip to content

Commit

Permalink
Documented substring matching
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdabaa committed Jan 1, 2011
1 parent 22d1a46 commit 7f7ec77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions RapMatcher.py
Expand Up @@ -30,6 +30,10 @@ def __equality_match(self, word1, word2):
return word1 == word2 return word1 == word2


def __substring_match(self, word1, word2): def __substring_match(self, word1, word2):
"""
Tests whether either word has length greater than 3
and is a substring of the other word
"""
return (((len(word1) > 3) and (word1 in word2)) or return (((len(word1) > 3) and (word1 in word2)) or
((len(word2) > 3) and (word2 in word1))) ((len(word2) > 3) and (word2 in word1)))


Expand Down

0 comments on commit 7f7ec77

Please sign in to comment.