Python typo in word

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

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

@Close Закрытые избиратели: я вижу, что двое из вас предлагают перенести это в SU. Вопросы об инструментах программирования являются актуальными для SO , поэтому я не согласен с этими конкретными голосами против.

3 ответа

Вы можете перейти в меню Файл → Настройки → Редактор → Инспекции. Затем вы разверните список в разделе «Правописание» в среднем окне и снимите флажок «Typo». Это оно. Тем не менее, практически большая часть неровной линии вызвана нарушениями «стиля кодирования PEP 8» (см. здесь для получения дополнительной информации). Итак, если вы также хотите отключить этот параметр, вы можете в том же окне развернуть список в разделе «Python» и снять флажок «Нарушение стиля кодирования PEP 8».

PyCharm делает не проверку синтаксиса внутри строк и комментариев. Он проверяет правописание.

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

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

Читайте также:  Python socket read until

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

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

Источник

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

  1. Place the caret at any word highlighted by the Typo inspection.
  2. Click or press Alt+Enter to show the available intention actions.
  3. 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.

  1. Place the caret at a word highlighted by the Typo inspection.
  2. Click or press Alt+Enter to show the available intention actions.
  3. 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.

  1. From the main menu, select Code | Analyze Code | Run Inspection by Name… or press Control+Alt+Shift+I .
  2. In the Enter inspection name popup, find and select the Typo inspection.
  3. 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.

  1. Press Control+Alt+S to open the IDE settings and select Editor | Inspections .
  2. Expand the Proofreading node and click Typo in the central pane.
  3. In the right-hand pane, configure the Typo inspection: Severity 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. Options 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.

How to suppress the Typo inspection

  1. Place the caret at a word highlighted by the Typo inspection.
  2. Click or press Alt+Enter to show the available intention actions.
  3. 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

  1. Press Control+Alt+S to open the IDE settings and select Editor | Inspections .
  2. 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

  1. Press Control+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .
  2. 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.

  1. Press Control+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .
  2. 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

  1. Press Control+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .
  2. 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.

Источник

Русские Блоги

[Python + Pycharm] Есть волнистая линия в нижней части слова, когда подсказка в слове предлагается

При использовании IDEA в коде есть волнистая линия внизу слова, когда появляется подсказка в слове
Причина: функция проверки правописания слова указывает, что текущее правописание неверно,

Решение: переименуйте его в соответствии с номенклатурой горбов

Используйте свое собственное имя в качестве тега. Но обнаружил, что есть очень хорошее напоминание. Волны, я буду твоей сестрой.

Typo:In word ‘miyuehu’ less. (Ctrl+F1)

spellchecker inspection helps locate typos and misspelled in your code,comments and literals, and fix them in one click.

Нима, я не могу принять это. Спешите и найдите решение. , ,

Снимите опечатку правописания (отключите проверку правописания слов)

Нажмите «Применить», чтобы закрыть окно. Посмотрев на него, намек на волну действительно исчез. Хаха ~~~

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

spellchecker inspection helps locate typos and misspelled in your code,comments and literals, and fix them in one click.

Программа проверки орфографии экзамен может помочь найти Орфографическая ошибка с Орфографическая ошибка в вы из Код , Ноты с текст 、 а также ремонт Они в один раз щелчок 。

На данный момент эта функция очень хороша! ! ! Все имеет свою ценность в существовании. , , Мышление. , , Руки вверх. , ,

Да, что-то было обнаружено! ! ! Выберите слово и щелкните правой кнопкой мыши, чтобы лечь.

Изменить на . не обязательно.

Сохранить «miyuehu» в словарь . не означает сохранение в словарь. , , Решающий момент. При взгляде волны исчезли.

На данный момент волна окончательно разрешена, возможно, это и есть решение.

Как начинающий pyCharm, я должен сказать, что эта IDE действительно удобна для написания Python.
Однако из-за проблем со стилем кода я столкнулся с тем, что имя функции должно быть в нижнем регистре, что действительно раздражает. Поделитесь решением здесь.

File –>Settings–>Editor–>Inspections–>Python–>PEP 8 naming convention violation

В правом нижнем углу есть элемент управления списком игнорируемых ошибок, добавьте
N802
N803
N806

code sample message N801 class names should use CapWords convention N802 function name should be lowercase N803 argument name should be lowercase N804 first argument of a classmethod should be named 'cls' N805 first argument of a method should be named 'self' N806 variable in function should be lowercase N811 constant imported as non constant N812 lowercase imported as non lowercase N813 camelcase imported as lowercase N814 camelcase imported as constant

Источник

Оцените статью