Skip to content

deadshot465/OwoifySwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

owoifySwift

Turning your worst nightmare into a Swift package.

Swift

This is a Swift port of mohan-cao's owoify-js, which will help you turn any string into nonsensical babyspeak similar to LeafySweet's infamous Chrome extension.

Just like my other Owoify ports, three levels of owoness are available:

  1. owo (default): The most vanilla one.
  2. uwu: The moderate one.
  3. uvu: Litewawwy unweadabwal.

Please refer to the original owoify-js repository for more information.

Seriously, if you have seen my other ports, you probably have already known the details.

Reason for development

Because it doesn't seem that Swift has any owoify package. And since I have already ported it to several languages, I might as well just keep porting it.

Install instructions

Put this in your Package.swift:

dependencies: [
    .package(url: "https://github.com/deadshot465/owoifySwift", from: "1.0.0")
]

Alternatively, you can read the article here to learn how to add dependencies to your Swift application using Xcode.

Usage

owoifySwift is implemented as a single function. That means you don't need to create an instance of any class; instead, just call the method owoify and pass the string you want to owoify and optionally provide a level of owoness.

import OwoifySwift

func main() {
    print(owoify(source: "This is the string to owo! Kinda cute, isn't it?"))
    print(owoify(source: "This is the string to owo! Kinda cute, isn't it?", level: OwoifyLevel.Uvu))
}

// Output:
// This is teh stwing two owo! Kinda cute, isn't it?
// fwis is teh stwing two owo(。♥‿♥。) Kinda cute(*^ω^) isn't it?

Disclaimer

As usual, I'm writing this package for both practicing and bots' needs. Performance is NOT guaranteed.

That being said, all regular expressions are declared beforehand rather than being declared inside a function. That should be able to avoid the performance cost of building regular expressions every time the method is called.

See also

  • owoify-js - The original owoify-js repository.
  • Owoify.Net - The C# port of Owoify written by me.
  • Owoify++ - The C++ header-only port of Owoify written by me.
  • owoify_rs - The Rust port of Owoify written by me.
  • owoify-py - The Python port of Owoify written by me.
  • owoify_dart - The Dart port of Owoify written by me.
  • owoify_rb - The Ruby port of Owoify written by me.
  • owoify-go - The Go port of Owoify written by me.
  • owoifyKt - The Kotlin port of Owoify written by me.

About

Turning your worst nightmare into a Swift package. https://codepen.io/newbeetf2/pen/yLLaNPZ

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages