mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 16:04:06 +00:00
refactor: move transliteration code to src/dict/transliteration
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
Some checks are pending
SonarCloud / Build and analyze (push) Waiting to run
This commit is contained in:
parent
f2ce85cda2
commit
d3700f2926
|
@ -11,12 +11,6 @@
|
||||||
#include "dict/sounddir.hh"
|
#include "dict/sounddir.hh"
|
||||||
#include "dict/hunspell.hh"
|
#include "dict/hunspell.hh"
|
||||||
#include "dictdfiles.hh"
|
#include "dictdfiles.hh"
|
||||||
#include "dict/romaji.hh"
|
|
||||||
#include "dict/customtransliteration.hh"
|
|
||||||
#include "dict/russiantranslit.hh"
|
|
||||||
#include "dict/german.hh"
|
|
||||||
#include "dict/greektranslit.hh"
|
|
||||||
#include "dict/belarusiantranslit.hh"
|
|
||||||
#include "dict/website.hh"
|
#include "dict/website.hh"
|
||||||
#include "dict/forvo.hh"
|
#include "dict/forvo.hh"
|
||||||
#include "dict/programs.hh"
|
#include "dict/programs.hh"
|
||||||
|
@ -34,12 +28,19 @@
|
||||||
#include "dict/lingualibre.hh"
|
#include "dict/lingualibre.hh"
|
||||||
#include "metadata.hh"
|
#include "metadata.hh"
|
||||||
|
|
||||||
|
#include "dict/transliteration/belarusian.hh"
|
||||||
|
#include "dict/transliteration/custom.hh"
|
||||||
|
#include "dict/transliteration/german.hh"
|
||||||
|
#include "dict/transliteration/greek.hh"
|
||||||
|
#include "dict/transliteration/romaji.hh"
|
||||||
|
#include "dict/transliteration/russian.hh"
|
||||||
|
|
||||||
#ifndef NO_EPWING_SUPPORT
|
#ifndef NO_EPWING_SUPPORT
|
||||||
#include "dict/epwing.hh"
|
#include "dict/epwing.hh"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MAKE_CHINESE_CONVERSION_SUPPORT
|
#ifdef MAKE_CHINESE_CONVERSION_SUPPORT
|
||||||
#include "dict/chinese.hh"
|
#include "dict/transliteration/chinese.hh"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
@ -243,10 +244,10 @@ void loadDictionaries( QWidget * parent,
|
||||||
///// We create transliterations synchronously since they are very simple
|
///// We create transliterations synchronously since they are very simple
|
||||||
|
|
||||||
#ifdef MAKE_CHINESE_CONVERSION_SUPPORT
|
#ifdef MAKE_CHINESE_CONVERSION_SUPPORT
|
||||||
addDicts( Chinese::makeDictionaries( cfg.transliteration.chinese ) );
|
addDicts( ChineseTranslit::makeDictionaries( cfg.transliteration.chinese ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
addDicts( Romaji::makeDictionaries( cfg.transliteration.romaji ) );
|
addDicts( RomajiTranslit::makeDictionaries( cfg.transliteration.romaji ) );
|
||||||
addDicts( CustomTranslit::makeDictionaries( cfg.transliteration.customTrans ) );
|
addDicts( CustomTranslit::makeDictionaries( cfg.transliteration.customTrans ) );
|
||||||
|
|
||||||
// Make Russian transliteration
|
// Make Russian transliteration
|
||||||
|
|
1
src/dict/transliteration/README.md
Normal file
1
src/dict/transliteration/README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Translit
|
|
@ -1,7 +1,7 @@
|
||||||
/* This file is (c) 2013 Maksim Tamkovicz <quendimax@gmail.com>
|
/* This file is (c) 2013 Maksim Tamkovicz <quendimax@gmail.com>
|
||||||
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
||||||
|
|
||||||
#include "belarusiantranslit.hh"
|
#include "belarusian.hh"
|
||||||
#include "transliteration.hh"
|
#include "transliteration.hh"
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include "dictionary.hh"
|
#include "dictionary.hh"
|
||||||
|
|
||||||
// Support for Belarusian transliteration
|
// Support for Belarusian transliteration
|
|
@ -4,16 +4,13 @@
|
||||||
#include "chinese.hh"
|
#include "chinese.hh"
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
// #ifdef Q_OS_MAC
|
|
||||||
#include <opencc/opencc.h>
|
#include <opencc/opencc.h>
|
||||||
// #endif
|
|
||||||
// #include <opencc/SimpleConverter.hpp>
|
|
||||||
#include "folding.hh"
|
#include "folding.hh"
|
||||||
#include "gddebug.hh"
|
#include "gddebug.hh"
|
||||||
#include "transliteration.hh"
|
#include "transliteration.hh"
|
||||||
#include "utf8.hh"
|
#include "utf8.hh"
|
||||||
|
|
||||||
namespace Chinese {
|
namespace ChineseTranslit {
|
||||||
|
|
||||||
class CharacterConversionDictionary: public Transliteration::BaseTransliterationDictionary
|
class CharacterConversionDictionary: public Transliteration::BaseTransliterationDictionary
|
||||||
{
|
{
|
||||||
|
@ -162,4 +159,4 @@ std::vector< sptr< Dictionary::Class > > makeDictionaries( Config::Chinese const
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Chinese
|
} // namespace ChineseTranslit
|
|
@ -3,12 +3,10 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include "config.hh"
|
|
||||||
#include "dictionary.hh"
|
#include "dictionary.hh"
|
||||||
|
|
||||||
/// Chinese character conversion support.
|
/// Chinese character conversion support.
|
||||||
namespace Chinese {
|
namespace ChineseTranslit {
|
||||||
|
|
||||||
std::vector< sptr< Dictionary::Class > > makeDictionaries( Config::Chinese const & );
|
std::vector< sptr< Dictionary::Class > > makeDictionaries( Config::Chinese const & );
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
#include "customtransliteration.hh"
|
#include "custom.hh"
|
||||||
#include "dictionary.hh"
|
#include "dictionary.hh"
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include "transliteration.hh"
|
#include "transliteration.hh"
|
||||||
|
|
||||||
// Support for Belarusian transliteration
|
// Support for Belarusian transliteration
|
|
@ -1,7 +1,7 @@
|
||||||
/* This file is (c) 2010 Jennie Petoumenou <epetoumenou@gmail.com>
|
/* This file is (c) 2010 Jennie Petoumenou <epetoumenou@gmail.com>
|
||||||
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
||||||
|
|
||||||
#include "greektranslit.hh"
|
#include "greek.hh"
|
||||||
#include "transliteration.hh"
|
#include "transliteration.hh"
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#include "romaji.hh"
|
#include "romaji.hh"
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
namespace Romaji {
|
namespace RomajiTranslit {
|
||||||
|
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
class HepburnHiragana: public Transliteration::Table
|
class HepburnHiragana: public Transliteration::Table
|
||||||
{
|
{
|
||||||
|
@ -375,4 +377,4 @@ vector< sptr< Dictionary::Class > > makeDictionaries( Config::Romaji const & r )
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Romaji
|
} // namespace RomajiTranslit
|
|
@ -4,12 +4,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "transliteration.hh"
|
#include "transliteration.hh"
|
||||||
#include "config.hh"
|
|
||||||
|
|
||||||
/// Japanese romanization (Romaji) support.
|
/// Japanese romanization (Romaji) support.
|
||||||
namespace Romaji {
|
namespace RomajiTranslit {
|
||||||
|
|
||||||
using std::vector;
|
std::vector< sptr< Dictionary::Class > > makeDictionaries( Config::Romaji const & );
|
||||||
|
} // namespace RomajiTranslit
|
||||||
vector< sptr< Dictionary::Class > > makeDictionaries( Config::Romaji const & );
|
|
||||||
} // namespace Romaji
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
|
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
|
||||||
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
||||||
|
|
||||||
#include "russiantranslit.hh"
|
#include "russian.hh"
|
||||||
#include "transliteration.hh"
|
#include "transliteration.hh"
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
Loading…
Reference in a new issue