<jupyter_start><jupyter_text>Modifiers<jupyter_code>#targets
modifiers.replace('\n',' ')
''
regexes_modifiers = ["liver","[intra]*[-]* *abdom[a-z]*","""abdom[a-z]* wall"""]
r_liver = re.compile(r"""liver""")
r_liver.findall(modifiers)
r_abdomen = re.compile(r"""[intra]*[-]* *abdom[a-z]* *[wall]*""")
r_abdomen.findall(modifiers)
r_wall = re.compile(r"""abdom[a-z]* wall""")
r_wall.findall(modifiers)<jupyter_output><empty_output><jupyter_text>Targets<jupyter_code>regexes_targets = \
["abscess[a-z]*","complex fluids*","loculated collections*","hematoma*",
 "heterogeneous collections*","abscess[es]*","collections* of fluid*|fluid collection[s]*"]

#simple fluid collection 
r_collection1 = re.compile(r"""fluid[s]* collection[s]*""")

r_collection1.findall(targets)
#collections of fluid
r_collection2 = re.compile(r"""collections* of fluid[s]*""")
r_collection2.findall(targets)
#combine both fluid collections
r_collection3 = re.compile(r"""(collections* of fluid*|fluid collection[s]*)""")

sentence = 'There is a fluid collection and heterogeneous collections in the abdomen.\
There is a fluid collection and a collection of fluid.'
r_collection3.findall(sentence)
# 'loculated collection'
r_loc = re.compile(r"""loculated collections*""")
r_loc.findall(targets)
# 'hematoma'
r_hemat = re.compile(r"""hematoma*""")
r_hemat.findall(targets)
# 'complex fluid'
r_complex = re.compile(r"""complex fluids*""")
r_complex.findall(targets)
# 'heterogeneous collection'
r_hetero = re.compile(r"""heterogeneous collections*""")
r_hetero.findall(targets)
#abscess
r_abscess = re.compile(r"""abscess[es]*""")
r_abscess.findall(targets)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18795180722891566, 'fraction_numerical': 0.0036144578313253013, 'mean_word_length': 9.38125, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '85702', 'license': 'MIT', 'n_tokens_mistral': 627, 'n_tokens_neox': 594, 'n_words': 99, 'path': ".ipynb_checkpoints/Testing RegEx's-checkpoint.ipynb", 'repo_name': 'abchapman93/fcFinder', 'size': '1660'}