- Update to version 4.2

* Support for Malaga dictionary format removed
  * hfst-ospell dependency updated
  * Java, Python, Javascript wrapper improvements
- Drop libvoikko-hfst-namespace.patch

OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libvoikko?expand=0&rev=34
This commit is contained in:
Timo Jyrinki 2019-02-27 07:39:51 +00:00 committed by Git OBS Bridge
parent 73ed27040a
commit 47c256eaba
7 changed files with 31 additions and 243 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bb179360abdb92f9459f4d4090e56c9d9d8a3ebe9161a4c4bcd19971d59f9124
size 705467

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEErF1l8QyFltfi2uJjPTCbYErjlC4FAljG9gQACgkQPTCbYErj
lC4JlQ/8CVE/IPkq7fpO+5R+vNP5rqfeYdMOqn5bRu+dKrFg6nNxKKTuA77nezAg
X3MuKIv0Zk9SYwzn4+Wz4d0HvGAl6BKMPZ8HrWwgLmdu0nnZT+lD1p60EqCVcZer
bN6g247chlWmvYgcbB630ynzWWZu3vDP8/7hB+efI8ldHdKpW7FJM8P5MRwgBlP2
ikmGINhB2cegV5Bw8aroSy/+eNjeIU1LaRAcxQbIHx1Ip7rtJvFqAR550k+Lu8gZ
zbxI0L0INaPxAiF3IC7fMCWBhxcx6NZsaz3bicjrxMShhbpP1pEKsBld9Vidn3lD
k5WGA74wKvSVJZsW12EsFRTMDO0TOW0/r4hHJKGfJkk+d3NuhR+m2574zXISC/qS
fFdfTHCdY+vZ3UekPjzPoruBBggSEyou4YPtyNnrAF4H5ekdMcBvuQFo7rJeJZAh
Il7FeuDxm7vjKMBMi+s+ST96pu7Z4V8qu6UcLBo+4uNLBh9iGLCFN92Bybrn/rEw
lxlP4nxFj0REEr8eKHVF3wZN1jhhsMrcYv5yP19buNc0a7gdgYen7t/4uEIxGYX4
FlDeOuuNiIAa2k+VZrMUSxeOk8aWxT2mkQg0yUF4oQZOEgN0cZdU2NvzlCCoEnKh
dxHjeAHqgeCL9N4ng7VdZY1ZdRpeOk0GNfMhdOLfLVsbuokQ/Q8=
=jOd4
-----END PGP SIGNATURE-----

3
libvoikko-4.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f13c59825f36152f388cd96f638e447744199775277f4e6bcd0b9483f0eebeca
size 653769

16
libvoikko-4.2.tar.gz.asc Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEErF1l8QyFltfi2uJjPTCbYErjlC4FAlvHWHYACgkQPTCbYErj
lC6zeRAAt8DFYIWcuhputIPrNOOLmW2Md4+8pwZzmsPQ6Mp/dd5Fr0crRApLFlFa
VtgptmYJN/mbuWGS/5MsFjp+X6dNtQCYfJA4hLJ+iTHp6G4lg8FgQL7uFDNkGIHJ
HJ5N6BWOuzjBQZ3l8I6hT8AYPKEMxnkI6PifWV8eCD17dUgQMY0oVRO4Fh0nSpB1
KvTZJOTmiVVwzU/WyXJfn3ONOZQka5prmmZCu1mT/hF+6ZEVUC8Bi4HmoOPIZFdV
SqlF/zhZOLFbNji9FVuhIy1G9y7d7s4j2SG92LXWm8irdFvunEXdRS9pLI1qE/xv
x+g3Q3wvwBNCUumfHDr6XqRm9j0FK79SHgPq78CXFuwRYW8AL4JBgS9uXQiTOJsE
MWQvMUvOdeps0anAQV6lo3g7aQWLnZyMQeyAe/DqZGym2nbvxKhDmR4WUEXrPTsY
dmVKJ/v9j87wrBhVVqrvmTuZOSXwHD1VZxLz9U+JYqXjoXkZ2rKba0B3USA9xOe9
cZ20Mt4dNNurXtb0yrWJ3xmGpit1WELROQ0Ej+yd/8kV5jyby+5hGv6WiIMf7ep5
aDtE3/Dgr01LNfyCUDDXTny1UjlkiXSnvMkpfNGenZxuCoZyIW6H+C0hRzaluQKi
dlGJmc3IsK+0YfhlXXgQjKidMHbd5y6UcLRYMlau2n/yWjW85DM=
=Om+L
-----END PGP SIGNATURE-----

