You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
517 B

  1. from typing import Dict
  2. def make_km_table(pattern: str) -> Dict[str, int]:
  3. table = dict()
  4. raise Exception("TODO")
  5. return table
  6. class Bm(object):
  7. def __init__(self, text: str, pattern: str):
  8. self.text = text
  9. self.pattern = pattern
  10. self.table = make_km_table(pattern)
  11. def decide_slide_width(self, c: str) -> int:
  12. assert len(c) == 1
  13. raise Exception("TODO")
  14. return -1
  15. def search(self) -> int:
  16. raise Exception("TODO")
  17. return -1