Update runtime files

This commit is contained in:
Bram Moolenaar
2022-06-23 13:04:20 +01:00
parent 180246cfd1
commit 8cc5b559f7
15 changed files with 179 additions and 339 deletions

View File

@ -0,0 +1,43 @@
The location of source files for Serbian spelling dictionary were downloaded
from
https://github.com/LibreOffice/dictionaries/tree/master/sr
(Serbian Spelling and Hyphenation for LibreOffice).
Here is the content of original README file from the repository:
"LibreOffice Spelling and Hyphenation
extension package for Serbian (Cyrillic and Latin)
This extension package includes the Hunspell dictionary and Hyphen
hyphenation patterns for the Serbian language adapted for usage in
LibreOffice.
Serbian spelling dictionary is developed by Milutin Smiljanic
<msmiljanic.gm@gmail.com> and is released under GNU LGPL version 3 or
later / MPL version 2 or later / GNU GPL version 3 or later, giving
you the choice of one of the three sets of free software licensing
terms.
Serbian hyphenation patterns are derived from the official TeX
patterns for Serbocroatian language (Cyrillic and Latin) created by
Dejan Muhamedagić, version 2.02 from 22 June 2008 adopted for usage
with Hyphen hyphenation library and released under GNU LGPL version
2.1 or later."
This dictionary used to create Vim spl file is the result of merging the two
LibreOffice dictionaries, for cyrillic and latin script.
The merge was accomplished by concatenating two .dic files, removing 1061
duplicates using the fixdup Vim script and updating the word count.
In both affix files each SFX (and two PFX) directive had to be appended with
the . at the end of the line. KEY and WORDCHAR directives were removed, and
MIDWORD was added. Each SFX block is the union of corresponding blocks from
sr.aff and sr-Latn.aff. Header line of each block was updated to the new
count (2 times the value from the corresponding block in the input affix
file).
Ivan Pešić
23.06.2022.

View File

