Compare commits

..

No commits in common. "c10s" and "c8s" have entirely different histories.
c10s ... c8s

10 changed files with 12 additions and 316 deletions

View File

@ -1 +0,0 @@
1

5
.gitignore vendored
View File

@ -1,3 +1,2 @@
hyph_ru_RU.zip SOURCES/hyph_ru_RU.zip
/hyph-ru.tex /hyph_ru_RU.zip
/hyph-ru.pat.txt

View File

@ -1,6 +0,0 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,35 +1,23 @@
Name: hyphen-ru Name: hyphen-ru
Summary: Russian hyphenation rules Summary: Russian hyphenation rules
%global upstreamid 20200325 %global upstreamid 20020727
Version: 0.%{upstreamid} Version: 0.%{upstreamid}
Release: 13%{?dist} Release: 17%{?dist}
Source1: http://mirrors.ctan.org/language/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/hyph-ru.tex Source: http://download.services.openoffice.org/contrib/dictionaries/hyph_ru_RU.zip
Source2: http://mirrors.ctan.org/language/hyph-utf8/tex/generic/hyph-utf8/patterns/txt/hyph-ru.pat.txt URL: http://wiki.services.openoffice.org/wiki/Dictionaries
URL: https://ctan.org/tex-archive/language/hyph-utf8 License: LGPLv2+
License: LPPL-1.3a
BuildArch: noarch BuildArch: noarch
Requires: hyphen Requires: hyphen
BuildRequires: hyphen-devel
Supplements: (hyphen and langpacks-ru) Supplements: (hyphen and langpacks-ru)
%description %description
Russian hyphenation rules. Russian hyphenation rules.
%prep %prep
%autosetup -c -n hyphen-ru -T %autosetup -c -n hyphen-ru
%build %build
substrings.pl %{SOURCE2} hyph_ru_RU.dic UTF-8 2 2 chmod -x *
cat > README_hyph_ru_RU.txt << EOF
hyph_ru_RU.dic generated by:
substrings.pl hyph-ru.pat.txt hyph_ru_RU.dic UTF-8 2 2
from hyph-ru.pat.txt provided by hyph-utf8 from
https://ctan.org/tex-archive/language/hyph-utf8
where hyph-ru.pat.txt is derived from hyph-ru.tex
whose licence header follows here:
EOF
head -n 44 %{SOURCE1} >> README_hyph_ru_RU.txt
%install %install
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/hyphen mkdir -p $RPM_BUILD_ROOT/%{_datadir}/hyphen
@ -46,61 +34,6 @@ done
%{_datadir}/hyphen/* %{_datadir}/hyphen/*
%changelog %changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 0.20200325-13
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.20200325-12
- Bump release for June 2024 mass rebuild
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.20200325-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jan 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.20200325-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.20200325-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Feb 23 2023 Caolán McNamara <caolanm@redhat.com> - 0.20200325-8
- migrated to SPDX license
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.20200325-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Nov 29 2022 Caolán McNamara <caolanm@redhat.com> - 0.20200325-6
- Resolves: rhbz#2148806 fix changelog dates
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.20200325-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.20200325-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.20200325-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.20200325-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Oct 16 2020 Caolán McNamara <caolanm@redhat.com> - 0.20200325-1
- rhbz#1888913 provide more recent patterns in UTF-8
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.20020727-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.20020727-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.20020727-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.20020727-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.20020727-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jul 06 2018 Parag Nemade <pnemade AT fedoraproject DOT org> - 0.20020727-17 * Fri Jul 06 2018 Parag Nemade <pnemade AT fedoraproject DOT org> - 0.20020727-17
- Update Source tag - Update Source tag
@ -147,8 +80,8 @@ done
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.20020727-3 * Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.20020727-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Wed Jan 21 2009 Caolán McNamara <caolanm@redhat.com> - 0.20020727-2 * Wed Jan 21 2009 Caolan McNamara <caolanm@redhat.com> - 0.20020727-2
- add an alias - add an alias
* Fri Nov 23 2007 Caolán McNamara <caolanm@redhat.com> - 0.20020727-1 * Fri Nov 23 2007 Caolan McNamara <caolanm@redhat.com> - 0.20020727-1
- initial version - initial version

View File

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

View File

@ -1,2 +1 @@
SHA512 (hyph-ru.tex) = 803f9f9c726dfc4401546622283a13f5146ac92bdcfaed3fabdf647be88f3ef35b1de16db84bd38961ade396d6491ee89ddd0b120d5e9f821637ffbc870d56d0 SHA512 (hyph_ru_RU.zip) = 4538a4fbdd61adafe321258fb4a9b1896d10747adf8203bd3a5eaa40ee15a9d5d3d8304a19a644f676a1224ac36f5d47ae7a10cbcae22ccbd2f8af49bf5e92ac
SHA512 (hyph-ru.pat.txt) = 3cef8d8b76864c07a0f062381a1c0aeea5610a0a518747402173d4bf57787b946eeefef57a041889679647183ead0cee0e8f8d54f0a9b3d63b976287db738b79

View File

@ -1,4 +0,0 @@
амбициозный
Нилоптал Датт
Координатор
Святилище

View File

@ -1,210 +0,0 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "hyphen.h"
#define BUFSIZE 1000
void help() {
fprintf(stderr,"correct syntax is:\n");
fprintf(stderr,"example [-d | -dd] hyphen_dictionary_file file_of_words_to_check\n");
fprintf(stderr,"-o = use old algorithm (without non-standard hyphenation)\n");
fprintf(stderr,"-d = hyphenation with listing of the possible hyphenations\n");
fprintf(stderr,"-n = print hyphenation vector\n");
}
/* get a pointer to the nth 8-bit or UTF-8 character of the word */
char * hindex(char * word, int n, int utf8) {
int j = 0;
while (j < n) {
j++;
word++;
while (utf8 && ((((unsigned char) *word) >> 6) == 2)) word++;
}
return word;
}
/* list possible hyphenations with -dd option (example for the usage of the hyphenate2() function) */
void single_hyphenations(char * word, char * hyphen, char ** rep, int * pos, int * cut, int utf8) {
int i, k, j = 0;
char r;
for (i = 0; (i + 1) < strlen(word); i++) {
if (utf8 && ((((unsigned char) word[i]) >> 6) == 2)) continue;
if ((hyphen[j] & 1)) {
if (rep && rep[j]) {
k = hindex(word, j - pos[j] + 1, utf8) - word;
r = word[k];
word[k] = 0;
printf(" - %s%s", word, rep[j]);
word[k] = r;
printf("%s\n", hindex(word + k, cut[j], utf8));
} else {
k = hindex(word, j + 1, utf8) - word;
r = word[k];
word[k] = 0;
printf(" - %s=", word);
word[k] = r;
printf("%s\n", word + k);
}
}
j++;
}
}
int
main(int argc, char** argv)
{
HyphenDict *dict;
int df;
int wtc;
FILE* wtclst;
int k, n, i, j, c;
char buf[BUFSIZE + 1];
int nHyphCount;
char *hyphens;
char *lcword;
char *hyphword;
char hword[BUFSIZE * 2];
int arg = 1;
int optd = 1;
int optn = 0;
int optdd = 0;
char ** rep;
int * pos;
int * cut;
/* first parse the command line options */
/* arg1 - hyphen dictionary file, arg2 - file of words to check */
if (argv[arg]) {
if (strcmp(argv[arg], "-o") == 0) {
optd = 0;
arg++;
}
if (strcmp(argv[arg], "-n") == 0) {
optn = 1;
arg++;
}
if (argv[arg] && strcmp(argv[arg], "-d") == 0) {
optd = 1;
optdd = 1;
arg++;
}
}
if (argv[arg]) {
df = arg++;
} else {
help();
exit(1);
}
if (argv[arg]) {
wtc = arg++;
} else {
help();
exit(1);
}
/* load the hyphenation dictionary */
if ((dict = hnj_hyphen_load(argv[df])) == NULL) {
fprintf(stderr, "Couldn't find file %s\n", argv[df]);
fflush(stderr);
exit(1);
}
/* open the words to check list */
wtclst = fopen(argv[wtc],"r");
if (!wtclst) {
fprintf(stderr,"Error - could not open file of words to check\n");
exit(1);
}
/* now read each word from the wtc file */
while(fgets(buf,BUFSIZE,wtclst) != NULL) {
k = strlen(buf);
if (k && buf[k - 1] == '\n') buf[k - 1] = '\0';
if (k >=2 && buf[k - 2] == '\r') buf[k-- - 2] = '\0';
/* set aside some buffers to hold lower cased */
/* and hyphen information */
lcword = (char *) malloc(k+1);
hyphens = (char *)malloc(k+5);
/* basic ascii lower-case, not suitable for real-world usage*/
for (i = 0; i < k; ++i) {
lcword[i] = buf[i];
if ( (lcword[i] >= 'A') && (lcword[i] <= 'Z') )
lcword[i] += 32;
}
/* first remove any trailing periods */
n = k-1;
while((n >=0) && (lcword[n] == '.')) n--;
n++;
/* now actually try to hyphenate the word */
rep = NULL;
pos = NULL;
cut = NULL;
hword[0] = '\0';
if ((!optd && hnj_hyphen_hyphenate(dict, lcword, n-1, hyphens)) ||
(optd && hnj_hyphen_hyphenate2(dict, lcword, n-1, hyphens, hword, &rep, &pos, &cut))) {
free(hyphens);
free(lcword);
fprintf(stderr, "hyphenation error\n");
exit(1);
}
if (optn) fprintf(stderr, "%s\n", hyphens);
if (!optd) {
/* now backfill hyphens[] for any removed periods */
for (c = n; c < k; c++) hyphens[c] = '0';
hyphens[k] = '\0';
/* now create a new char string showing hyphenation positions */
/* count the hyphens and allocate space for the new hypehanted string */
nHyphCount = 0;
for (i = 0; i < n; i++)
if (hyphens[i]&1)
nHyphCount++;
hyphword = (char *) malloc(k+1+nHyphCount);
j = 0;
for (i = 0; i < n; i++) {
hyphword[j++] = buf[i];
if (hyphens[i]&1) {
hyphword[j++] = '-';
}
}
hyphword[j] = '\0';
fprintf(stdout,"%s\n",hyphword);
fflush(stdout);
free(hyphword);
} else {
fprintf(stdout,"%s\n", hword);
if (optdd) single_hyphenations(lcword, hyphens, rep, pos, cut, dict->utf8);
if (rep) {
for (i = 0; i < n - 1; i++) {
if (rep[i]) free(rep[i]);
}
free(rep);
free(pos);
free(cut);
}
}
free(hyphens);
free(lcword);
}
fclose(wtclst);
hnj_hyphen_free(dict);
return 0;
}

View File

@ -1,2 +0,0 @@
gcc test-hyphen.c -lhyphen -o test-hyphen
./test-hyphen -d /usr/share/hyphen/hyph_ru_RU.dic Russian

View File

@ -1,7 +0,0 @@
require:
- hyphen-devel
- hyphen-ru
- gcc
test: bash ./test-hyphen.sh
framework: shell