public int parse(CharsetDetector det)
        {
            int b;
            boolean ignoreSpace = false;
            
            while ((b = nextByte(det)) >= 0) {
                byte mb = byteMap[b];
                
                // TODO: 0x20 might not be a space in all character sets...
                if (mb != 0) {
                    if (!(mb == 0x20 && ignoreSpace)) {
                        addByte(mb);                    
                    }
                    
                    ignoreSpace = (mb == 0x20);
                }
            }
            
            // TODO: Is this OK? The buffer could have ended in the middle of a word...
            addByte(0x20);

            double rawPercent = (double) hitCount / (double) ngramCount;
            
//            if (rawPercent <= 2.0) {
//                return 0;
//            }
            
            // TODO - This is a bit of a hack to take care of a case
            // were we were getting a confidence of 135...
            if (rawPercent > 0.33) {
                return 98;
            }
            
            return (int) (rawPercent * 300.0);
        }