kyu_6.string_subpattern_recognition_3 package¶
Submodules¶
kyu_6.string_subpattern_recognition_3.has_subpattern module¶
-
kyu_6.string_subpattern_recognition_3.has_subpattern.
has_subpattern
(string: str) → str[source]¶ String subpattern recognition III
Since there is no deterministic way to tell which pattern was really the original one among all the possible permutations of a fitting subpattern, return a subpattern with sorted characters, otherwise return the base string with sorted characters (you might consider this case as an edge case, with the subpattern being repeated only once and thus equalling the original input string).
- Parameters
string –
- Returns
kyu_6.string_subpattern_recognition_3.test_has_subpattern module¶
-
class
kyu_6.string_subpattern_recognition_3.test_has_subpattern.
HasSubpatternTestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Testing ‘has_subpattern’ function
-
test_has_subpattern
()[source]¶ Verify that ‘has_subpattern’ function
Return a subpattern with sorted characters, otherwise return the base string with sorted characters (you might consider this case as an edge case, with the subpattern being repeated only once and thus equalling the original input string). :return:
-