0Mart00
Verbumix rebrand: emojis removed, multi-jurisdictional legal docs, cookie consent, footer links
9d4e305 Download clean_emojis.py from humut/WordGame: direct link, hf CLI and curl.
- Browser
- Download file 7.99 kB
-
https://huggingface.co/spaces/humut/WordGame/resolve/main/clean_emojis.py
- Command line
-
hf download hf://spaces/humut/WordGame/clean_emojis.py
-
curl -L -o clean_emojis.py https://huggingface.co/spaces/humut/WordGame/resolve/main/clean_emojis.py
7.99 kB
| #!/usr/bin/env python3 | |
| """Remove all emojis from the wordgame project and rename WordGame -> Verbumix.""" | |
| import os | |
| import re | |
| import sys | |
| # Emoji pattern - covers most emoji unicode ranges | |
| EMOJI_PATTERN = re.compile( | |
| "[" | |
| "\U0001F600-\U0001F64F" # emoticons | |
| "\U0001F300-\U0001F5FF" # symbols & pictographs | |
| "\U0001F680-\U0001F6FF" # transport & map | |
| "\U0001F1E0-\U0001F1FF" # flags (iOS) | |
| "\U0001F900-\U0001F9FF" # supplemental symbols | |
| "\U0001FA00-\U0001FA6F" # chess symbols | |
| "\U0001FA70-\U0001FAFF" # symbols extended-A | |
| "\U00002600-\U000026FF" # misc symbols | |
| "\U00002700-\U000027BF" # dingbats | |
| "\U00002300-\U000023FF" # misc technical | |
| "\U00002B50" # star | |
| "\U0000200D" # zero width joiner | |
| "\U0000FE0F" # variation selector-16 | |
| "\U0000FE4E0-\U0000FE4FF" # variation selectors | |
| "]+", | |
| re.UNICODE | |
| ) | |
| # Additional specific emojis that might be missed | |
| EXTRA_EMOJIS = [ | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', 'ยฉ', 'ยฎ', 'โผ', 'โ', 'โข', 'โน', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', 'โ', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', 'โคด', | |
| 'โคต', '', '', '', '', '', '', '', 'ใฐ', 'ใฝ', | |
| 'ใ', 'ใ', '๐', '๐', '๐ ฐ', '๐ ฑ', '๐ พ', '๐ ฟ', '๐', '๐', | |
| '๐', '๐', '๐', '๐', '๐', '๐', '๐', '๐', '๐', '', | |
| '', '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '๐', '๐', '๐', '๐ฏ', '๐ฒ', | |
| '๐ณ', '๐ด', '๐ต', '๐ถ', '๐ท', '๐ธ', '๐น', '๐บ', '๐', '๐', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', '', '', '', '', '', '', '', '', | |
| '', '', | |
| ] | |
| SKIP_DIRS = {'.venv', '.git', '__pycache__', 'node_modules', 'Library', 'Logs', 'Packages'} | |
| SKIP_EXTENSIONS = {'.db', '.db-shm', '.db-wal', '.gguf', '.zip', '.gz', '.png', '.jpg', '.jpeg', '.gif', '.ico', '.svg', '.woff', '.woff2', '.ttf', '.eot'} | |
| BASE_DIR = '/mnt/sdc1/STARTUPS/TEST wordGame' | |
| def clean_content(content): | |
| """Remove emojis from content.""" | |
| # Use regex for most emojis | |
| content = EMOJI_PATTERN.sub('', content) | |
| # Remove any remaining known emojis | |
| for emoji in EXTRA_EMOJIS: | |
| content = content.replace(emoji, '') | |
| return content | |
| def process_file(filepath): | |
| """Process a single file to remove emojis.""" | |
| ext = os.path.splitext(filepath)[1].lower() | |
| if ext in SKIP_EXTENSIONS: | |
| return False | |
| try: | |
| with open(filepath, 'r', encoding='utf-8') as f: | |
| content = f.read() | |
| except (UnicodeDecodeError, PermissionError): | |
| return False | |
| original = content | |
| content = clean_content(content) | |
| if content != original: | |
| with open(filepath, 'w', encoding='utf-8') as f: | |
| f.write(content) | |
| return True | |
| return False | |
| def main(): | |
| count = 0 | |
| for root, dirs, files in os.walk(BASE_DIR): | |
| # Skip unwanted directories | |
| dirs[:] = [d for d in dirs if d not in SKIP_DIRS] | |
| for filename in files: | |
| filepath = os.path.join(root, filename) | |
| if process_file(filepath): | |
| relpath = os.path.relpath(filepath, BASE_DIR) | |
| print(f"Cleaned: {relpath}") | |
| count += 1 | |
| print(f"\nTotal files cleaned: {count}") | |
| if __name__ == '__main__': | |
| main() |