Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
a500dea7
Commit
a500dea7
authored
Apr 25, 1997
by
chris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug in Index.__getitem__() which caused a TypeError
when searching for a stopword
parent
285ecf40
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
lib/python/SearchIndex/InvertedIndex.py
lib/python/SearchIndex/InvertedIndex.py
+8
-4
No files found.
lib/python/SearchIndex/InvertedIndex.py
View file @
a500dea7
...
...
@@ -30,7 +30,7 @@ Example usage:
print i['blah']
$Id: InvertedIndex.py,v 1.4
2 1997/04/24 14:20:32
chris Exp $'''
$Id: InvertedIndex.py,v 1.4
3 1997/04/25 15:42:07
chris Exp $'''
# Copyright
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
...
...
@@ -82,6 +82,10 @@ $Id: InvertedIndex.py,v 1.42 1997/04/24 14:20:32 chris Exp $'''
# (540) 371-6909
#
# $Log: InvertedIndex.py,v $
# Revision 1.43 1997/04/25 15:42:07 chris
# fixed bug in Index.__getitem__() which caused a TypeError
# when searching for a stopword
#
# Revision 1.42 1997/04/24 14:20:32 chris
# Fixed small bug in Index.__init__()
#
...
...
@@ -223,7 +227,7 @@ $Id: InvertedIndex.py,v 1.42 1997/04/24 14:20:32 chris Exp $'''
#
#
#
__version__
=
'$Revision: 1.4
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
3
$'
[
11
:
-
2
]
import
regex
,
string
,
copy
...
...
@@ -610,7 +614,7 @@ class Index:
addentry
=
self
.
addentry
for
word
,
positions
in
d
.
items
():
freq
=
int
(
100
*
(
len
(
positions
)
/
nwords
))
addentry
(
word
,
srckey
,(
freq
,
positions
))
addentry
(
word
,
srckey
,(
freq
,
tuple
(
positions
)
))
def
addentry
(
self
,
word
,
key
,
data
):
...
...
@@ -674,7 +678,7 @@ class Index:
except
KeyError
:
break
else
:
if
(
key
[
0
]
==
'"'
):
if
(
(
key
is
not
None
)
and
(
key
[
0
]
==
'"'
)
):
ws
=
WordSequence
(
key
,
self
.
synstop
)
ws
=
map
(
lambda
x
,
self
=
self
:
self
[
x
],
ws
)
return
reduce
(
lambda
x
,
y
:
x
.
near
(
y
),
ws
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment