mirror of
https://gitlab.freedesktop.org/uchardet/uchardet.git
synced 2025-12-06 16:56:40 +08:00
src: when checking for candidates, make sure we haven't any unprocessed…
… language data left.
This commit is contained in:
parent
7f386d922e
commit
4f35cd4416
@ -404,10 +404,17 @@ void nsMBCSGroupProber::CheckCandidates()
|
|||||||
{
|
{
|
||||||
for (int j = 0; j < NUM_OF_LANGUAGES; j++)
|
for (int j = 0; j < NUM_OF_LANGUAGES; j++)
|
||||||
{
|
{
|
||||||
float langConf = langDetectors[i][j]->GetConfidence();
|
float langConf;
|
||||||
|
|
||||||
|
/* Process any remaining language data first. */
|
||||||
|
if (codePointBufferIdx[i] > 0 && codePointBuffer[i])
|
||||||
|
langDetectors[i][j]->HandleData(codePointBuffer[i], codePointBufferIdx[i]);
|
||||||
|
|
||||||
|
/* Now check the confidence in this (charset, lang) couple. */
|
||||||
|
langConf = langDetectors[i][j]->GetConfidence();
|
||||||
candidates[i][j] = (cf * langConf > CANDIDATE_THRESHOLD);
|
candidates[i][j] = (cf * langConf > CANDIDATE_THRESHOLD);
|
||||||
}
|
}
|
||||||
|
codePointBufferIdx[i] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user