コンテンツへスキップ
🛠️ToolsShed

Emoji Text Replacement

一般的な英単語を合致する絵文字に置き換えてテキストをより表現力豊かにします。

絵文字辞書(サンプル)

love❤️heart❤️happy😊smile😊laugh😂cry😢sad😢angry😠cool😎think🤔wow😮fire🔥starsun☀️moon🌙rain🌧️snow❄️cloud☁️dog🐕cat🐈bird🐦fish🐟horse🐎cow🐄pig🐷rabbit🐰bear🐻lion🦁tiger🐯elephant🐘+89 その他の単語

このツールについて

絵文字テキスト置換は、一般的な英単語を対応する絵文字に置き換えることで、文章をより視覚的に表現豊かにする楽しいツールです。ソーシャルメディアの投稿、チャットメッセージ、カジュアルなメールなど、どのようなコンテキストでも、このツールはテキストを即座にカラフルで魅力的な形式に変換し、注目を集め、感情をより生き生きと伝えることができます。

使い方はシンプルです。テキストをテキスト欄に貼り付けるか入力すると、ツールは自動的に対象の単語を絵文字に置き換えます—例えば「love」は❤️に、「sun」は☀️に、「pizza」は🍕になります。結果はコピーして、メッセージ、投稿、ドキュメントで直接使用できます。置換は選別的で文脈を考慮しているため、明確な名詞の置き換えのみが行われ、メッセージの可読性が保たれます。

このツールはソーシャルメディアのコメント、テキストメッセージ、フレンドリーなメールなど、絵文字の使用が自然で奨励される非公式なコミュニケーションに最適です。すべての単語に直接対応する絵文字があるわけではないため、一部の一般的でない単語は変わらないままになる可能性があります。このツールは元のテキストの構造を尊重し、大文字小文字と句読点が保持されることを保証しています。

よくある質問

コード実装

import re

EMOJI_MAP = {
    "sun": "☀️", "moon": "🌙", "star": "⭐", "heart": "❤️",
    "fire": "🔥", "water": "💧", "tree": "🌳", "flower": "🌸",
    "house": "🏠", "car": "🚗", "book": "📚", "music": "🎵",
    "food": "🍎", "coffee": "☕", "dog": "🐶", "cat": "🐱",
    "money": "💰", "time": "⏰", "phone": "📱", "computer": "💻",
    "love": "💕", "happy": "😊", "sad": "😢", "angry": "😠",
    "eyes": "👀", "hand": "👋", "thumbs up": "👍", "party": "🎉",
    "snow": "❄️", "rain": "🌧️", "lightning": "⚡", "wind": "🌬️",
}

def replace_with_emojis(text: str) -> str:
    """Replace words in text with matching emojis."""
    def replace_word(match):
        word = match.group(0)
        return EMOJI_MAP.get(word.lower(), word)

    # Build pattern from longest to shortest to handle multi-word mappings
    pattern = r"\b(" + "|".join(
        re.escape(k) for k in sorted(EMOJI_MAP.keys(), key=len, reverse=True)
    ) + r")\b"

    return re.sub(pattern, replace_word, text, flags=re.IGNORECASE)

text = "I love the sun, the moon, and the stars. My heart is on fire!"
result = replace_with_emojis(text)
print(result)
# Output: I ❤️ the ☀️, the 🌙, and the ⭐. My ❤️ is on 🔥!

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.