Skip to content

Instantly share code, notes, and snippets.

@isaacimholt
Created April 23, 2019 15:44
Show Gist options
  • Save isaacimholt/3c952742f3ef767d34694977ba930c6d to your computer and use it in GitHub Desktop.
Save isaacimholt/3c952742f3ef767d34694977ba930c6d to your computer and use it in GitHub Desktop.
Bies
def _bies_word(str: word) -> str:
if len(word) == 1:
return 'S'
return 'B' + ''.join('I' for _ in word[1:-1]) + 'E'
def _bies_line(str: line) -> str:
return ''.join(_bies_word(w) for w in line.split())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment