Compare commits
No commits in common. "main" and "latest" have entirely different histories.
19
.SRCINFO
19
.SRCINFO
@ -1,19 +0,0 @@
|
|||||||
pkgbase = term-owo-git
|
|
||||||
pkgdesc = A simple C++ program that owofies text
|
|
||||||
pkgver = 1.0
|
|
||||||
pkgrel = 1
|
|
||||||
url = https://git.alfieking.dev/acetheking987/term-owo-cpp
|
|
||||||
arch = x86_64
|
|
||||||
arch = i686
|
|
||||||
arch = arm
|
|
||||||
arch = armv6h
|
|
||||||
arch = armv7h
|
|
||||||
arch = aarch64
|
|
||||||
license = MIT
|
|
||||||
makedepends = cmake
|
|
||||||
makedepends = git
|
|
||||||
makedepends = gcc
|
|
||||||
source = git+https://git.alfieking.dev/acetheking987/term-owo-cpp.git
|
|
||||||
md5sums = SKIP
|
|
||||||
|
|
||||||
pkgname = term-owo-git
|
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -32,4 +32,4 @@
|
|||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
build/
|
builds/
|
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"files.associations": {
|
|
||||||
"*.pyw": "python",
|
|
||||||
"string": "cpp",
|
|
||||||
"ostream": "cpp"
|
|
||||||
}
|
|
||||||
}
|
|
28
.vscode/tasks.json
vendored
Normal file
28
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "cppbuild",
|
||||||
|
"label": "C/C++: g++ build active file",
|
||||||
|
"command": "/usr/bin/g++",
|
||||||
|
"args": [
|
||||||
|
"-fdiagnostics-color=always",
|
||||||
|
"-g",
|
||||||
|
"${file}",
|
||||||
|
"-o",
|
||||||
|
"${fileDirname}/${fileBasenameNoExtension}"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cwd": "${fileDirname}"
|
||||||
|
},
|
||||||
|
"problemMatcher": [
|
||||||
|
"$gcc"
|
||||||
|
],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"detail": "Task generated by Debugger."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": "2.0.0"
|
||||||
|
}
|
@ -1,7 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
|
||||||
find_program(CMAKE_C_COMPILER NAMES $ENV{CC} gcc PATHS ENV PATH NO_DEFAULT_PATH)
|
|
||||||
find_program(CMAKE_CXX_COMPILER NAMES $ENV{CXX} g++ PATHS ENV PATH NO_DEFAULT_PATH)
|
|
||||||
project(owo)
|
|
||||||
add_executable(owo src/main.cpp)
|
|
||||||
target_link_libraries(owo)
|
|
||||||
|
|
21
PKGBUILD
21
PKGBUILD
@ -1,22 +1,21 @@
|
|||||||
pkgname="term-owo-git"
|
pkgname="term-owo-cpp"
|
||||||
pkgver=1.0
|
pkgver=1.0.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="A simple C++ program that owofies text"
|
pkgdesc="A simple C++ program that owofies text"
|
||||||
url="https://git.alfieking.dev/acetheking987/term-owo-cpp"
|
|
||||||
arch=(x86_64 i686 arm armv6h armv7h aarch64)
|
arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h' 'aarch64')
|
||||||
makedepends=(cmake git gcc)
|
depends=('gcc' 'git')
|
||||||
license=('MIT')
|
license=('MIT')
|
||||||
|
|
||||||
source=("git+https://git.alfieking.dev/acetheking987/term-owo-cpp.git")
|
source=("git+https://git.alfieking.dev/acetheking987/term-owo-cpp.git")
|
||||||
md5sums=('SKIP')
|
md5sums=('SKIP')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "$srcdir/term-owo-cpp"
|
cd "$srcdir/term-owo-cpp"
|
||||||
cmake . -B build
|
g++ -o owo owo.cpp
|
||||||
cd build && make
|
}
|
||||||
}
|
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "$srcdir/term-owo-cpp/build"
|
cd "$srcdir/term-owo-cpp"
|
||||||
install -Dm755 owo "$pkgdir/usr/bin/owo"
|
install -Dm755 owo "$pkgdir/usr/bin/owo"
|
||||||
}
|
}
|
@ -28,12 +28,9 @@ $ ./owo -o output.txt "Hello, world!"
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
to build the program, run the following command:
|
to build the program, run the following command (note that you need g++ installed):
|
||||||
```bash
|
```bash
|
||||||
$ cmake . -B build
|
$ g++ -o owo owo.cpp
|
||||||
$ cd build && make
|
|
||||||
$ ./owo "Hello, world!"
|
|
||||||
hewwo, wowld!
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <random>
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
string replacements[6][2] = {
|
string replacements[6][2] = {
|
||||||
@ -14,76 +13,11 @@ string replacements[6][2] = {
|
|||||||
{"ove", "uv"}
|
{"ove", "uv"}
|
||||||
};
|
};
|
||||||
|
|
||||||
string random_ending_replacents[11] = {
|
string owo(string input) {
|
||||||
"uwu",
|
|
||||||
"owo",
|
|
||||||
"OwO",
|
|
||||||
"UwU",
|
|
||||||
"uwu",
|
|
||||||
"OwO",
|
|
||||||
">w<",
|
|
||||||
"Owo",
|
|
||||||
"X3",
|
|
||||||
":3",
|
|
||||||
">:3",
|
|
||||||
};
|
|
||||||
|
|
||||||
string full_word_replacents[20][2] = {
|
|
||||||
{"hello", "h-hello there"},
|
|
||||||
{"goodbye", "bai"},
|
|
||||||
{"bye", "bai"},
|
|
||||||
{"please", "p-pwease"},
|
|
||||||
{"thanks", "t-thank u"},
|
|
||||||
{"thank you", "t-thank u"},
|
|
||||||
{"you", "u"},
|
|
||||||
{"your", "ur"},
|
|
||||||
{"you're", "ur"},
|
|
||||||
{"you are", "ur"},
|
|
||||||
{"are", "r"},
|
|
||||||
{"the", "da"},
|
|
||||||
{"this", "dis"},
|
|
||||||
{"that", "dat"},
|
|
||||||
{"there", "dere"},
|
|
||||||
{"they", "dey"},
|
|
||||||
{"their", "dere"},
|
|
||||||
{"them", "dem"},
|
|
||||||
{"those", "dose"},
|
|
||||||
{"these", "deez"},
|
|
||||||
};
|
|
||||||
|
|
||||||
string random_ending(string input) {
|
|
||||||
string output = input;
|
string output = input;
|
||||||
for (int i = 0; i < output.length(); i++) {
|
|
||||||
if (output[i] == '.' || output[i] == '!' || output[i] == '?') {
|
|
||||||
output.insert(i, " " + random_ending_replacents[rand() % 11]);
|
|
||||||
i += random_ending_replacents[rand() % 11].length() + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (output[output.length()-1] != '.' && output[output.length()-1] != '!' && output[output.length()-1] != '?') {
|
|
||||||
output += " " + random_ending_replacents[rand() % 11];
|
|
||||||
}
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
string full_word(string input) {
|
|
||||||
string output = input;
|
|
||||||
for (int i = 0; i < 20; i++) {
|
|
||||||
output = regex_replace(output, regex(full_word_replacents[i][0]), full_word_replacents[i][1]);
|
|
||||||
}
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
string owo(string input, bool no_full_word = false, bool no_random_ending = false) {
|
|
||||||
string output = input;
|
|
||||||
if (!no_full_word){
|
|
||||||
output = full_word(output);
|
|
||||||
}
|
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
output = regex_replace(output, regex(replacements[i][0]), replacements[i][1]);
|
output = regex_replace(output, regex(replacements[i][0]), replacements[i][1]);
|
||||||
}
|
}
|
||||||
if (!no_random_ending) {
|
|
||||||
output = random_ending(output);
|
|
||||||
}
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,18 +29,12 @@ int help() {
|
|||||||
cout << "Options:" << endl;
|
cout << "Options:" << endl;
|
||||||
cout << " -p Read from stdin" << endl;
|
cout << " -p Read from stdin" << endl;
|
||||||
cout << " -h Show this help message" << endl;
|
cout << " -h Show this help message" << endl;
|
||||||
cout << " -f Read from file" << endl;
|
|
||||||
cout << " -o Write to file" << endl;
|
|
||||||
cout << " -ne Stops extra stuff from being added to the end of sentences" << endl;
|
|
||||||
cout << " -nf Stops full word replacements" << endl;
|
|
||||||
cout << " text Text to convert" << endl;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
srand(time(nullptr));
|
|
||||||
string input, inputfile, outputfile;
|
string input, inputfile, outputfile;
|
||||||
bool _stdin = false, clipboard = false, no_full_word = false, no_random_ending = false;
|
bool _stdin = false;
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
cout << owo("No text provided") << endl << endl;
|
cout << owo("No text provided") << endl << endl;
|
||||||
@ -127,10 +55,6 @@ int main(int argc, char *argv[]) {
|
|||||||
return help();
|
return help();
|
||||||
} else if (i == argc-1) {
|
} else if (i == argc-1) {
|
||||||
input = string(argv[i]);
|
input = string(argv[i]);
|
||||||
} else if (string(argv[i]) == "-ne") {
|
|
||||||
no_random_ending = true;
|
|
||||||
} else if (string(argv[i]) == "-nf") {
|
|
||||||
no_full_word = true;
|
|
||||||
} else {
|
} else {
|
||||||
cout << owo("Invalid argument: " + string(argv[i])) << endl << endl;
|
cout << owo("Invalid argument: " + string(argv[i])) << endl << endl;
|
||||||
help();
|
help();
|
||||||
@ -157,9 +81,9 @@ int main(int argc, char *argv[]) {
|
|||||||
if (_stdin) {
|
if (_stdin) {
|
||||||
while (getline(cin, input)) {
|
while (getline(cin, input)) {
|
||||||
if (outputfile != "") {
|
if (outputfile != "") {
|
||||||
*output << owo(input, no_full_word, no_random_ending) << endl;
|
*output << owo(input) << endl;
|
||||||
} else {
|
} else {
|
||||||
cout << owo(input, no_full_word, no_random_ending) << endl;
|
cout << owo(input) << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,18 +99,18 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
while (getline(inputstream, input)) {
|
while (getline(inputstream, input)) {
|
||||||
if (outputfile != "") {
|
if (outputfile != "") {
|
||||||
*output << owo(input, no_full_word, no_random_ending) << endl;
|
*output << owo(input) << endl;
|
||||||
} else {
|
} else {
|
||||||
cout << owo(input, no_full_word, no_random_ending) << endl;
|
cout << owo(input) << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inputstream.close();
|
inputstream.close();
|
||||||
|
|
||||||
} else if (input != "") {
|
} else if (input != "") {
|
||||||
if (outputfile != "") {
|
if (outputfile != "") {
|
||||||
*output << owo(input, no_full_word, no_random_ending) << endl;
|
*output << owo(input) << endl;
|
||||||
} else {
|
} else {
|
||||||
cout << owo(input, no_full_word, no_random_ending) << endl;
|
cout << owo(input) << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,5 +118,6 @@ int main(int argc, char *argv[]) {
|
|||||||
((ofstream*)output)->close();
|
((ofstream*)output)->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user