mirror of
https://gitlab.freedesktop.org/uchardet/uchardet.git
synced 2025-12-06 16:56:40 +08:00
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).
This commit is contained in:
parent
a916fb1c56
commit
908f9b8ba7
@ -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
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -112,10 +112,10 @@ 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 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,
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user