View File

@ -1,219 +0,0 @@
From c516a6e6a3d0cea878d114dab867bc426b7ecafe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?B=C3=B8rre=20Gaup?= <albbas@gmail.com>
Date: Wed, 1 Nov 2017 12:05:36 +0100
Subject: [PATCH] Adapt to the namespace changes in hfst-ospell
---
libvoikko/src/grammar/HfstAnalysis.cpp | 2 +-
libvoikko/src/morphology/HfstAnalyzer.cpp | 6 +++---
libvoikko/src/morphology/HfstAnalyzer.hpp | 2 +-
libvoikko/src/setup/V3DictionaryLoader.cpp | 6 +++---
libvoikko/src/setup/V4DictionaryLoader.cpp | 6 +++---
libvoikko/src/setup/setup.hpp | 4 ++--
libvoikko/src/spellchecker/HfstSpeller.cpp | 4 ++--
libvoikko/src/spellchecker/HfstSpeller.hpp | 2 +-
libvoikko/src/spellchecker/HfstSuggestion.cpp | 6 +++---
libvoikko/src/spellchecker/HfstSuggestion.hpp | 4 ++--
10 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/libvoikko/src/grammar/HfstAnalysis.cpp b/libvoikko/src/grammar/HfstAnalysis.cpp
index 9fd1e84d..229668ab 100644
--- a/libvoikko/src/grammar/HfstAnalysis.cpp
+++ b/libvoikko/src/grammar/HfstAnalysis.cpp
@@ -44,7 +44,7 @@
#include <vector>
using namespace libvoikko::grammar;
-using namespace hfst_ol;
+using namespace hfst_ospell;
//using namespace hfst;
namespace libvoikko {
diff --git a/libvoikko/src/morphology/HfstAnalyzer.cpp b/libvoikko/src/morphology/HfstAnalyzer.cpp
index e55f1216..e842bc5f 100644
--- a/libvoikko/src/morphology/HfstAnalyzer.cpp
+++ b/libvoikko/src/morphology/HfstAnalyzer.cpp
@@ -45,7 +45,7 @@ HfstAnalyzer::HfstAnalyzer(const string& s) {
return;
}
FILE *fd = fopen(s.c_str(), "rb");
- t = new hfst_ol::Transducer(fd);
+ t = new hfst_ospell::Transducer(fd);
}
@@ -73,10 +73,10 @@ list<Analysis *> * HfstAnalyzer::analyze(const char * word, bool fullMorphology)
std::copy(str.begin(), str.end(), writable);
writable[str.size()] = '\0';
- hfst_ol::AnalysisQueue q = t->lookup(writable);
+ hfst_ospell::AnalysisQueue q = t->lookup(writable);
while(q.size() > 0) {
- hfst_ol::StringWeightPair pair = q.top();
+ hfst_ospell::StringWeightPair pair = q.top();
string analysis = pair.first;
string tags = analysis.substr(analysis.find("+"),analysis.length()-1);
Analysis * a = new Analysis();
diff --git a/libvoikko/src/morphology/HfstAnalyzer.hpp b/libvoikko/src/morphology/HfstAnalyzer.hpp
index f228b449..17709c82 100644
--- a/libvoikko/src/morphology/HfstAnalyzer.hpp
+++ b/libvoikko/src/morphology/HfstAnalyzer.hpp
@@ -49,7 +49,7 @@ class HfstAnalyzer : public Analyzer {
HfstAnalyzer & operator = (const HfstAnalyzer & other);
private:
- hfst_ol::Transducer *t;
+ hfst_ospell::Transducer *t;
HfstAnalyzer(HfstAnalyzer const & other);
diff --git a/libvoikko/src/setup/V3DictionaryLoader.cpp b/libvoikko/src/setup/V3DictionaryLoader.cpp
index 93b17fa8..9d65c156 100644
--- a/libvoikko/src/setup/V3DictionaryLoader.cpp
+++ b/libvoikko/src/setup/V3DictionaryLoader.cpp
@@ -58,15 +58,15 @@ void V3DictionaryLoader::findDictionaries(const string & path) {
// TODO implement null hyphenator
BackendProperties hyphenatorBackend("AnalyzerToFinnishHyphenatorAdapter(currentAnalyzer)", false);
- hfst_ol::ZHfstOspeller * speller = new hfst_ol::ZHfstOspeller();
+ hfst_ospell::ZHfstOspeller * speller = new hfst_ospell::ZHfstOspeller();
try {
speller->read_zhfst(fullPath.c_str());
}
- catch (hfst_ol::ZHfstZipReadingError& zhzre) {
+ catch (hfst_ospell::ZHfstZipReadingError& zhzre) {
delete speller;
continue; // broken dictionary
}
- const hfst_ol::ZHfstOspellerXmlMetadata spellerMetadata = speller->get_metadata();
+ const hfst_ospell::ZHfstOspellerXmlMetadata spellerMetadata = speller->get_metadata();
LanguageTag language;
language.setBcp47(spellerMetadata.info_.locale_);
diff --git a/libvoikko/src/setup/V4DictionaryLoader.cpp b/libvoikko/src/setup/V4DictionaryLoader.cpp
index 8735e11b..58a79a99 100644
--- a/libvoikko/src/setup/V4DictionaryLoader.cpp
+++ b/libvoikko/src/setup/V4DictionaryLoader.cpp
@@ -82,16 +82,16 @@ void V4DictionaryLoader::findDictionaries(const string & path) {
// TODO implement null hyphenator
//cerr << " +found: " << fileName << endl;
- hfst_ol::ZHfstOspeller * speller = new hfst_ol::ZHfstOspeller();
+ hfst_ospell::ZHfstOspeller * speller = new hfst_ospell::ZHfstOspeller();
try {
speller->read_zhfst(fullPath.c_str());
}
- catch (hfst_ol::ZHfstZipReadingError& zhzre) {
+ catch (hfst_ospell::ZHfstZipReadingError& zhzre) {
delete speller;
//cerr << " -broken :( " << fileName << endl;
continue; // broken dictionary
}
- const hfst_ol::ZHfstOspellerXmlMetadata spellerMetadata = speller->get_metadata();
+ const hfst_ospell::ZHfstOspellerXmlMetadata spellerMetadata = speller->get_metadata();
LanguageTag language;
language.setBcp47(spellerMetadata.info_.locale_);
diff --git a/libvoikko/src/setup/setup.hpp b/libvoikko/src/setup/setup.hpp
index 6f29dab9..b680470b 100644
--- a/libvoikko/src/setup/setup.hpp
+++ b/libvoikko/src/setup/setup.hpp
@@ -42,7 +42,7 @@
#include "setup/Dictionary.hpp"
// TODO proper abstraction
-namespace hfst_ol {
+namespace hfst_ospell {
class ZHfstOspeller;
}
@@ -67,7 +67,7 @@ typedef struct {
spellchecker::suggestion::SuggestionGenerator * suggestionGenerator;
hyphenator::Hyphenator * hyphenator;
setup::Dictionary dictionary;
- hfst_ol::ZHfstOspeller* hfst;
+ hfst_ospell::ZHfstOspeller* hfst;
} voikko_options_t;
}
diff --git a/libvoikko/src/spellchecker/HfstSpeller.cpp b/libvoikko/src/spellchecker/HfstSpeller.cpp
index 35d23495..422685e0 100644
--- a/libvoikko/src/spellchecker/HfstSpeller.cpp
+++ b/libvoikko/src/spellchecker/HfstSpeller.cpp
@@ -39,7 +39,7 @@ using namespace std;
using namespace libvoikko::character;
using namespace libvoikko::utils;
-using hfst_ol::ZHfstOspeller;
+using hfst_ospell::ZHfstOspeller;
namespace libvoikko { namespace spellchecker {
@@ -49,7 +49,7 @@ HfstSpeller::HfstSpeller(const string & zhfstFileName, voikko_options_t * voikko
try {
speller->read_zhfst(zhfstFileName.c_str());
}
- catch (hfst_ol::ZHfstZipReadingError& zhzre) {
+ catch (hfst_ospell::ZHfstZipReadingError& zhzre) {
throw setup::DictionaryException("Error reading ZHFST speller");
}
}
diff --git a/libvoikko/src/spellchecker/HfstSpeller.hpp b/libvoikko/src/spellchecker/HfstSpeller.hpp
index fd079a8e..be94459e 100644
--- a/libvoikko/src/spellchecker/HfstSpeller.hpp
+++ b/libvoikko/src/spellchecker/HfstSpeller.hpp
@@ -49,7 +49,7 @@ class HfstSpeller : public Speller {
void terminate();
/** Public for use in HfstSuggestion */
- hfst_ol::ZHfstOspeller * speller;
+ hfst_ospell::ZHfstOspeller * speller;
private:
/** Return SPELL_FAILED or SPELL_OK depending on whether given word is correct as is. */
spellresult doSpell(const wchar_t * word, size_t wlen);
diff --git a/libvoikko/src/spellchecker/HfstSuggestion.cpp b/libvoikko/src/spellchecker/HfstSuggestion.cpp
index bf65bc74..30fa466f 100644
--- a/libvoikko/src/spellchecker/HfstSuggestion.cpp
+++ b/libvoikko/src/spellchecker/HfstSuggestion.cpp
@@ -41,11 +41,11 @@
using namespace std;
using namespace libvoikko::utils;
-using hfst_ol::ZHfstOspeller;
+using hfst_ospell::ZHfstOspeller;
namespace libvoikko { namespace spellchecker { namespace suggestion {
-HfstSuggestion::HfstSuggestion(hfst_ol::ZHfstOspeller * speller) :
+HfstSuggestion::HfstSuggestion(hfst_ospell::ZHfstOspeller * speller) :
speller_(speller) { }
void HfstSuggestion::generate(SuggestionStatus * s) const {
@@ -54,7 +54,7 @@ void HfstSuggestion::generate(SuggestionStatus * s) const {
char * wordUtf8 = StringUtils::utf8FromUcs4(s->getWord(), wlen);
set<wstring> allSuggs;
bool checkUppercasing = (voikko_casetype(s->getWord(), wlen) == CT_FIRST_UPPER);
- hfst_ol::CorrectionQueue corrections = speller_->suggest(wordUtf8);
+ hfst_ospell::CorrectionQueue corrections = speller_->suggest(wordUtf8);
while (corrections.size() > 0 && !s->shouldAbort()) {
const char * sugUtf8 = corrections.top().first.c_str();
wchar_t * sugU4 = StringUtils::ucs4FromUtf8(sugUtf8, strlen(sugUtf8));
diff --git a/libvoikko/src/spellchecker/HfstSuggestion.hpp b/libvoikko/src/spellchecker/HfstSuggestion.hpp
index f3e29b77..1217fb45 100644
--- a/libvoikko/src/spellchecker/HfstSuggestion.hpp
+++ b/libvoikko/src/spellchecker/HfstSuggestion.hpp
@@ -45,11 +45,11 @@ namespace libvoikko { namespace spellchecker { namespace suggestion {
*/
class HfstSuggestion : public SuggestionGenerator {
public:
- HfstSuggestion(hfst_ol::ZHfstOspeller * speller);
+ HfstSuggestion(hfst_ospell::ZHfstOspeller * speller);
void generate(SuggestionStatus * s) const;
void terminate();
private:
- hfst_ol::ZHfstOspeller * speller_;
+ hfst_ospell::ZHfstOspeller * speller_;
};
} } }

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Feb 27 07:38:46 UTC 2019 - Timo Jyrinki <tjyrinki@suse.com>
- Update to version 4.2
* Support for Malaga dictionary format removed
* hfst-ospell dependency updated
* Java, Python, Javascript wrapper improvements
- Drop libvoikko-hfst-namespace.patch
-------------------------------------------------------------------
Mon Apr 23 13:27:51 UTC 2018 - tchvatal@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package libvoikko
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -12,12 +12,12 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: libvoikko
Version: 4.1.1
Version: 4.2
Release: 0
Summary: Spellchecker and Hyphenator for Finnish Language
License: GPL-2.0-or-later
@ -27,7 +27,6 @@ Source0: http://www.puimula.org/voikko-sources/%{name}/%{name}-%{version}
Source1: http://www.puimula.org/voikko-sources/%{name}/%{name}-%{version}.tar.gz.asc
Source2: %{name}.keyring
Source99: baselibs.conf
Patch0: libvoikko-hfst-namespace.patch
BuildRequires: gcc-c++
BuildRequires: glib2-devel
BuildRequires: pkgconfig
@ -80,7 +79,6 @@ tasks on text.
%prep
%setup -q
%patch0 -p2
%build
%configure \