Skip to main content
added 1021 characters in body
Source Link
Args:
    text: Input text to transform
    personality: "baby", "toddler", "uwu", or "custom"
    cuteness_level: 1-5, controls frequency of embellishments

Returns:
    Transformed baby talk text
"""
# Word replacements (significantly expanded)
baby_dict = {
    "hello": "hewwo",
    "hullo": "hewwo",
    "water": "wawa",
    "drink": "drinkie",
    "mother": "mama",
    "father": "dada",
    "dad": "dada",
    "mom": "mama",
    "boat": "boatie",
    "rabbit": "wabbit",
    "bunny": "bun-bun",
    "cat": "kitty",
    "kitten": "kitty",
    "dog": "doggy",
    "puppy": "pup-pup",
    "dear": "deawie",
    "wonderful": "wuvwy",
    "never": "neba",
    "before": "befowe",
    "mischief": "twouble",
    "accident": "oopsie",
    "said": "sayed",
    "sculls": "oarsies",
    "big": "biggie",
    "pie": "yummie pie",
    "time": "timie",
    "names": "namies",
    "very": "vewy",
    "love": "wuv",
    "food": "num-nums",
    "eat": "nom-nom",
    "sleep": "sweepy",
    "tired": "sweepy",
    "happy": "happies",
    "sad": "saddie",
    "angry": "angwy",
    "please": "pwease",
    "thank": "fank",
    "thanks": "fanks",
    "yes": "yesh",
    "no": "nuh-uh",
    "good": "gud",
    "bad": "bad-bad",
    "sorry": "sowwy",
    "little": "widdle",
    "small": "smol",
    "tiny": "teeny-weeny",
    "look": "wook",
    "see": "see-see",
    "beautiful": "pwetty",
    "pretty": "pwetty",
    "scary": "scawy",
    "frightening": "scawy",
    "friend": "fwen",
    "baby": "beebee",
    "child": "widdle one",
    "children": "widdle ones",
    "person": "hooman",
    "people": "hoomans",
    "something": "sumfin",
    "anything": "anyfing",
    "everything": "evwyfing",
    "nothing": "nuffin",
    "want": "wanna",
    "going to": "gunna",
    "going": "goin",
    "remember": "memba",
    "forget": "forgotted",
    "forgot": "forgotted"
}

# Word endings by personality
endings_by_personality = {
    "baby": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wy",
        "short": ""
    },
    "toddler": {
        "default": "y",
        "consonant": "y",
        "vowel": "ey",
        "short": ""
    },
    "uwu": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wie",
        "short": "u"
    },
    "custom": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wy",
        "short": ""
    }
}

# Get the correct endings for selected personality
endings = endings_by_personality.get(personality, endings_by_personality["baby"])

# Function to replace letter combos with baby-talk equivalents
def transform_letters(word):
    # Skip short words
    if len(word) <= 2:
        return word
        
    # Different letter transformations based on personality
    if personality == "baby":
        word = re.sub(r'(?<!^)[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'th', 'd', word, flags=re.IGNORECASE)
        word = re.sub(r'v', 'b', word, flags=re.IGNORECASE)
    elif personality == "toddler":
        word = re.sub(r'(?<!^)[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'th', 'd', word, flags=re.IGNORECASE)
    elif personality == "uwu":
        word = re.sub(r'[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'n([aeiou])', 'ny\\1', word, flags=re.IGNORECASE)
        word = re.sub(r's', 'sh', word, flags=re.IGNORECASE)
    
    return word

# Add endings to words
def baby_endings(word):
    if len(word) <= 3:
        return word
        
    # Words that shouldn't get endings
    if word.lower() in ["the", "and", "but", "for", "nor", "yet", "so", "at", "by", "to"]:
        return word
        
    if personality == "uwu" and random.random() < 0.3:
        return word + "-" + word  # UwU likes repetition
        
    # Different endings based on word pattern
    if word.endswith(("at", "og")):
        return word + "gie"
    elif word.endswith(("t", "d", "p")):
        return word + endings["consonant"]
    elif word.endswith(("n", "m")):
        return word + "nie"
    elif word.endswith(("a", "e", "i", "o", "u")):
        return word + endings["vowel"]
    
    # Random chance to add ending based on cuteness level
    if random.random() < (cuteness_level * 0.1):
        return word + endings["default"]
        
    return word

# Randomized stuttering based on cuteness level
def maybe_stutter(word):
    # Only stutter some initial consonants
    if len(word) > 2 and word[0].lower() in 'bcdfghjklmnpqrstvwxyz' and random.random() < (cuteness_level * 0.05):
        return word[0] + "-" + word
    return word

# Add emoticons based on personality and cuteness
def add_emoticons(sentence):
    emoticons = {
        "baby": ["(✿◠‿◠)", "ʕ•ᴥ•ʔ", "(。・ω・。)", "◕‿◕", "(。◕‿◕。)"],
        "toddler": ["(◠‿◠)", "ʕ•ᴥ•ʔ", "(•‿•)"],
        "uwu": ["uwu", "owo", ">w<", "^w^", ":3", "nyaa~", "ʕ•ᴥ•ʔ", "(・ω・)"]
    }
    
    selected_emoticons = emoticons.get(personality, emoticons["baby"])
    
    if random.random() < (cuteness_level * 0.15):
        return sentence + " " + random.choice(selected_emoticons)
    return sentence

# Get baby speak interjections by personality
def get_interjections():
    interjections = {
        "baby": ["Goo goo ga ga!", "Ba ba!", "Gah!", "Agoo!", "Blblblbl!"],
        "toddler": ["Oopsie!", "Yay!", "Uh-oh!", "Wow-wee!", "Oh noes!"],
        "uwu": ["Uwu~", "Owo~", "Nyaa~", "Waaah~", "*giggles*", "*blushes*"]
    }
    return interjections.get(personality, interjections["baby"])

# Transform each word
def transform_word(word):
    # Skip empty strings
    if not word.strip():
        return word
        
    # Handle punctuation
    match = re.match(r'^(\W*)([\w\'-]*)(\W*)$', word)
    if match:
        prefix, core, suffix = match.groups()
    else:
        prefix, core, suffix = '', word, ''
        
    if not core:
        return word
        
    lw = core.lower()
    
    # Special case for contractions
    if "'" in core:
        return prefix + core + suffix
        
    # Dictionary replacement
    if lw in baby_dict:
        bw = baby_dict[lw]
    else:
        # Apply transformations
        bw = transform_letters(lw)
        bw = baby_endings(bw)
        bw = maybe_stutter(bw)
        
    # Preserve original capitalization
    if core.istitle():
        bw = bw.capitalize()
    elif core.isupper():
        bw = bw.upper()
        
    return prefix + bw + suffix

# Break into sentences
sentences = re.split(r'([.!?]+)', text)
result = []

i = 0
while i < len(sentences):
    s = sentences[i]
    
    # Skip empty sentences
    if not s.strip():
        i += 1
        continue
        
    # Process sentence
    words = s.split()
    baby_words = [transform_word(w) for w in words]
    processed = ' '.join(baby_words)
    
    # Add to result
    if processed:
        processed = add_emoticons(processed)
        result.append(processed)
    
    # Add punctuation if it exists
    if i + 1 < len(sentences) and sentences[i + 1].strip():
        result[-1] += sentences[i + 1]
        
        # Add baby interjections randomly based on cuteness level
        if sentences[i + 1].strip() in ['.', '!', '?'] and random.random() < (cuteness_level * 0.12):
            result.append(random.choice(get_interjections()))
    
    i += 2

output = ' '.join(result)
return output
Args:
    text: Input text to transform
    personality: "baby", "toddler", "uwu", or "custom"
    cuteness_level: 1-5, controls frequency of embellishments

Returns:
    Transformed baby talk text
"""
# Word replacements
baby_dict = {
    "hello": "hewwo",
    "hullo": "hewwo",
    "water": "wawa",
    "drink": "drinkie",
    "mother": "mama",
    "father": "dada",
    "dad": "dada",
    "mom": "mama",
    "boat": "boatie",
    "rabbit": "wabbit",
    "bunny": "bun-bun",
    "cat": "kitty",
    "kitten": "kitty",
    "dog": "doggy",
    "puppy": "pup-pup",
    "dear": "deawie",
    "wonderful": "wuvwy",
    "never": "neba",
    "before": "befowe",
    "mischief": "twouble",
    "accident": "oopsie",
    "said": "sayed",
    "sculls": "oarsies",
    "big": "biggie",
    "pie": "yummie pie",
    "time": "timie",
    "names": "namies",
    "very": "vewy",
    "love": "wuv",
    "food": "num-nums",
    "eat": "nom-nom",
    "sleep": "sweepy",
    "tired": "sweepy",
    "happy": "happies",
    "sad": "saddie",
    "angry": "angwy",
    "please": "pwease",
    "thank": "fank",
    "thanks": "fanks",
    "yes": "yesh",
    "no": "nuh-uh",
    "good": "gud",
    "bad": "bad-bad",
    "sorry": "sowwy",
    "little": "widdle",
    "small": "smol",
    "tiny": "teeny-weeny",
    "look": "wook",
    "see": "see-see",
    "beautiful": "pwetty",
    "pretty": "pwetty",
    "scary": "scawy",
    "frightening": "scawy",
    "friend": "fwen",
    "baby": "beebee",
    "child": "widdle one",
    "children": "widdle ones",
    "person": "hooman",
    "people": "hoomans",
    "something": "sumfin",
    "anything": "anyfing",
    "everything": "evwyfing",
    "nothing": "nuffin",
    "want": "wanna",
    "going to": "gunna",
    "going": "goin",
    "remember": "memba",
    "forget": "forgotted",
    "forgot": "forgotted"
}

