



"""simple docstring"""




from __future__ import annotations

class        UpperCAmelCase_  :

						'''simple docstring'''




						def __init__(   self				,							_A				,							_A		):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE							,	__SCREAMING_SNAKE_CASE									= text, pattern
													__SCREAMING_SNAKE_CASE							,	__SCREAMING_SNAKE_CASE									= len(_A		), len(_A		)






						def 	_A     (   self				,							_A		):







													'''simple docstring'''

													for i in range(self.patLen - 1				,							-1				,							-1		):
																				if char == self.pattern[i]:
																											return i
													return -1






						def 	_A     (   self				,							_A		):







													'''simple docstring'''

													for i in range(self.patLen - 1				,							-1				,							-1		):
																				if self.pattern[i] != self.text[current_pos + i]:
																											return current_pos + i
													return -1






						def 	_A     (   self		):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE									= []
													for i in range(self.textLen - self.patLen + 1		):
																				__SCREAMING_SNAKE_CASE									= self.mismatch_in_text(_A		)
																				if mismatch_index == -1:
																											positions.append(_A		)
																				else:
																											__SCREAMING_SNAKE_CASE									= self.match_in_pattern(self.text[mismatch_index]		)
																											__SCREAMING_SNAKE_CASE									= (
																											    mismatch_index - match_index
																											)  # shifting index lgtm [py/multiple-definition]
													return positions







lowerCAmelCase__		:					Optional[Any]							='''ABAABA'''
lowerCAmelCase__		:					List[str]							='''AB'''
lowerCAmelCase__		:					Tuple							=BoyerMooreSearch(text, pattern)
lowerCAmelCase__		:					Any							=bms.bad_character_heuristic()

if len(positions) == 0:
			print('''No match found''')
else:
			print('''Pattern found in following positions: ''')
			print(positions)











from ..utils import DummyObject, requires_backends

class        UpperCAmelCase_  (       metaclass=UpperCamelCase_	):

						'''simple docstring'''




						UpperCamelCase__      :			Optional[int]      =  ['''speech''']






						def __init__(   self				,							*_A				,							**_A		):







													'''simple docstring'''

													requires_backends(self				,							['speech']		)







class        UpperCAmelCase_  (       metaclass=UpperCamelCase_	):

						'''simple docstring'''




						UpperCamelCase__      :			Optional[int]      =  ['''speech''']






						def __init__(   self				,							*_A				,							**_A		):







													'''simple docstring'''

													requires_backends(self				,							['speech']		)






