diff options
| author | Erwin de Haan <EraYaN@users.noreply.github.com> | 2019-01-13 20:22:56 +0100 |
|---|---|---|
| committer | Erwin de Haan <EraYaN@users.noreply.github.com> | 2019-01-13 20:22:56 +0100 |
| commit | 25f0315e918cf6f8c26b1e435c236ff1dbcbc6a5 (patch) | |
| tree | 805191d28c22edcaf31ffb03ba355f5fbbc1c3da /Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs | |
| parent | 0efc699e3d4cef2cb5b36223873fa5ad98177d1c (diff) | |
Visual Studio Reformat: Emby.Server.Implementations Part T-T
Diffstat (limited to 'Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs')
| -rw-r--r-- | Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs index 5d57e30e1..11ce90c87 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs @@ -36,7 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -using System; namespace UniversalDetector.Core { @@ -135,12 +134,14 @@ namespace UniversalDetector.Core byte[] newbuf = FilterWithEnglishLetters(buf, offset, len); byte charClass, freq; - for (int i = 0; i < newbuf.Length; i++) { + for (int i = 0; i < newbuf.Length; i++) + { charClass = Latin1_CharToClass[newbuf[i]]; freq = Latin1ClassModel[lastCharClass * CLASS_NUM + charClass]; - if (freq == 0) { - state = ProbingState.NotMe; - break; + if (freq == 0) + { + state = ProbingState.NotMe; + break; } freqCounter[freq]++; lastCharClass = charClass; @@ -155,13 +156,17 @@ namespace UniversalDetector.Core float confidence = 0.0f; int total = 0; - for (int i = 0; i < FREQ_CAT_NUM; i++) { + for (int i = 0; i < FREQ_CAT_NUM; i++) + { total += freqCounter[i]; } - if (total <= 0) { + if (total <= 0) + { confidence = 0.0f; - } else { + } + else + { confidence = freqCounter[3] * 1.0f / total; confidence -= freqCounter[1] * 20.0f / total; } |