# Word endings by personality
endings_by_personality = {
    "baby": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wy",
        "short": ""
    },
    "toddler": {
        "default": "y",
        "consonant": "y",
        "vowel": "ey",
        "short": ""
    },
    "uwu": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wie",
        "short": "u"
    },
    "custom": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wy",
        "short": ""
    }
}

# Get the correct endings for selected personality
endings = endings_by_personality.get(personality, endings_by_personality["baby"])

# Function to replace letter combos with baby-talk equivalents
def transform_letters(word):
    # Skip short words
    if len(word) <= 2:
        return word
        
    # Different letter transformations based on personality
    if personality == "baby":
        word = re.sub(r'(?<!^)[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'th', 'd', word, flags=re.IGNORECASE)
        word = re.sub(r'v', 'b', word, flags=re.IGNORECASE)
    elif personality == "toddler":
        word = re.sub(r'(?<!^)[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'th', 'd', word, flags=re.IGNORECASE)
    elif personality == "uwu":
        word = re.sub(r'[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'n([aeiou])', 'ny\\1', word, flags=re.IGNORECASE)
        word = re.sub(r's', 'sh', word, flags=re.IGNORECASE)
    
    return word

# Add endings to words
def baby_endings(word):
    if len(word) <= 3:
        return word
        
    # Words that shouldn't get endings
    if word.lower() in ["the", "and", "but", "for", "nor", "yet", "so", "at", "by", "to"]:
        return word
        
    if personality == "uwu" and random.random() < 0.3:
        return word + "-" + word  # UwU likes repetition
        
    # Different endings based on word pattern
    if word.endswith(("at", "og")):
        return word + "gie"
    elif word.endswith(("t", "d", "p")):
        return word + endings["consonant"]
    elif word.endswith(("n", "m")):
        return word + "nie"
    elif word.endswith(("a", "e", "i", "o", "u")):
        return word + endings["vowel"]
    
    # Random chance to add ending based on cuteness level
    if random.random() < (cuteness_level * 0.1):
        return word + endings["default"]
        
    return word

# Randomized stuttering based on cuteness level
def maybe_stutter(word):
    # Only stutter some initial consonants
    if len(word) > 2 and word[0].lower() in 'bcdfghjklmnpqrstvwxyz' and random.random() < (cuteness_level * 0.05):
        return word[0] + "-" + word
    return word

# Add emoticons based on personality and cuteness
def add_emoticons(sentence):
    emoticons = {
        "baby": ["(✿◠‿◠)", "ʕ•ᴥ•ʔ", "(。・ω・。)", "◕‿◕", "(。◕‿◕。)"],
        "toddler": ["(◠‿◠)", "ʕ•ᴥ•ʔ", "(•‿•)"],
        "uwu": ["uwu", "owo", ">w<", "^w^", ":3", "nyaa~", "ʕ•ᴥ•ʔ", "(・ω・)"]
    }
    
    selected_emoticons = emoticons.get(personality, emoticons["baby"])
    
    if random.random() < (cuteness_level * 0.15):
        return sentence + " " + random.choice(selected_emoticons)
    return sentence

# Get baby speak interjections by personality
def get_interjections():
    interjections = {
        "baby": ["Goo goo ga ga!", "Ba ba!", "Gah!", "Agoo!", "Blblblbl!"],
        "toddler": ["Oopsie!", "Yay!", "Uh-oh!", "Wow-wee!", "Oh noes!"],
        "uwu": ["Uwu~", "Owo~", "Nyaa~", "Waaah~", "*giggles*", "*blushes*"]
    }
    return interjections.get(personality, interjections["baby"])

# Transform each word
def transform_word(word):
    # Skip empty strings
    if not word.strip():
        return word
        
    # Handle punctuation
    match = re.match(r'^(\W*)([\w\'-]*)(\W*)$', word)
    if match:
        prefix, core, suffix = match.groups()
    else:
        prefix, core, suffix = '', word, ''
        
    if not core:
        return word
        
    lw = core.lower()
    
    # Special case for contractions
    if "'" in core:
        return prefix + core + suffix
        
    # Dictionary replacement
    if lw in baby_dict:
        bw = baby_dict[lw]
    else:
        # Apply transformations
        bw = transform_letters(lw)
        bw = baby_endings(bw)
        bw = maybe_stutter(bw)
        
    # Preserve original capitalization
    if core.istitle():
        bw = bw.capitalize()
    elif core.isupper():
        bw = bw.upper()
        
    return prefix + bw + suffix

# Break into sentences
sentences = re.split(r'([.!?]+)', text)
result = []

i = 0
while i < len(sentences):
    s = sentences[i]
    
    # Skip empty sentences
    if not s.strip():
        i += 1
        continue
        
    # Process sentence
    words = s.split()
    baby_words = [transform_word(w) for w in words]
    processed = ' '.join(baby_words)
    
    # Add to result
    if processed:
        processed = add_emoticons(processed)
        result.append(processed)
    
    # Add punctuation if it exists
    if i + 1 < len(sentences) and sentences[i + 1].strip():
        result[-1] += sentences[i + 1]
        
        # Add baby interjections randomly based on cuteness level
        if sentences[i + 1].strip() in ['.', '!', '?'] and random.random() < (cuteness_level * 0.12):
            result.append(random.choice(get_interjections()))
    
    i += 2

output = ' '.join(result)
return output
Args:
    text: Input text to transform
    personality: "baby", "toddler", "uwu", or "custom"
    cuteness_level: 1-5, controls frequency of embellishments

Returns:
    Transformed baby talk text
"""
# Word replacements (significantly expanded)
baby_dict = {
    "hello": "hewwo",
    "hullo": "hewwo",
    "water": "wawa",
    "drink": "drinkie",
    "mother": "mama",
    "father": "dada",
    "dad": "dada",
    "mom": "mama",
    "boat": "boatie",
    "rabbit": "wabbit",
    "bunny": "bun-bun",
    "cat": "kitty",
    "kitten": "kitty",
    "dog": "doggy",
    "puppy": "pup-pup",
    "dear": "deawie",
    "wonderful": "wuvwy",
    "never": "neba",
    "before": "befowe",
    "mischief": "twouble",
    "accident": "oopsie",
    "said": "sayed",
    "sculls": "oarsies",
    "big": "biggie",
    "pie": "yummie pie",
    "time": "timie",
    "names": "namies",
    "very": "vewy",
    "love": "wuv",
    "food": "num-nums",
    "eat": "nom-nom",
    "sleep": "sweepy",
    "tired": "sweepy",
    "happy": "happies",
    "sad": "saddie",
    "angry": "angwy",
    "please": "pwease",
    "thank": "fank",
    "thanks": "fanks",
    "yes": "yesh",
    "no": "nuh-uh",
    "good": "gud",
    "bad": "bad-bad",
    "sorry": "sowwy",
    "little": "widdle",
    "small": "smol",
    "tiny": "teeny-weeny",
    "look": "wook",
    "see": "see-see",
    "beautiful": "pwetty",
    "pretty": "pwetty",
    "scary": "scawy",
    "frightening": "scawy",
    "friend": "fwen",
    "baby": "beebee",
    "child": "widdle one",
    "children": "widdle ones",
    "person": "hooman",
    "people": "hoomans",
    "something": "sumfin",
    "anything": "anyfing",
    "everything": "evwyfing",
    "nothing": "nuffin",
    "want": "wanna",
    "going to": "gunna",
    "going": "goin",
    "remember": "memba",
    "forget": "forgotted",
    "forgot": "forgotted"
}

# Word endings by personality
endings_by_personality = {
    "baby": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wy",
        "short": ""
    },
    "toddler": {
        "default": "y",
        "consonant": "y",
        "vowel": "ey",
        "short": ""
    },
    "uwu": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wie",
        "short": "u"
    },
    "custom": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wy",
        "short": ""
    }
}

# Get the correct endings for selected personality
endings = endings_by_personality.get(personality, endings_by_personality["baby"])

# Function to replace letter combos with baby-talk equivalents
def transform_letters(word):
    # Skip short words
    if len(word) <= 2:
        return word
        
    # Different letter transformations based on personality
    if personality == "baby":
        word = re.sub(r'(?<!^)[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'th', 'd', word, flags=re.IGNORECASE)
        word = re.sub(r'v', 'b', word, flags=re.IGNORECASE)
    elif personality == "toddler":
        word = re.sub(r'(?<!^)[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'th', 'd', word, flags=re.IGNORECASE)
    elif personality == "uwu":
        word = re.sub(r'[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'n([aeiou])', 'ny\\1', word, flags=re.IGNORECASE)
        word = re.sub(r's', 'sh', word, flags=re.IGNORECASE)
    
    return word

# Add endings to words
def baby_endings(word):
    if len(word) <= 3:
        return word
        
    # Words that shouldn't get endings
    if word.lower() in ["the", "and", "but", "for", "nor", "yet", "so", "at", "by", "to"]:
        return word
        
    if personality == "uwu" and random.random() < 0.3:
        return word + "-" + word  # UwU likes repetition
        
    # Different endings based on word pattern
    if word.endswith(("at", "og")):
        return word + "gie"
    elif word.endswith(("t", "d", "p")):
        return word + endings["consonant"]
    elif word.endswith(("n", "m")):
        return word + "nie"
    elif word.endswith(("a", "e", "i", "o", "u")):
        return word + endings["vowel"]
    
    # Random chance to add ending based on cuteness level
    if random.random() < (cuteness_level * 0.1):
        return word + endings["default"]
        
    return word

# Randomized stuttering based on cuteness level
def maybe_stutter(word):
    # Only stutter some initial consonants
    if len(word) > 2 and word[0].lower() in 'bcdfghjklmnpqrstvwxyz' and random.random() < (cuteness_level * 0.05):
        return word[0] + "-" + word
    return word

# Add emoticons based on personality and cuteness
def add_emoticons(sentence):
    emoticons = {
        "baby": ["(✿◠‿◠)", "ʕ•ᴥ•ʔ", "(。・ω・。)", "◕‿◕", "(。◕‿◕。)"],
        "toddler": ["(◠‿◠)", "ʕ•ᴥ•ʔ", "(•‿•)"],
        "uwu": ["uwu", "owo", ">w<", "^w^", ":3", "nyaa~", "ʕ•ᴥ•ʔ", "(・ω・)"]
    }
    
    selected_emoticons = emoticons.get(personality, emoticons["baby"])
    
    if random.random() < (cuteness_level * 0.15):
        return sentence + " " + random.choice(selected_emoticons)
    return sentence

# Get baby speak interjections by personality
def get_interjections():
    interjections = {
        "baby": ["Goo goo ga ga!", "Ba ba!", "Gah!", "Agoo!", "Blblblbl!"],
        "toddler": ["Oopsie!", "Yay!", "Uh-oh!", "Wow-wee!", "Oh noes!"],
        "uwu": ["Uwu~", "Owo~", "Nyaa~", "Waaah~", "*giggles*", "*blushes*"]
    }
    return interjections.get(personality, interjections["baby"])

# Transform each word
def transform_word(word):
    # Skip empty strings
    if not word.strip():
        return word
        
    # Handle punctuation
    match = re.match(r'^(\W*)([\w\'-]*)(\W*)$', word)
    if match:
        prefix, core, suffix = match.groups()
    else:
        prefix, core, suffix = '', word, ''
        
    if not core:
        return word
        
    lw = core.lower()
    
    # Special case for contractions
    if "'" in core:
        return prefix + core + suffix
        
    # Dictionary replacement
    if lw in baby_dict:
        bw = baby_dict[lw]
    else:
        # Apply transformations
        bw = transform_letters(lw)
        bw = baby_endings(bw)
        bw = maybe_stutter(bw)
        
    # Preserve original capitalization
    if core.istitle():
        bw = bw.capitalize()
    elif core.isupper():
        bw = bw.upper()
        
    return prefix + bw + suffix

# Break into sentences
sentences = re.split(r'([.!?]+)', text)
result = []

i = 0
while i < len(sentences):
    s = sentences[i]
    
    # Skip empty sentences
    if not s.strip():
        i += 1
        continue
        
    # Process sentence
    words = s.split()
    baby_words = [transform_word(w) for w in words]
    processed = ' '.join(baby_words)
    
    # Add to result
    if processed:
        processed = add_emoticons(processed)
        result.append(processed)
    
    # Add punctuation if it exists
    if i + 1 < len(sentences) and sentences[i + 1].strip():
        result[-1] += sentences[i + 1]
        
        # Add baby interjections randomly based on cuteness level
        if sentences[i + 1].strip() in ['.', '!', '?'] and random.random() < (cuteness_level * 0.12):
            result.append(random.choice(get_interjections()))
    
    i += 2

output = ' '.join(result)
return output
Args:
    text: Input text to transform
    personality: "baby", "toddler", "uwu", or "custom"
    cuteness_level: 1-5, controls frequency of embellishments

Returns:
    Transformed baby talk text
"""
# Word replacements
baby_dict = {
    "hello": "hewwo",
    "hullo": "hewwo",
    "water": "wawa",
    "drink": "drinkie",
    "mother": "mama",
    "father": "dada",
    "dad": "dada",
    "mom": "mama",
    "boat": "boatie",
    "rabbit": "wabbit",
    "bunny": "bun-bun",
    "cat": "kitty",
    "kitten": "kitty",
    "dog": "doggy",
    "puppy": "pup-pup",
    "dear": "deawie",
    "wonderful": "wuvwy",
    "never": "neba",
    "before": "befowe",
    "mischief": "twouble",
    "accident": "oopsie",
    "said": "sayed",
    "sculls": "oarsies",
    "big": "biggie",
    "pie": "yummie pie",
    "time": "timie",
    "names": "namies",
    "very": "vewy",
    "love": "wuv",
    "food": "num-nums",
    "eat": "nom-nom",
    "sleep": "sweepy",
    "tired": "sweepy",
    "happy": "happies",
    "sad": "saddie",
    "angry": "angwy",
    "please": "pwease",
    "thank": "fank",
    "thanks": "fanks",
    "yes": "yesh",
    "no": "nuh-uh",
    "good": "gud",
    "bad": "bad-bad",
    "sorry": "sowwy",
    "little": "widdle",
    "small": "smol",
    "tiny": "teeny-weeny",
    "look": "wook",
    "see": "see-see",
    "beautiful": "pwetty",
    "pretty": "pwetty",
    "scary": "scawy",
    "frightening": "scawy",
    "friend": "fwen",
    "baby": "beebee",
    "child": "widdle one",
    "children": "widdle ones",
    "person": "hooman",
    "people": "hoomans",
    "something": "sumfin",
    "anything": "anyfing",
    "everything": "evwyfing",
    "nothing": "nuffin",
    "want": "wanna",
    "going to": "gunna",
    "going": "goin",
    "remember": "memba",
    "forget": "forgotted",
    "forgot": "forgotted"
}

# Word endings by personality
endings_by_personality = {
    "baby": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wy",
        "short": ""
    },
    "toddler": {
        "default": "y",
        "consonant": "y",
        "vowel": "ey",
        "short": ""
    },
    "uwu": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wie",
        "short": "u"
    },
    "custom": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wy",
        "short": ""
    }
}

