Spaces:
Sleeping
Sleeping
Download rules/wrappers.py from frznkshn/TextNormalizer: direct link, hf CLI and curl.
- Browser
- Download file 316 Bytes
-
https://huggingface.co/spaces/frznkshn/TextNormalizer/resolve/main/rules/wrappers.py
- Command line
-
hf download hf://spaces/frznkshn/TextNormalizer/rules/wrappers.py
-
curl -L -o wrappers.py https://huggingface.co/spaces/frznkshn/TextNormalizer/resolve/main/rules/wrappers.py
316 Bytes
| """Characters that can wrap a number, symbol or unit: `(kg)`, `[V]`, `{m}`, `"m"`, `«V»`.""" | |
| import re | |
| OPEN_CHARS = "([{\"“«‘'" | |
| CLOSE_CHARS = ")]}\"”»’'" | |
| OPENERS = "[" + re.escape(OPEN_CHARS) + "]" | |
| CLOSERS = "[" + re.escape(CLOSE_CHARS) + "]" | |
| WRAPPERS = "[" + re.escape(OPEN_CHARS + CLOSE_CHARS) + "]" | |