kyu_6.string_subpattern_recognition_2 package¶
Submodules¶
kyu_6.string_subpattern_recognition_2.has_subpattern module¶
-
kyu_6.string_subpattern_recognition_2.has_subpattern.
has_subpattern
(string: str) → bool[source]¶ String subpattern recognition II
if a subpattern has been used, it will be repeated at least twice, meaning the subpattern has to be shorter than the original string;
the strings you will be given might or might not be created repeating a given subpattern, then shuffling the result.
- Parameters
string –
- Returns
kyu_6.string_subpattern_recognition_2.test_has_subpattern module¶
-
class
kyu_6.string_subpattern_recognition_2.test_has_subpattern.
HasSubpatternTestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Testing ‘has_subpattern’ function
-
test_has_subpattern
()[source]¶ Verify that ‘has_subpattern’ function to returns either true/True or false/False if a string can be seen as the repetition of a simpler/shorter subpattern or not.
1. if a subpattern has been used, it will be repeated at least twice, meaning the subpattern has to be shorter than the original string;
2. the strings you will be given might or might not be created repeating a given subpattern, then shuffling the result. :return:
-