[go: up one dir, main page]

Menu

[r384]: / ctranslit.h  Maximize  Restore  History

Download this file

113 lines (94 with data), 3.8 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* Marcion
Copyright (C) 2009 - 2011 Milan Konvicka
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program */
#ifndef CTRANSLIT_H
#define CTRANSLIT_H
//
#include <QString>
#include <QStringList>
#include <QRegExp>
#include <QPair>
//
//#define COUNT_WORDTYPE 23
#define COUNT_QUALITY 9
#define CRUM_FIRST 22
#define CRUM_LAST 865
#define CRUM_COUNT 843
typedef QPair<QString,int> QCWordClassItem;
typedef QList<QCWordClassItem> QCWordClass;
struct beta
{
char beta[4];
int utf;
};
struct cmbstruct{
QString t;
char n;
};
QString get_quality(int n);
cmbstruct & get_quality_item(int n);
class CTranslit
{
public:
enum Script{
Latin=1,Greek=2,Copt=3,Hebrew=4
};
enum Tr{GreekNToGreekTr,
GreekTrToGreekN,
GreekNToGreekTr_num,
GreekTrToGreekN_num,
GreekTrToGreekNcs,
CopticNToCopticTr,
CopticTrToCopticN,
CopticNToCopticTr_num,
CopticTrToCopticN_num,
HebrewNToHebrewTr,
HebrewTrToHebrewN,
HebrewNToHebrewTr_num,
HebrewTrToHebrewN_num,
LatinNToLatinTr,
LatinTrToLatinN,
CopticNToGreekTr,
CopticNToGreekN,
CopticDictC,
CopticDictGr};
static void init();
static QString tr(QString const & str,Tr from_to,bool strip=false,bool rm_spaces=false);
static QString to(QString latin,Script scr,
bool ancient_only=false);
static QString NAtoLatin(QString const &);
static QString NAtoLatin2(QString const &,bool);
static QString betaToUtfSimple(QString const & string,
Script script);
static QString betaToUtf(QString const & string,
Script script);
static QString betaToLatStripped(QString const & string,Script lang);
static QString greekToLatinExt(QString const & str);
static QString latinToGreekExt(QString const & str);
static QString latinToCopticExt(QString const & str);
static QString latinToXExt(QString const & str,Script script);
static QString perseusToUtf8(QString const & latin);
//static QString copticForLsj(QString const & coptic);
static QString escaped(QString const & string);
static bool isCoptic(QString const & str);
static bool isGreek(QString const & str);
static bool isHebrew(QString const & str);
static CTranslit::Script identify(QString const &);
static QString getWordType(int n);
//static bool isTag(QString const &,int);
//static QString highlightHtmlText(QString const &,QString const &,QString const &,QString const &,bool,bool);
static QCWordClass CWClass;
private:
static QString const lat,lat_heb,hebr,copt,copt2,gr,beta_wp_coptic,beta_wp_greek,lat_wp,lat_wpg,copt_wp;
static QString const tr_clc,tr_llc,tr_clc_n,tr_llc_n,tr_ccl,tr_lcl,tr_ccl_n,tr_lcl_n,tr_glg,tr_glg_n,tr_ggl,tr_lgl,tr_ggl_n,tr_lgl_n,tr_llg,tr_llg_n,tr_hlh,tr_hlh_n,tr_hhl,tr_hhl_n,tr_llh,tr_llh_n,tr_lhl,tr_lhl_n,tr_lLl,tr_llL,tr_LLl,tr_LlL,tr_ccg,tr_gcg,tr_gcl,tr_glg_cs,tr_llg_cs;
};
struct beta * beta_p(CTranslit::Script script,beta ** beta_ns);
#endif