Skip to content

Instantly share code, notes, and snippets.

@jonasmalacofilho
Created February 20, 2014 03:36
Show Gist options
  • Save jonasmalacofilho/9106687 to your computer and use it in GitHub Desktop.
Save jonasmalacofilho/9106687 to your computer and use it in GitHub Desktop.
Create/update dictionary files for Sublime Text 2
# Create/update dictionary files for Sublime Text 2
# Execute somewhere like $HOME/.config/sublime-text-2/Packages/Languages Brazilian/
# `DICTPATH` defines the source for the dictionary files
# This Makefile expects them to be encoded in ISO8859-1
# Makefile based on https://github.com/SublimeText/Dictionaries
# Requires dos2unix
# VERO 2.1 from http://extensions.libreoffice.org/extension-center/vero-verificador-ortografico-e-hifenizador-em-portugues-do-brasil/pscreleasefolder.2012-01-04.1563120832/2.1
# extract in DICTPATH with unzip
# DICTPATH=./vero_pt_br_v210aoc
# VERO 3.0 from package ibrazilian
# DICTPATH=/usr/share/hunspell
# VERO 3.2 from http://pt-br.libreoffice.org/assets/VeroptBRV320AOC.oxt
# extract in DICTPATH with unzip
DICTPATH=./VeroptBRV320AOC
all: pt_BR
pt_BR: pt_BR.dic pt_BR.aff
clean:
rm -f *.dic *.aff *.dic.tmp *.aff.tmp
@phony: all pt_BR clean
pt_BR.dic: $(DICTPATH)/pt_BR.dic
iconv -f iso8859-1 -t utf8 -o pt_BR.dic.tmp $(DICTPATH)/pt_BR.dic
dos2unix pt_BR.dic.tmp
cp pt_BR.dic.tmp pt_BR.dic
rm -f pt_BR.dic.tmp
pt_BR.aff: $(DICTPATH)/pt_BR.aff
iconv -f iso8859-1 -t utf8 -o pt_BR.aff.tmp $(DICTPATH)/pt_BR.aff
dos2unix pt_BR.aff.tmp
sed "s/SET ISO8859-1/SET UTF-8\nFLAG UTF-8/" pt_BR.aff.tmp >pt_BR.aff
rm -f pt_BR.aff.tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment