Empty character categories removed from database

This commit is contained in:
Simon Rozman 2016-05-25 13:57:33 +02:00
parent 1fcd2d2689
commit 67a6fd18e4
7 changed files with 48 additions and 70 deletions

View File

@ -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,6 +473,7 @@ int _tmain(int argc, _TCHAR *argv[])
while (!ZRCola::DBSource::IsEOF(rs)) {
// Read character category from the database.
if (src.GetCharacterCategory(rs, cc)) {
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++)
@ -483,6 +489,8 @@ int _tmain(int argc, _TCHAR *argv[])
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.

View File

@ -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 ""

View File

@ -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"

View File

@ -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.

View File

@ -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"