branch: externals/guess-language commit a2c048c0f48684eaf1039b0df6adaa468a691c17 Author: Titus von der Malsburg <malsb...@posteo.de> Commit: Titus von der Malsburg <malsb...@posteo.de>
Updated README. --- README.org | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index aaae00e..614f952 100644 --- a/README.org +++ b/README.org @@ -1,11 +1,12 @@ +* Emacs mode that automatically detects the language of the current paragraph -I write a lot of text in multiple languages and I was getting tired of switching the dictionary of my spell-checker all the time. In true Emacs spirit, I decided to do something about this and dusted off my grandpa's parentheses. The code in this repository guesses the language of the current paragraph and then changes the dictionary of ispell and the language-specific settings of typo-mode. It also reruns flyspell on the current paragraph, but only on that paragraph because some docu [...] +I write a lot of text in multiple languages and I was getting tired of switching the dictionary of my spell-checker all the time. In true Emacs spirit, I decided dust off my grandpa's parentheses and to write some code to address this problem. The result is ~guess-language-mode~, a minor mode for Emacs that guesses the language of the current paragraph and then changes the dictionary of ispell and the language settings of typo-mode. It also reruns Flyspell on the current paragraph, bu [...] -This is currently a proof of concept and only supports two languages, English and German. However, it should be very easy to add more languages. +This is currently a proof of concept and only three languages are supported: English, French, German. However, it is very easy to add more languages and this repository already includes the necessary language statistics for 61 additional languages. (These are copied from [[https://github.com/kent37/guess-language][guess_language.py]].) ** Prerequisites -This mode assumes that you have Flyspell configured for all relevant languages (i.e., those listed in ~guess-language-languages~). Guess-language also assumes that [[https://github.com/jorgenschaefer/typoel][typo-mode]] is installed and set up. +This mode assumes that you have Flyspell is activated and configured for all relevant languages (i.e., those listed in ~guess-language-languages~). Guess-language also assumes that [[https://github.com/jorgenschaefer/typoel][typo-mode]] is installed and set up. ** Configuration @@ -16,9 +17,15 @@ This mode assumes that you have Flyspell configured for all relevant languages ( (setq guess-language-min-paragraph-length 30) #+END_SRC +Available languages at this time: + +- ~de~: German +- ~en~: English +- ~fr~: French + ** Usage -Activate ~guess-language-mode~ in the buffer in which you want to use it. To activate is automatically in buffers containing human language (as opposed to programming language), you could add this to ~text-mode-hook~: +Activate ~guess-language-mode~ in the buffer in which you want to use it. To activate it automatically in buffers containing human language (as opposed to programming language), add this to ~text-mode-hook~: #+BEGIN_SRC elisp (add-hook 'text-mode-hook (lambda () (guess-language-mode 1)))