Skip to content

Commit

Permalink
Minor non-functional edits to satisfy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
aalok-sathe authored Dec 17, 2024
1 parent 01ca576 commit 8954459
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions surprisal/surprisal.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ def __getitem__(

if slctype == "char":
fn = partial(hf_pick_matching_token_ixs, span_type="char")
elif slctype == "word":
else: # if slctype == "word": # we already did error handling up above
fn = partial(hf_pick_matching_token_ixs, span_type="word")


if isinstance(slc, int):
slc = slice(slc, slc + 1)
Expand Down Expand Up @@ -124,10 +125,12 @@ def __getitem__(
slc, slctype = slctup, "char"

if slctype == "char":
raise NotImplementedError('WIP; currently only supports "word" spans')
raise NotImplementedError('NGramSurprisal currently only supports "word" spans')
# fn = partial(hf_pick_matching_token_ixs, span_type="char")
if slctype == "word":
token_slc = slc
else:
token_slc = None

if isinstance(slc, int):
slc = slice(slc, slc + 1)
Expand Down

0 comments on commit 8954459

Please sign in to comment.