You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 9, 2023. It is now read-only.
**WARNING: `sudachipy link` is no longer available in SudachiPy v0.5.2 and later. **
181
+
182
+
178
183
There are three editions of Sudachi Dictionary, namely, `small`, `core`, and `full`. See [WorksApplications/SudachiDict](https://github.com/WorksApplications/SudachiDict) for the detail.
179
184
180
-
SudachiPy uses `sudachidict_core` by default. You can specify the dictionary with the `link -t` command.
185
+
SudachiPy uses `sudachidict_core` by default.
186
+
187
+
Dictionaries are installed as Python packages `sudachidict_small`, `sudachidict_core`, and `sudachidict_full`.
The dictionary files are not in the package itself, but it is downloaded upon installation.
194
+
195
+
### Dictionary option: command line
196
+
197
+
You can specify the dictionary with the tokenize option `-s`.
181
198
182
199
```bash
183
200
$ pip install sudachidict_small
184
-
$ sudachipy link -t small
201
+
$ echo"外国人参政権"| sudachipy -s small
185
202
```
186
203
187
204
```bash
188
205
$ pip install sudachidict_full
189
-
$ sudachipy link -t full
206
+
$ echo"外国人参政権"| sudachipy -s full
190
207
```
191
208
192
-
You can remove the dictionary link with the `link -u` commnad.
209
+
### Dictionary option: Python package
193
210
194
-
```bash
195
-
$ sudachipy link -u
211
+
You can specify the dictionary with the `Dicionary()` argument;`config_path` or `dict_type`.
212
+
213
+
```python
214
+
class Dictionary(config_path=None, resource_dir=None, dict_type=None)
196
215
```
197
216
198
-
Dictionaries are installed as Python packages `sudachidict_small`, `sudachidict_core`, and `sudachidict_full`. SudachiPy tries to refer `sudachidict` package to use a dictionary. The `link` subcommand creates *a symbolic link* of `sudachidict_*` as `sudachidict`, to switch the packages.
217
+
1. `config_path`
218
+
* You can specify the file path to the setting file with `config_path` (See [Dictionary in The Setting File](#Dictionary in The Setting File) for the detail).
219
+
* If the dictionary file is specified in the setting file as `systemDict`, SudachiPy will use the dictionary.
220
+
2. `dict_type`
221
+
* You can also specify the dictionary type with `dict_type`.
222
+
* The available arguments are `small`, `core`, or `full`.
223
+
* If different dictionaries are specified with `config_path` and `dict_type`, **a dictionary defined `dict_type` overrides** those defined in the config path.
The dictionary files are not in the package itself, but it is downloaded upon installation.
205
245
206
246
### Dictionary in The Setting File
207
247
@@ -256,7 +296,7 @@ optional arguments:
256
296
-h, --help show this help message and exit
257
297
-d string description comment to be embedded on dictionary
258
298
-o file output file (default: user.dic)
259
-
-s file system dictionary (default: linked system_dic, see link -h)
299
+
-s file system dictionary (default: core dic)
260
300
```
261
301
262
302
About the dictionary file format, please refer to [this document](https://github.com/WorksApplications/Sudachi/blob/develop/docs/user_dict.md) (written in Japanese, English version is not available yet).
0 commit comments