summaryrefslogtreecommitdiffstats
path: root/runtime/spell
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-07-01 18:45:04 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-01 18:45:04 +0100
commit0d878b95d8f9ece2fdba81050f5caba224540f9c (patch)
tree20cf23db136c9df0fed67fb1ff30df7a43ee38c4 /runtime/spell
parent27efc62f5d86afcb2ecb7565587fe8dea4b036fe (diff)
Update runtime files
Diffstat (limited to 'runtime/spell')
-rw-r--r--runtime/spell/sr/README_sr.txt14
-rw-r--r--runtime/spell/sr/convert.vim30
2 files changed, 44 insertions, 0 deletions
diff --git a/runtime/spell/sr/README_sr.txt b/runtime/spell/sr/README_sr.txt
index 8f7c908ddf..6a3b10a0dc 100644
--- a/runtime/spell/sr/README_sr.txt
+++ b/runtime/spell/sr/README_sr.txt
@@ -40,6 +40,20 @@ continues monotonically after the last flag number in cyrillic .aff file.
A couple of words in cyrillic dict used a latin codepoints for 'a' and 'e',
that was also corrected.
+You should be able to reproduce this with these steps:
+ * Save the existing sr.aff and sr.dic files, if you have them, they will be
+ overwritten.
+ * Create a subfolder "new".
+ * Put 4 files downloaded from LibreOffice dictionaries GitHub repository in
+ it: sr.aff, sr-Latn.aff, sr.dic and sr-Latn.dic
+ * Open Vim and cd into "new"
+ * Execute: :so ../convert.vim
+ * The resulting sr.aff and sr.dic are created in the parent spell folder
+ (here).
+ * Now one can generate spl file as usual using the merged dic and aff
+ files:
+ env LANG=sr_RS.UTF-8 vim -u NONE -e -c "set enc=utf-8" -c "mkspell! ../sr sr" -c q
+
Ivan Pešić
28.06.2022.
diff --git a/runtime/spell/sr/convert.vim b/runtime/spell/sr/convert.vim
new file mode 100644
index 0000000000..731986e9b0
--- /dev/null
+++ b/runtime/spell/sr/convert.vim
@@ -0,0 +1,30 @@
+:e sr.aff
+:normal gg
+:normal wgu$
+:3d
+:4d
+:normal G
+:normal o
+:r sr-Latn.aff
+:%s#^\(SFX\|PFX\).*[а-џa-ž]\zs$# .#g
+:normal G
+?SET
+:.,+5d
+:.,$s#^\(SFX\|PFX\) \zs\(\d\+\)#\= eval(submatch(2) .. ' + 1903')#
+:w ../sr.aff
+:bd!
+:e sr.dic
+:%s#a#а#g
+:%s#e#е#g
+:normal G
+:normal o
+:r sr-Latn.dic
+:normal 201dd
+:.,$s#/\zs\(\d\+\)\(,\(\d\+\)\)\?$#\=(submatch(2) == '') ? eval(submatch(1) + '1903') : eval(submatch(1) + '1903') .. ',' .. eval(submatch(3) + '1903')#
+:normal {
+:normal dd
+:normal gg
+:normal C502898
+:w ../sr.dic
+:bd!
+:q!