Upload prompt_selector_1215.py
Browse files
Danbooru Prompt Selector/.py_version/prompt_selector_1215.py
CHANGED
@@ -388,7 +388,7 @@ def random_function():
|
|
388 |
rows = []
|
389 |
for row in reader:
|
390 |
if all(re.search(r'(?:^|, )' + re.escape(kw) + r'(?:,|$)', ', '.join(row)) for kw in perfect_match_keywords) \
|
391 |
-
and not any(exclude
|
392 |
and all(include in cell for include in include_keywords for cell in row):
|
393 |
# '{}' μμ ν€μλ μ²λ¦¬
|
394 |
if all(any(re.search(r'(?:^|, )' + re.escape(kw) + r'(?:,|$)', ', '.join(cell)) for kw in perfect_group) or
|
@@ -403,7 +403,7 @@ def random_function():
|
|
403 |
rows = []
|
404 |
for row in reader:
|
405 |
if all(re.search(r'(?:^|, )' + re.escape(kw) + r'(?:,|$)', ', '.join(row)) for kw in perfect_match_keywords) \
|
406 |
-
and not any(exclude
|
407 |
and all(include in cell for include in include_keywords for cell in row):
|
408 |
# '{}' μμ ν€μλ μ²λ¦¬
|
409 |
if all(any(re.search(r'(?:^|, )' + re.escape(kw) + r'(?:,|$)', ', '.join(cell)) for kw in perfect_group) or
|
@@ -603,7 +603,8 @@ def random_function():
|
|
603 |
if rm_characteristic_var.get():
|
604 |
for keyword in random_row_keywords:
|
605 |
if keyword in bag_of_tags or keyword in character_keys or "(" in keyword or "horns" in keyword:
|
606 |
-
|
|
|
607 |
for keyword in temp_rm:
|
608 |
random_row_keywords.remove(keyword)
|
609 |
#NSFW_assert_var
|
|
|
388 |
rows = []
|
389 |
for row in reader:
|
390 |
if all(re.search(r'(?:^|, )' + re.escape(kw) + r'(?:,|$)', ', '.join(row)) for kw in perfect_match_keywords) \
|
391 |
+
and not any(re.search(r'\b' + re.escape(exclude) + r'\b', cell) for exclude in exclude_keywords for cell in row) \
|
392 |
and all(include in cell for include in include_keywords for cell in row):
|
393 |
# '{}' μμ ν€μλ μ²λ¦¬
|
394 |
if all(any(re.search(r'(?:^|, )' + re.escape(kw) + r'(?:,|$)', ', '.join(cell)) for kw in perfect_group) or
|
|
|
403 |
rows = []
|
404 |
for row in reader:
|
405 |
if all(re.search(r'(?:^|, )' + re.escape(kw) + r'(?:,|$)', ', '.join(row)) for kw in perfect_match_keywords) \
|
406 |
+
and not any(re.search(r'\b' + re.escape(exclude) + r'\b', cell) for exclude in exclude_keywords for cell in row) \
|
407 |
and all(include in cell for include in include_keywords for cell in row):
|
408 |
# '{}' μμ ν€μλ μ²λ¦¬
|
409 |
if all(any(re.search(r'(?:^|, )' + re.escape(kw) + r'(?:,|$)', ', '.join(cell)) for kw in perfect_group) or
|
|
|
603 |
if rm_characteristic_var.get():
|
604 |
for keyword in random_row_keywords:
|
605 |
if keyword in bag_of_tags or keyword in character_keys or "(" in keyword or "horns" in keyword:
|
606 |
+
if keyword not in entry_text_keywords:
|
607 |
+
temp_rm.append(keyword)
|
608 |
for keyword in temp_rm:
|
609 |
random_row_keywords.remove(keyword)
|
610 |
#NSFW_assert_var
|