1
0
mirror of https://github.com/ilri/csv-metadata-quality.git synced 2024-11-29 09:08:26 +01:00

Compare commits

..

No commits in common. "c95261f5220e7e6775ee5307b5b9a3030555ceca" and "82261f7fe0e6bbd9621f2515ceefb4ccca814e62" have entirely different histories.

4 changed files with 4 additions and 6 deletions

View File

@ -16,7 +16,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
well as dcterms.bibliographicCitation) in `experimental.correct_language()`
- Regular expression to match dc.title and dcterms.title, but
ignore dc.title.alternative `check.duplicate_items()`
- Missing field name in `fix.newlines()` output
## [0.4.7] - 2021-03-17
### Changed

View File

@ -89,7 +89,7 @@ def run(argv):
# Fix: newlines
if args.unsafe_fixes:
df[column] = df[column].apply(fix.newlines, field_name=column)
df[column] = df[column].apply(fix.newlines)
# Fix: missing space after comma. Only run on author and citation
# fields for now, as this problem is mostly an issue in names.

View File

@ -180,7 +180,7 @@ def duplicates(field, field_name):
return new_field
def newlines(field, field_name):
def newlines(field):
"""Fix newlines.
Single metadata values should not span multiple lines because this is not
@ -205,7 +205,7 @@ def newlines(field, field_name):
match = re.findall(r"\n", field)
if match:
print(f"{Fore.GREEN}Removing newline ({field_name}): {Fore.RESET}{field}")
print(f"{Fore.GREEN}Removing newline: {Fore.RESET}{field}")
field = field.replace("\n", "")
return field

View File

@ -76,9 +76,8 @@ def test_fix_newlines():
value = """Ken
ya"""
field_name = "dcterms.subject"
assert fix.newlines(value, field_name) == "Kenya"
assert fix.newlines(value) == "Kenya"
def test_fix_comma_space():