@ -1,4 +1,5 @@
# Aap recipe for Serbian Vim spell files.
# See README_sr.txt for instructions to get the .aff and .dic files.
# Use a freshly compiled Vim if it exists.
@if os.path.exists('../../../src/vim'):
@ -7,136 +8,16 @@
:progsearch VIM vim
SPELLDIR = ..
FILES = sr_RS.aff sr_RS.dic
'sr_RS@latin.aff' 'sr_RS@latin.dic'
FILES = sr.aff sr.dic
all: $SPELLDIR/sr.utf-8.spl $SPELLDIR/'sr@latin.utf-8.spl' ../README_sr.txt
# Original files will be in the subfolder hunspell-sr after unpacking:
# sr.dic original cyrillic dictionary
# sr.aff original cyrillic affix file
# sr-Latn.dic original latin dictionary file
# sr-Latn.aff original latin affix file
# Just before using the dictionary files, the right ones are copied to
# sr_RS.aff
# sr_RS.dic
# and
# sr_RS@latin.aff
# sr_RS@latin.dic
all: $SPELLDIR/sr.utf-8.spl ../README_sr.txt
$SPELLDIR/sr.utf-8.spl : $FILES
:sys env LANG=sr_RS.UTF-8
$VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/sr sr_RS" -c q
$VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/sr sr" -c q
$SPELLDIR/"sr@latin.utf-8.spl" : $FILES
:sys env LANG=sr_RS@latin.UTF-8
$VIM -u NONE -e -c "set enc=utf-8" -c "mkspell! $SPELLDIR/sr@latin sr_RS@latin" -c q
../README_sr.txt : hunspell-sr/README_sr.txt README_sr_RS.txt
:cat README_sr_RS.txt >!$target
:print >>$target
:print ============================================================== >>$target
:print Следи оригинална README датотека: >>$target
:print >>$target
:cat hunspell-sr/README_sr.txt >>$target
#
# Used to fetch the files.
#
ZIPFILE = http://devbase.net/dict-sr/hunspell-sr-20130715.zip
:attr {fetch = $ZIPFILE} sr_RS.zip
# The files don't depend on the .zip file so that we can delete it.
# Only download the zip file if the targets don't exist.
sr_RS.aff sr_RS.dic: {buildcheck=}
:assertpkg unzip patch
:fetch sr_RS.zip
:sys $UNZIP sr_RS.zip
:delete sr_RS.zip
@if not os.path.exists('sr_RS.orig.aff'):
:copy hunspell-sr/sr.aff sr_RS.orig.aff
@if not os.path.exists('sr_RS.orig.dic'):
:copy hunspell-sr/sr.dic sr_RS.orig.dic
@if os.path.exists('sr_RS.diff'):
:sys patch <sr_RS.diff
:copy sr_RS.orig.aff sr_RS.aff
:copy sr_RS.orig.dic sr_RS.dic
# Remove the 3 misspelled words and update the word count
# :sys $VIM -u NONE -e -c "set enc=utf-8"
# -c "e sr_RS.orig.dic"
# -c "%g/ажуриранје/d"
# -c "%g/вишнја/d"
# -c "%g/вишнјевац/d"
# -c "%s/263909/263906/e"
# -c "w! sr_RS.dic"
# -c q
sr_RS@latin.aff sr_RS@latin.dic: {buildcheck=}
:assertpkg unzip patch
:fetch sr_RS.zip
:sys $UNZIP sr_RS.zip
:delete sr_RS.zip
@if not os.path.exists('sr_RS@latin.orig.aff'):
:copy hunspell-sr/sr-Latn.aff 'sr_RS@latin.orig.aff'
@if not os.path.exists('sr_RS@latin.orig.dic'):
:copy hunspell-sr/sr-Latn.dic 'sr_RS@latin.orig.dic'
@if os.path.exists('sr_RS@latin.diff'):
:sys patch <'sr_RS@latin.diff'
:copy 'sr_RS@latin.orig.aff' 'sr_RS@latin.aff'
:copy 'sr_RS@latin.orig.dic' 'sr_RS@latin.dic'
# Remove the 3 duplicated words and update the word count
# :sys $VIM -u NONE -e -c "set enc=utf-8"
# -c "e sr_RS@latin.orig.dic"
# -c "%g/\v(ažuriranje)(\_.*\1)@=/d"
# -c "%g/\v(višnja)(\_.*\1)@=/d"
# -c "%g/\v(višnjevac)(\_.*\1)@=/d"
# -c "%s/263909/263906/e"
# -c "w! sr_RS@latin.dic"
# -c q
# Generate diff files, so that others can get the files and apply
# the diffs to get the Vim versions.
diff:
:assertpkg diff
:sys {force} diff -a -C 1 sr_RS.orig.aff sr_RS.aff >sr_RS.diff
:sys {force} diff -a -C 1 sr_RS.orig.dic sr_RS.dic >>sr_RS.diff
:sys {force} diff -a -C 1 'sr_RS@latin.orig.aff' 'sr_RS@latin.aff' >'sr_RS@latin.diff'
:sys {force} diff -a -C 1 'sr_RS@latin.orig.dic' 'sr_RS@latin.dic' >>'sr_RS@latin.diff'
# Delete all the unpacked and generated files, including the "orig" files.
clean:
:delete {force} sr_RS.zip sr_RS.dic
sr_RS.orig.aff sr_RS.orig.dic
sr_RS.aff
'sr_RS@latin.dic' 'sr_RS@latin.aff'
'sr_RS@latin.orig.aff' 'sr_RS@latin.orig.dic'
:sys rm -f -r hunspell-sr/
# Check for updated OpenOffice spell files. When there are changes the
# ".new.aff" and ".new.dic" files are left behind for manual inspection.
#
#check:
# :assertpkg unzip diff
# :fetch fr_FR.zip
# :mkdir tmp
# :cd tmp
# @try:
# @import stat
# :sys $UNZIP ../fr_FR.zip
# :sys {force} diff ../fr_FR.orig.aff fr_FR.aff >d
# @if os.stat('d')[stat.ST_SIZE] > 0:
# :copy fr_FR.aff ../fr_FR.new.aff
# :sys {force} diff ../fr_FR.orig.dic fr_FR.dic >d
# @if os.stat('d')[stat.ST_SIZE] > 0:
# :copy fr_FR.dic ../fr_FR.new.dic
# @finally:
# :cd ..
# :delete {r}{f}{q} tmp
# :delete fr_FR.zip
../README_sr.txt : README_sr.txt
:copy README_sr.txt $target
vim: set sts=4 sw=4 :

