Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
Add case to exempt space joining separate lines for dashes or slashes.
Browse files Browse the repository at this point in the history
This is important for phone numbers!
  • Loading branch information
Den4200 committed Apr 3, 2023
1 parent e354eb0 commit cbff43c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tungsten/parsers/supplier/sigma_aldrich/field_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,16 @@ def getFieldMappings(self, field: SdsQueryFieldName) -> tuple[list[SelectCommand
SelectCommand(key="name",
where_value=re.compile(r"Emergency\sPhone", re.IGNORECASE)),
SelectCommand(key="data")
], lambda x: re.match(r"\:?\s*(.*)", "".join(x), re.DOTALL).group(1)),
], lambda x: re.match(
r"\:?\s*(.*)",
"".join(
item \
if item.endswith("-") or item.endswith("/") \
else f"{item} " \
for item in (item.strip() for item in x)
).rstrip(),
re.DOTALL
).group(1)),
SdsQueryFieldName.IDENTIFICATION_OTHER: ([
SelectCommand(key="sections"),
SelectCommand(key="title", where_value="IDENTIFICATION"),
Expand Down

0 comments on commit cbff43c

Please sign in to comment.