Почему pycharm подчеркивает русские слова
Перейти к содержимому

Почему pycharm подчеркивает русские слова

  • автор:

Spellchecking

PyCharm checks the spelling of all your source code, including variable names, text in strings, comments, literals, and commit messages. For this purpose, PyCharm provides a dedicated Typo inspection which is enabled by default.

The Typo inspection detects and highlights words that are not included in any dictionary. You can either correct the spelling or save the word to the dictionary.

Disable the Typo inspection if you want to ignore all spelling mistakes. For more information, see Disable spellchecking.

Correct a misspelled word

Place the caret at any word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

Select one of the suggested fixes from the list.

In string literals and comments, only the spelling of this particular word at caret changes. For code elements, such as names of variables, functions, classes, and other symbols, the inspection also suggests changing all occurrences via the Rename refactoring.

Save a word to dictionary

If a detected typo is actually a valid word, you can add it to a user-defined dictionary that extends the built-in dictionaries.

Place the caret at a word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

Select the Save to dictionary action to add the word to the user’s dictionary and skip it in the future.

If you have added the word by mistake, press Control+Z to remove it from the dictionary.

By default, PyCharm saves words to the global application-level dictionary. You can choose to save words to the project-level dictionary if the spelling is correct only for this particular project. For more information, see Select the default dictionary for saving words.

Press F2 and Shift+F2 to step through all problems in a file, including typos.

Find all spelling mistakes

The Typo inspection highlights typos in the current file. You can also run the inspection on your entire project or a set of files. For more information, see Run a single inspection.

From the main menu, select Code | Analyze Code | Run Inspection by Name… or press Control+Alt+Shift+I .

In the Enter inspection name popup, find and select the Typo inspection.

In the Run ‘Typo’ dialog, select the scope in which you want to run the inspection, and other options, such as a file mask filter. Then click OK .

PyCharm will run the Typo inspection on all files in the selected scope and show all found typos in a separate tab of the Problems tool window.

Configure the Typo inspection

By default, the Typo inspection checks all text, including code elements, string literals, and comments in all scopes.

Press Control+Alt+S to open the IDE settings and then select Editor | Inspections .

Expand the Proofreading node and click Typo in the central pane.

In the right-hand pane, configure the Typo inspection:

Specify the severity level and the scope in which to apply this level.

For example, if you want typos to stand out more, select Error or Warning to highlight typos similar to syntax errors or warnings in your code.

Specify the type of content to check:

Process code : check various code elements.

Process literals : check text inside string literals.

Process comments : check text inside comments.

Suppress the Typo inspection

Like with any other inspection, you can suppress the Typo inspection for specific files and code elements.

Place the caret at a word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

On one of the suggested fixes, press the right arrow key or click and select Suppress for class or another relevant suppress action.

Depending on the language and code element, this adds a special annotation or comment that tells the editor to suppress the relevant inspection in the corresponding scope. For example, in case of Python, suppressing the Typo inspection for a class adds the following annotation before the class declaration:

This suppresses all spelling checks within the class.

Disable spellchecking

Press Control+Alt+S to open the IDE settings and then select Editor | Inspections .

Clear the checkbox next to the Typo inspection.

Dictionaries

PyCharm includes bundled dictionaries for all configured languages. You cannot change them directly, but you can extend the spellchecker in other ways:

Save words to a built-in global or project dictionary.

Add plain-text files with the .dic extension that contain lists of words.

You can add Hunspell dictionaries, each of which consists of two files: the DIC file that contains a list of words with the applicable modification rules and the AFF file that lists prefixes and suffixes regulated by a specific modification rule. For example, en_GB.dic and en_GB.aff .

Configure the spellchecker dictionaries

Press Control+Alt+S to open the IDE settings and then select Editor | Natural Languages | Spelling .

Configure the list of custom dictionaries:

To add a new custom dictionary to the list, click or press Alt+Insert and specify the location of the required file.

To edit the contents of a custom dictionary in PyCharm, select it and click or press Enter . The corresponding file will open in a new editor tab.

To remove a custom dictionary from the list, select it and click or press Alt+Delete .

Select the default dictionary for saving words

By default, PyCharm saves words to the global application-level dictionary. You can choose to save words to the project-level dictionary if the spelling is correct only for this particular project.

Press Control+Alt+S to open the IDE settings and then select Editor | Natural Languages | Spelling .

Select either the built-in project-level or application-level dictionary or disable the option to prompt you every time you save a word.

Add accepted words manually

Press Control+Alt+S to open the IDE settings and then select Editor | Natural Languages | Spelling .

