Skip to content

Commit

Permalink
Add enhancements to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
rossarmstrong committed Oct 26, 2023
1 parent 138ab54 commit 561ae87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions werpy/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def remove_leading_trailing_spaces(self):
def remove_whitespace(self):
"""
Method that removes leading/trailing spaces and multiple spaces within text
"""
"""
if isinstance(self.text, np.ndarray):
if self.text.ndim == 0:
# For scalar arrays, convert to a string, split, and join
Expand All @@ -90,7 +90,7 @@ def remove_whitespace(self):
# For 1-dimensional arrays, split and join
self.text = ' '.join(self.text.astype(str).tolist())
elif isinstance(self.text, str):
self.text = ' '.join(self.text.split())
self.text = ' '.join(self.text.split())

def apply_normalization(self) -> np.ndarray:
"""
Expand Down

0 comments on commit 561ae87

Please sign in to comment.