diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-19 15:11:50 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-19 15:11:50 -0500 |
| commit | 55538764fa06a64795c099fc6496df9dbb4156bd (patch) | |
| tree | 8c1f94861ecebdf634b70a7265945b6f8f13aff1 /Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/Latin1Prober.cs | |
| parent | 3b52035ee064a5d9aa215d9515211d4508585d39 (diff) | |
| parent | c5430f86b0b5863482e7c4f7e55a79c7d88c133b (diff) | |
Merge pull request #575 from EraYaN/reformat
Reformat all C# server code to conform with code standards
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; } |
