dpelle / vim-Grammalecte

A vim plugin for the Grammalecte French grammar checker
83 stars 11 forks source link

Expression invalide #2

Closed Karmaki closed 7 years ago

Karmaki commented 7 years ago

First of all: thank you so much to provide this plugin !

Unfortunately, I don't succeed to make it work. I see the command:

# python3 ~/Grammalecte-v0.5.14-libreoffice/pythonpath/cli.py -f /tmp/vAJ0zmk/3-roff apostrophe_typographique apostrophe_typographique_après_t espaces_début_ligne espaces_milieu_ligne espaces_fin_de_ligne typo_points_suspension1 typo_tiret_incise nbsp_avant_double_ponctuation nbsp_avant_deux_points nbsp_après_chevrons_ouvrants nbsp_avant_chevrons_fermants1 unit_nbsp_avant_unités1 unit_nbsp_avant_unités2 unit_nbsp_avant_unités3 -j -cl -owe -ctx

I get the following error:

E15: Expression invalide : sort(l:grammar_errors_in_paragraph,      { a, b ->
     a['nStartY'] == b['nStartY'] ?        a['nStartX'] - b['nStartX' ] :
 a['nStartY'] - b['nStartY'] })  

It seems that Grammalecte is ok since when I run the command from a terminal, it is working, and I get:

{ "grammalecte": "0.5.14", "lang": "fr", "data" : [
{"lSpellingErrors": [], "lGrammarErrors": [{"sType": "conf", "sUnderlined": "voire", "nEndX": 31, "sAfter": " si ça marches.", "aSuggestions": ["voir"], "sMessage": "Confusion probable : “voire” signifie “et même possiblement”. Pour le verbe, écrivez “voir”.", "URL": "https://fr.wiktionary.org/wiki/voire", "nStartX": 26, "sLineId": "3167s", "sRuleId": "conf_voire_voir", "sBefore": "juste un petits test pour ", "nStartY": 1, "nEndY": 1}, {"sType": "gn", "sUnderlined": "petits", "nEndX": 15, "sAfter": " test pour voire si ça marches.", "aSuggestions": ["petit"], "sMessage": "Accord de nombre erroné : « petits » devrait être au singulier.", "URL": "", "nStartX": 9, "sLineId": "4096s", "sRuleId": "gn_un_accord", "sBefore": "juste un ", "nStartY": 1, "nEndY": 1}, {"sType": "conj", "sUnderlined": "marches", "nEndX": 45, "sAfter": ".", "aSuggestions": ["marche"], "sMessage": "Conjugaison erronée. Accord avec « ça ». Le verbe devrait être à la 3ᵉ personne du singulier.", "URL": "", "nStartX": 38, "sLineId": "8775s", "sRuleId": "conj_ça", "sBefore": "juste un petits test pour voire si ça ", "nStartY": 1, "nEndY": 1}]}
]}

Hope you will be able to tell me how to make it work. Thanks in advance.

dpelle commented 7 years ago

I don't see this error. Which version of Vim are you using? Once I know your version of Vim, I checkout from git that same version and try.

I suppose that the sort() function with a lambda is not supported in "old" versions of Vim. If that's the case, I'll try to change the plugin in such a way that it works on older version of Vim.

Karmaki commented 7 years ago

Thank you for your answer. I am using vim on Linux-Ubuntu (don't know if it matters) and the version is:

$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Rustines incluses : 1-1689
Rustines extra : 8.0.0056
Modifié par pkg-vim-maintainers@lists.alioth.debian.org
Compilé par pkg-vim-maintainers@lists.alioth.debian.org
Énorme version avec interface graphique GTK2.

Do you need the details of the included feature?

Karmaki commented 7 years ago

OK. I have installed the 8.0 version and it is working now.

dpelle commented 7 years ago

OK. I have installed the 8.0 version and it is working now.

Good. Thanks for the feedback. Glad it works with vim-8.

I still want to make the plugin work with vim-7.4.1689 since many users probably use the package from Ubuntu. So I'll make a change soon.

Karmaki commented 7 years ago

Great.

I also installed vim-LanguageTool (I didn't know LanguageTool before) and both tools and plug-ins are great. Thanks again.

dpelle commented 7 years ago

Issue with old version of Vim should now be fixed in latest checkin. Closing ticket. Thanks!