Add words to the Accepted words list. PyCharm adds manually accepted words to the project-level dictionary.

You can’t add words that are already present in one of the dictionaries and mixed-case words, such as CamelCase and snake_case .

The Accepted words list also contains words that you saved to either the built-in global or project dictionary. Although it does not contain words added to the project-level dictionary by other users and words from other custom dictionaries, the Typo inspection will not highlight them.

Share dictionaries

PyCharm stores the built-in project-level dictionary with other project-related files. This means that anyone working with the project has access to the words stored in this dictionary.

To share your application-level dictionary, use the bundled Settings Sync plugin.

Проблема с проверкой орфографии в Pycharm

Я столкнулся с такой проблемой: когда я пишу код или комментарий на русском языке, то у меня все русские слова подчеркнуты зеленой волнистой линией (на скриншоте пару штук не подчеркнуты потому, что я их добавил в словарь

Скриншот экрана

Spatz's user avatar

Скорее всего у вас не установлена поддержка русского языка.

Зайдите в настройки (меню File -> Settings) и найдите раздел Editor -> Natural Languages

Справа будет список языков, а под ним иконка со знаком + для добавления дополнительных языков. Добавьте русский язык и всё должно заработать.

введите сюда описание изображения

Дополнительную информацию ищите в доках плагина Grazie.

Spatz's user avatar

Поскольку он расчитан на английские слова он думает что русские слова это опечатка, игнорируй это

Пичарм стал подеркивать все красным

В трее значок сети стал красным (крестик).
Здравствуйте. Помогите, пожалуйста, как вернуть значок сети в трее в исходное состояние (то есть.

Почему ранее работавший код стал подчеркиваться красным?
Всем добрый. setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); //Фиксируем.

Почему все в теге p красным цветом
В общем как то случаем перевел сайт в translate google и все что находится в теге p (текст) стало.

Выделить на экране красным цветом все цифры (tasm)
Ребята нужна помощь! Выделить на экране красным цветом все цифры.

DOPIXKMNLD, а ты зачем внутри венва создаешь модули? Венв вообще не трогай, создай пакет пайтон, там модуль и работай.

Добавлено через 31 секунду
ну и плюс попробуй сбросить кеш и рестарт сделать (опция в меню Файл)

Лучший ответСообщение было отмечено DOPIXKMNLD как решение

Решение

Сообщение от DOPIXKMNLD

на названии своего проекта ПКМ и выбрать создать = проект питон, появится папка, в ней создавай модули

ну или вот как выше написали

Добавлено через 57 секунд
а, нет, косяк за мной, плохо посмотрел, он у тебя не в венве, но все равно лучше пакеты создавать

Лучший ответСообщение было отмечено DOPIXKMNLD как решение

Решение

Строка. Выделить все русские слова красным цветом
Помогите с заданием. Нужно в строке выделить все русские слова красным цветом.

При включении все индикаторы мигают красным и работает насос
Помогите, пожалуйста, какая ошибка тут? Стиральная машина мигает красным, работает насос сразу же.

В произвольном тексте все e-mail адреса вывести красным цветом
В произвольном тексте все e-mail адреса вывести красным цветом и привести к виду <a.

В тексте все полиндромы выделить красным цветом с увеличеной яркостью
Помогите пожалуйста. Задача не тяжелая, но не могу понять как выделить в самом тексте. Напишите.

Дан текст в контейнере выделить все гласные буквы красным цветом
Как на подобие вот такого вот сприпта сделать чтобы все гласные быквы в тексте выделялись красным.

Как убрать подчеркивание русских слов в pycharm

PyCharm checks the spelling of all your source code, including variable names, text in strings, comments, literals, and commit messages. For this purpose, PyCharm provides a dedicated Typo inspection which is enabled by default.

The Typo inspection detects and highlights words that are not included in any dictionary. You can either correct the spelling or save the word to the dictionary.

Disable the Typo inspection if you want to ignore all spelling mistakes. For more information, see Disable spellchecking.

Correct a misspelled word

Place the caret at any word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

Select one of the suggested fixes from the list.

In string literals and comments, only the spelling of this particular word at caret changes. For code elements, such as names of variables, functions, classes, and other symbols, the inspection also suggests changing all occurrences via the Rename refactoring.

Save a word to dictionary

If a dedected typo is actually a valid word, you can add it to a user-defined dictionary that extends the built-in dictionaries.

Place the caret at a word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

Select the Save to dictionary action to add the word to the user’s dictionary and skip it in the future.

If you have added the word by mistake, press Ctrl+Z to remove it from the dictionary.

By default, PyCharm saves words to the global application-level dictionary. You can choose to save words to the project-level dictionary if the spelling is correct only for this particular project. For more information, see Select the default dictionary for saving words.

Press F2 and Shift+F2 to step through all problems in a file, including typos.

Find all spelling mistakes

The Typo inspection highlights typos in the current file. You can also run the inspection on your entire project or a set of files. For more information, see Run a single inspection.

From the main menu, select Code | Analyze Code | Run Inspection by Name… or press Ctrl+Alt+Shift+I .

In the Enter inspection name popup, find and select the Typo inspection.

In the Run ‘Typo’ dialog, select the scope in which you want to run the inspection, and other options, such as a file mask filter. Then click OK .

PyCharm will run the Typo inspection on all files in the selected scope and show all found typos in a separate tab of the Problems tool window.

Configure the Typo inspection

By default, the Typo inspection checks all text, including code elements, string literals, and comments in all scopes.

Press Ctrl+Alt+S to open the IDE settings and select Editor | Inspections .

Expand the Proofreading node and click Typo in the central pane.

In the right-hand pane, configure the Typo inspection:

Specify the severity level and the scope in which to apply this level.

For example, if you want typos to stand out more, select Error or Warning to highlight typos similar to syntax errors or warnings in your code.

Specify the type of content to check:

Process code : check various code elements.

Process literals : check text inside string literals.

Process comments : check text inside comments.

Suppress the Typo inspection

Like with any other inspection, you can suppress the Typo inspection for specific files and code elements.

Place the caret at a word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

On one of the suggested fixes, press the right arrow key or click and select Suppress for class or another relevant suppress action.

Depending on the language and code element, this adds a special annotation or comment that tells the editor to suppress the relevant inspection in the corresponding scope. For example, in case of Python, suppressing the Typo inspection for a class adds the following annotation before the class declaration:

This suppresses all spelling checks within the class.

Disable spellchecking

Press Ctrl+Alt+S to open the IDE settings and select Editor | Inspections .

Clear the checkbox next to the Typo inspection.

Dictionaries

PyCharm includes bundled dictionaries for all configured languages. You cannot change them directly, but you can extend the spellchecker in other ways:

Save words to a built-in global or project dictionary.

Add plain-text files with the .dic extension that contain lists of words.

You can add Hunspell dictionaries, each of which consists of two files: the DIC file that contains a list of words with the applicable modification rules and the AFF file that lists prefixes and suffixes regulated by a specific modification rule. For example, en_GB.dic and en_GB.aff .

Configure the spellchecker dictionaries

Press Ctrl+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .

Configure the list of custom dictionaries:

To add a new custom dictionary to the list, click or press Alt+Insert and specify the location of the required file.

To edit the contents of a custom dictionary in PyCharm, select it and click or press Enter . The corresponding file will open in a new editor tab.

To remove a custom dictionary from the list, select it and click or press Alt+Delete .

Select the default dictionary for saving words

By default, PyCharm saves words to the global application-level dictionary. You can choose to save words to the project-level dictionary if the spelling is correct only for this particular project.

Press Ctrl+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .

Select either the built-in project-level or application-level dictionary or disable the option to prompt you every time you save a word.

Add accepted words manually

Press Ctrl+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .

Add words to the Accepted words list. PyCharm adds manually accepted words to the project-level dictionary.

You can’t add words that are already present in one of the dictionaries and mixed-case words, such as CamelCase and snake_case .

The Accepted words list also contains words that you saved to either the built-in global or project dictionary. Although it does not contain words added to the project-level dictionary by other users and words from other custom dictionaries, the Typo inspection will not highlight them.

Share dictionaries

PyCharm stores the built-in project-level dictionary with other project-related files. This means that anyone working with the project has access to the words stored in this dictionary.

To share your application-level dictionary, use the bundled IDE Settings Sync plugin.

Как избежать проверки орфографии в строке в Pycharm

Где можно отключить проверку орфографии в строках для PyCharm IDE? Ненавижу зубчатые линии под моими комментариями и строками.

Перейти к File -> Settings -> Editor -> Inspections . Разверните список Spelling в среднем окне и снимите флажок Typo .

введите описание изображения здесь

Однако практически большая часть неровной линии вызвана нарушениями стиля кодирования PEP 8 . Если вы хотите отключить и эту опцию, в том же окне разверните список Python и снимите отметку с опции PEP 8 coding style violation .

В последней версии PyCharm он отображается как ProofReading:

Корректура

PyCharm не проверяет синтаксис внутри строк и комментариев. Проверяет орфографию .

Вы можете найти настройки проверки орфографии на странице Настройки . В настройках проекта есть страница правописания . Внутри этой страницы в нижней части вкладки « Словари » вы можете включить / отключить словари. Если вы не хотите проверять орфографию, просто отключите их все.

Обратите внимание, что можно добавить собственные слова в средство проверки орфографии или, если у вас уже есть словарь на вашем компьютере, вы можете добавить его. Это может оказаться полезным, если вы хотите проверить правописание на разных языках (например, итальянском).

В частности , если вы используете систему Linux и вы установили итальянский языковой пакет, вы , вероятно , есть итальянский словарь под: /usr/share/dict/italian . Вы можете добавить /usr/share/dict каталог в каталоги, в которых выполняется поиск словарей, и включить italian словарь.

Проблема с проверкой орфографии в Pycharm

Я столкнулся с такой проблемой: когда я пишу код или комментарий на русском языке, то у меня все русские слова подчеркнуты зеленой волнистой линией (на скриншоте пару штук не подчеркнуты потому, что я их добавил в словарь

Скриншот экрана

Spatz's user avatar

Скорее всего у вас не установлена поддержка русского языка.

Зайдите в настройки (меню File -> Settings) и найдите раздел Editor -> Natural Languages

Справа будет список языков, а под ним иконка со знаком + для добавления дополнительных языков. Добавьте русский язык и всё должно заработать.

введите сюда описание изображения

Дополнительную информацию ищите в доках плагина Grazie.

Spatz's user avatar

Поскольку он расчитан на английские слова он думает что русские слова это опечатка, игнорируй это

Как избежать проверки орфографии в строке в Pycharm

Где можно отключить проверку орфографии в строках для PyCharm IDE? Ненавижу зубчатые линии под моими комментариями и строками.

9 ответов

Перейти к File -> Settings -> Editor -> Inspections . Разверните список под Spelling в среднем окне и снимите флажок Typo .

enter image description here

В последней версии PyCharm он отображается как ProofReading:

ProofReading

Вы можете отключить проверку орфографии для определенного раздела кода, добавив над ним комментарий # noinspection SpellCheckingInspection .

PyCharm не проверяет синтаксис внутри строк и комментариев. Он проверяет орфографию .

Вы можете найти настройки проверки орфографии на странице Настройки . . В Настройках проекта есть страница Орфография . На этой странице в нижней части вкладки Словари вы можете включить / отключить словари. Если вы не хотите проверять орфографию, просто отключите их все.

Обратите внимание, что можно добавить собственные слова в средство проверки орфографии или, если у вас уже есть словарь на вашем компьютере, вы можете добавить его. Это может оказаться полезным, если вы хотите проверить правописание на разных языках (например, итальянском).

В частности, если вы используете систему Linux и установили пакет итальянского языка, у вас, вероятно, есть итальянский словарь в разделе: /usr/share/dict/italian . Вы можете добавить каталог /usr/share/dict в каталоги, в которых выполняется поиск словарей, и включить словарь italian .

Похоже, PyCharm проверяет только файлы с расширением .dic . Если вы хотите использовать /usr/share/dict/italian , вам, вероятно, следует либо скопировать его в другой каталог, переименовав его в italian.dic , либо создать символическую ссылку.

На мой взгляд, лучший вариант — отключить проверку опечаток только для кода . Таким образом исчезают зеленые линии под именами переменных / методов / классов и строк, но PyCharm по-прежнему контролирует комментарии, чтобы избежать орфографических ошибок, поэтому у вас есть как красивый компактный код, так и полностью понятная документация.

Я точно не знаю, с какой версии PyCharm этот параметр доступен, но наверняка в версии 2020.2, если вы выделите Опечатку в Настройки> Редактор> Инспекции> Корректура , появится три дополнительных параметра на правой панели — просто снимите флажок Обработать код.

enter image description here

В более новой версии PyCharm перейдите в «Настройки» -> «Редактор» -> «Инспекции» -> «Орфография».

Вы также можете добавить определенное слово-опечатку в словарь PyCharm, нажав Alt + Enter это слово и выбрав Save [typo word] to dictionary . Иногда это лучший выбор для меня.

Я нашел, как отключить опечатки только в строковых литералах в официальном документацию, отключив литералы процесса, но у меня это не работает (возможно, это ошибка, которая будет исправлена ​​в будущем).

Для одной строки вы можете использовать # noqa в конце строки, и это подавит проверку орфографии (волнистая зеленая линия).

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *