diff options
| author | Erwin de Haan <EraYaN@users.noreply.github.com> | 2019-01-17 17:48:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-17 17:48:01 +0100 |
| commit | e241589969c643116f9fc5c24bcf2009fed83fe5 (patch) | |
| tree | 5a9e7d266b5f79c6d90a4767e804887b40b87b1c /Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs | |
| parent | 47f08fbb12db5854f5e474ddbf70b758ca084616 (diff) | |
| parent | 7aa975325af87fe425fe143aaed1df830133be8b (diff) | |
Merge branch 'dev' into skia-native-arm
Diffstat (limited to 'Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs')
| -rw-r--r-- | Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs index 515cd2498..e1fbb873e 100644 --- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs +++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/SJISProber.cs @@ -21,7 +21,7 @@ * Contributor(s): * Shy Shalom <shooshX@gmail.com> * Rudi Pettazzi <rudi.pettazzi@gmail.com> (C# port) - * + * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), @@ -50,25 +50,25 @@ namespace UniversalDetector.Core private SJISContextAnalyser contextAnalyser; private SJISDistributionAnalyser distributionAnalyser; private byte[] lastChar = new byte[2]; - + public SJISProber() { codingSM = new CodingStateMachine(new SJISSMModel()); distributionAnalyser = new SJISDistributionAnalyser(); - contextAnalyser = new SJISContextAnalyser(); + contextAnalyser = new SJISContextAnalyser(); Reset(); } - + public override string GetCharsetName() { - return "Shift-JIS"; + return "Shift-JIS"; } - + public override ProbingState HandleData(byte[] buf, int offset, int len) { int codingState; int max = offset + len; - + for (int i = offset; i < max; i++) { codingState = codingSM.NextState(buf[i]); if (codingState == SMModel.ERROR) { @@ -90,7 +90,7 @@ namespace UniversalDetector.Core distributionAnalyser.HandleOneChar(buf, i-1, charLen); } } - } + } lastChar[0] = buf[max-1]; if (state == ProbingState.Detecting) if (contextAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) @@ -100,12 +100,12 @@ namespace UniversalDetector.Core public override void Reset() { - codingSM.Reset(); + codingSM.Reset(); state = ProbingState.Detecting; contextAnalyser.Reset(); distributionAnalyser.Reset(); } - + public override float GetConfidence() { float contxtCf = contextAnalyser.GetConfidence(); |
