I've installed the latest beta (1.9.2) but the spellchecker doesn't work even with enchant installed.
$ pacman -Qi enchant
Name : enchant Version : 2.2.7-1 Description : A wrapper library for generic spell checking Architecture : x86_64 URL : https://abiword.github.io/enchant/ Licenses : LGPL Groups : None Provides : None Depends On : aspell hunspell hspell libvoikko glib2 Optional Deps : None Required By : gspell gtkspell gtkspell3 python-pyenchant webkit2gtk Optional For : hexchat Conflicts With : None Replaces : None Installed Size : 167,00 KiB Packager : Antonio RojasBuild Date : thu 26 september 2019, 08:06:28 AM Install Date : tue 15 october 2019, 11:42:59 AM Install Reason : Installed as a dependency for another package Install Script : No Validated By : Signature
$ yay -Sy enchant
warning: enchant-2.2.7-1 is up to date -- reinstalling
$ yay -Syu
:: Starting full system upgrade... there is nothing to do :: Searching databases for updates... :: Searching AUR for updates... there is nothing to do
Using debian-10 with enchant 1.6.0, I get the only a meaningless error message in gdb:
terminate called after throwing an instance of 'enchant::Exception'
what():
Is there some way to disable the spell checker?
if it's the same way as on windows, on settings.
p.s. run https://github.com/TrinityCore/TrinityCore/blob/master/contrib/debugger/crashreport.gdb to see if you get better data, or if when you start again telegram you get a crash report click send it and put id here.
It crashes already when I click at the settings button聽
null
I don't get crash trying to reach settings or spell checking (debian 10)
https://i.imgur.com/A9SGgOg.png
https://i.imgur.com/o1NwFkZ.png
I tried again and changed the language to english. But I get the same behavior, see: https://imgur.com/a/TfHTzAO
Do you need further information for reproducing?
when you get the crash run:
https://github.com/TrinityCore/TrinityCore/blob/master/contrib/debugger/crashreport.gdb on gdb window.
did it and got the appended backtrace.log file
backtrace.log
@ANaumann85 I'll try to log exceptions instead of crash in 1.9.3 version, if you launch it with debug logs enabled we'll be able to see at least which command causes the exception.
ah, I found the debug hints
The three files from the DebugLogs folder are appended
EDIT: Now (mean with the version 1.9.3) the option to enable or disable the spell checker has appeared in the settings, but still no effective spell check. I can literally write anything, not even taking into account the basic rules of the English language, but nothing is highlighted as an error
At least it does not crash anymore, but spellchecking is not available on debian 10
works for me (TM) https://i.imgur.com/qsLUSKV.png
At least it does not crash anymore, but spellchecking is not available on debian 10
Have you installed enchant?
Yes, it is installed. But when I run strace on Telegram, i recognize two things:
The command
echo "wrongWord" | enchant -a -d "en"
leads to the output
@(#) International Ispell Version 3.1.20 (but really Enchant 1.6.0)
& wrongWord 3 0: wrong Word, wrong-word, wrongdoer
So, I would say, enchant alone works
I think I have understood what the problem is, on manjaro / arch, the CLI command for enchant is enchant-2, not enchant.
Proofs:
~ >>> echo "wrongWord" | enchant -a -d "en"
zsh: command not found: enchant
~ >>> echo "wrongWord" | enchant-2 -a -d "en"
@(#) International Ispell Version 3.1.20 (but really Enchant 2.2.7)
& wrongWord 3 0: wrong Word, wrong-word, wrongdoing
@john-preston I think that is really easy to fix, just read the /etc/os-release file (or more easily use "lsb_release -a") and if the distro is manjaro or arch, add a "-2" to the enchant command in the code (eg enchant-2...)
@john-preston I think that is really easy to fix, just read the /etc/os-release file (or more easily use "lsb_release -a") and if the distro is manjaro or arch, add a "-2" to the enchant command in the code (eg enchant-2...)
This ignores all other distros with actual enchant2. Debian has an outdated enchant2 before renaming binaries and libs.
I think I have understood what the problem is, on manjaro / arch, the CLI command for enchant is enchant-2, not enchant.
(also, i can't find any call of any cli command: https://github.com/desktop-app/lib_spellcheck/blob/master/spellcheck/platform/linux/linux_enchant.cpp)
@alsoGAMER, Telegram Desktop does not use command enchant
directly. It loads Enchant shared library with dlopen.
Do you write something related to the spellchecking, or the user interaction to the log file? After enabling debugging, I did not find anything in the log file.
@alsoGAMER, Telegram Desktop does not use command
enchant
directly. It loads Enchant shared library with dlopen.
Ok, sorry, my fault.
I found the root of the problem. On debian enchant compiled without hspell, but on others with hspell. Because the current algorithm adds all dictionaries (which is incorrect), on non-debian distros, when enchant tries to check a word with hspell - it getitng an error. I'll send a pr with fix.
@ilya-fedin, you think that loading of all dictionaries at a time is wrong behavior. So what do you suggest to do instead?
@ilya-fedin, sorry, I don't get you. Could you focus on the specificity of Telegram Desktop? Let's suppose we have the next message: "test 璇曢獙 锌褉芯胁械褉泻邪 elprovo". Against which language this string should be checked?
What if a user has several dictionaries installed and we need to check a document in undeclared language? As far as I know, Telegram has no idea of chat language so we can't choose a single dictionary to check spelling.
What if a user has several dictionaries installed and we need to check a document in undeclared language?
As you can see, adding all dictionaries produces a crash. So there are three options:
I have the same problem on Manjaro. Spell checker and newly uploaded gif animations doesn't works at all.
Manjaro 18.1.5; Workaround for me - Spell checker work perfectly with [enchant-pure] (2.2.7-1) from AUR. (tdesktop 1.9.3)
@viktor-w thank you!
Same problem on arch linux
On Arch Linux I found another workaround is removing hspell by pacman -Rdd hspell
while ignoring dependency and keep enchant installed.
enchant-pure is not configured with hspell support, so I think this is related to @viktor-w 's workaround.
Does this means Hebrew support is broken with lib_spellchecker?
as I understand it, the problem on manjaro / arch is that it costs enchant-2 and the telegram wants enchant, I installed enchant and the EN dictionary from aur, but it still doesn鈥檛 work
@jcrush2 telegram tried to load enchant and enchant2, whichever is available:
https://github.com/desktop-app/lib_spellcheck/blob/master/spellcheck/platform/linux/linux_enchant.cpp#L220-L222
And it actually loaded enchant-2, with hunspell, aspell and their dicts, you can confirm this by strace. But if your enchant-2 sees hspell available on the system, telegram spellchecker stopped working for some unknown reason.
for some unknown reason
hspell tries to convert the text to local Hebrew codepage
Should be fixed now.
Most helpful comment
Manjaro 18.1.5; Workaround for me - Spell checker work perfectly with [enchant-pure] (2.2.7-1) from AUR. (tdesktop 1.9.3)