Add check for missing quad lookup table

git-svn-id: https://cld2.googlecode.com/svn/trunk@111 b252ecd4-b096-bf77-eb8e-91563289f87e
This commit is contained in:
dsites@google.com
2014-02-03 19:05:18 +00:00
parent c7564d6371
commit 39b46855a5

View File

@@ -1624,6 +1624,7 @@ Language DetectLanguageSummaryV2(
// Exit now if no text // Exit now if no text
if (buffer_length == 0) {return UNKNOWN_LANGUAGE;} if (buffer_length == 0) {return UNKNOWN_LANGUAGE;}
if (kScoringtables.quadgram_obj == NULL) {return UNKNOWN_LANGUAGE;}
// Document totals // Document totals
DocTote doc_tote; // Reliability = 0..100 DocTote doc_tote; // Reliability = 0..100
@@ -1973,8 +1974,9 @@ static char temp_detectlanguageversion[32];
// Return version text string // Return version text string
// String is "code_version - data_build_date" // String is "code_version - data_build_date"
const char* DetectLanguageVersion() { const char* DetectLanguageVersion() {
if (kScoringtables.quadgram_obj == NULL) {return "";}
sprintf(temp_detectlanguageversion, sprintf(temp_detectlanguageversion,
"V2.0 - %u", kQuad_obj.kCLDTableBuildDate); "V2.0 - %u", kScoringtables.quadgram_obj->kCLDTableBuildDate);
return temp_detectlanguageversion; return temp_detectlanguageversion;
} }