Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions emm/preprocessing/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def map_shorthands(name):
"remove_extra_space": F.regex_replace(r"""\s+""", " ", simple=True),
# Map all the shorthands to the same format (stichting => stg)
"map_shorthands": map_shorthands,
# Merge & separated abbreviations by removing & and the spaces between them
# Merge & or / separated abbreviations by removing & or / and the spaces between them
"merge_&": F.regex_replace(
r"(\s|^)(\w)\s*&\s*(\w)(\s|$)", r"$1$2$3$4" if use_spark else r"\1\2\3\4", simple=True
r"(\s|^)(\w)\s*[&/]\s*(\w)(\s|$)", r"$1$2$3$4" if use_spark else r"\1\2\3\4", simple=True
),
# remove legal form
"remove_legal_form": F.run_custom_function(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_name_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
["Tzu-Sun_BV.a;b,c_ä", "ąćęłńóśźżĄĆĘŁŃÓŚŹŻ", "Café"],
["Tzu-Sun_BV.a;b,c_a", "acelnoszzACELNOSZZ", "Cafe"],
),
("merge_&", ["xyz & abc C&D"], ["xyz & abc CD"]),
("merge_&", ["xyz & abc C&D", "foobar S/A"], ["xyz & abc CD", "foobar SA"]),
(
"preprocess_name",
["Tzu-Sun_BV.a;b,c_ä", "Tzu-Sun_BV morethan1space"],
Expand Down
Loading