Empty character categories removed from database
This commit is contained in:
parent
1fcd2d2689
commit
67a6fd18e4
@ -385,6 +385,8 @@ int _tmain(int argc, _TCHAR *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
set<ZRCola::chrcatid_t> categories_used;
|
||||
|
||||
{
|
||||
// Get characters.
|
||||
ATL::CComPtr<ADORecordset> rs;
|
||||
@ -425,6 +427,9 @@ int _tmain(int argc, _TCHAR *argv[])
|
||||
idxChrDsc .add_keywords(chr.keywords.c_str(), chr.chr, 0);
|
||||
idxChrDscSub.add_keywords(chr.desc .c_str(), chr.chr, 3);
|
||||
idxChrDscSub.add_keywords(chr.keywords.c_str(), chr.chr, 3);
|
||||
|
||||
// Mark category used.
|
||||
categories_used.insert(chr.cat);
|
||||
} else
|
||||
has_errors = true;
|
||||
|
||||
@ -468,21 +473,24 @@ int _tmain(int argc, _TCHAR *argv[])
|
||||
while (!ZRCola::DBSource::IsEOF(rs)) {
|
||||
// Read character category from the database.
|
||||
if (src.GetCharacterCategory(rs, cc)) {
|
||||
// Add character category to index and data.
|
||||
unsigned __int32 idx = db.data.size();
|
||||
for (wstring::size_type i = 0; i < sizeof(ZRCola::chrcatid_t)/sizeof(unsigned __int16); i++)
|
||||
db.data.push_back(((const unsigned __int16*)cc.id.data)[i]);
|
||||
wxASSERT_MSG((int)0xffff8000 <= cc.rank && cc.rank <= (int)0x00007fff, wxT("character category rank out of bounds"));
|
||||
db.data.push_back((unsigned __int16)cc.rank);
|
||||
wstring::size_type n_name = cc.name.length();
|
||||
wxASSERT_MSG(n_name <= 0xffff, wxT("character category name too long"));
|
||||
db.data.push_back((unsigned __int16)n_name);
|
||||
for (wstring::size_type i = 0; i < n_name; i++)
|
||||
db.data.push_back(cc.name[i]);
|
||||
db.idxChrCat.push_back(idx);
|
||||
db.idxRnk .push_back(idx);
|
||||
if (build_pot)
|
||||
pot.insert(cc.name);
|
||||
if (categories_used.find(cc.id) != categories_used.end()) {
|
||||
// Add character category to index and data.
|
||||
unsigned __int32 idx = db.data.size();
|
||||
for (wstring::size_type i = 0; i < sizeof(ZRCola::chrcatid_t)/sizeof(unsigned __int16); i++)
|
||||
db.data.push_back(((const unsigned __int16*)cc.id.data)[i]);
|
||||
wxASSERT_MSG((int)0xffff8000 <= cc.rank && cc.rank <= (int)0x00007fff, wxT("character category rank out of bounds"));
|
||||
db.data.push_back((unsigned __int16)cc.rank);
|
||||
wstring::size_type n_name = cc.name.length();
|
||||
wxASSERT_MSG(n_name <= 0xffff, wxT("character category name too long"));
|
||||
db.data.push_back((unsigned __int16)n_name);
|
||||
for (wstring::size_type i = 0; i < n_name; i++)
|
||||
db.data.push_back(cc.name[i]);
|
||||
db.idxChrCat.push_back(idx);
|
||||
db.idxRnk .push_back(idx);
|
||||
if (build_pot)
|
||||
pot.insert(cc.name);
|
||||
} else
|
||||
_ftprintf(stderr, wxT("%s: warning ZCC0019: Ommiting empty category %ls.\n"), (LPCTSTR)filenameIn.c_str(), (LPCWSTR)cc.name.c_str());
|
||||
} else
|
||||
has_errors = true;
|
||||
|
||||
|
Binary file not shown.
@ -5,7 +5,7 @@ msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: ZRColaCompile 2.0-beta\n"
|
||||
"X-Generator: ZRColaCompile 2.0-beta1\n"
|
||||
|
||||
msgid "Albanian"
|
||||
msgstr ""
|
||||
@ -160,6 +160,9 @@ msgstr ""
|
||||
msgid "Letter Z"
|
||||
msgstr ""
|
||||
|
||||
msgid "Letter a"
|
||||
msgstr ""
|
||||
|
||||
msgid "Letter e"
|
||||
msgstr ""
|
||||
|
||||
@ -205,9 +208,6 @@ msgstr ""
|
||||
msgid "Mark, Non-Spacing"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mark, Spacing Combining"
|
||||
msgstr ""
|
||||
|
||||
msgid "Metric"
|
||||
msgstr ""
|
||||
|
||||
@ -271,9 +271,6 @@ msgstr ""
|
||||
msgid "Other, Format"
|
||||
msgstr ""
|
||||
|
||||
msgid "Other, Surrogate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Parentheses"
|
||||
msgstr ""
|
||||
|
||||
@ -313,12 +310,6 @@ msgstr ""
|
||||
msgid "Russian"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Line"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Paragraph"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Space"
|
||||
msgstr ""
|
||||
|
||||
|
@ -167,6 +167,10 @@ msgstr ""
|
||||
msgid "Letter Z"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
msgid "Letter a"
|
||||
msgstr "Letter Extra 9 1/2 x 12 Zoll"
|
||||
|
||||
msgid "Letter e"
|
||||
msgstr ""
|
||||
|
||||
@ -212,9 +216,6 @@ msgstr ""
|
||||
msgid "Mark, Non-Spacing"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mark, Spacing Combining"
|
||||
msgstr ""
|
||||
|
||||
msgid "Metric"
|
||||
msgstr ""
|
||||
|
||||
@ -279,9 +280,6 @@ msgstr ""
|
||||
msgid "Other, Format"
|
||||
msgstr ""
|
||||
|
||||
msgid "Other, Surrogate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Parentheses"
|
||||
msgstr ""
|
||||
|
||||
@ -321,12 +319,6 @@ msgstr ""
|
||||
msgid "Russian"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Line"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Paragraph"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Space"
|
||||
msgstr ""
|
||||
|
||||
@ -429,7 +421,3 @@ msgstr "Windows Türkisch (CP 1254)"
|
||||
|
||||
msgid "Ukrainian"
|
||||
msgstr ""
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "Letter a"
|
||||
#~ msgstr "Letter Extra 9 1/2 x 12 Zoll"
|
||||
|
@ -167,6 +167,9 @@ msgstr ""
|
||||
msgid "Letter Z"
|
||||
msgstr ""
|
||||
|
||||
msgid "Letter a"
|
||||
msgstr ""
|
||||
|
||||
msgid "Letter e"
|
||||
msgstr ""
|
||||
|
||||
@ -212,9 +215,6 @@ msgstr ""
|
||||
msgid "Mark, Non-Spacing"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mark, Spacing Combining"
|
||||
msgstr ""
|
||||
|
||||
msgid "Metric"
|
||||
msgstr ""
|
||||
|
||||
@ -278,9 +278,6 @@ msgstr ""
|
||||
msgid "Other, Format"
|
||||
msgstr ""
|
||||
|
||||
msgid "Other, Surrogate"
|
||||
msgstr ""
|
||||
|
||||
msgid "Parentheses"
|
||||
msgstr ""
|
||||
|
||||
@ -320,12 +317,6 @@ msgstr ""
|
||||
msgid "Russian"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Line"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Paragraph"
|
||||
msgstr ""
|
||||
|
||||
msgid "Separator, Space"
|
||||
msgstr ""
|
||||
|
||||
|
Binary file not shown.
@ -167,6 +167,9 @@ msgstr "Črka Y"
|
||||
msgid "Letter Z"
|
||||
msgstr "Črka Z"
|
||||
|
||||
msgid "Letter a"
|
||||
msgstr "Črka a"
|
||||
|
||||
msgid "Letter e"
|
||||
msgstr "Črka e"
|
||||
|
||||
@ -212,9 +215,6 @@ msgstr "Ločevalo, obdajajoča"
|
||||
msgid "Mark, Non-Spacing"
|
||||
msgstr "Ločevalo, neločljivo"
|
||||
|
||||
msgid "Mark, Spacing Combining"
|
||||
msgstr "Ločevalo, ločljivo"
|
||||
|
||||
msgid "Metric"
|
||||
msgstr "Metrično"
|
||||
|
||||
@ -278,9 +278,6 @@ msgstr "Druga spreminjevala"
|
||||
msgid "Other, Format"
|
||||
msgstr "Drugo, oblikovni"
|
||||
|
||||
msgid "Other, Surrogate"
|
||||
msgstr "Drugo, nadomestni"
|
||||
|
||||
msgid "Parentheses"
|
||||
msgstr "Oklepaji"
|
||||
|
||||
@ -320,12 +317,6 @@ msgstr "romunščina"
|
||||
msgid "Russian"
|
||||
msgstr "ruščina"
|
||||
|
||||
msgid "Separator, Line"
|
||||
msgstr "Ločilo, vrstic"
|
||||
|
||||
msgid "Separator, Paragraph"
|
||||
msgstr "Ločilo, odstavkov"
|
||||
|
||||
msgid "Separator, Space"
|
||||
msgstr "Ločilo, presledek"
|
||||
|
||||
@ -416,8 +407,17 @@ msgstr "turščina"
|
||||
msgid "Ukrainian"
|
||||
msgstr "ukrajinščina"
|
||||
|
||||
#~ msgid "Letter a"
|
||||
#~ msgstr "Črka a"
|
||||
#~ msgid "Mark, Spacing Combining"
|
||||
#~ msgstr "Ločevalo, ločljivo"
|
||||
|
||||
#~ msgid "Other, Surrogate"
|
||||
#~ msgstr "Drugo, nadomestni"
|
||||
|
||||
#~ msgid "Separator, Line"
|
||||
#~ msgstr "Ločilo, vrstic"
|
||||
|
||||
#~ msgid "Separator, Paragraph"
|
||||
#~ msgstr "Ločilo, odstavkov"
|
||||
|
||||
#~ msgid "Letter b"
|
||||
#~ msgstr "Črka b"
|
||||
|
Loading…
x
Reference in New Issue
Block a user