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 1 ]]; 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');
100 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
101 printf "%s\n" "${output[@]}";
102 #printf "Found %d matching lines for nouns.\n" "${#output[@]}" 1>&2; # debug
103 # yell "STATUS:Finished find_nouns() on $fin" # debug;
106 # Desc: Find adjectives
107 # Usage: cat *.txt | find_adjectives
108 # Input: stdin input lines
109 # CONTEXT_ADJ grep parameter
110 # Output: stdout lines matching grep patterns
113 cmd
+=('--ignore-case');
114 cmd
+=('--extended-regexp');
115 cmd
+=('--context' "$CONTEXT_ADJ");
116 cmd
+=('-e' 'handsome');
117 cmd
+=('-e' 'gorgeous');
118 cmd
+=('-e' 'beautiful');
119 cmd
+=('-e' 'bewitching');
120 cmd
+=('-e' 'seductive');
122 cmd
+=('-e' 'comely');
123 cmd
+=('-e' 'stunning');
124 cmd
+=('-e' 'elegant');
125 cmd
+=('-e' 'exquisite');
126 cmd
+=('-e' 'luxurious');
127 cmd
+=('-e' 'ravishing');
128 cmd
+=('-e' 'magnificent');
129 cmd
+=('-e' 'glistening');
130 cmd
+=('-e' 'lovely');
131 cmd
+=('-e' 'loving');
132 cmd
+=('-e' 'sexy|sexual|sexiest');
134 cmd
+=('-e' 'sensual');
135 cmd
+=('-e' 'arousing');
138 cmd
+=('-e' 'soaked');
140 cmd
+=('-e' 'gentle');
141 cmd
+=('-e' 'supple');
142 cmd
+=('-e' 'tender');
143 cmd
+=('-e' 'pleasurabl');
144 cmd
+=('-e' 'buxom|busty|curvy');
145 cmd
+=('-e' 'naked|nude');
149 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
150 printf "%s\n" "${output[@]}";
151 #printf "Found %d matching lines for adjectives.\n" "${#output[@]}" 1>&2; # debug
155 # Usage: cat *.txt | find_verbs
156 # Input: stdin input lines
157 # CONTEXT_VERB grep parameter
158 # Output: stdout lines matching grep patterns
161 cmd
+=('--ignore-case');
162 cmd
+=('--extended-regexp');
163 cmd
+=('--context' "$CONTEXT_VERB");
165 cmd
+=('-e' 'nuzzle');
166 cmd
+=('-e' 'pleasure');
167 cmd
+=('-e' 'make love');
169 cmd
+=('-e' 'arouse');
170 cmd
+=('-e' 'quiver');
171 cmd
+=('-e' 'tremble');
172 cmd
+=('-e' 'caress');
176 cmd
+=('-e' 'suck|suckle');
177 cmd
+=('-e' 'fondle');
179 cmd
+=('-e' 'feel up|felt up|felt (me|her|him) up');
182 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
183 printf "%s\n" "${output[@]}";
184 #printf "Found %d matching lines for verbs.\n" "${#output[@]}" 1>&2; # debug
188 # Usage: cat *.txt | find_mix_1
189 # Input: stdin input lines
190 # CONTEXT_VERB grep parameter
191 # Output: stdout lines matching grep patterns
193 cmd
+=('--ignore-case');
194 cmd
+=('--context' "$CONTEXT_MIX_1");
196 cmd
+=('-e' 'breast');
198 cmd
+=('-e' 'manhood');
199 cmd
+=('-e' 'vagina');
203 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
204 printf "%s\n" "${output[@]}";
208 # Usage: cat *.txt | find_mix_2
209 # Input: stdin input lines
210 # CONTEXT_VERB grep parameter
211 # Output: stdout lines matching grep patterns
214 cmd
+=('--ignore-case');
215 cmd
+=('--context' "$CONTEXT_MIX_2");
216 cmd
+=('-e' 'nipple');
217 cmd
+=('-e' 'womanhood');
218 cmd
+=('-e' 'manhood');
221 cmd
+=('-e' 'vagina');
224 cmd
+=('-e' '\ lust');
225 cmd
+=('-e' 'voyeur');
226 cmd
+=('-e' 'ecstacy');
227 cmd
+=('-e' 'tingle');
228 cmd
+=('-e' 'orgasm');
229 cmd
+=('-e' 'gorgeous');
230 cmd
+=('-e' 'bewitching');
231 cmd
+=('-e' 'seductive');
233 cmd
+=('-e' 'stunning');
234 cmd
+=('-e' 'ravishing');
235 cmd
+=('-e' 'lovely');
238 cmd
+=('-e' 'sexiest');
239 cmd
+=('-e' 'sensual');
240 cmd
+=('-e' 'arousing');
243 cmd
+=('-e' 'nuzzle');
244 cmd
+=('-e' 'pleasure');
245 cmd
+=('-e' 'make\ love');
248 cmd
+=('-e' 'arouse');
250 cmd
+=('-e' 'breast');
252 cmd
+=('-e' 'manhood');
253 cmd
+=('-e' 'vagina');
255 cmd
+=('-e' 'lovers');
258 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
259 printf "%s\n" "${output[@]}";
262 # Desc: Filter phrase
263 # Usage: cat *.txt | find_phrase
264 # Input: stdin input lines
265 # CONTEXT_VERB grep parameter
266 # Output: stdout lines matching grep patterns
269 cmd
+=('--ignore-case');
270 cmd
+=('--context' "$CONTEXT_PHRASE");
271 cmd
+=('--extended-regexp');
272 cmd
+=('--color=always');
273 cmd
+=('-e' '( his| her| my) [^\.|;]{,48}( his| her| my) (breast|pussy|tits|nipple|womanhood|cock( |\.|,)|manhood|dick|cunt)');
274 cmd
+=('-e' '( his| her| my) [^\.|;]{,24}nipple.{,24}harden');
275 cmd
+=('-e' '(suck|lick)[^\.|;]{,12} (nipple|cock( |\.|,)|dick)');
276 cmd
+=('-e' '(slap)[^\.|;]{,12}( ass)');
277 cmd
+=('-e' '( his| her| my) [^\.|;]{,12}(cunt|pussy( |\.|,)|cock( |\.|,)|dick|shaft( |\.|,|;))');
280 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
281 printf "%s\n" "${output[@]}";
282 #printf "Found %d matching lines for phrases in %s.\n" "${#output[@]}" "$fin" 1>&2; # debug
286 if [[ ! -d "$din" ]]; then die
"FATAL:Not a dir:${din}"; fi;
288 find "$din" -type f
-name "*.txt" | shuf |
head -n "$FIN_MAX" | \
289 #parallel search_thread '{}' | less --RAW-CONTROL-CHARS -S;
290 parallel search_thread
'{}';
292 export -f yell die must search_thread find_nouns find_adjectives find_verbs find_mix_1 find_mix_2 find_phrase
;