(self, byte_str)
| 55 | return "" |
| 56 | |
| 57 | def feed(self, byte_str): |
| 58 | for c in byte_str: |
| 59 | coding_state = self.coding_sm.next_state(c) |
| 60 | if coding_state == MachineState.ERROR: |
| 61 | self._state = ProbingState.NOT_ME |
| 62 | break |
| 63 | elif coding_state == MachineState.ITS_ME: |
| 64 | self._state = ProbingState.FOUND_IT |
| 65 | break |
| 66 | elif coding_state == MachineState.START: |
| 67 | if self.coding_sm.get_current_charlen() >= 2: |
| 68 | self._num_mb_chars += 1 |
| 69 | |
| 70 | if self.state == ProbingState.DETECTING: |
| 71 | if self.get_confidence() > self.SHORTCUT_THRESHOLD: |
| 72 | self._state = ProbingState.FOUND_IT |
| 73 | |
| 74 | return self.state |
| 75 | |
| 76 | def get_confidence(self): |
| 77 | unlike = 0.99 |
no test coverage detected