/conllu-mode

CoNLL-U major mode for emacs

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

emacs mode for CoNLL-U files

https://melpa.org/packages/conllu-mode-badge.svg

this mode provides simple utilities for editing and viewing CoNLL-U files.

you can watch the following demo for an idea of what it can do:

static/demo.png

default key bindings

key bindingdescription
C-c C-aalign columns (inserts no real whitespace) in the selected region (defaults to the current sentence)
C-c C-uunalign columns in the selected region (defaults to current sentence)
M-nunalign current sentence, go to the next one, and align it
M-punalign current sentence, go to the previous one, and align it
C-Nmove to field number N in a token line (C-c 0 moves to field number 10, i.e. MISC)
C-c C-hmove point to head token of present token

features

  • highlighting comments, and upostag and deprel fields
  • truncate lines by default
  • show newline and tab characters using whitespace.el
  • aligning and unaligning column fields
  • jumping to next or previous sentence
  • in a token line, jump to its head

missing

if you’d like to have a feature implemented, you should file at ticket at the issue tracker. here is our wishlist of what we would like to implement in the future:

  • hiding columns
  • call a parser to create CoNLL-U output from a sentence
  • call external visualization tool
  • validating CoNLL-U file

installation

in your .emacs:

(autoload 'conllu-mode "conllu-mode" "Major mode for editing CoNLL-U files." t)
(add-to-list 'auto-mode-alist '("\\.conllu\\'" . conllu-mode))

you may install the latest versions from MELPA, or proceed to a manual installation:

MELPA

set MELPA up if you haven’t already and then do:

M-x package-install RET conllu-mode

manual installation

first you must install the dependencies: assuming you have a standard Emacs distribution, the only package needed which is probably not installed yet is parsec.

after having installed parsec, clone the repo, as in:

$ cd ~/some/path/
$ git clone https://github.com/odanoburu/conllu-mode

make sure the repository in is emacs load path with

(add-to-list 'load-path "~/some/path/conllu-mode")

in your .emacs.

contributing

contributions are welcome! even comments from experienced elispers are welcome. just send an email or open an issue – if you’d like a suggestion on what to work on, take a look at the open issues or at the missing features (above).