Skip to content

Commit

Permalink
1.17.5 : bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alban Peyrat (Archi) committed Apr 11, 2024
1 parent aa6e741 commit 46386a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ _Some previous changes will be added_

## [Unreleased]

## [1.17.5] - 2024-04-11

### Fixed

* `Universal_Data_Extractor.extract_list_of_strings` method does not crash anymore if some subfield had no values
* ASCII range (hexadecimal) `21-2F`, `3A-40`, `5B-60`, `7B-7F` added to the noise list

## [1.17.4] - 2024-03-28

### Added
Expand Down
6 changes: 5 additions & 1 deletion fcr_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2884,7 +2884,11 @@ def extract_list_of_strings(self,marc_field: Marc_Fields_Data, filter_value: Opt
output = []
extraction = self.extract_data_from_marc_field(marc_field, filter_value)
for field_value in extraction:
output.append(" ".join(field_value))
valid_values = []
for value in field_value:
if value:
valid_values.append(value)
output.append(" ".join(valid_values))
return output

def extract_list_of_lists(self,marc_field: Marc_Fields_Data, filter_value: Optional[str] = "") -> List[str]:
Expand Down
2 changes: 1 addition & 1 deletion fcr_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def prep_string(_str:str, _noise = True, _multiplespaces = True) -> str:
"""
# remove noise (punctuation) if asked (by default yes)
if _noise:
_str = re.sub(r"\.|\,|\?|\!|\;|\/|\:|\=|\[|\]|\'|\-|\(|\)|\||\"|\<|\>|\+|\°|[\u2010-\u2015]", " ", _str, flags=re.IGNORECASE)
_str = re.sub(r"[\x21-\x2F]|[\x3A-\x40]|[\x5B-\x60]|[\x7B-\x7F]|[\u2010-\u2015]|\.|\,|\?|\!|\;|\/|\:|\=|\[|\]|\'|\-|\(|\)|\||\"|\<|\>|\+|\°", " ", _str, flags=re.IGNORECASE)
# replace multiple spaces by ine in string if requested (default yes)
if _multiplespaces:
_str = re.sub("\s+", " ", _str).strip()
Expand Down

0 comments on commit 46386a0

Please sign in to comment.