Commit f6fcd6f3 authored by chris's avatar chris

*** empty log message ***

parent efcf0aea
...@@ -30,7 +30,7 @@ Example usage: ...@@ -30,7 +30,7 @@ Example usage:
print i['blah'] print i['blah']
$Id: InvertedIndex.py,v 1.39 1997/04/23 20:56:38 chris Exp $''' $Id: InvertedIndex.py,v 1.40 1997/04/24 14:18:07 chris Exp $'''
# Copyright # Copyright
# #
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne # Copyright 1996 Digital Creations, L.C., 910 Princess Anne
...@@ -82,6 +82,9 @@ $Id: InvertedIndex.py,v 1.39 1997/04/23 20:56:38 chris Exp $''' ...@@ -82,6 +82,9 @@ $Id: InvertedIndex.py,v 1.39 1997/04/23 20:56:38 chris Exp $'''
# (540) 371-6909 # (540) 371-6909
# #
# $Log: InvertedIndex.py,v $ # $Log: InvertedIndex.py,v $
# Revision 1.40 1997/04/24 14:18:07 chris
# *** empty log message ***
#
# Revision 1.39 1997/04/23 20:56:38 chris # Revision 1.39 1997/04/23 20:56:38 chris
# added support for multi-word synonyms # added support for multi-word synonyms
# #
...@@ -214,7 +217,7 @@ $Id: InvertedIndex.py,v 1.39 1997/04/23 20:56:38 chris Exp $''' ...@@ -214,7 +217,7 @@ $Id: InvertedIndex.py,v 1.39 1997/04/23 20:56:38 chris Exp $'''
# #
# #
# #
__version__='$Revision: 1.39 $'[11:-2] __version__='$Revision: 1.40 $'[11:-2]
import regex, string, copy import regex, string, copy
...@@ -536,7 +539,7 @@ class Index: ...@@ -536,7 +539,7 @@ class Index:
self._index_object = index_dictionary self._index_object = index_dictionary
def subindex(self, src, d, pos): def subindex(self, isrc, d, pos):
'''\ '''\
index(src, srckey) index(src, srckey)
...@@ -547,7 +550,7 @@ class Index: ...@@ -547,7 +550,7 @@ class Index:
key, srckey. For simple objects, the srckey may be the object itself, key, srckey. For simple objects, the srckey may be the object itself,
or it may be a key into some other data structure, such as a table. or it may be a key into some other data structure, such as a table.
''' '''
src = WordSequence(src, self.synstop) src = WordSequence(isrc, self.synstop)
for s in src: for s in src:
if s[0] == '"': if s[0] == '"':
...@@ -559,7 +562,7 @@ class Index: ...@@ -559,7 +562,7 @@ class Index:
d[s] = [ pos ] d[s] = [ pos ]
def index(self, src, srckey): def index(self, isrc, srckey):
'''\ '''\
index(src, srckey) index(src, srckey)
...@@ -570,11 +573,14 @@ class Index: ...@@ -570,11 +573,14 @@ class Index:
key, srckey. For simple objects, the srckey may be the object itself, key, srckey. For simple objects, the srckey may be the object itself,
or it may be a key into some other data structure, such as a table. or it may be a key into some other data structure, such as a table.
''' '''
src = WordSequence(src, self.synstop) src = WordSequence(isrc, self.synstop)
d = {} d = {}
i = -1 i = -1
__traceback_info__=i, d, src, srckey
try:
for s in src: for s in src:
__traceback_info__=i, d, src, srckey, s
i = i + 1 i = i + 1
if s[0] == '"': if s[0] == '"':
...@@ -584,6 +590,8 @@ class Index: ...@@ -584,6 +590,8 @@ class Index:
d[s].append(i) d[s].append(i)
except KeyError: except KeyError:
d[s] = [ i ] d[s] = [ i ]
except:
pass
if (i < 1): if (i < 1):
return return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment