Yura uwuifier specification describes an algorithm used to convert the text to its "uwuified" form, considering edge cases and keeping the text readable.
This specification follows RFC 2119.
EMOJIS is a list of UTF-8 encoded strings. It MUST contain these strings: <3
, :3
, UwU
, OwO
, ^^
, >w<
, >~<
, >.<
, >w<
, ^w^
, (◕ᴥ◕)
, ʕ•ᴥ•ʔ
, ʕ→ᴥ←ʔ
, (*^ω^)
, (◕‿◕✿)
, (*^.^*)
, (つ✧ω✧)つ
, (/ =ω=)/
. EMOJIS must not match any of the replacement rules. Implementations MAY amend the list.
PHRASES is a list of strings. It MUST contain these strings: *snuzzwes*
, *nuzzwes youw chest*
, *wicks uw neck*
, *paws*
, *puwws*
, *meows*
, *snugs cwosew*
, *pounces on u*
. The phrases must not match any of the replacement rules.Implementations MAY amend the list.
ENDOFSTRING is the end of the input string.
The uwuifier SHOULD produce the same output on the same input.
Uwuification is split into four parts:
- Replace all "r" and "l" with "w"
- Apply simple replacements
- Apply complex replacements
- Apply punctuation replacements
Each part MUST be executed in order. All uwuification rules MUST be aplied. Implementations MAY amend the list of rules.
Each replacement in each of the parts MAY be applied in order. Replacements MUST NOT have any "r" or "l" in either the input or the output.
Each simple replacement is defined in this format:
"x" -> "y"
which means
Replace all occurences of "x" with "y".
Below are the simple replacements.
- "wove" -> "wuv"
- "nice" -> "nyaice"
- "what" -> "wut"
- "you" -> "u"
- "the" -> "da"
- "hewwo" -> "hewo"
- "cat" -> "neko"
- "kitty" -> "neko"
- "cute" -> "kawaii"
- "hi" -> "hii"
Each complex replacement is defined in this format:
(LOOKBACKS) "MATCH" (LOOKFORWARDS)
LOOKBACKS is a list of strings that should be before the match for it to be satisfied.
LOOKFORWARDS is the same but the strings should be after the match.
If a lookaround is preceeded with "!", it means that it is negative.
Example:
("a" or !"b") "c" ("d" or !"e") -> "x"
which means
Replace all occurences of "c" that are preceeded by "a" but not "b" and are followed by "d", but not "e"; with "a".
Below are the complex replacements.
- "aww" ("w" or " " or "\n" or ENDOFSTRING) -> "uwu"
- "awe" ("some") -> "uwu"
- "n" ("a" or "e" or "i" or "o" or "u") -> "ny"
- ("o") "wo" (!"w") -> "owo"
Below are the punctuation replacements.
- If a sequence of periods ends with " " or "\n", put a random sample from EMOJI or PHRASE depending on the rng result before it.
- If a comma is followed by " " or "\n" or ENDOFSTRING, put a random sample from PHRASE before it.
- Double all exclamation marks.
- Replace each question mark with either "!?" or "?!", depending on the rng result.