aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/language/detector.cpp
diff options
context:
space:
mode:
authorGravatar wodim2019-04-01 15:01:02 +0200
committerGravatar GitHub2019-04-01 15:01:02 +0200
commit1e89e2da2e3740e55642c8ce44c573cd4bbe6ea9 (patch)
tree94cfdd5000b6b0d6af1272e89f8b234fd8c484d4 /src/modules/language/detector.cpp
parentAdd support for Python 3 (diff)
parentuintUserListMinimumWidth: Reduce minimum due to account for certain combinati... (diff)
downloadKVIrc-1e89e2da2e3740e55642c8ce44c573cd4bbe6ea9.tar.gz
KVIrc-1e89e2da2e3740e55642c8ce44c573cd4bbe6ea9.tar.bz2
KVIrc-1e89e2da2e3740e55642c8ce44c573cd4bbe6ea9.zip
Merge branch 'master' into python3
Diffstat (limited to 'src/modules/language/detector.cpp')
-rw-r--r--src/modules/language/detector.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/language/detector.cpp b/src/modules/language/detector.cpp
index bbdb67812..9e5694972 100644
--- a/src/modules/language/detector.cpp
+++ b/src/modules/language/detector.cpp
@@ -23,30 +23,31 @@
// DO NOT EDIT THIS FILE: Edit detector/build_detector.pl instead!
//
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
+#include <cstdlib>
+#include <cstdio>
+#include <cstring>
+#include <cctype>
#include "detector.h"
+namespace {
//
// CORE DEFS
//
-typedef struct _DetectorNGram
+struct DetectorNGram
{
const unsigned char * szNGram;
double dScore;
-} DetectorNGram;
+};
-typedef struct _DetectorDescriptor
+struct DetectorDescriptor
{
const char * szLanguage;
const char * szEncoding;
double single_char_data[256];
DetectorNGram * ngram_hash[256];
-} DetectorDescriptor;
+};
static DetectorNGram X[] = { { nullptr, 0 } };
@@ -18712,6 +18713,7 @@ static int utf8score(const unsigned char * p)
}
static const char * unknown_string = "?";
+} // namespace
void detect_language_and_encoding(const char * data, LanguageAndEncodingResult * retBuffer, int iFlags = 0)
{