Resolves:RHEL-52496 - Add conditional for RHEL for using hunspell directory

Add tmt CI tests
This commit is contained in:
Parag Nemade 2024-08-12 13:46:42 +05:30
parent b08333b500
commit d952c191b1
No known key found for this signature in database
GPG Key ID: 71932951EB71E972
7 changed files with 43 additions and 2 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -1,4 +1,4 @@
%if 0%{?fedora} > 35
%if 0%{?fedora} >= 36 || 0%{?rhel} > 9
%global dict_dirname hunspell
%else
%global dict_dirname myspell
@ -7,7 +7,7 @@ Name: hunspell-pl
Summary: Polish hunspell dictionaries
%global upstreamid 20240301
Version: 0.%{upstreamid}
Release: 2%{?dist}
Release: 3%{?dist}
Source: https://sjp.pl/sl/ort/sjp-myspell-pl-%{upstreamid}.zip
URL: https://sjp.pl/sl/ort/
License: LGPL-2.1-or-later OR GPL-1.0-or-later OR MPL-1.1 OR Apache-2.0 OR CC-BY-SA-4.0
@ -35,6 +35,10 @@ cp -p *.dic *.aff $RPM_BUILD_ROOT/%{_datadir}/%{dict_dirname}
%{_datadir}/%{dict_dirname}/*
%changelog
* Mon Aug 12 2024 Parag Nemade <pnemade AT redhat DOT com> - 0.20240301-3
- Resolves:RHEL-52496 - Add conditional for RHEL for using hunspell directory
- Add tmt CI tests
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.20240301-2
- Bump release for June 2024 mass rebuild

5
plans/hunspell-pl.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

View File

@ -0,0 +1,6 @@
require:
- python3-enchant
- hunspell-pl
test: python3 test_dic_availability.py
framework: shell

View File

@ -0,0 +1,10 @@
#!/usr/bin/python3
import enchant
lang = "pl_PL"
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,6 @@
require:
- python3-enchant
- hunspell-pl
test: python3 test_suggest_words.py
framework: shell

View File

@ -0,0 +1,9 @@
#!/usr/bin/python3
import enchant
wdlst = [ "wita", "herbat", "poran"]
dic = enchant.Dict("pl_PL")
for wd in wdlst:
dic.check(wd)
print("input word = {0}, Suggestions => {1}".format(wd, dic.suggest(wd)))