Skip to content

Commit 05033c3

Browse files
Update README around multi-dictionary changes (#1669)
* Update README around multi-dictionary changes * Counting grammar fix * Add back some removed information * Improve the wording * More attempts to cover multiple dictionaries in the readme * Revert another edit about the trailing comma * Apply suggestions from code review Co-authored-by: Eric Larson <[email protected]>
1 parent 94a6fbd commit 05033c3

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

README.rst

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ Display them without terminal colors and with a quiet level of 3. ::
6767

6868
Run interactive mode level 3 and write changes to file.
6969

70-
We ship a dictionary that is an improved version of the one available
70+
We ship a collection of dictionaries that are an improved version of the one available
7171
`on Wikipedia <https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines>`_
7272
after applying them in projects like Linux Kernel, EFL, oFono among others.
7373
You can provide your own version of the dictionary, but patches for
7474
new/different entries are very welcome.
7575

76-
Want to know if a word you're proposing exists in codespell already? It is possible to test a word against the current dictionary that exists in ``codespell_lib/data/dictionary.txt`` via::
76+
Want to know if a word you're proposing exists in codespell already? It is possible to test a word against the current set dictionaries that exist in ``codespell_lib/data/dictionary*.txt`` via::
7777

7878
echo "word" | codespell -
7979
echo "1stword,2ndword" | codespell -
8080

81+
You can select the optional dictionaries with the ``--builtin`` option.
82+
8183
Using a config file
8284
-------------------
8385

@@ -103,10 +105,8 @@ config file.
103105
Dictionary format
104106
-----------------
105107

106-
The format of the dictionary was influenced by the one it originally came from,
107-
i.e. from Wikipedia. The difference is how multiple options are treated and
108-
that the last argument is the reason why a certain entry could not be applied
109-
directly, but instead be manually inspected. E.g.:
108+
The format of the dictionaries was influenced by the one they originally came from,
109+
i.e. from Wikipedia. The difference is how multiple options are treated. E.g.:
110110

111111
1. Simple entry: one wrong word / one suggestion::
112112

@@ -122,12 +122,17 @@ directly, but instead be manually inspected. E.g.:
122122
to give the user the file and line where the error occurred as well as
123123
the suggestions.
124124

125-
3. Entry with one word, but with automatically fix disabled::
125+
3. Entry with one word, but with automatic fix disabled::
126126

127127
clas->class, disabled because of name clash in c++
128128

129-
Note that there isn't a comma in the end of the line. The last argument is
129+
Note that there isn't a comma at the end of the line. The last argument is
130130
treated as the reason why a suggestion cannot be automatically applied.
131+
132+
There can also be multiple suggestions but any automatic fix will again be
133+
disabled::
134+
135+
clas->class, clash, disabled because of name clash in c++
131136

132137
Development Setup
133138
-----------------
@@ -147,19 +152,21 @@ If you have a suggested typo that you'd like to see merged please follow these s
147152

148153
1. Make sure you read the instructions mentioned in the ``Dictionary format`` section above to submit correctly formatted entries.
149154

150-
2. Sort the dictionary. This is done by invoking (in the top level directory of ``codespell/``)::
155+
2. Choose the correct dictionary file to add your typo too. See `codespell --help` for explanations of the different dictionaries.
156+
157+
3. Sort the dictionaries. This is done by invoking (in the top level directory of ``codespell/``)::
151158

152159
make check-dictionaries
153160

154-
If the make script finds that you need to sort the dictionary, please then run::
161+
If the make script finds that you need to sort a dictionary, please then run::
155162

156163
make sort-dictionaries
157164

158-
3. Only after this process is complete do we recommend you submit the PR.
165+
4. Only after this process is complete do we recommend you submit the PR.
159166

160167
**Important Notes:**
161168

162-
* If the dictionary is submitted without being pre-sorted the PR will fail via TravisCI.
169+
* If the dictionaries are submitted without being pre-sorted the PR will fail via our various CI tools.
163170
* Not all PRs will be merged. This is pending on the discretion of the devs, maintainers, and the community.
164171

165172
Updating
@@ -178,16 +185,19 @@ To stay current with codespell developments it is possible to build codespell fr
178185
* It has been reported that after installing from ``pip``, codespell can't be located. Please check the $PATH variable to see if ``~/.local/bin`` is present. If it isn't then add it to your path.
179186
* If you decide to install via ``pip`` then be sure to remove any previously installed versions of codespell (via your platform's preferred app manager).
180187

181-
Updating the dictionary
182-
-----------------------
188+
Updating the dictionaries
189+
-------------------------
183190

184-
In the scenario where the user prefers not to follow the development version of codespell yet still opts to benefit from the frequently updated `dictionary.txt` file, we recommend running a simple set of commands to achieve this ::
191+
In the scenario where the user prefers not to follow the development version of codespell yet still opts to benefit from the frequently updated dictionary files, we recommend running a simple set of commands to achieve this ::
185192

186193
wget https://raw.githubusercontent.com/codespell-project/codespell/master/codespell_lib/data/dictionary.txt
187194
codespell -D dictionary.txt
188195

189196
The above simply downloads the latest ``dictionary.txt`` file and then by utilizing the ``-D`` flag allows the user to specify the freshly downloaded ``dictionary.txt`` as the custom dictionary instead of the default one.
190197

198+
You can also do the same thing for the other dictionaries listed here:
199+
https://github.com/codespell-project/codespell/tree/master/codespell_lib/data
200+
191201
License
192202
-------
193203

0 commit comments

Comments
 (0)