public SBCSGroupProber()
 {
     probers[0] = new SingleByteCharSetProber(new Win1251Model());
     probers[1] = new SingleByteCharSetProber(new Koi8rModel());
     probers[2] = new SingleByteCharSetProber(new Latin5Model());
     probers[3] = new SingleByteCharSetProber(new MacCyrillicModel());
     probers[4] = new SingleByteCharSetProber(new Ibm866Model());
     probers[5] = new SingleByteCharSetProber(new Ibm855Model());
     probers[6] = new SingleByteCharSetProber(new Latin7Model());
     probers[7] = new SingleByteCharSetProber(new Win1253Model());
     probers[8] = new SingleByteCharSetProber(new Latin5BulgarianModel());
     probers[9] = new SingleByteCharSetProber(new Win1251BulgarianModel());
     HebrewProber hebprober = new HebrewProber();
     probers[10] = hebprober;
     // Logical
     probers[11] = new SingleByteCharSetProber(new Win1255Model(), false, hebprober);
     // Visual
     probers[12] = new SingleByteCharSetProber(new Win1255Model(), true, hebprober);
     hebprober.SetModelProbers(probers[11], probers[12]);
     // disable latin2 before latin1 is available, otherwise all latin1
     // will be detected as latin2 because of their similarity.
     //probers[13] = new SingleByteCharSetProber(new Latin2HungarianModel());
     //probers[14] = new SingleByteCharSetProber(new Win1250HungarianModel());
     Reset();
 }
示例#2
0
        public SBCSGroupProber()
        {
            probers[0] = new SingleByteCharSetProber(new Win1251Model());
            probers[1] = new SingleByteCharSetProber(new Koi8rModel());
            probers[2] = new SingleByteCharSetProber(new Latin5Model());
            probers[3] = new SingleByteCharSetProber(new MacCyrillicModel());
            probers[4] = new SingleByteCharSetProber(new Ibm866Model());
            probers[5] = new SingleByteCharSetProber(new Ibm855Model());
            probers[6] = new SingleByteCharSetProber(new Latin7Model());
            probers[7] = new SingleByteCharSetProber(new Win1253Model());
            probers[8] = new SingleByteCharSetProber(new Latin5BulgarianModel());
            probers[9] = new SingleByteCharSetProber(new Win1251BulgarianModel());
            HebrewProber hebprober = new HebrewProber();

            probers[10] = hebprober;
            // Logical
            probers[11] = new SingleByteCharSetProber(new Win1255Model(), false, hebprober);
            // Visual
            probers[12] = new SingleByteCharSetProber(new Win1255Model(), true, hebprober);
            hebprober.SetModelProbers(probers[11], probers[12]);
            // disable latin2 before latin1 is available, otherwise all latin1
            // will be detected as latin2 because of their similarity.
            //probers[13] = new SingleByteCharSetProber(new Latin2HungarianModel());
            //probers[14] = new SingleByteCharSetProber(new Win1250HungarianModel());
            Reset();
        }
示例#3
0
        public SBCSGroupProber()
        {
            this.probers[0] = new SingleByteCharSetProber(new Win1251Model());
            this.probers[1] = new SingleByteCharSetProber(new Koi8rModel());
            this.probers[2] = new SingleByteCharSetProber(new Latin5Model());
            this.probers[3] = new SingleByteCharSetProber(new MacCyrillicModel());
            this.probers[4] = new SingleByteCharSetProber(new Ibm866Model());
            this.probers[5] = new SingleByteCharSetProber(new Ibm855Model());
            this.probers[6] = new SingleByteCharSetProber(new Latin7Model());
            this.probers[7] = new SingleByteCharSetProber(new Win1253Model());
            this.probers[8] = new SingleByteCharSetProber(new Latin5BulgarianModel());
            this.probers[9] = new SingleByteCharSetProber(new Win1251BulgarianModel());
            HebrewProber hebrewProber = new HebrewProber();

            this.probers[10] = hebrewProber;
            this.probers[11] = new SingleByteCharSetProber(new Win1255Model(), false, hebrewProber);
            this.probers[12] = new SingleByteCharSetProber(new Win1255Model(), true, hebrewProber);
            hebrewProber.SetModelProbers(this.probers[11], this.probers[12]);
            this.Reset();
        }
示例#4
0
 public override ProbingState HandleData(byte[] buf, int offset, int len)
 {
     if (this.GetState() == ProbingState.NotMe)
     {
         return(ProbingState.NotMe);
     }
     checked
     {
         int num = offset + len;
         for (int i = offset; i < num; i++)
         {
             byte b = buf[i];
             if (b == 32)
             {
                 if (this.beforePrev != 32)
                 {
                     if (HebrewProber.IsFinal(this.prev))
                     {
                         this.finalCharLogicalScore++;
                     }
                     else if (HebrewProber.IsNonFinal(this.prev))
                     {
                         this.finalCharVisualScore++;
                     }
                 }
             }
             else if (this.beforePrev == 32 && HebrewProber.IsFinal(this.prev) && b != 32)
             {
                 this.finalCharVisualScore++;
             }
             this.beforePrev = this.prev;
             this.prev       = b;
         }
         return(ProbingState.Detecting);
     }
 }