add script

This commit is contained in:
konomo 2021-10-18 12:22:31 +00:00
parent b21310ef89
commit c0caf24582
3 changed files with 57 additions and 2 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) <year> <copyright holders>
Copyright (c) 2021 konomo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@ -1,3 +1,12 @@
# gem-pd
gem-pd is a Pronoun Dressing Room program for gemini in bash
gem-pd is a Pronoun Dressing Room program for gemini in bash
made after seeing [https://asteine8.github.io/projects/pronoun-dressing-room/dressing-room/index.html](https://asteine8.github.io/projects/pronoun-dressing-room/dressing-room/index.html) in the web
## Setup
copy it into your gemini directory and make it executable of course
## Changelog
* 2021-10-18: thrown together in an hour

46
index.gmi Executable file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
if [ -z $QUERY_STRING ]; then
printf "10 Please enter your name!\r\n"
fi
name=$QUERY_STRING
printf "20 text/gemini\r\n"
printf "# Pronoun Dressing Room for ${name}\n"
sentences=("I really enjoy spending time with OBJECTIVE." "NAME is really cool, I like OBJECTIVE." "POSESSIVEDT accent is nice." "That belongs to OBJECTIVE." "NAME did so well, SUBJECTIVE MSHAS every reason to be proud of REFLEXIVE.")
pr_sub=("he" "she" "they" "xe")
pr_obj=("him" "her" "them" "xem")
pr_psd=("his" "her" "their" "xyr")
pr_pos=("his" "hers" "theirs" "xyrs")
pr_ref=("himself" "herself" "themselves" "xemself")
cnt=0
for i in "${pr_sub[@]}"; do
printf "${i}:\n---\n"
for j in "${sentences[@]}"; do
cursent="${j}"
if [[ "${cnt}" == 2 ]]; then
cursent="${cursent//MSHAS/have}"
else
cursent="${cursent//MSHAS/has}"
fi
cursent="${cursent//MSHAS/has}"
cursent="${cursent//NAME/${name}}"
cursent="${cursent//SUBJECTIVE/"${pr_sub[${cnt}]}"}"
cursent="${cursent//OBJECTIVE/"${pr_obj[${cnt}]}"}"
cursent="${cursent//POSESSIVEDT/"${pr_psd[${cnt}]}"}"
cursent="${cursent//POSESSIVE/"${pr_pos[${cnt}]}"}"
cursent="${cursent//REFLEXIVE/"${pr_ref[${cnt}]}"}"
printf "${cursent^}\n"
done
printf "\n"
((cnt++))
done
exit