This commit is contained in:
Paweł Skurzyński 2024-04-05 17:33:16 +02:00
parent 409a2489d7
commit 6fedb5759d
3 changed files with 1 additions and 1 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
mr/.DS_Store vendored

Binary file not shown.

View File

@ -7,7 +7,7 @@ for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# split the line into words
words = re.findall(r'\b\w+\b', line) # using regex to find words
words = re.findall(r'\b[\w\s]+\b', line) # using regex to find words
# increase counters
for word in words:
# apply regex to remove non-alphanumeric characters and convert to lowercase