qanastek commited on
Commit
7bbc4d3
·
1 Parent(s): 04740c6

Update PxCorpus.py

Browse files
Files changed (1) hide show
  1. PxCorpus.py +2 -0
PxCorpus.py CHANGED
@@ -60,6 +60,8 @@ class StringIndex:
60
 
61
  def find(self, t):
62
  key = (t[0], len(t))
 
 
63
  return t in self.vocab_struct[key]
64
 
65
  _VOCAB = StringIndex(vocab=open("./vocabulary_nachos_lowercased.txt","r").read().split("\n"))
 
60
 
61
  def find(self, t):
62
  key = (t[0], len(t))
63
+ if key not in self.vocab_struct:
64
+ return False
65
  return t in self.vocab_struct[key]
66
 
67
  _VOCAB = StringIndex(vocab=open("./vocabulary_nachos_lowercased.txt","r").read().split("\n"))