Repository: TRoboto/Maha

Issue:
Adding a list of strings to cleaner functions
### What problem are you trying to solve?

Enhance the cleaners functions to take a list of strings as input if needed.

### Examples (if relevant)

```py
>>> from maha.cleaners.functions import remove
>>> text = "من اليوم سوف ينتقل صديقي منور من المدينة المنورة وعنوانه الجديد هو الرياض"
>>>remove(text, custom_expressions = [r"\bمن\b", r"\bعن\b")
'اليوم سوف ينتقل صديقي منور المدينة المنورة وعنوانه الجديد هو الرياض'

```

### Definition of Done

- It must adhere to the coding style used in the defined cleaner functions.
- The implementation should cover most use cases.
- Adding tests

Comments:

Patch:
diff --git a/maha/cleaners/functions/remove_fn.py b/maha/cleaners/functions/remove_fn.py
index 1385f34..47786b8 100644
--- a/maha/cleaners/functions/remove_fn.py
+++ b/maha/cleaners/functions/remove_fn.py
@@ -3,6 +3,8 @@ Functions that operate on a string and remove certain characters.
 """
 from __future__ import annotations
 
+from maha.rexy import non_capturing_group
+
 __all__ = [
     "remove",
     "remove_strings",
@@ -92,7 +94,7 @@ def remove(
     emojis: bool = False,
     use_space: bool = True,
     custom_strings: list[str] | str | None = None,
-    custom_expressions: ExpressionGroup | Expression | str | None = None,
+    custom_expressions: ExpressionGroup | Expression | list[str] | str | None = None,
 ):
 
     """Removes certain characters from the given text.
@@ -168,7 +170,7 @@ def remove(
         for more information, by default True
     custom_strings:
         Include any other string(s), by default None
-    custom_expressions: Union[:class:`~.ExpressionGroup`, :class:`~.Expression`, str]
+    custom_expressions:
         Include any other regular expression expressions, by default None
 
     Returns
@@ -213,11 +215,15 @@ def remove(
     if isinstance(custom_strings, str):
         custom_strings = [custom_strings]
 
+    chars_to_remove.extend(custom_strings)
+
+    # expressions to remove
     if isinstance(custom_expressions, str):
         custom_expressions = Expression(custom_expressions)
 
-    chars_to_remove.extend(custom_strings)
-    # expressions to remove
+    elif isinstance(custom_expressions, list):
+        custom_expressions = Expression(non_capturing_group(*custom_expressions))
+
     expressions_to_remove = ExpressionGroup(custom_expressions)
 
     # Since each argument has the same name as the corresponding constant


Test patch:
diff --git a/tests/cleaners/test_remove.py b/tests/cleaners/test_remove.py
index df184a8..071f5a6 100644
--- a/tests/cleaners/test_remove.py
+++ b/tests/cleaners/test_remove.py
@@ -823,3 +823,12 @@ def test_remove_arabic_letter_dots_with_edge_case(input: str, expected: str):
 def test_remove_arabic_letter_dots_general(input: str, expected: str):
 
     assert remove_arabic_letter_dots(input) == expected
+
+
+def test_remove_list_input(simple_text_input: str):
+    list_ = ["بِسْمِ", "the", "ال(?=ر)"]
+    processed_text = remove(text=simple_text_input, custom_expressions=list_)
+    assert (
+        processed_text
+        == "1. ،اللَّهِ رَّحْمَٰنِ رَّحِيمِ In name of Allah,Most Gracious, Most Merciful."
+    )