-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/rodekruis/river-flood-data-…
- Loading branch information
Showing
7 changed files
with
81 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import unicodedata | ||
def remove_accents(input_str): | ||
"""Remove accents from a given string.""" | ||
if isinstance(input_str, str): # Only process strings | ||
nfkd_form = unicodedata.normalize('NFKD', input_str) | ||
return "".join([c for c in nfkd_form if not unicodedata.combining(c)]) | ||
return input_str # Return as is if not a string | ||
|
||
def capitalize(input_str): | ||
"""Remove accents and capitalize the input string.""" | ||
if isinstance(input_str, str): # Only process strings | ||
input_str = remove_accents(input_str) # Remove accents first | ||
return input_str.upper() # Capitalize (convert to uppercase) | ||
return input_str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.