コード例 #1
0
ファイル: EUCJPProber.cs プロジェクト: shu2333/dnGrep
 public EUCJPProber()
 {
     codingSM = new CodingStateMachine(new EUCJPSMModel());
     distributionAnalyser = new EUCJPDistributionAnalyser();
     contextAnalyser = new EUCJPContextAnalyser(); 
     Reset();
 }
コード例 #2
0
ファイル: SJISProber.cs プロジェクト: shu2333/dnGrep
 public SJISProber()
 {
     codingSM = new CodingStateMachine(new SJISSMModel());
     distributionAnalyser = new SJISDistributionAnalyser();
     contextAnalyser = new SJISContextAnalyser(); 
     Reset();
 }
コード例 #3
0
 public GB18030Prober()
 {
     lastChar = new byte[2];
     codingSM = new CodingStateMachine(new GB18030SMModel());
     analyser = new GB18030DistributionAnalyser();
     Reset();
 }
コード例 #4
0
ファイル: EscCharsetProber.cs プロジェクト: shu2333/dnGrep
 public EscCharsetProber()
 {
     codingSM = new CodingStateMachine[CHARSETS_NUM]; 
     codingSM[0] = new CodingStateMachine(new HZSMModel());
     codingSM[1] = new CodingStateMachine(new ISO2022CNSMModel());
     codingSM[2] = new CodingStateMachine(new ISO2022JPSMModel());
     codingSM[3] = new CodingStateMachine(new ISO2022KRSMModel());
     Reset();
 }
コード例 #5
0
ファイル: EscCharsetProber.cs プロジェクト: igorvar/UDE
        public override ProbingState HandleData(byte[] buf, int offset, int len)
        {
            int max = offset + len;

            for (int i = offset; i < max && state == ProbingState.Detecting; i++)
            {
                for (int j = activeSM - 1; j >= 0; j--)
                {
                    // byte is feed to all active state machine
                    int codingState = codingSM[j].NextState(buf[i]);
                    if (codingState == SMModel.ERROR)
                    {
                        // got negative answer for this state machine, make it inactive
                        activeSM--;
                        if (activeSM == 0)
                        {
                            state = ProbingState.NotMe;
                            return(state);
                        }
                        else if (j != activeSM)
                        {
                            CodingStateMachine t = codingSM[activeSM];
                            codingSM[activeSM] = codingSM[j];
                            codingSM[j]        = t;
                        }
                    }
                    else if (codingState == SMModel.ITSME)
                    {
                        state           = ProbingState.FoundIt;
                        detectedCharset = codingSM[j].ModelName;
                        return(state);
                    }
                }
            }
            return(state);
        }
コード例 #6
0
ファイル: EUCTWProber.cs プロジェクト: shu2333/dnGrep
 public EUCTWProber()
 {
     this.codingSM = new CodingStateMachine(new EUCTWSMModel());
     this.distributionAnalyser = new EUCTWDistributionAnalyser();
     this.Reset();
 }
コード例 #7
0
ファイル: EUCKRProber.cs プロジェクト: PaulofSilva/b-Search
 public EUCKRProber()
 {
     codingSM             = new CodingStateMachine(new EUCKRSMModel());
     distributionAnalyser = new EUCKRDistributionAnalyser();
     Reset();
 }
コード例 #8
0
 public Big5Prober()
 {
     this.codingSM             = new CodingStateMachine(new BIG5SMModel());
     this.distributionAnalyser = new BIG5DistributionAnalyser();
     this.Reset();
 }
コード例 #9
0
 public UTF8Prober()
 {
     numOfMBChar = 0;
     codingSM = new CodingStateMachine(new UTF8SMModel());
     Reset();
 }
コード例 #10
0
ファイル: UTF8Prober.cs プロジェクト: igorvar/UDE
 public UTF8Prober()
 {
     numOfMBChar = 0;
     codingSM    = new CodingStateMachine(new UTF8SMModel());
     Reset();
 }
コード例 #11
0
ファイル: Big5Prober.cs プロジェクト: shu2333/dnGrep
 public Big5Prober()
 {
     this.codingSM = new CodingStateMachine(new BIG5SMModel());
     this.distributionAnalyser = new BIG5DistributionAnalyser();
     this.Reset();        
 }
コード例 #12
0
 public EUCTWProber()
 {
     this.codingSM             = new CodingStateMachine(new EUCTWSMModel());
     this.distributionAnalyser = new EUCTWDistributionAnalyser();
     this.Reset();
 }
コード例 #13
0
ファイル: EUCKRProber.cs プロジェクト: shu2333/dnGrep
 public EUCKRProber()
 {
     codingSM = new CodingStateMachine(new EUCKRSMModel());
     distributionAnalyser = new EUCKRDistributionAnalyser(); 
     Reset();
 }
コード例 #14
0
ファイル: UTF8Prober.cs プロジェクト: xhute/Kooboo
 public UTF8Prober()
 {
     this.numOfMBChar = 0;
     this.codingSM    = new CodingStateMachine(new UTF8SMModel());
     this.Reset();
 }