2024-11-14 20:30:48 +01:00
|
|
|
with open('polish_wiki_excerpt.in', encoding='utf8') as f:
|
|
|
|
lines = f.readlines()
|
2024-11-14 20:46:13 +01:00
|
|
|
results = []
|
|
|
|
i = 0
|
2024-11-14 20:30:48 +01:00
|
|
|
for line in lines:
|
|
|
|
line = line.strip()
|
|
|
|
|
|
|
|
subdigits = []
|
|
|
|
pom = ''
|
|
|
|
|
|
|
|
for char in line:
|
2024-11-14 20:46:13 +01:00
|
|
|
if char in '0123456789':
|
2024-11-14 20:30:48 +01:00
|
|
|
pom += char
|
|
|
|
elif pom != '':
|
|
|
|
subdigits.append(pom)
|
|
|
|
pom = ''
|
|
|
|
else:
|
|
|
|
pass
|
|
|
|
|
|
|
|
if pom.isdigit():
|
|
|
|
subdigits.append(pom)
|
|
|
|
|
|
|
|
if len(subdigits) > 0:
|
|
|
|
finalLine = ' '.join(subdigits)
|
|
|
|
print(finalLine)
|
|
|
|
|
|
|
|
|