Skip to content

Commit bfcb95b

Browse files
authored
Create codespell.yml (TheAlgorithms#1698)
* fixup! Format Python code with psf/black push * Create codespell.yml * fixup! Format Python code with psf/black push
1 parent c01d178 commit bfcb95b

File tree

78 files changed

+206
-188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+206
-188
lines changed

.github/workflows/codespell.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# GitHub Action to automate the identification of common misspellings in text files
2+
# https://github.com/codespell-project/codespell
3+
name: codespell
4+
on: [push, pull_request]
5+
jobs:
6+
codespell:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v1
11+
- run: pip install codespell flake8
12+
- run: |
13+
SKIP="./.*,./other/dictionary.txt,./other/words,./project_euler/problem_22/p022_names.txt,*.bak,*.gif,*.jpeg,*.jpg,*.json,*.png,*.pyc"
14+
codespell -L ans,fo,hist,iff,secant,tim --skip=$SKIP

DIRECTORY.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@
177177
* [Longest Sub Array](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/longest_sub_array.py)
178178
* [Matrix Chain Order](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/matrix_chain_order.py)
179179
* [Max Sub Array](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/max_sub_array.py)
180-
* [Max Sum Contigous Subsequence](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/max_sum_contigous_subsequence.py)
180+
* [Max Sum Contiguous Subsequence](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/max_sum_contiguous_subsequence.py)
181181
* [Minimum Partition](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/minimum_partition.py)
182182
* [Rod Cutting](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/rod_cutting.py)
183183
* [Subset Generation](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/subset_generation.py)
184184
* [Sum Of Subset](https://github.com/TheAlgorithms/Python/blob/master/dynamic_programming/sum_of_subset.py)
185185

186186
## File Transfer
187-
* [Recieve File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/recieve_file.py)
187+
* [Receive File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/receive_file.py)
188188
* [Send File](https://github.com/TheAlgorithms/Python/blob/master/file_transfer/send_file.py)
189189

190190
## Fuzzy Logic
@@ -219,7 +219,7 @@
219219
* [Kahns Algorithm Topo](https://github.com/TheAlgorithms/Python/blob/master/graphs/kahns_algorithm_topo.py)
220220
* [Minimum Spanning Tree Kruskal](https://github.com/TheAlgorithms/Python/blob/master/graphs/minimum_spanning_tree_kruskal.py)
221221
* [Minimum Spanning Tree Prims](https://github.com/TheAlgorithms/Python/blob/master/graphs/minimum_spanning_tree_prims.py)
222-
* [Multi Hueristic Astar](https://github.com/TheAlgorithms/Python/blob/master/graphs/multi_hueristic_astar.py)
222+
* [Multi Heuristic Astar](https://github.com/TheAlgorithms/Python/blob/master/graphs/multi_heuristic_astar.py)
223223
* [Page Rank](https://github.com/TheAlgorithms/Python/blob/master/graphs/page_rank.py)
224224
* [Prim](https://github.com/TheAlgorithms/Python/blob/master/graphs/prim.py)
225225
* [Scc Kosaraju](https://github.com/TheAlgorithms/Python/blob/master/graphs/scc_kosaraju.py)
@@ -319,6 +319,7 @@
319319
* [Sieve Of Eratosthenes](https://github.com/TheAlgorithms/Python/blob/master/maths/sieve_of_eratosthenes.py)
320320
* [Simpson Rule](https://github.com/TheAlgorithms/Python/blob/master/maths/simpson_rule.py)
321321
* [Softmax](https://github.com/TheAlgorithms/Python/blob/master/maths/softmax.py)
322+
* [Square Root](https://github.com/TheAlgorithms/Python/blob/master/maths/square_root.py)
322323
* [Sum Of Arithmetic Series](https://github.com/TheAlgorithms/Python/blob/master/maths/sum_of_arithmetic_series.py)
323324
* [Test Prime Check](https://github.com/TheAlgorithms/Python/blob/master/maths/test_prime_check.py)
324325
* [Trapezoidal Rule](https://github.com/TheAlgorithms/Python/blob/master/maths/trapezoidal_rule.py)
@@ -469,6 +470,8 @@
469470
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_28/sol1.py)
470471
* Problem 29
471472
* [Solution](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_29/solution.py)
473+
* Problem 30
474+
* [Soln](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_30/soln.py)
472475
* Problem 31
473476
* [Sol1](https://github.com/TheAlgorithms/Python/blob/master/project_euler/problem_31/sol1.py)
474477
* Problem 32
@@ -508,6 +511,7 @@
508511
* [Quick Select](https://github.com/TheAlgorithms/Python/blob/master/searches/quick_select.py)
509512
* [Sentinel Linear Search](https://github.com/TheAlgorithms/Python/blob/master/searches/sentinel_linear_search.py)
510513
* [Simple-Binary-Search](https://github.com/TheAlgorithms/Python/blob/master/searches/simple-binary-search.py)
514+
* [Simulated Annealing](https://github.com/TheAlgorithms/Python/blob/master/searches/simulated_annealing.py)
511515
* [Tabu Search](https://github.com/TheAlgorithms/Python/blob/master/searches/tabu_search.py)
512516
* [Ternary Search](https://github.com/TheAlgorithms/Python/blob/master/searches/ternary_search.py)
513517

@@ -564,7 +568,7 @@
564568
* [Reverse Words](https://github.com/TheAlgorithms/Python/blob/master/strings/reverse_words.py)
565569
* [Split](https://github.com/TheAlgorithms/Python/blob/master/strings/split.py)
566570
* [Upper](https://github.com/TheAlgorithms/Python/blob/master/strings/upper.py)
567-
* [Word Occurence](https://github.com/TheAlgorithms/Python/blob/master/strings/word_occurence.py)
571+
* [Word Occurrence](https://github.com/TheAlgorithms/Python/blob/master/strings/word_occurrence.py)
568572

569573
## Traversals
570574
* [Binary Tree Traversals](https://github.com/TheAlgorithms/Python/blob/master/traversals/binary_tree_traversals.py)

backtracking/n_queens.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def isSafe(board, row, column):
4040

4141
def solve(board, row):
4242
"""
43-
It creates a state space tree and calls the safe function untill it receives a
44-
False Boolean and terminates that brach and backtracks to the next
43+
It creates a state space tree and calls the safe function until it receives a
44+
False Boolean and terminates that branch and backtracks to the next
4545
poosible solution branch.
4646
"""
4747
if row >= len(board):
@@ -58,7 +58,7 @@ def solve(board, row):
5858
"""
5959
For every row it iterates through each column to check if it is feesible to place a
6060
queen there.
61-
If all the combinations for that particaular branch are successfull the board is
61+
If all the combinations for that particular branch are successful the board is
6262
reinitialized for the next possible combination.
6363
"""
6464
if isSafe(board, row, i):
@@ -70,7 +70,7 @@ def solve(board, row):
7070

7171
def printboard(board):
7272
"""
73-
Prints the boards that have a successfull combination.
73+
Prints the boards that have a successful combination.
7474
"""
7575
for i in range(len(board)):
7676
for j in range(len(board)):

ciphers/hill_cipher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
Hill Cipher:
44
The below defined class 'HillCipher' implements the Hill Cipher algorithm.
55
The Hill Cipher is an algorithm that implements modern linear algebra techniques
6-
In this algortihm, you have an encryption key matrix. This is what will be used
6+
In this algorithm, you have an encryption key matrix. This is what will be used
77
in encoding and decoding your text.
88
9-
Algortihm:
9+
Algorithm:
1010
Let the order of the encryption key be N (as it is a square matrix).
1111
Your text is divided into batches of length N and converted to numerical vectors
1212
by a simple mapping starting with A=0 and so on.
1313
14-
The key is then mulitplied with the newly created batch vector to obtain the
14+
The key is then multiplied with the newly created batch vector to obtain the
1515
encoded vector. After each multiplication modular 36 calculations are performed
1616
on the vectors so as to bring the numbers between 0 and 36 and then mapped with
1717
their corresponding alphanumerics.

ciphers/rsa_cipher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
def main():
88
filename = "encrypted_file.txt"
9-
response = input(r"Encrypte\Decrypt [e\d]: ")
9+
response = input(r"Encrypt\Decrypt [e\d]: ")
1010

1111
if response.lower().startswith("e"):
1212
mode = "encrypt"

ciphers/rsa_key_generator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ def makeKeyFiles(name, keySize):
4242

4343
publicKey, privateKey = generateKey(keySize)
4444
print("\nWriting public key to file %s_pubkey.txt..." % name)
45-
with open("%s_pubkey.txt" % name, "w") as fo:
46-
fo.write("{},{},{}".format(keySize, publicKey[0], publicKey[1]))
45+
with open("%s_pubkey.txt" % name, "w") as out_file:
46+
out_file.write("{},{},{}".format(keySize, publicKey[0], publicKey[1]))
4747

4848
print("Writing private key to file %s_privkey.txt..." % name)
49-
with open("%s_privkey.txt" % name, "w") as fo:
50-
fo.write("{},{},{}".format(keySize, privateKey[0], privateKey[1]))
49+
with open("%s_privkey.txt" % name, "w") as out_file:
50+
out_file.write("{},{},{}".format(keySize, privateKey[0], privateKey[1]))
5151

5252

5353
if __name__ == "__main__":

compression/burrows_wheeler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ def reverse_bwt(bwt_string: str, idx_original_string: int) -> str:
157157
entry_msg = "Provide a string that I will generate its BWT transform: "
158158
s = input(entry_msg).strip()
159159
result = bwt_transform(s)
160-
bwt_output_msg = "Burrows Wheeler tranform for string '{}' results in '{}'"
160+
bwt_output_msg = "Burrows Wheeler transform for string '{}' results in '{}'"
161161
print(bwt_output_msg.format(s, result["bwt_string"]))
162162
original_string = reverse_bwt(result["bwt_string"], result["idx_original_string"])
163163
fmt = (
164-
"Reversing Burrows Wheeler tranform for entry '{}' we get original"
164+
"Reversing Burrows Wheeler transform for entry '{}' we get original"
165165
" string '{}'"
166166
)
167167
print(fmt.format(result["bwt_string"], original_string))

compression/huffman.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, freq, left, right):
2121
def parse_file(file_path):
2222
"""
2323
Read the file and build a dict of all letters and their
24-
frequences, then convert the dict into a list of Letters.
24+
frequencies, then convert the dict into a list of Letters.
2525
"""
2626
chars = {}
2727
with open(file_path) as f:

0 commit comments

Comments
 (0)