2 # Desc: Searches for erotic phrases in text files in specified working directory
3 # Usage: find_erotica.sh [dir]
4 # Depends: GNU Find utils, GNU Parallel 20210822, GNU Grep, GNU Coreutils 8.32, bc
9 export SHOW_FILENAME
=false
;
10 export CONTEXT_NOUN
=128;
11 export CONTEXT_ADJ
=64;
12 export CONTEXT_VERB
=32;
13 export CONTEXT_MIX_1
=32
14 export CONTEXT_MIX_2
=32
15 export CONTEXT_PHRASE
=16;
18 yell
() { echo "$0: $*" >&2; } # print script path and all args to stderr
19 die
() { yell
"$*"; exit 111; } # same as yell() but non-zero exit status
20 must
() { "$@" || die
"cannot $*"; } # runs args as command, reports args if command fails
22 # Desc: Apply filters to a file
23 # Depends: find_nouns();
24 # Input: arg1 file path
25 # Output: stdout search results
27 if [[ ! -f "$1" ]]; then die
"FATAL:Not a file:$1"; fi;
29 # yell "STATUS:Starting search_thread() on ${fin}" # debug;
30 # yell "Processing: ${fin}..."; # debug
32 mapfile
-t output
< <(
39 grep -v -- '-$'; # ADJUST ME
42 if [[ "${#output[@]}" -gt 0 ]]; then
43 printf "%s\n" "$(basename "${fin}" )";
44 printf "Result: %d lines.\n" "${#output[@]}"
45 printf "%s\n" "${output[@]}";
49 # yell "STATUS:Finished search_thread() on ${fin}" # debug;
53 # Usage: find_nouns [path]
54 # Input: arg1 text file path
55 # CONTEXT_NOUN grep parameter
56 # Output: stdout lines matching grep patterns
58 if [[ ! -f "$1" ]]; then die
"FATAL:Not a file:$1"; fi;
61 #yell "STATUS:Starting find_nouns() on $fin" # debug;
64 cmd
+=('--ignore-case');
65 cmd
+=('--extended-regexp');
66 if [[ "$SHOW_FILENAME" == "true" ]]; then cmd
+=('--with-filename'); fi;
67 cmd
+=('--line-number');
68 cmd
+=('--context' "$CONTEXT_NOUN");
72 cmd
+=('-e' 'womanhood');
73 cmd
+=('-e' 'manhood');
74 cmd
+=('-e' 'his member');
86 cmd
+=('-e' 'ecstacy');
87 cmd
+=('-e' 'pleasure');
92 cmd
+=('-e' 'hard-on');
96 cmd
+=('-e' 'cleavage');
99 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
100 printf "%s\n" "${output[@]}";
102 # yell "STATUS:Finished find_nouns() on $fin" # debug;
105 # Desc: Find adjectives
106 # Usage: cat *.txt | find_adjectives
107 # Input: stdin input lines
108 # CONTEXT_ADJ grep parameter
109 # Output: stdout lines matching grep patterns
112 cmd
+=('--ignore-case');
113 cmd
+=('--extended-regexp');
114 cmd
+=('--context' "$CONTEXT_ADJ");
115 cmd
+=('-e' 'handsome');
116 cmd
+=('-e' 'gorgeous');
117 cmd
+=('-e' 'beautiful');
118 cmd
+=('-e' 'bewitching');
119 cmd
+=('-e' 'seductive');
121 cmd
+=('-e' 'comely');
122 cmd
+=('-e' 'stunning');
123 cmd
+=('-e' 'elegant');
124 cmd
+=('-e' 'exquisite');
125 cmd
+=('-e' 'luxurious');
126 cmd
+=('-e' 'ravishing');
127 cmd
+=('-e' 'magnificent');
128 cmd
+=('-e' 'glistening');
129 cmd
+=('-e' 'lovely');
130 cmd
+=('-e' 'loving');
131 cmd
+=('-e' 'sexy|sexual|sexiest');
133 cmd
+=('-e' 'sensual');
134 cmd
+=('-e' 'arousing');
137 cmd
+=('-e' 'soaked');
139 cmd
+=('-e' 'gentle');
140 cmd
+=('-e' 'supple');
141 cmd
+=('-e' 'tender');
142 cmd
+=('-e' 'pleasurabl');
143 cmd
+=('-e' 'buxom|busty|curvy');
147 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
148 printf "%s\n" "${output[@]}";
152 # Usage: cat *.txt | find_verbs
153 # Input: stdin input lines
154 # CONTEXT_VERB grep parameter
155 # Output: stdout lines matching grep patterns
158 cmd
+=('--ignore-case');
159 cmd
+=('--extended-regexp');
160 cmd
+=('--context' "$CONTEXT_VERB");
162 cmd
+=('-e' 'nuzzle');
163 cmd
+=('-e' 'pleasure');
164 cmd
+=('-e' 'make love');
166 cmd
+=('-e' 'arouse');
167 cmd
+=('-e' 'quiver');
168 cmd
+=('-e' 'tremble');
169 cmd
+=('-e' 'caress');
173 cmd
+=('-e' 'suck|suckle');
174 cmd
+=('-e' 'fondle');
176 cmd
+=('-e' 'feel up|felt up|felt (me|her|him) up');
179 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
180 printf "%s\n" "${output[@]}";
184 # Usage: cat *.txt | find_mix_1
185 # Input: stdin input lines
186 # CONTEXT_VERB grep parameter
187 # Output: stdout lines matching grep patterns
189 cmd
+=('--ignore-case');
190 cmd
+=('--context' "$CONTEXT_MIX_1");
192 cmd
+=('-e' 'breast');
194 cmd
+=('-e' 'manhood');
195 cmd
+=('-e' 'vagina');
199 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
200 printf "%s\n" "${output[@]}";
204 # Usage: cat *.txt | find_mix_2
205 # Input: stdin input lines
206 # CONTEXT_VERB grep parameter
207 # Output: stdout lines matching grep patterns
210 cmd
+=('--ignore-case');
211 cmd
+=('--context' "$CONTEXT_MIX_2");
212 cmd
+=('-e' 'nipple');
213 cmd
+=('-e' 'womanhood');
214 cmd
+=('-e' 'manhood');
217 cmd
+=('-e' 'vagina');
220 cmd
+=('-e' '\ lust');
221 cmd
+=('-e' 'voyeur');
222 cmd
+=('-e' 'ecstacy');
223 cmd
+=('-e' 'tingle');
224 cmd
+=('-e' 'orgasm');
225 cmd
+=('-e' 'gorgeous');
226 cmd
+=('-e' 'bewitching');
227 cmd
+=('-e' 'seductive');
229 cmd
+=('-e' 'stunning');
230 cmd
+=('-e' 'ravishing');
231 cmd
+=('-e' 'lovely');
234 cmd
+=('-e' 'sexiest');
235 cmd
+=('-e' 'sensual');
236 cmd
+=('-e' 'arousing');
239 cmd
+=('-e' 'nuzzle');
240 cmd
+=('-e' 'pleasure');
241 cmd
+=('-e' 'make\ love');
244 cmd
+=('-e' 'arouse');
246 cmd
+=('-e' 'breast');
248 cmd
+=('-e' 'manhood');
249 cmd
+=('-e' 'vagina');
251 cmd
+=('-e' 'lovers');
254 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
255 printf "%s\n" "${output[@]}";
258 # Desc: Filter phrase
259 # Usage: cat *.txt | find_phrase
260 # Input: stdin input lines
261 # CONTEXT_VERB grep parameter
262 # Output: stdout lines matching grep patterns
265 cmd
+=('--ignore-case');
266 cmd
+=('--context' "$CONTEXT_PHRASE");
267 cmd
+=('--extended-regexp');
268 cmd
+=('--color=always');
269 cmd
+=('-e' '( his| her| my) [^\.|;]{,48}( his| her| my) (breast|pussy|tits|nipple|womanhood|cock( |\.|,)|manhood|dick|cunt)');
270 cmd
+=('-e' '( his| her| my) [^\.|;]{,24}nipple.{,24}harden');
271 cmd
+=('-e' '(suck|lick)[^\.|;]{,12} (nipple|cock( |\.|,)|dick)');
272 cmd
+=('-e' '(slap)[^\.|;]{,12}( ass)');
273 cmd
+=('-e' '( his| her| my) [^\.|;]{,12} (cunt|pussy( |\.|,)|cock( |\.|,)|dick|shaft( |\.|,|;))');
276 "${cmd[@]}"; # execute command
280 if [[ ! -d "$din" ]]; then die
"FATAL:Not a dir:${din}"; fi;
282 find "$din" -type f
-name "*.txt" | shuf |
head -n "$FIN_MAX" | \
283 #parallel search_thread '{}' | less --RAW-CONTROL-CHARS -S;
284 parallel search_thread
'{}';
286 export -f yell die must search_thread find_nouns find_adjectives find_verbs find_mix_1 find_mix_2 find_phrase
;