r"""Split a string based on a list of characters. Args: s (str): The string to split. char_list (Optional[List[str]], optional): T he list of characters to split on. (default: :obj:`None`)
(
self, s: str, char_list: Optional[List[str]] = None
)
| 429 | return float("inf") |
| 430 | |
| 431 | def split_string( |
| 432 | self, s: str, char_list: Optional[List[str]] = None |
| 433 | ) -> list[str]: |
| 434 | r"""Split a string based on a list of characters. |
| 435 | |
| 436 | Args: |
| 437 | s (str): The string to split. |
| 438 | char_list (Optional[List[str]], optional): T |
| 439 | he list of characters to split on. |
| 440 | (default: :obj:`None`) |
| 441 | """ |
| 442 | if char_list is None: |
| 443 | char_list = [",", ";"] |
| 444 | pattern = f"[{''.join(char_list)}]" |
| 445 | return re.split(pattern, s) |
| 446 | |
| 447 | def normalize_str(self, input_str, remove_punct=True) -> str: |
| 448 | r"""Normalize a string. |