View File

@ -1,68 +0,0 @@
*** sr_RS.orig.aff Fri Feb 23 20:04:41 2018
--- sr_RS.aff Fri Feb 23 18:18:48 2018
***************
*** 1,10 ****
! SET UTF-8
! LANG sr
! TRY аиоенртсвумклпјдгзбшчцхћњљжфђџАИОЕНРТСВУМКЛПЈДГЗБШЧЦХЋЊЉЖФЂЏ
! KEY љњертжуиопшђж|асдфгхјклчћ|зџцвбнм|жшђ|ћшч|жчђ|ђћж|зж|љањседрфтгжхуј|јиколпч|азсџдцфвгбх|хнјмк
!
! MAP 4
! MAP цћ
! MAP цч
MAP зж
--- 1,5 ----
! SET utf-8
! MAP 3
! MAP цћч
MAP зж
***************
*** 12,14 ****
! REP 8
REP дј ђ
--- 7,11 ----
! MIDWORD -
!
! REP 4
REP дј ђ
***************
*** 17,28 ****
REP дж џ
- REP ц с # Ако хоћу да откуцам слово „С“ могу се залетети за ознаком на тастатури и уписати „Ц“ (C)
- REP п р # Ако хоћу да откуцам слово „В“ могу се залетети за ознаком и уписати „Б“ (B)
- REP џ х # Ако хоћу да откуцам слово „Р“ могу се залетети за ознаком и уписати „П“ (P)
- REP х н # Ако хоћу да откуцам слово „Х“ могу се залетети за ознаком и уписати „Џ“ (X)
- # Ако хоћу да откуцам слово „В“ могу се залетети за ознаком и уписати „Б“ (B) (покривено KEY паром „в - б“)
-
- ICONV 3
- ICONV ҵ тц
- ICONV ҥ нг
- ICONV ӕ ае
--- 14,15 ----
*** sr_RS.orig.dic Fri Feb 23 20:04:42 2018
--- sr_RS.dic Fri Feb 23 20:04:46 2018
***************
*** 1,2 ****
! 263909
а
--- 1,2 ----
! 263906
а
***************
*** 882,884 ****
ажурираних
- ажуриранје
ажурирано
--- 882,883 ----
***************
*** 22177,22180 ****
вишку
- вишнја
- вишнјевац
Вишну
--- 22176,22177 ----

View File

@ -1,66 +0,0 @@
*** sr_RS@latin.orig.aff Fri Feb 23 20:08:28 2018
--- sr_RS@latin.aff Fri Feb 23 18:18:48 2018
***************
*** 1,10 ****
! SET UTF-8
! LANG sr-Latn
! TRY aioenrtsvumklpjdgzbščchćnjljžfđdžAIOENRTSVUMKLPJDGZBŠČCHĆNJLJŽFĐDŽ
! KEY qwertyuiopšđž|asdfghjklčć|zxcvbnm|žšđ|ćšč|žčđ|đćž|zy|qawsedrftgyhuj|jikolpč|azsxdcfvgbh|hnjmk
!
! MAP 4
! MAP cć
! MAP cč
MAP zž
--- 1,5 ----
! SET utf-8
! MAP 3
! MAP cćč
MAP zž
***************
*** 12,20 ****
! REP 1
! REP dj đ
! ICONV fi fi
! ICONV fl fl
! ICONV st st
! ICONV ij ij
! ICONV œ oe
--- 7,14 ----
! MIDWORD -
! REP 4
! REP dj đ
! REP fl fl
! REP ff ff
! REP fi fi
*** sr_RS@latin.orig.dic Fri Feb 23 20:08:28 2018
--- sr_RS@latin.dic Fri Feb 23 20:08:53 2018
***************
*** 1,2 ****
! 263909
a
--- 1,2 ----
! 263906
a
***************
*** 882,884 ****
ažuriranih
- ažuriranje
ažurirano
--- 882,883 ----
***************
*** 22177,22184 ****
višku
- višnja
- višnjevac
Višnu
višnja
višnjama
višnjare
višnje
--- 22176,22181 ----