refactoring, improved string cleansing preprocessing
This commit is contained in:
15
tests/pre_test_examples.py
Normal file
15
tests/pre_test_examples.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import re
|
||||
|
||||
|
||||
string = """
|
||||
Hallo mein Name ist Max Mustermann und ich bin am 01.01.2024 geboren.
|
||||
"""
|
||||
|
||||
patt = r'(\d{1,2}\.)?(\d{1,2}\.)([\d]{2,4})?'
|
||||
patt2 = r'[ ]{2,}'
|
||||
pattern = re.compile(patt)
|
||||
pattern2 = re.compile(patt2)
|
||||
res = pattern.sub('', string)
|
||||
res = pattern2.sub(' ', res)
|
||||
|
||||
print(res)
|
||||
Reference in New Issue
Block a user