Update PxCorpus.py
Browse files- PxCorpus.py +2 -2
PxCorpus.py
CHANGED
@@ -49,7 +49,7 @@ class StringIndex:
|
|
49 |
continue
|
50 |
|
51 |
# Index terms by their first letter and length
|
52 |
-
key = (
|
53 |
|
54 |
if key not in self.vocab_struct:
|
55 |
self.vocab_struct[key] = []
|
@@ -60,7 +60,7 @@ class StringIndex:
|
|
60 |
|
61 |
def find(self, term):
|
62 |
print(f"'{term}'")
|
63 |
-
return term in self.vocab_struct[(
|
64 |
|
65 |
_VOCAB = StringIndex(vocab=open("./vocabulary_nachos_lowercased.txt","r").read().split("\n"))
|
66 |
|
|
|
49 |
continue
|
50 |
|
51 |
# Index terms by their first letter and length
|
52 |
+
key = (term[0], len(term))
|
53 |
|
54 |
if key not in self.vocab_struct:
|
55 |
self.vocab_struct[key] = []
|
|
|
60 |
|
61 |
def find(self, term):
|
62 |
print(f"'{term}'")
|
63 |
+
return term in self.vocab_struct[(term[0], len(str(term)))]
|
64 |
|
65 |
_VOCAB = StringIndex(vocab=open("./vocabulary_nachos_lowercased.txt","r").read().split("\n"))
|
66 |
|