Update to 1.4.0 release

Update hunspell dictionary directory path
  https://fedoraproject.org/wiki/Changes/Hunspell_dictionary_dir_change
Added CI tests

Signed-off-by: Parag Nemade <pnemade@fedoraproject.org>
This commit is contained in:
Parag Nemade 2022-01-29 19:49:23 +05:30
parent e6d27b6a74
commit 629d25519c
No known key found for this signature in database
GPG Key ID: 71932951EB71E972
7 changed files with 47 additions and 7 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/lv_LV-1.0.0.oxt
/lv_LV-1.4.0.oxt

View File

@ -1,7 +1,7 @@
Name: openoffice-lv
Summary: Latvian linguistic dictionaries
Version: 1.0.0
Release: 15%{?dist}
Version: 1.4.0
Release: 1%{?dist}
Source: http://dict.dv.lv/download/lv_LV-%{version}.oxt
URL: http://dict.dv.lv/
License: LGPLv2+
@ -45,20 +45,19 @@ for i in README_lv_LV.txt README_hyph_lv_LV.txt; do
touch -r $i $i.new
mv -f $i.new $i
done
chmod -x *.dic
%install
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/myspell
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/hunspell
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/hyphen
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/mythes
cp -p lv_LV.dic lv_LV.aff $RPM_BUILD_ROOT/%{_datadir}/myspell
cp -p lv_LV.dic lv_LV.aff $RPM_BUILD_ROOT/%{_datadir}/hunspell
cp -p hyph_lv_LV.dic $RPM_BUILD_ROOT/%{_datadir}/hyphen
cp -p th_lv_LV_v2.* $RPM_BUILD_ROOT/%{_datadir}/mythes
%files -n hunspell-lv
%doc README_lv_LV.txt
%license license.txt
%{_datadir}/myspell/*
%{_datadir}/hunspell/*
%files -n hyphen-lv
%doc README_hyph_lv_LV.txt
@ -71,6 +70,12 @@ cp -p th_lv_LV_v2.* $RPM_BUILD_ROOT/%{_datadir}/mythes
%{_datadir}/mythes/*
%changelog
* Sat Jan 29 2022 Parag Nemade <pnemade AT redhat DOT com> - 1.4.0-1
- Update to 1.4.0 release
- Update hunspell dictionary directory path
https://fedoraproject.org/wiki/Changes/Hunspell_dictionary_dir_change
- Added CI tests
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

View File

@ -1 +1 @@
fbae82fd446d7672fda484d4832eb5f2 lv_LV-1.0.0.oxt
SHA512 (lv_LV-1.4.0.oxt) = e817d960c5d013cb2ffda49c20b955f7954124642ac6214ca81286065cf2443f5c3348af91105eaa070aecafe417376d078d851cdd8056a39e012ae6510a367a

View File

@ -0,0 +1,4 @@
#!/bin/bash
python3 test_suggest_words.py
python3 test_dic_availability.py

View File

@ -0,0 +1,10 @@
#!/usr/bin/python3
import enchant
lang = "lv_LV"
try:
dic = enchant.request_dict(lang)
print("Dictionary for {0} language is available for use".format(lang))
except enchant.errors.DictNotFoundError:
print("Dictionary is not installed for use")

View File

@ -0,0 +1,9 @@
#!/usr/bin/python3
import enchant
wdlst = [ "Pēšņi", "Padies", "Sviki"]
dic = enchant.Dict("lv_LV")
for wd in wdlst:
dic.check(wd)
print("input word = {0}, Suggestions => {1}".format(wd, dic.suggest(wd)))

11
tests/tests.yml Normal file
View File

@ -0,0 +1,11 @@
- hosts: localhost
roles:
- role: standard-test-basic
required_packages:
- python3-enchant
tags:
- classic
tests:
- sample:
dir: scripts/
run: ./run_tests.sh