hunspell, bump version, fix credits to patchset (#9669)

This commit is contained in:
Schrijvers Luc
2023-10-24 06:04:57 +00:00
committed by GitHub
parent e362d4a015
commit 0e1ad9b6cc
3 changed files with 284 additions and 163 deletions

View File

@@ -9,9 +9,9 @@ COPYRIGHT="2007-2016 Hunspell developers et al.
LICENSE="GNU GPL v2
GNU LGPL v2.1
MPL v1.1"
REVISION="3"
REVISION="1"
SOURCE_URI="https://github.com/hunspell/hunspell/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="bb27b86eb910a8285407cf3ca33b62643a02798cf2eef468c0a74f6c3ee6bc8a"
CHECKSUM_SHA256="69fa312d3586c988789266eaf7ffc9861d9f6396c31fc930a014d551b59bbd6e"
SOURCE_FILENAME="hunspell-$portVersion.tar.gz"
PATCHES="hunspell-$portVersion.patchset"
@@ -83,7 +83,8 @@ INSTALL()
fixPkgconfig
packageEntries devel \
$developDir
$developDir \
$manDir/man3
}
TEST()

View File

@@ -1,160 +0,0 @@
From 85c0ca98b6fca53250c23b605bc25d1bc8cce1f7 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Mon, 12 Aug 2019 07:48:24 +0200
Subject: Import previous patch to rename the binaries
diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am
index 1786e8e..190bffe 100644
--- a/src/tools/Makefile.am
+++ b/src/tools/Makefile.am
@@ -1,4 +1,4 @@
-bin_PROGRAMS=analyze chmorph hunspell munch unmunch hzip hunzip
+bin_PROGRAMS=hunspell-analyze hunspell-chmorph hunspell hunspell-munch hunspell-unmunch hzip hunzip
AM_CPPFLAGS=-I${top_builddir}/src/hunspell -I${top_srcdir}/src/hunspell -I${top_srcdir}/src/parsers
@@ -6,8 +6,8 @@ hzip_SOURCES=hzip.cxx
hunzip_SOURCES=hunzip.cxx
hunzip_LDADD = ../hunspell/libhunspell-1.7.la
-munch_SOURCES=munch.cxx munch.h
-unmunch_SOURCES=unmunch.cxx unmunch.h
+hunspell_munch_SOURCES=munch.cxx munch.h
+hunspell_unmunch_SOURCES=unmunch.cxx unmunch.h
example_SOURCES=example.cxx
example_LDADD = ../hunspell/libhunspell-1.7.la
@@ -17,11 +17,11 @@ nodist_hunspell_SOURCES= ../../config.h
hunspell_LDADD = @LIBINTL@ @LIBICONV@ ../parsers/libparsers.a \
../hunspell/libhunspell-1.7.la @CURSESLIB@ @READLINELIB@
-analyze_SOURCES=analyze.cxx
-analyze_LDADD = ../hunspell/libhunspell-1.7.la
+hunspell_analyze_SOURCES=analyze.cxx
+hunspell_analyze_LDADD = ../hunspell/libhunspell-1.7.la
-chmorph_SOURCES=chmorph.cxx
-chmorph_LDADD = ../parsers/libparsers.a ../hunspell/libhunspell-1.7.la
+hunspell_chmorph_SOURCES=chmorph.cxx
+hunspell_chmorph_LDADD = ../parsers/libparsers.a ../hunspell/libhunspell-1.7.la
noinst_PROGRAMS=example
diff --git a/src/tools/chmorph.cxx b/src/tools/chmorph.cxx
index 6e5add6..037d403 100644
--- a/src/tools/chmorph.cxx
+++ b/src/tools/chmorph.cxx
@@ -55,11 +55,11 @@ int main(int, char** argv) {
if (!argv[i]) {
fprintf(
stderr,
- "chmorph - change affixes by morphological analysis and generation\n"
- "correct syntax is:\nchmorph affix_file "
+ "hunspell_chmorph - change affixes by morphological analysis and generation\n"
+ "correct syntax is:\nhunspell_chmorph affix_file "
"dictionary_file file_to_convert STRING1 STRING2\n"
"STRINGS may be arbitrary parts of the morphological descriptions\n"
- "example: chmorph hu.aff hu.dic hu.txt SG_2 SG_3 "
+ "example: hunspell_chmorph hu.aff hu.dic hu.txt SG_2 SG_3 "
" (convert informal Hungarian second person texts to formal third "
"person texts)\n");
exit(1);
diff --git a/src/tools/example.cxx b/src/tools/example.cxx
index 8213a5f..f386203 100644
--- a/src/tools/example.cxx
+++ b/src/tools/example.cxx
@@ -48,9 +48,9 @@ int main(int argc, char** argv) {
/* first parse the command line options */
if (argc < 4) {
- fprintf(stderr, "example (now it works with more dictionary files):\n");
+ fprintf(stderr, "hunspell_example (now it works with more dictionary files):\n");
fprintf(stderr,
- "example affix_file dictionary_file(s) file_of_words_to_check\n");
+ "hunspell_example affix_file dictionary_file(s) file_of_words_to_check\n");
exit(1);
}
diff --git a/src/tools/munch.cxx b/src/tools/munch.cxx
index 5f51fc6..bbfc024 100644
--- a/src/tools/munch.cxx
+++ b/src/tools/munch.cxx
@@ -78,14 +78,14 @@ int main(int argc, char** argv) {
wf = mystrdup(argv[1]);
} else {
fprintf(stderr, "correct syntax is:\n");
- fprintf(stderr, "munch word_list_file affix_file\n");
+ fprintf(stderr, "hunspell_munch word_list_file affix_file\n");
exit(1);
}
if (argv[2]) {
af = mystrdup(argv[2]);
} else {
fprintf(stderr, "correct syntax is:\n");
- fprintf(stderr, "munch word_list_file affix_file\n");
+ fprintf(stderr, "hunspell_munch word_list_file affix_file\n");
exit(1);
}
diff --git a/src/tools/unmunch.cxx b/src/tools/unmunch.cxx
index 82c2f9d..479c6e5 100644
--- a/src/tools/unmunch.cxx
+++ b/src/tools/unmunch.cxx
@@ -73,14 +73,14 @@ int main(int argc, char** argv) {
wf = mystrdup(argv[1]);
} else {
fprintf(stderr, "correct syntax is:\n");
- fprintf(stderr, "unmunch dic_file affix_file\n");
+ fprintf(stderr, "hunspell_unmunch dic_file affix_file\n");
exit(1);
}
if (argv[2]) {
af = mystrdup(argv[2]);
} else {
fprintf(stderr, "correct syntax is:\n");
- fprintf(stderr, "unmunch dic_file affix_file\n");
+ fprintf(stderr, "hunspell_unmunch dic_file affix_file\n");
exit(1);
}
diff --git a/tests/test.sh b/tests/test.sh
index 3fcf42c..7a9d7ef 100755
--- a/tests/test.sh
+++ b/tests/test.sh
@@ -63,8 +63,8 @@ if [[ "$1" == "-i" && -n "$2" ]]; then
fi
shopt -s expand_aliases
-[[ "$HUNSPELL" = "" ]] && HUNSPELL="$(dirname $0)"/../src/tools/hunspell
-[[ "$ANALYZE" = "" ]] && ANALYZE="$(dirname $0)"/../src/tools/analyze
+[[ "$HUNSPELL" = "" ]] && HUNSPELL="$(dirname $0)"/../src/tools/hunspell_hunspell
+[[ "$ANALYZE" = "" ]] && ANALYZE="$(dirname $0)"/../src/tools/hunspell_analyze
[[ "$LIBTOOL" = "" ]] && LIBTOOL="$(dirname $0)"/../libtool
alias hunspell='"$LIBTOOL" --mode=execute "$HUNSPELL"'
alias analyze='"$LIBTOOL" --mode=execute "$ANALYZE"'
--
2.37.3
From e6936b86f5fb992703d547d9b5799f7e5e9213b2 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Tue, 11 Jul 2023 14:29:03 +0000
Subject: Add search path for Haiku's spell directory
diff --git a/src/tools/hunspell.cxx b/src/tools/hunspell.cxx
index 690e34a..e4e18c6 100644
--- a/src/tools/hunspell.cxx
+++ b/src/tools/hunspell.cxx
@@ -116,6 +116,7 @@
#include "../parsers/odfparser.hxx"
#define LIBDIR \
+ "/system/data/hunspell:" \
"/usr/share/hunspell:" \
"/usr/share/myspell:" \
"/usr/share/myspell/dicts:" \
--
2.37.3

View File

@@ -0,0 +1,280 @@
From d3e2d1d29615f4861fd3354353d426bd8701389d Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Tue, 13 Nov 2018 10:37:42 +0100
Subject: [PATCH] Rename some executables which have too generic names
to be placed in /usr/bin - this patch prefixes them with 'hunspell-'
Real authorship is a bit unclear as Gentoo is using this kind of patch since
hunspell-1.1.3 which was added to Gentoo back in 2006-01-29 and the
corresponding bug report didn't mention the patch at all:
https://bugs.gentoo.org/114482
https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-text/hunspell/files/hunspell-1.1.3-renameexes.patch?hideattic=0&view=log
---
src/tools/Makefile.am | 14 +++++++-------
src/tools/chmorph.cxx | 6 +++---
src/tools/munch.cxx | 4 ++--
src/tools/unmunch.cxx | 4 ++--
tests/Makefile.am | 2 +-
tests/test.sh | 2 +-
7 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am
index 1786e8e..190bffe 100644
--- a/src/tools/Makefile.am
+++ b/src/tools/Makefile.am
@@ -1,4 +1,4 @@
-bin_PROGRAMS=analyze chmorph hunspell munch unmunch hzip hunzip
+bin_PROGRAMS=hunspell-analyze hunspell-chmorph hunspell hunspell-munch hunspell-unmunch hzip hunzip
AM_CPPFLAGS=-I${top_builddir}/src/hunspell -I${top_srcdir}/src/hunspell -I${top_srcdir}/src/parsers
@@ -6,8 +6,8 @@ hzip_SOURCES=hzip.cxx
hunzip_SOURCES=hunzip.cxx
hunzip_LDADD = ../hunspell/libhunspell-1.7.la
-munch_SOURCES=munch.cxx munch.h
-unmunch_SOURCES=unmunch.cxx unmunch.h
+hunspell_munch_SOURCES=munch.cxx munch.h
+hunspell_unmunch_SOURCES=unmunch.cxx unmunch.h
example_SOURCES=example.cxx
example_LDADD = ../hunspell/libhunspell-1.7.la
@@ -17,11 +17,11 @@ nodist_hunspell_SOURCES= ../../config.h
hunspell_LDADD = @LIBINTL@ @LIBICONV@ ../parsers/libparsers.a \
../hunspell/libhunspell-1.7.la @CURSESLIB@ @READLINELIB@
-analyze_SOURCES=analyze.cxx
-analyze_LDADD = ../hunspell/libhunspell-1.7.la
+hunspell_analyze_SOURCES=analyze.cxx
+hunspell_analyze_LDADD = ../hunspell/libhunspell-1.7.la
-chmorph_SOURCES=chmorph.cxx
-chmorph_LDADD = ../parsers/libparsers.a ../hunspell/libhunspell-1.7.la
+hunspell_chmorph_SOURCES=chmorph.cxx
+hunspell_chmorph_LDADD = ../parsers/libparsers.a ../hunspell/libhunspell-1.7.la
noinst_PROGRAMS=example
diff --git a/src/tools/chmorph.cxx b/src/tools/chmorph.cxx
index 07bae64..8bbf39d 100644
--- a/src/tools/chmorph.cxx
+++ b/src/tools/chmorph.cxx
@@ -55,11 +55,11 @@ int main(int, char** argv) {
if (!argv[i]) {
fprintf(
stderr,
- "chmorph - change affixes by morphological analysis and generation\n"
- "correct syntax is:\nchmorph affix_file "
+ "hunspell-chmorph - change affixes by morphological analysis and generation\n"
+ "correct syntax is:\nhunspell-chmorph affix_file "
"dictionary_file file_to_convert STRING1 STRING2\n"
"STRINGS may be arbitrary parts of the morphological descriptions\n"
- "example: chmorph hu.aff hu.dic hu.txt SG_2 SG_3 "
+ "example: hunspell-chmorph hu.aff hu.dic hu.txt SG_2 SG_3 "
" (convert informal Hungarian second person texts to formal third "
"person texts)\n");
exit(1);
diff --git a/src/tools/munch.cxx b/src/tools/munch.cxx
index 1e8342f..57c959c 100644
--- a/src/tools/munch.cxx
+++ b/src/tools/munch.cxx
@@ -77,14 +77,14 @@ int main(int argc, char** argv) {
wf = mystrdup(argv[1]);
} else {
fprintf(stderr, "correct syntax is:\n");
- fprintf(stderr, "munch word_list_file affix_file\n");
+ fprintf(stderr, "hunspell-munch word_list_file affix_file\n");
exit(1);
}
if (argv[2]) {
af = mystrdup(argv[2]);
} else {
fprintf(stderr, "correct syntax is:\n");
- fprintf(stderr, "munch word_list_file affix_file\n");
+ fprintf(stderr, "hunspell-munch word_list_file affix_file\n");
exit(1);
}
diff --git a/src/tools/unmunch.cxx b/src/tools/unmunch.cxx
index 3d9e318..b421cf7 100644
--- a/src/tools/unmunch.cxx
+++ b/src/tools/unmunch.cxx
@@ -72,14 +72,14 @@ int main(int argc, char** argv) {
wf = mystrdup(argv[1]);
} else {
fprintf(stderr, "correct syntax is:\n");
- fprintf(stderr, "unmunch dic_file affix_file\n");
+ fprintf(stderr, "hunspell-unmunch dic_file affix_file\n");
exit(1);
}
if (argv[2]) {
af = mystrdup(argv[2]);
} else {
fprintf(stderr, "correct syntax is:\n");
- fprintf(stderr, "unmunch dic_file affix_file\n");
+ fprintf(stderr, "hunspell-unmunch dic_file affix_file\n");
exit(1);
}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9d0757b..c0002b6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,7 +4,7 @@ SUBDIRS = suggestiontest
TEST_EXTENSIONS = .dic
AM_TESTS_ENVIRONMENT = export HUNSPELL=$(top_builddir)/src/tools/hunspell; \
- export ANALYZE=$(top_builddir)/src/tools/analyze; \
+ export ANALYZE=$(top_builddir)/src/tools/hunspell-analyze; \
export LIBTOOL=$(top_builddir)/libtool;
DIC_LOG_COMPILER = $(top_srcdir)/tests/test.sh
diff --git a/tests/test.sh b/tests/test.sh
index 0238dbb..c02cc21 100755
--- a/tests/test.sh
+++ b/tests/test.sh
@@ -64,7 +64,7 @@ fi
shopt -s expand_aliases
[[ "$HUNSPELL" = "" ]] && HUNSPELL="$(dirname $0)"/../src/tools/hunspell
-[[ "$ANALYZE" = "" ]] && ANALYZE="$(dirname $0)"/../src/tools/analyze
+[[ "$ANALYZE" = "" ]] && ANALYZE="$(dirname $0)"/../src/tools/hunspell-analyze
[[ "$LIBTOOL" = "" ]] && LIBTOOL="$(dirname $0)"/../libtool
alias hunspell='"$LIBTOOL" --mode=execute "$HUNSPELL"'
alias analyze='"$LIBTOOL" --mode=execute "$ANALYZE"'
--
2.42.0
From e2fe9f86e1769b440972971240e9b8fb1cd53b97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 6 Jan 2023 16:20:45 +0000
Subject: [PATCH] Resolves: rhbz#2158548 allow longer words for hunspell-ko
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
https://github.com/hunspell/hunspell/issues/903
A problem since the sanity check added in:
commit 05e44e069e4cfaa9ce1264bf13f23fc9abd7ed05
Author: Caolán McNamara <caolanm@redhat.com>
Date: Thu Sep 1 13:46:40 2022 +0100
Check word limit (#813)
* check against hentry blen max
---
src/hunspell/hashmgr.cxx | 6 +++---
src/hunspell/htypes.hxx | 4 ++--
tests/korean.dic | 3 ++-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/hunspell/hashmgr.cxx b/src/hunspell/hashmgr.cxx
index 20c4696..a3a5cf7 100644
--- a/src/hunspell/hashmgr.cxx
+++ b/src/hunspell/hashmgr.cxx
@@ -209,7 +209,7 @@ int HashMgr::add_word(const std::string& in_word,
}
// limit of hp->blen
- if (word->size() > std::numeric_limits<unsigned char>::max()) {
+ if (word->size() > std::numeric_limits<unsigned short>::max()) {
HUNSPELL_WARNING(stderr, "error: word len %ld is over max limit\n", word->size());
delete desc_copy;
delete word_copy;
@@ -235,8 +235,8 @@ int HashMgr::add_word(const std::string& in_word,
int i = hash(hpw, word->size());
- hp->blen = (unsigned char)word->size();
- hp->clen = (unsigned char)wcl;
+ hp->blen = (unsigned short)word->size();
+ hp->clen = (unsigned short)wcl;
hp->alen = (short)al;
hp->astr = aff;
hp->next = NULL;
diff --git a/src/hunspell/htypes.hxx b/src/hunspell/htypes.hxx
index 44366b1..2b896fb 100644
--- a/src/hunspell/htypes.hxx
+++ b/src/hunspell/htypes.hxx
@@ -62,8 +62,8 @@
#endif
struct hentry {
- unsigned char blen; // word length in bytes
- unsigned char clen; // word length in characters (different for UTF-8 enc.)
+ unsigned short blen; // word length in bytes
+ unsigned short clen; // word length in characters (different for UTF-8 enc.)
short alen; // length of affix flag vector
unsigned short* astr; // affix flag vector
struct hentry* next; // next word with same hash code
diff --git a/tests/korean.dic b/tests/korean.dic
index 95cb450..d76ea05 100644
--- a/tests/korean.dic
+++ b/tests/korean.dic
@@ -1,3 +1,4 @@
-2
+3
들어오세요
안녕하세요
+김수한무거북이와두루미삼천갑자동방삭치치카포사리사리세ᅡ워리워리세브리캉무드셀ᅡ구름위허ᅵ케ᅵᆫᅦ담벼락서생원에ᄀ양
--
2.42.0
From 3d43e55f4da2bf917d571f2575fdac495ed367f3 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Sun, 22 Oct 2023 18:26:30 +0200
Subject: applying patch aspell_conv (Debian patch)
diff --git a/man/hunspell.5 b/man/hunspell.5
index fe546bf..c17b5b3 100644
--- a/man/hunspell.5
+++ b/man/hunspell.5
@@ -1487,6 +1487,38 @@ frequency order to set edit distance suggestions:
echo "TRY qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM" >>xx.aff
.fi
+.SH "Conversion of aspell dictionaries"
+Aspell dictionaries can be easily converted into hunspell. Conversion steps:
+
+\fBdictionary (xx.cwl -> xx.wl):\fR
+
+.nf
+preunzip xx.cwl
+wc -l < xx.wl > xx.dic
+cat xx.wl >> xx.dic
+.fi
+
+\fBaffix file\fR
+
+If the affix file exists, copy it:
+.nf
+cp xx_affix.dat xx.aff
+.fi
+If not, create it with the suitable character encoding (see xx.dat)
+.nf
+echo "SET ISO8859-x" > xx.aff
+.fi
+or
+.nf
+echo "SET UTF-8" > xx.aff
+.fi
+
+It's useful to add a TRY option with the characters of the dictionary with
+frequency order to set edit distance suggestions:
+.nf
+echo "TRY qwertzuiopasdfghjklyxcvbnmQWERTZUIOPASDFGHJKLYXCVBNM" >>xx.aff
+.fi
+
.SH "SEE ALSO"
.B hunspell (1),
.B ispell (1),
--
2.42.0