A02
This commit is contained in:
parent
e5e1e10494
commit
87f198acc2
@ -10,18 +10,28 @@ def join_path(filename: str) -> str:
|
||||
return os.path.join(DIR, filename)
|
||||
|
||||
|
||||
with open(join_path("simple.in"), "r", newline="", encoding="utf8") as file:
|
||||
with open(
|
||||
join_path("polish_wiki_excerpt.in"), "r", newline="", encoding="utf8"
|
||||
) as file:
|
||||
text = file.readlines()
|
||||
|
||||
|
||||
def not_in(letter, set):
|
||||
for i in set:
|
||||
if i == letter:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def find_me():
|
||||
for j in range(len(PHRASE)):
|
||||
if line[i + j] != PHRASE[j] and line[i + j] != PHRASE[j].capitalize():
|
||||
return False
|
||||
|
||||
if line[i - 1] not in [" ", "\t", "\n"]:
|
||||
if not_in(line[i - 1], [" ", "\n"]):
|
||||
return False
|
||||
if line[i + len(PHRASE)] not in [" ", "\t", "\n", "\r"]:
|
||||
|
||||
if not_in(line[i + len(PHRASE)], [" ", "\n", "\r"]):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user