hsanagrams 0.2.0__py3-none-any.whl
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.
hsanagrams/__init__.py
ADDED
hsanagrams/__main__.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
from hsanagrams.anagrams import Anagrams
|
|
3
|
+
|
|
4
|
+
def main(word, wordspath):
|
|
5
|
+
anagrams = Anagrams(wordspath)
|
|
6
|
+
print(anagrams.get_anagrams(word))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def mainexternal():
|
|
11
|
+
parser = argparse.ArgumentParser(description="Process a file with optional settings.")
|
|
12
|
+
parser.add_argument("word", help="Word")
|
|
13
|
+
parser.add_argument("filename", help="The target file to process") # Positional (required)
|
|
14
|
+
args = parser.parse_args()
|
|
15
|
+
main(args.word, args.filename)
|
|
16
|
+
|
|
17
|
+
if __name__ == "__main__":
|
|
18
|
+
mainexternal()
|
hsanagrams/anagrams.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
|
|
3
|
+
class Anagrams:
|
|
4
|
+
|
|
5
|
+
def __init__(self, wordsfile):
|
|
6
|
+
with open(wordsfile, "r") as file:
|
|
7
|
+
self.words = file.read().splitlines()
|
|
8
|
+
|
|
9
|
+
def get_anagrams(self, targetword):
|
|
10
|
+
target_key = sorted(targetword.lower())
|
|
11
|
+
matches = [word for word in self.words if sorted(word.lower()) == target_key]
|
|
12
|
+
return matches
|
|
13
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: hsanagrams
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Author: Hernan Saltiveri
|
|
6
|
+
Author-email: Hernan Saltiveri <hernansaltiveri@gmail.com>
|
|
7
|
+
Requires-Dist: build>=1.6.1
|
|
8
|
+
Requires-Python: >=3.13
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
# Anagrams
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
This tool is designed to retrieve a list of anagram words based on a dictionary with all the posible words and a target search word. All the words in the retrieved list will be an anagram of the provided search word.
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Table of Contents
|
|
24
|
+
|
|
25
|
+
- [Features](#features)
|
|
26
|
+
- [Installation](#installation)
|
|
27
|
+
- [Usage](#usage)
|
|
28
|
+
- [Contributing](#contributing)
|
|
29
|
+
- [License](#license)
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
This tool is designed to retrieve a list of anagram words based on a dictionary with all the posible words and a target search word. All the words in the retrieved list will be an anagram of the provided search word.
|
|
33
|
+
|
|
34
|
+
Examples:
|
|
35
|
+
|
|
36
|
+
> For the word: 'plates' some anagrams are 'palest', 'pastel', 'petals', 'plates' and 'staple'. If the provided list contains those values they will be retrieved.
|
|
37
|
+
|
|
38
|
+
> Another example would be for the word 'eat' some posible retrieve values are 'ate', 'eat' are 'tea' (if they where on the input list)
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
- How to build it from source
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- How to install it from source
|
|
54
|
+
- How to install it from pypi
|
|
55
|
+
- How to use it as a command line tool
|
|
56
|
+
- How to use it as a module
|
|
57
|
+
- How to run all tests
|
|
58
|
+
- Conclusion/Final words
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Contributing
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
Distributed under the MIT License. See `LICENSE` for more information.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
hsanagrams/__init__.py,sha256=zI5QtLSrgJ6Xv5WL6_-pM3KHM9pnZmSbw91YavknZfg,54
|
|
2
|
+
hsanagrams/__main__.py,sha256=s3CWTb95sg2FAjcmVD37zRuiqdxNbEh23fr6zbISRTA,527
|
|
3
|
+
hsanagrams/anagrams.py,sha256=MUMQkdBa-mgeqS40AWaJNspPALeN2gVMjhFe2NZQ0jk,368
|
|
4
|
+
hsanagrams-0.2.0.dist-info/WHEEL,sha256=_d8F1e7SqtoW6CDj4Gi8lFC26a_7I17R7zPLCKTp4Fg,81
|
|
5
|
+
hsanagrams-0.2.0.dist-info/entry_points.txt,sha256=xWV2V4-x6mSO5djsBR0PUyMw3qvCriTcn7z-PqI4k7Q,65
|
|
6
|
+
hsanagrams-0.2.0.dist-info/METADATA,sha256=NBI_bUANEHkolD0c-eb68TQ_tppQRs7-X9n6M7C0nEc,1752
|
|
7
|
+
hsanagrams-0.2.0.dist-info/RECORD,,
|