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');
95 cmd
+=('-e' 'cleavage');
99 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
100 printf "%s\n" "${output[@]}";
101 #printf "Found %d matching lines for nouns.\n" "${#output[@]}" 1>&2; # debug
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');
144 cmd
+=('-e' 'naked|nude');
148 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
149 printf "%s\n" "${output[@]}";
150 #printf "Found %d matching lines for adjectives.\n" "${#output[@]}" 1>&2; # debug
154 # Usage: cat *.txt | find_verbs
155 # Input: stdin input lines
156 # CONTEXT_VERB grep parameter
157 # Output: stdout lines matching grep patterns
160 cmd
+=('--ignore-case');
161 cmd
+=('--extended-regexp');
162 cmd
+=('--context' "$CONTEXT_VERB");
164 cmd
+=('-e' 'nuzzle');
165 cmd
+=('-e' 'pleasure');
166 cmd
+=('-e' 'make love');
168 cmd
+=('-e' 'arouse');
169 cmd
+=('-e' 'quiver');
170 cmd
+=('-e' 'tremble');
171 cmd
+=('-e' 'caress');
175 cmd
+=('-e' 'suck|suckle');
176 cmd
+=('-e' 'fondle');
178 cmd
+=('-e' 'feel up|felt up|felt (me|her|him) up');
181 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
182 printf "%s\n" "${output[@]}";
183 #printf "Found %d matching lines for verbs.\n" "${#output[@]}" 1>&2; # debug
187 # Usage: cat *.txt | find_mix_1
188 # Input: stdin input lines
189 # CONTEXT_VERB grep parameter
190 # Output: stdout lines matching grep patterns
192 cmd
+=('--ignore-case');
193 cmd
+=('--context' "$CONTEXT_MIX_1");
195 cmd
+=('-e' 'breast');
197 cmd
+=('-e' 'manhood');
198 cmd
+=('-e' 'vagina');
202 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
203 printf "%s\n" "${output[@]}";
207 # Usage: cat *.txt | find_mix_2
208 # Input: stdin input lines
209 # CONTEXT_VERB grep parameter
210 # Output: stdout lines matching grep patterns
213 cmd
+=('--ignore-case');
214 cmd
+=('--context' "$CONTEXT_MIX_2");
215 cmd
+=('-e' 'nipple');
216 cmd
+=('-e' 'womanhood');
217 cmd
+=('-e' 'manhood');
220 cmd
+=('-e' 'vagina');
223 cmd
+=('-e' '\ lust');
224 cmd
+=('-e' 'voyeur');
225 cmd
+=('-e' 'ecstacy');
226 cmd
+=('-e' 'tingle');
227 cmd
+=('-e' 'orgasm');
228 cmd
+=('-e' 'gorgeous');
229 cmd
+=('-e' 'bewitching');
230 cmd
+=('-e' 'seductive');
232 cmd
+=('-e' 'stunning');
233 cmd
+=('-e' 'ravishing');
234 cmd
+=('-e' 'lovely');
237 cmd
+=('-e' 'sexiest');
238 cmd
+=('-e' 'sensual');
239 cmd
+=('-e' 'arousing');
242 cmd
+=('-e' 'nuzzle');
243 cmd
+=('-e' 'pleasure');
244 cmd
+=('-e' 'make\ love');
247 cmd
+=('-e' 'arouse');
249 cmd
+=('-e' 'breast');
251 cmd
+=('-e' 'manhood');
252 cmd
+=('-e' 'vagina');
254 cmd
+=('-e' 'lovers');
257 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
258 printf "%s\n" "${output[@]}";
261 # Desc: Filter phrase
262 # Usage: cat *.txt | find_phrase
263 # Input: stdin input lines
264 # CONTEXT_VERB grep parameter
265 # Output: stdout lines matching grep patterns
268 cmd
+=('--ignore-case');
269 cmd
+=('--context' "$CONTEXT_PHRASE");
270 cmd
+=('--extended-regexp');
271 cmd
+=('--color=always');
272 cmd
+=('-e' '( his| her| my) [^\.|;]{,48}( his| her| my) (breast|pussy|tits|nipple|womanhood|cock( |\.|,)|manhood|dick|cunt)');
273 cmd
+=('-e' '( his| her| my) [^\.|;]{,24}nipple.{,24}harden');
274 cmd
+=('-e' '(suck|lick)[^\.|;]{,12} (nipple|cock( |\.|,)|dick)');
275 cmd
+=('-e' '(slap)[^\.|;]{,12}( ass)');
276 cmd
+=('-e' '( his| her| my) [^\.|;]{,12}(cunt|pussy( |\.|,)|cock( |\.|,)|dick|shaft( |\.|,|;))');
279 local output
; mapfile
-t output
< <( "${cmd[@]}"; );
280 printf "%s\n" "${output[@]}";
281 #printf "Found %d matching lines for phrases in %s.\n" "${#output[@]}" "$fin" 1>&2; # debug
285 if [[ ! -d "$din" ]]; then die
"FATAL:Not a dir:${din}"; fi;
287 find "$din" -type f
-name "*.txt" | shuf |
head -n "$FIN_MAX" | \
288 #parallel search_thread '{}' | less --RAW-CONTROL-CHARS -S;
289 parallel search_thread
'{}';
291 export -f yell die must search_thread find_nouns find_adjectives find_verbs find_mix_1 find_mix_2 find_phrase
;