pattern-searching 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pattern_searching-0.1.0/LICENSE +36 -0
- pattern_searching-0.1.0/PKG-INFO +88 -0
- pattern_searching-0.1.0/README.md +65 -0
- pattern_searching-0.1.0/pattern_searching.egg-info/PKG-INFO +88 -0
- pattern_searching-0.1.0/pattern_searching.egg-info/SOURCES.txt +8 -0
- pattern_searching-0.1.0/pattern_searching.egg-info/dependency_links.txt +1 -0
- pattern_searching-0.1.0/pattern_searching.egg-info/top_level.txt +1 -0
- pattern_searching-0.1.0/pyproject.toml +3 -0
- pattern_searching-0.1.0/setup.cfg +4 -0
- pattern_searching-0.1.0/setup.py +19 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
⚖️ License
|
|
2
|
+
|
|
3
|
+
This project is licensed under the MIT License – see the LICENSE
|
|
4
|
+
file for details.
|
|
5
|
+
|
|
6
|
+
💡 Notes
|
|
7
|
+
All algorithms are implemented in Python 3.
|
|
8
|
+
Examples are included in each file for easy testing.
|
|
9
|
+
You can adapt these algorithms for bioinformatics sequence analysis by replacing text with DNA/protein sequences.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## **LICENSE** (MIT License)
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
MIT License
|
|
17
|
+
|
|
18
|
+
Copyright (c) 2026 <Your Name>
|
|
19
|
+
|
|
20
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
21
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
22
|
+
in the Software without restriction, including without limitation the rights
|
|
23
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
24
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
25
|
+
furnished to do so, subject to the following conditions:
|
|
26
|
+
|
|
27
|
+
The above copyright notice and this permission notice shall be included in all
|
|
28
|
+
copies or substantial portions of the Software.
|
|
29
|
+
|
|
30
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
31
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
32
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
33
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
34
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
35
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
36
|
+
SOFTWARE.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pattern_searching
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Single-pattern and multiple-pattern string searching algorithms in Python
|
|
5
|
+
Home-page: https://github.com/HADIL19/Pattern-Searching
|
|
6
|
+
Author: Hadil Khelif
|
|
7
|
+
Author-email: your_email@example.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.7
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: classifier
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: home-page
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
23
|
+
|
|
24
|
+
# Pattern Searching Algorithms
|
|
25
|
+
|
|
26
|
+
This repository contains implementations of **single-pattern and multiple-pattern string searching algorithms** in Python.
|
|
27
|
+
It is designed for students, programmers, and bioinformatics enthusiasts to **learn, practice, and experiment with text and DNA/protein sequence analysis**.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🎯 Relevance to Bioinformatics
|
|
32
|
+
|
|
33
|
+
Pattern searching is crucial in bioinformatics for tasks such as:
|
|
34
|
+
|
|
35
|
+
- Finding **motifs in DNA sequences** (e.g., promoters, binding sites)
|
|
36
|
+
- Identifying **repeated sequences** or mutations in genomes
|
|
37
|
+
- Searching multiple motifs efficiently in large genomic datasets
|
|
38
|
+
|
|
39
|
+
These algorithms provide a foundation for understanding **sequence analysis, text processing, and data mining** in biological data.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 🧩 Single-Pattern Algorithms (Recherche d’un seul motif)
|
|
44
|
+
|
|
45
|
+
| Algorithm | Description |
|
|
46
|
+
|-----------|-------------|
|
|
47
|
+
| Naive | Simple brute-force search for a single pattern. |
|
|
48
|
+
| Morris-Pratt | Optimized for repeated patterns using prefix preprocessing. |
|
|
49
|
+
| Boyer-Moore | Skips unmatched characters using bad character heuristic. |
|
|
50
|
+
| Rabin-Karp | Uses hashing for pattern search. |
|
|
51
|
+
|
|
52
|
+
**Example:**
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from algorithms.single_pattern.naive import naive_search
|
|
56
|
+
|
|
57
|
+
text = "ABABDABACDABABCABAB"
|
|
58
|
+
pattern = "ABABCABAB"
|
|
59
|
+
naive_search(text, pattern)
|
|
60
|
+
🧩 Multiple-Pattern Algorithms (Recherche de plusieurs motifs)
|
|
61
|
+
Algorithm Description
|
|
62
|
+
Rabin-Karp (Multiple) Hash-based search for multiple patterns at once.
|
|
63
|
+
Aho-Corasick Builds a finite automaton for all patterns; very efficient for multiple patterns.
|
|
64
|
+
Wu-Manber Optimized multiple-pattern search using block shifts.
|
|
65
|
+
Commentz-Walter Combines Boyer-Moore logic with multiple-pattern optimization.
|
|
66
|
+
|
|
67
|
+
Example:
|
|
68
|
+
|
|
69
|
+
from algorithms.multiple_pattern.aho_corasick import AhoCorasick
|
|
70
|
+
|
|
71
|
+
text = "ACGTACGTGACG"
|
|
72
|
+
patterns = ["ACG", "GAC"]
|
|
73
|
+
ac = AhoCorasick(patterns)
|
|
74
|
+
ac.search(text)
|
|
75
|
+
🚀 Usage
|
|
76
|
+
Clone the repository:
|
|
77
|
+
git clone https://github.com/<your-username>/Pattern-Searching-Algorithms.git
|
|
78
|
+
cd Pattern-Searching-Algorithms
|
|
79
|
+
Run any algorithm:
|
|
80
|
+
python algorithms/single_pattern/naive.py
|
|
81
|
+
python algorithms/multiple_pattern/aho_corasick.py
|
|
82
|
+
📚 Resources
|
|
83
|
+
|
|
84
|
+
Check resources/pattern_searching_links.md for tutorials and detailed explanations:
|
|
85
|
+
|
|
86
|
+
Pattern Searching on GeeksforGeeks
|
|
87
|
+
KMP, Rabin-Karp, Boyer-Moore, Aho-Corasick tutorials
|
|
88
|
+
Wu-Manber and Commentz-Walter references
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Pattern Searching Algorithms
|
|
2
|
+
|
|
3
|
+
This repository contains implementations of **single-pattern and multiple-pattern string searching algorithms** in Python.
|
|
4
|
+
It is designed for students, programmers, and bioinformatics enthusiasts to **learn, practice, and experiment with text and DNA/protein sequence analysis**.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🎯 Relevance to Bioinformatics
|
|
9
|
+
|
|
10
|
+
Pattern searching is crucial in bioinformatics for tasks such as:
|
|
11
|
+
|
|
12
|
+
- Finding **motifs in DNA sequences** (e.g., promoters, binding sites)
|
|
13
|
+
- Identifying **repeated sequences** or mutations in genomes
|
|
14
|
+
- Searching multiple motifs efficiently in large genomic datasets
|
|
15
|
+
|
|
16
|
+
These algorithms provide a foundation for understanding **sequence analysis, text processing, and data mining** in biological data.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 🧩 Single-Pattern Algorithms (Recherche d’un seul motif)
|
|
21
|
+
|
|
22
|
+
| Algorithm | Description |
|
|
23
|
+
|-----------|-------------|
|
|
24
|
+
| Naive | Simple brute-force search for a single pattern. |
|
|
25
|
+
| Morris-Pratt | Optimized for repeated patterns using prefix preprocessing. |
|
|
26
|
+
| Boyer-Moore | Skips unmatched characters using bad character heuristic. |
|
|
27
|
+
| Rabin-Karp | Uses hashing for pattern search. |
|
|
28
|
+
|
|
29
|
+
**Example:**
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from algorithms.single_pattern.naive import naive_search
|
|
33
|
+
|
|
34
|
+
text = "ABABDABACDABABCABAB"
|
|
35
|
+
pattern = "ABABCABAB"
|
|
36
|
+
naive_search(text, pattern)
|
|
37
|
+
🧩 Multiple-Pattern Algorithms (Recherche de plusieurs motifs)
|
|
38
|
+
Algorithm Description
|
|
39
|
+
Rabin-Karp (Multiple) Hash-based search for multiple patterns at once.
|
|
40
|
+
Aho-Corasick Builds a finite automaton for all patterns; very efficient for multiple patterns.
|
|
41
|
+
Wu-Manber Optimized multiple-pattern search using block shifts.
|
|
42
|
+
Commentz-Walter Combines Boyer-Moore logic with multiple-pattern optimization.
|
|
43
|
+
|
|
44
|
+
Example:
|
|
45
|
+
|
|
46
|
+
from algorithms.multiple_pattern.aho_corasick import AhoCorasick
|
|
47
|
+
|
|
48
|
+
text = "ACGTACGTGACG"
|
|
49
|
+
patterns = ["ACG", "GAC"]
|
|
50
|
+
ac = AhoCorasick(patterns)
|
|
51
|
+
ac.search(text)
|
|
52
|
+
🚀 Usage
|
|
53
|
+
Clone the repository:
|
|
54
|
+
git clone https://github.com/<your-username>/Pattern-Searching-Algorithms.git
|
|
55
|
+
cd Pattern-Searching-Algorithms
|
|
56
|
+
Run any algorithm:
|
|
57
|
+
python algorithms/single_pattern/naive.py
|
|
58
|
+
python algorithms/multiple_pattern/aho_corasick.py
|
|
59
|
+
📚 Resources
|
|
60
|
+
|
|
61
|
+
Check resources/pattern_searching_links.md for tutorials and detailed explanations:
|
|
62
|
+
|
|
63
|
+
Pattern Searching on GeeksforGeeks
|
|
64
|
+
KMP, Rabin-Karp, Boyer-Moore, Aho-Corasick tutorials
|
|
65
|
+
Wu-Manber and Commentz-Walter references
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pattern_searching
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Single-pattern and multiple-pattern string searching algorithms in Python
|
|
5
|
+
Home-page: https://github.com/HADIL19/Pattern-Searching
|
|
6
|
+
Author: Hadil Khelif
|
|
7
|
+
Author-email: your_email@example.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.7
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: classifier
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: home-page
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
23
|
+
|
|
24
|
+
# Pattern Searching Algorithms
|
|
25
|
+
|
|
26
|
+
This repository contains implementations of **single-pattern and multiple-pattern string searching algorithms** in Python.
|
|
27
|
+
It is designed for students, programmers, and bioinformatics enthusiasts to **learn, practice, and experiment with text and DNA/protein sequence analysis**.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🎯 Relevance to Bioinformatics
|
|
32
|
+
|
|
33
|
+
Pattern searching is crucial in bioinformatics for tasks such as:
|
|
34
|
+
|
|
35
|
+
- Finding **motifs in DNA sequences** (e.g., promoters, binding sites)
|
|
36
|
+
- Identifying **repeated sequences** or mutations in genomes
|
|
37
|
+
- Searching multiple motifs efficiently in large genomic datasets
|
|
38
|
+
|
|
39
|
+
These algorithms provide a foundation for understanding **sequence analysis, text processing, and data mining** in biological data.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 🧩 Single-Pattern Algorithms (Recherche d’un seul motif)
|
|
44
|
+
|
|
45
|
+
| Algorithm | Description |
|
|
46
|
+
|-----------|-------------|
|
|
47
|
+
| Naive | Simple brute-force search for a single pattern. |
|
|
48
|
+
| Morris-Pratt | Optimized for repeated patterns using prefix preprocessing. |
|
|
49
|
+
| Boyer-Moore | Skips unmatched characters using bad character heuristic. |
|
|
50
|
+
| Rabin-Karp | Uses hashing for pattern search. |
|
|
51
|
+
|
|
52
|
+
**Example:**
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from algorithms.single_pattern.naive import naive_search
|
|
56
|
+
|
|
57
|
+
text = "ABABDABACDABABCABAB"
|
|
58
|
+
pattern = "ABABCABAB"
|
|
59
|
+
naive_search(text, pattern)
|
|
60
|
+
🧩 Multiple-Pattern Algorithms (Recherche de plusieurs motifs)
|
|
61
|
+
Algorithm Description
|
|
62
|
+
Rabin-Karp (Multiple) Hash-based search for multiple patterns at once.
|
|
63
|
+
Aho-Corasick Builds a finite automaton for all patterns; very efficient for multiple patterns.
|
|
64
|
+
Wu-Manber Optimized multiple-pattern search using block shifts.
|
|
65
|
+
Commentz-Walter Combines Boyer-Moore logic with multiple-pattern optimization.
|
|
66
|
+
|
|
67
|
+
Example:
|
|
68
|
+
|
|
69
|
+
from algorithms.multiple_pattern.aho_corasick import AhoCorasick
|
|
70
|
+
|
|
71
|
+
text = "ACGTACGTGACG"
|
|
72
|
+
patterns = ["ACG", "GAC"]
|
|
73
|
+
ac = AhoCorasick(patterns)
|
|
74
|
+
ac.search(text)
|
|
75
|
+
🚀 Usage
|
|
76
|
+
Clone the repository:
|
|
77
|
+
git clone https://github.com/<your-username>/Pattern-Searching-Algorithms.git
|
|
78
|
+
cd Pattern-Searching-Algorithms
|
|
79
|
+
Run any algorithm:
|
|
80
|
+
python algorithms/single_pattern/naive.py
|
|
81
|
+
python algorithms/multiple_pattern/aho_corasick.py
|
|
82
|
+
📚 Resources
|
|
83
|
+
|
|
84
|
+
Check resources/pattern_searching_links.md for tutorials and detailed explanations:
|
|
85
|
+
|
|
86
|
+
Pattern Searching on GeeksforGeeks
|
|
87
|
+
KMP, Rabin-Karp, Boyer-Moore, Aho-Corasick tutorials
|
|
88
|
+
Wu-Manber and Commentz-Walter references
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="pattern_searching", # package name, must be unique on PyPI
|
|
5
|
+
version="0.1.0",
|
|
6
|
+
author="Hadil Khelif",
|
|
7
|
+
author_email="your_email@example.com",
|
|
8
|
+
description="Single-pattern and multiple-pattern string searching algorithms in Python",
|
|
9
|
+
long_description=open("README.md", "r", encoding="utf-8").read(),
|
|
10
|
+
long_description_content_type="text/markdown",
|
|
11
|
+
url="https://github.com/HADIL19/Pattern-Searching",
|
|
12
|
+
packages=find_packages(),
|
|
13
|
+
classifiers=[
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"License :: OSI Approved :: MIT License",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
],
|
|
18
|
+
python_requires='>=3.7',
|
|
19
|
+
)
|