-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- обновил логику - перевел комментарии на русский - подготовил файл, который меняет автоматически длину слова и выбор нужного словаря
- Loading branch information
Showing
19 changed files
with
35,617 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# ░██████╗░██╗░░░██╗░█████╗░███╗░░██╗████████╗██╗░░░██╗███╗░░░███╗ ░██████╗████████╗░█████╗░░█████╗░██╗░░██╗ | ||
# ██╔═══██╗██║░░░██║██╔══██╗████╗░██║╚══██╔══╝██║░░░██║████╗░████║ ██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██║░██╔╝ | ||
# ██║██╗██║██║░░░██║███████║██╔██╗██║░░░██║░░░██║░░░██║██╔████╔██║ ╚█████╗░░░░██║░░░███████║██║░░╚═╝█████═╝░ | ||
# ╚██████╔╝██║░░░██║██╔══██║██║╚████║░░░██║░░░██║░░░██║██║╚██╔╝██║ ░╚═══██╗░░░██║░░░██╔══██║██║░░██╗██╔═██╗░ | ||
# ░╚═██╔═╝░╚██████╔╝██║░░██║██║░╚███║░░░██║░░░╚██████╔╝██║░╚═╝░██║ ██████╔╝░░░██║░░░██║░░██║╚█████╔╝██║░╚██╗ | ||
# ░░░╚═╝░░░░╚═════╝░╚═╝░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░░╚═════╝░╚═╝░░░░░╚═╝ ╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝░╚════╝░╚═╝░░╚═╝ | ||
|
||
|
||
|
||
import configparser | ||
|
||
# Функция для создания и настройки файла конфигурации | ||
def create_config_file(word_length): | ||
config = configparser.ConfigParser() | ||
|
||
config['Settings'] = { | ||
'DictionaryPath': f'dict/russian/russian_nouns_{word_length}.txt', | ||
'ValidCharacters': 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | ||
'йцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ', | ||
'WordLength': str(word_length), | ||
'WordsToRemove': 'clint,garbo,galen,abner' | ||
} | ||
|
||
with open('config.ini', 'w') as configfile: | ||
config.write(configfile) | ||
|
||
while True: | ||
# Спрашиваем пользователя о количестве букв | ||
print("Сколько букв в вашем слове?") | ||
print("Выберите длину слова (от 4 до 11):") | ||
word_length = int(input()) | ||
|
||
if word_length < 4 or word_length > 11: | ||
print("Недопустимая длина слова. Выберите от 4 до 11 букв.") | ||
else: | ||
with open(f'dict/russian/russian_nouns_{word_length}.txt', 'w') as f: | ||
# Здесь можно добавить код для наполнения файла словами нужной длины | ||
pass | ||
|
||
create_config_file(word_length) | ||
print(f"Настройки изменены. Теперь выбрана длина слова: {word_length}") | ||
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
# ░██████╗░██╗░░░██╗░█████╗░███╗░░██╗████████╗██╗░░░██╗███╗░░░███╗ ░██████╗████████╗░█████╗░░█████╗░██╗░░██╗ | ||
# ██╔═══██╗██║░░░██║██╔══██╗████╗░██║╚══██╔══╝██║░░░██║████╗░████║ ██╔════╝╚══██╔══╝██╔══██╗██╔══██╗██║░██╔╝ | ||
# ██║██╗██║██║░░░██║███████║██╔██╗██║░░░██║░░░██║░░░██║██╔████╔██║ ╚█████╗░░░░██║░░░███████║██║░░╚═╝█████═╝░ | ||
# ╚██████╔╝██║░░░██║██╔══██║██║╚████║░░░██║░░░██║░░░██║██║╚██╔╝██║ ░╚═══██╗░░░██║░░░██╔══██║██║░░██╗██╔═██╗░ | ||
# ░╚═██╔═╝░╚██████╔╝██║░░██║██║░╚███║░░░██║░░░╚██████╔╝██║░╚═╝░██║ ██████╔╝░░░██║░░░██║░░██║╚█████╔╝██║░╚██╗ | ||
# ░░░╚═╝░░░░╚═════╝░╚═╝░░╚═╝╚═╝░░╚══╝░░░╚═╝░░░░╚═════╝░╚═╝░░░░░╚═╝ ╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝░╚════╝░╚═╝░░╚═╝ | ||
|
||
[Settings] | ||
DictionaryPath = dict/russian_nouns_five.txt | ||
ValidCharacters = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZйцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ | ||
WordLength = 5 | ||
WordsToRemove = clint,garbo,galen,abner | ||
dictionarypath = dict/russian/russian_nouns_4.txt | ||
validcharacters = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZйцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ | ||
wordlength = 4 | ||
wordstoremove = clint,garbo,galen,abner | ||
|
File renamed without changes.
Oops, something went wrong.