# Get the correct endings for selected personality
endings = endings_by_personality.get(personality, endings_by_personality["baby"])

# Function to replace letter combos with baby-talk equivalents
def transform_letters(word):
    # Skip short words
    if len(word) <= 2:
        return word
        
    # Different letter transformations based on personality
    if personality == "baby":
        word = re.sub(r'(?<!^)[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'th', 'd', word, flags=re.IGNORECASE)
        word = re.sub(r'v', 'b', word, flags=re.IGNORECASE)
    elif personality == "toddler":
        word = re.sub(r'(?<!^)[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'th', 'd', word, flags=re.IGNORECASE)
    elif personality == "uwu":
        word = re.sub(r'[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'n([aeiou])', 'ny\\1', word, flags=re.IGNORECASE)
        word = re.sub(r's', 'sh', word, flags=re.IGNORECASE)
    
    return word

# Add endings to words
def baby_endings(word):
    if len(word) <= 3:
        return word
        
    # Words that shouldn't get endings
    if word.lower() in ["the", "and", "but", "for", "nor", "yet", "so", "at", "by", "to"]:
        return word
        
    if personality == "uwu" and random.random() < 0.3:
        return word + "-" + word  # UwU likes repetition
        
    # Different endings based on word pattern
    if word.endswith(("at", "og")):
        return word + "gie"
    elif word.endswith(("t", "d", "p")):
        return word + endings["consonant"]
    elif word.endswith(("n", "m")):
        return word + "nie"
    elif word.endswith(("a", "e", "i", "o", "u")):
        return word + endings["vowel"]
    
    # Random chance to add ending based on cuteness level
    if random.random() < (cuteness_level * 0.1):
        return word + endings["default"]
        
    return word

# Randomized stuttering based on cuteness level
def maybe_stutter(word):
    # Only stutter some initial consonants
    if len(word) > 2 and word[0].lower() in 'bcdfghjklmnpqrstvwxyz' and random.random() < (cuteness_level * 0.05):
        return word[0] + "-" + word
    return word

# Add emoticons based on personality and cuteness
def add_emoticons(sentence):
    emoticons = {
        "baby": ["(✿◠‿◠)", "ʕ•ᴥ•ʔ", "(。・ω・。)", "◕‿◕", "(。◕‿◕。)"],
        "toddler": ["(◠‿◠)", "ʕ•ᴥ•ʔ", "(•‿•)"],
        "uwu": ["uwu", "owo", ">w<", "^w^", ":3", "nyaa~", "ʕ•ᴥ•ʔ", "(・ω・)"]
    }
    
    selected_emoticons = emoticons.get(personality, emoticons["baby"])
    
    if random.random() < (cuteness_level * 0.15):
        return sentence + " " + random.choice(selected_emoticons)
    return sentence

# Get baby speak interjections by personality
def get_interjections():
    interjections = {
        "baby": ["Goo goo ga ga!", "Ba ba!", "Gah!", "Agoo!", "Blblblbl!"],
        "toddler": ["Oopsie!", "Yay!", "Uh-oh!", "Wow-wee!", "Oh noes!"],
        "uwu": ["Uwu~", "Owo~", "Nyaa~", "Waaah~", "*giggles*", "*blushes*"]
    }
    return interjections.get(personality, interjections["baby"])

# Transform each word
def transform_word(word):
    # Skip empty strings
    if not word.strip():
        return word
        
    # Handle punctuation
    match = re.match(r'^(\W*)([\w\'-]*)(\W*)$', word)
    if match:
        prefix, core, suffix = match.groups()
    else:
        prefix, core, suffix = '', word, ''
        
    if not core:
        return word
        
    lw = core.lower()
    
    # Special case for contractions
    if "'" in core:
        return prefix + core + suffix
        
    # Dictionary replacement
    if lw in baby_dict:
        bw = baby_dict[lw]
    else:
        # Apply transformations
        bw = transform_letters(lw)
        bw = baby_endings(bw)
        bw = maybe_stutter(bw)
        
    # Preserve original capitalization
    if core.istitle():
        bw = bw.capitalize()
    elif core.isupper():
        bw = bw.upper()
        
    return prefix + bw + suffix

# Break into sentences
sentences = re.split(r'([.!?]+)', text)
result = []

i = 0
while i < len(sentences):
    s = sentences[i]
    
    # Skip empty sentences
    if not s.strip():
        i += 1
        continue
        
    # Process sentence
    words = s.split()
    baby_words = [transform_word(w) for w in words]
    processed = ' '.join(baby_words)
    
    # Add to result
    if processed:
        processed = add_emoticons(processed)
        result.append(processed)
    
    # Add punctuation if it exists
    if i + 1 < len(sentences) and sentences[i + 1].strip():
        result[-1] += sentences[i + 1]
        
        # Add baby interjections randomly based on cuteness level
        if sentences[i + 1].strip() in ['.', '!', '?'] and random.random() < (cuteness_level * 0.12):
            result.append(random.choice(get_interjections()))
    
    i += 2

output = ' '.join(result)
return output
Source Link

import re import random

def baby_talk(text, personality="baby", cuteness_level=3): """ Transform text into baby talk with different personalities and customization.

Args:
    text: Input text to transform
    personality: "baby", "toddler", "uwu", or "custom"
    cuteness_level: 1-5, controls frequency of embellishments

Returns:
    Transformed baby talk text
"""
# Word replacements (significantly expanded)
baby_dict = {
    "hello": "hewwo",
    "hullo": "hewwo",
    "water": "wawa",
    "drink": "drinkie",
    "mother": "mama",
    "father": "dada",
    "dad": "dada",
    "mom": "mama",
    "boat": "boatie",
    "rabbit": "wabbit",
    "bunny": "bun-bun",
    "cat": "kitty",
    "kitten": "kitty",
    "dog": "doggy",
    "puppy": "pup-pup",
    "dear": "deawie",
    "wonderful": "wuvwy",
    "never": "neba",
    "before": "befowe",
    "mischief": "twouble",
    "accident": "oopsie",
    "said": "sayed",
    "sculls": "oarsies",
    "big": "biggie",
    "pie": "yummie pie",
    "time": "timie",
    "names": "namies",
    "very": "vewy",
    "love": "wuv",
    "food": "num-nums",
    "eat": "nom-nom",
    "sleep": "sweepy",
    "tired": "sweepy",
    "happy": "happies",
    "sad": "saddie",
    "angry": "angwy",
    "please": "pwease",
    "thank": "fank",
    "thanks": "fanks",
    "yes": "yesh",
    "no": "nuh-uh",
    "good": "gud",
    "bad": "bad-bad",
    "sorry": "sowwy",
    "little": "widdle",
    "small": "smol",
    "tiny": "teeny-weeny",
    "look": "wook",
    "see": "see-see",
    "beautiful": "pwetty",
    "pretty": "pwetty",
    "scary": "scawy",
    "frightening": "scawy",
    "friend": "fwen",
    "baby": "beebee",
    "child": "widdle one",
    "children": "widdle ones",
    "person": "hooman",
    "people": "hoomans",
    "something": "sumfin",
    "anything": "anyfing",
    "everything": "evwyfing",
    "nothing": "nuffin",
    "want": "wanna",
    "going to": "gunna",
    "going": "goin",
    "remember": "memba",
    "forget": "forgotted",
    "forgot": "forgotted"
}

# Word endings by personality
endings_by_personality = {
    "baby": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wy",
        "short": ""
    },
    "toddler": {
        "default": "y",
        "consonant": "y",
        "vowel": "ey",
        "short": ""
    },
    "uwu": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wie",
        "short": "u"
    },
    "custom": {
        "default": "ie",
        "consonant": "ie",
        "vowel": "wy",
        "short": ""
    }
}

# Get the correct endings for selected personality
endings = endings_by_personality.get(personality, endings_by_personality["baby"])

# Function to replace letter combos with baby-talk equivalents
def transform_letters(word):
    # Skip short words
    if len(word) <= 2:
        return word
        
    # Different letter transformations based on personality
    if personality == "baby":
        word = re.sub(r'(?<!^)[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'th', 'd', word, flags=re.IGNORECASE)
        word = re.sub(r'v', 'b', word, flags=re.IGNORECASE)
    elif personality == "toddler":
        word = re.sub(r'(?<!^)[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'th', 'd', word, flags=re.IGNORECASE)
    elif personality == "uwu":
        word = re.sub(r'[rl]', 'w', word, flags=re.IGNORECASE)
        word = re.sub(r'n([aeiou])', 'ny\\1', word, flags=re.IGNORECASE)
        word = re.sub(r's', 'sh', word, flags=re.IGNORECASE)
    
    return word

# Add endings to words
def baby_endings(word):
    if len(word) <= 3:
        return word
        
    # Words that shouldn't get endings
    if word.lower() in ["the", "and", "but", "for", "nor", "yet", "so", "at", "by", "to"]:
        return word
        
    if personality == "uwu" and random.random() < 0.3:
        return word + "-" + word  # UwU likes repetition
        
    # Different endings based on word pattern
    if word.endswith(("at", "og")):
        return word + "gie"
    elif word.endswith(("t", "d", "p")):
        return word + endings["consonant"]
    elif word.endswith(("n", "m")):
        return word + "nie"
    elif word.endswith(("a", "e", "i", "o", "u")):
        return word + endings["vowel"]
    
    # Random chance to add ending based on cuteness level
    if random.random() < (cuteness_level * 0.1):
        return word + endings["default"]
        
    return word

# Randomized stuttering based on cuteness level
def maybe_stutter(word):
    # Only stutter some initial consonants
    if len(word) > 2 and word[0].lower() in 'bcdfghjklmnpqrstvwxyz' and random.random() < (cuteness_level * 0.05):
        return word[0] + "-" + word
    return word

# Add emoticons based on personality and cuteness
def add_emoticons(sentence):
    emoticons = {
        "baby": ["(✿◠‿◠)", "ʕ•ᴥ•ʔ", "(。・ω・。)", "◕‿◕", "(。◕‿◕。)"],
        "toddler": ["(◠‿◠)", "ʕ•ᴥ•ʔ", "(•‿•)"],
        "uwu": ["uwu", "owo", ">w<", "^w^", ":3", "nyaa~", "ʕ•ᴥ•ʔ", "(・ω・)"]
    }
    
    selected_emoticons = emoticons.get(personality, emoticons["baby"])
    
    if random.random() < (cuteness_level * 0.15):
        return sentence + " " + random.choice(selected_emoticons)
    return sentence

# Get baby speak interjections by personality
def get_interjections():
    interjections = {
        "baby": ["Goo goo ga ga!", "Ba ba!", "Gah!", "Agoo!", "Blblblbl!"],
        "toddler": ["Oopsie!", "Yay!", "Uh-oh!", "Wow-wee!", "Oh noes!"],
        "uwu": ["Uwu~", "Owo~", "Nyaa~", "Waaah~", "*giggles*", "*blushes*"]
    }
    return interjections.get(personality, interjections["baby"])

# Transform each word
def transform_word(word):
    # Skip empty strings
    if not word.strip():
        return word
        
    # Handle punctuation
    match = re.match(r'^(\W*)([\w\'-]*)(\W*)$', word)
    if match:
        prefix, core, suffix = match.groups()
    else:
        prefix, core, suffix = '', word, ''
        
    if not core:
        return word
        
    lw = core.lower()
    
    # Special case for contractions
    if "'" in core:
        return prefix + core + suffix
        
    # Dictionary replacement
    if lw in baby_dict:
        bw = baby_dict[lw]
    else:
        # Apply transformations
        bw = transform_letters(lw)
        bw = baby_endings(bw)
        bw = maybe_stutter(bw)
        
    # Preserve original capitalization
    if core.istitle():
        bw = bw.capitalize()
    elif core.isupper():
        bw = bw.upper()
        
    return prefix + bw + suffix

# Break into sentences
sentences = re.split(r'([.!?]+)', text)
result = []

i = 0
while i < len(sentences):
    s = sentences[i]
    
    # Skip empty sentences
    if not s.strip():
        i += 1
        continue
        
    # Process sentence
    words = s.split()
    baby_words = [transform_word(w) for w in words]
    processed = ' '.join(baby_words)
    
    # Add to result
    if processed:
        processed = add_emoticons(processed)
        result.append(processed)
    
    # Add punctuation if it exists
    if i + 1 < len(sentences) and sentences[i + 1].strip():
        result[-1] += sentences[i + 1]
        
        # Add baby interjections randomly based on cuteness level
        if sentences[i + 1].strip() in ['.', '!', '?'] and random.random() < (cuteness_level * 0.12):
            result.append(random.choice(get_interjections()))
    
    i += 2

output = ' '.join(result)
return output

Sample Text 1

sample1 = """Then the two animals stood and regarded each other cautiously.

"Hullo, Mole!" said the Water Rat.

"Hullo, Rat!" said the Mole.

"Would you like to come over?" enquired the Rat presently.

"Oh, it's all very well to talk," said the Mole rather pettishly, he being new to a river and riverside life and its ways.

[...]

"This has been a wonderful day!" said he, as the Rat shoved off and took to the sculls again. "Do you know, I've never been in a boat before in all my life." """

Sample Text 2

sample2 = """Once upon a time there were four little Rabbits, and their names were—

Flopsy,

Mopsy,

Cotton-tail,

and Peter.

They lived with their Mother in a sand-bank, underneath the root of a very big fir-tree.

'Now my dears,' said old Mrs. Rabbit one morning, 'you may go into the fields or down the lane, but don't go into Mr. McGregor's garden: your Father had an accident there; he was put in a pie by Mrs. McGregor.'

'Now run along, and don't get into mischief. I am going out.' """

Show examples with different personalities and cuteness levels

print("Sample 1 - Standard Baby Talk:\n") print(baby_talk(sample1))

print("\nSample 2 - Toddler Style (Cuteness Level 2):\n") print(baby_talk(sample2, personality="toddler", cuteness_level=2))

print("\nSample 1 - UwU Style (Cuteness Level 5):\n") print(baby_talk(sample1, personality="uwu", cuteness_level=5))

Interactive demo for competitions

if name == "main": print("\n*** BabyTalk 2.0 - Advanced Text Cutifier ***") print("Convert any text to adorable baby talk with different styles!\n")

try:
    while True:
        choice = input("\nChoose an option:\n1. Enter custom text\n2. Choose from sample texts\n3. Quit\nChoice: ")
        
        if choice == "3":
            break
            
        text_to_convert = ""
        if choice == "1":
            print("\nEnter your text (press Enter twice when finished):")
            lines = []
            while True:
                line = input()
                if not line and lines:
                    break
                lines.append(line)
            text_to_convert = "\n".join(lines)
        elif choice == "2":
            sample_choice = input("\nChoose sample:\n1. Wind in the Willows\n2. Peter Rabbit\nChoice: ")
            text_to_convert = sample1 if sample_choice == "1" else sample2
        else:
            print("Invalid choice. Please try again.")
            continue
            
        personality = input("\nChoose personality:\n1. Baby (default)\n2. Toddler\n3. UwU\nChoice: ")
        personality_map = {"1": "baby", "2": "toddler", "3": "uwu"}
        selected_personality = personality_map.get(personality, "baby")
        
        cuteness = input("\nCuteness level (1-5, default 3): ")
        try:
            cuteness_level = min(5, max(1, int(cuteness)))
        except:
            cuteness_level = 3
            
        result = baby_talk(text_to_convert, personality=selected_personality, cuteness_level=cuteness_level)
        print("\n--- CONVERTED TEXT ---\n")
        print(result)
        print("\n---------------------")
except KeyboardInterrupt:
    print("\nThank you for using BabyTalk 2.0!")