diff options
author | Jehan <jehan@girinstud.io> | 2022-12-13 23:45:22 +0100 |
---|---|---|
committer | Jehan <jehan@girinstud.io> | 2022-12-14 00:24:53 +0100 |
commit | 908f9b8ba776d21cd6e0b0b836014dd212f9a12f (patch) | |
tree | e15075ba617e5f19d078ed468b429355cf00b13f | |
parent | a916fb1c56a64aa2db1366775bbe9b2661ecb6bc (diff) |
src, test: rename s/uchardet_get_candidates/uchardet_get_n_candidates/.
This was badly named as this function does not return candidates, but
the number of candidates (to be actually used in other API).
-rw-r--r-- | src/symbols.cmake | 2 | ||||
-rw-r--r-- | src/tools/uchardet.cpp | 2 | ||||
-rw-r--r-- | src/uchardet.cpp | 2 | ||||
-rw-r--r-- | src/uchardet.h | 22 | ||||
-rw-r--r-- | test/uchardet-tests.c | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/src/symbols.cmake b/src/symbols.cmake index e5d2cc7..995012b 100644 --- a/src/symbols.cmake +++ b/src/symbols.cmake @@ -6,7 +6,7 @@ set( uchardet_data_end uchardet_reset uchardet_get_charset - uchardet_get_candidates + uchardet_get_n_candidates uchardet_get_encoding uchardet_get_confidence uchardet_get_language diff --git a/src/tools/uchardet.cpp b/src/tools/uchardet.cpp index 958b5c3..32e5118 100644 --- a/src/tools/uchardet.cpp +++ b/src/tools/uchardet.cpp @@ -67,7 +67,7 @@ static void detect(uchardet_t handle, if (verbose) { - size_t candidates = uchardet_get_candidates(handle); + size_t candidates = uchardet_get_n_candidates(handle); size_t i; printf("\n"); diff --git a/src/uchardet.cpp b/src/uchardet.cpp index b2207e3..576eaac 100644 --- a/src/uchardet.cpp +++ b/src/uchardet.cpp @@ -237,7 +237,7 @@ const char* uchardet_get_charset(uchardet_t ud) return reinterpret_cast<HandleUniversalDetector*>(ud)->GetCharset(0); } -size_t uchardet_get_candidates (uchardet_t ud) +size_t uchardet_get_n_candidates (uchardet_t ud) { return reinterpret_cast<HandleUniversalDetector*>(ud)->GetCandidates(); } diff --git a/src/uchardet.h b/src/uchardet.h index d2299b6..c8ecb72 100644 --- a/src/uchardet.h +++ b/src/uchardet.h @@ -112,20 +112,20 @@ UCHARDET_INTERFACE void uchardet_reset(uchardet_t ud); * @param ud [in] handle of an instance of uchardet * @return name of charset on success and "" on failure. */ -DEPRECATED("use uchardet_get_candidates() and uchardet_get_encoding() instead (since 0.1.0)") +DEPRECATED("use uchardet_get_n_candidates() and uchardet_get_encoding() instead (since 0.1.0)") UCHARDET_INTERFACE const char * uchardet_get_charset(uchardet_t ud); -UCHARDET_INTERFACE size_t uchardet_get_candidates (uchardet_t ud); -UCHARDET_INTERFACE float uchardet_get_confidence (uchardet_t ud, - size_t candidate); -UCHARDET_INTERFACE const char * uchardet_get_encoding (uchardet_t ud, - size_t candidate); -UCHARDET_INTERFACE const char * uchardet_get_language (uchardet_t ud, - size_t candidate); +UCHARDET_INTERFACE size_t uchardet_get_n_candidates (uchardet_t ud); +UCHARDET_INTERFACE float uchardet_get_confidence (uchardet_t ud, + size_t candidate); +UCHARDET_INTERFACE const char * uchardet_get_encoding (uchardet_t ud, + size_t candidate); +UCHARDET_INTERFACE const char * uchardet_get_language (uchardet_t ud, + size_t candidate); -UCHARDET_INTERFACE void uchardet_weigh_language (uchardet_t ud, - const char *language, - float weight); +UCHARDET_INTERFACE void uchardet_weigh_language (uchardet_t ud, + const char *language, + float weight); UCHARDET_INTERFACE void uchardet_set_default_weight (uchardet_t ud, float weight); diff --git a/test/uchardet-tests.c b/test/uchardet-tests.c index 5d9ee01..96dbedf 100644 --- a/test/uchardet-tests.c +++ b/test/uchardet-tests.c @@ -94,7 +94,7 @@ detect(FILE *fp, *lang == NULL || strcmp(expected_lang, *lang) != 0) { - size_t n_candidates = uchardet_get_candidates(handle); + size_t n_candidates = uchardet_get_n_candidates(handle); *expected_confidence = 0.0f; *expected_candidate = SIZE_MAX; |