Comments (6)
Thank you so much, @abougouffa !
I was able to use your code to load two different files for the same language.
(setq lsp-ltex-dictionary
`(:en-US ; English
,(vconcat
(string-lines
(with-temp-buffer
(insert-file-contents "path/to/your/custom/dictionary.english.txt")
(buffer-string)))
(string-lines
(with-temp-buffer
(insert-file-contents "path/to/another/custom/dictionary.english.txt")
(buffer-string))))))
For anyone else reading this, note that the file names can be anything. You can even use a ~
in the file path.
from lsp-ltex.
Hello @JoeyEremondi,
I've just commented on the original issue #4 (comment)
Do you have any idea?
from lsp-ltex.
Has anyone figured out how to read from a file? Or has this feature not been implemented yet? Just curious to know its state.
from lsp-ltex.
It's implemented in #26. Closing this issue now. ;)
from lsp-ltex.
Since I'm not too familiar with emacs configuration, how would I go about adding a file as a dictionary? The file contains a single word per line.
from lsp-ltex.
Theoretically, we can use such a file as a dictionary by setting the lsp-ltex-dictionary
to the language and the file name, something like this:
(setq lsp-ltex-dictionary
'(:fr [":/home/hacko/.config/emacs/ltex-dict.french.txt"]
:en [":/home/hacko/.config/emacs/ltex-dict.english.txt"]
:ar [":/home/hacko/.config/emacs/ltex-dict.arabic.txt"]))
However, the last time I've tested this it wasn't working, I think it is a problem in the upstream ltex-ls
, but I didn't figure out the real cause of the problem (see #4 (comment)).
You can also set the list of words to add to the directory by modifying the lsp-ltex-dictionary
value using for example:
(setq lsp-ltex-dictionary
'(:fr ["coplanarité" "neuromorphique"] :en ["photometrically" "neuromorphic"]))
Currently, lsp-ltex
provide a workaround for adding words to a custom directory (via code actions -> Add "word" to dictionary"
). However, the used format is not a text file with a word per line, but rather, an Emacs Lisp file representing the value of lsp-ltex-dictionary
, following the same format as the code above:
(:fr ["coplanarité" "neuromorphique"] :en ["photometrically" "neuromorphic"])
As a workaround, you can probably load the directory file elements and use it in the lsp-ltex-directory
variable, using for example:
(setq lsp-ltex-dictionary
`(:en ; English
,(vconcat
(string-lines
(with-temp-buffer
(insert-file-contents "path/to/your/custom/dictionary.english.txt")
(buffer-string))))
:fr ; French
,(vconcat
(string-lines
(with-temp-buffer
(insert-file-contents "path/to/your/custom/dictionary.french.txt")
(buffer-string))))))
I hope this answers your question!
from lsp-ltex.
Related Issues (20)
- How to ignore org-mode syntax? HOT 5
- Configuration over Tramp
- Minor documentation fix: JAVA_HOME does not need to be setup if using the standalone ltex-ls version that includes java HOT 4
- Suggestions offered by ltex-ls are not shown HOT 2
- Don't seem to be find the lsp-ltex direction HOT 6
- lsp-ltex does not recognize already installed ltex-ls HOT 15
- Does not work with `lsp-use-plists` HOT 8
- lsp-ltex with eglot? HOT 2
- Premium features HOT 2
- No command to trigger manual check HOT 1
- `JAVA_HOME is not defined correctly` error with platform-dependent version HOT 4
- Can't get it to work with `rst-mode` HOT 2
- Correct path for LTeX ? HOT 2
- Possibility to disable rules on a per-mode basis HOT 3
- Activating lsp-ltex in other modes HOT 3
- How to use the ltex-dictionary variable HOT 8
- New version of lsp-ltex is not started HOT 14
- Adding an error threshold
- error on use-package HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lsp-ltex.