Update PxCorpus.py
Browse files- 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"))
|