Skip to content

Commit

Permalink
V1.2
Browse files Browse the repository at this point in the history
- Упростил структуры файлов
- Скрипты для сортировки и удаления ненужных символов вынес в отдельную папку
  • Loading branch information
Plim4ik committed Jun 14, 2023
1 parent 1dbae9e commit 15d6358
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
7 changes: 0 additions & 7 deletions nouns_sorter.py

This file was deleted.

4 changes: 2 additions & 2 deletions letter_e_replacer.py → sort_replace/letter_e_replacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# ░╚═██╔═╝░╚██████╔╝██║░░██║██║░╚███║░░░██║░░░╚██████╔╝██║░╚═╝░██║  ██████╔╝░░░██║░░░██║░░██║╚█████╔╝██║░╚██╗
# ░░░╚═╝░░░░╚═════╝░╚═╝░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░░╚═════╝░╚═╝░░░░░╚═╝  ╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝░╚════╝░╚═╝░░╚═╝

with open("dict/russian_nouns_five.txt", "r") as f:
with open("../dict/russian_nouns_five.txt", "r") as f:
file_content = f.read()

file_content = file_content.replace("ё", "е")

with open("dict/russian_nouns_five.txt", "w") as f:
with open("../dict/russian_nouns_five.txt", "w") as f:
f.write(file_content)
14 changes: 14 additions & 0 deletions sort_replace/nouns_sorter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ░██████╗░██╗░░░██╗░█████╗░███╗░░██╗████████╗██╗░░░██╗███╗░░░███╗  ░██████╗████████╗░█████╗░░█████╗░██╗░░██╗
# ██╔═══██╗██║░░░██║██╔══██╗████╗░██║╚══██╔══╝██║░░░██║████╗░████║  ██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██║░██╔╝
# ██║██╗██║██║░░░██║███████║██╔██╗██║░░░██║░░░██║░░░██║██╔████╔██║  ╚█████╗░░░░██║░░░███████║██║░░╚═╝█████═╝░
# ╚██████╔╝██║░░░██║██╔══██║██║╚████║░░░██║░░░██║░░░██║██║╚██╔╝██║  ░╚═══██╗░░░██║░░░██╔══██║██║░░██╗██╔═██╗░
# ░╚═██╔═╝░╚██████╔╝██║░░██║██║░╚███║░░░██║░░░╚██████╔╝██║░╚═╝░██║  ██████╔╝░░░██║░░░██║░░██║╚█████╔╝██║░╚██╗
# ░░░╚═╝░░░░╚═════╝░╚═╝░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░░╚═════╝░╚═╝░░░░░╚═╝  ╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝░╚════╝░╚═╝░░╚═╝

with open("../dict/russian_nouns.txt", "r") as f:
nouns = f.readlines()

five_letter_nouns = filter(lambda x: len(x.strip()) == 5, nouns)

with open("../dict/russian_nouns_five.txt", "w") as f:
f.writelines(five_letter_nouns)
4 changes: 2 additions & 2 deletions worlds_sorter.py → sort_replace/worlds_sorter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# ░╚═██╔═╝░╚██████╔╝██║░░██║██║░╚███║░░░██║░░░╚██████╔╝██║░╚═╝░██║  ██████╔╝░░░██║░░░██║░░██║╚█████╔╝██║░╚██╗
# ░░░╚═╝░░░░╚═════╝░╚═╝░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░░╚═════╝░╚═╝░░░░░╚═╝  ╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝░╚════╝░╚═╝░░╚═╝

with open('dict/russian_nouns_five.txt', 'r') as f:
with open('../dict/russian_nouns_five.txt', 'r') as f:
lines = f.readlines()
lines.sort()

with open('dict/russian_nouns_five.txt', 'w') as f:
with open('../dict/russian_nouns_five.txt', 'w') as f:
f.writelines(lines)

0 comments on commit 15d6358

Please sign in to comment.