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
21938926
Commit
21938926
authored
Apr 14, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in proximity searches.
parent
074cc8a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
lib/python/SearchIndex/InvertedIndex.py
lib/python/SearchIndex/InvertedIndex.py
+9
-4
No files found.
lib/python/SearchIndex/InvertedIndex.py
View file @
21938926
...
@@ -30,7 +30,7 @@ Example usage:
...
@@ -30,7 +30,7 @@ Example usage:
print i['blah']
print i['blah']
$Id: InvertedIndex.py,v 1.
29 1997/04/08 00:14:22
jim Exp $'''
$Id: InvertedIndex.py,v 1.
30 1997/04/14 12:03:17
jim 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.29 1997/04/08 00:14:22 jim Exp $'''
...
@@ -82,6 +82,9 @@ $Id: InvertedIndex.py,v 1.29 1997/04/08 00:14:22 jim Exp $'''
# (540) 371-6909
# (540) 371-6909
#
#
# $Log: InvertedIndex.py,v $
# $Log: InvertedIndex.py,v $
# Revision 1.30 1997/04/14 12:03:17 jim
# Fixed bug in proximity searches.
#
# Revision 1.29 1997/04/08 00:14:22 jim
# Revision 1.29 1997/04/08 00:14:22 jim
# Chris' changes, I think....
# Chris' changes, I think....
#
#
...
@@ -184,7 +187,7 @@ $Id: InvertedIndex.py,v 1.29 1997/04/08 00:14:22 jim Exp $'''
...
@@ -184,7 +187,7 @@ $Id: InvertedIndex.py,v 1.29 1997/04/08 00:14:22 jim Exp $'''
#
#
#
#
#
#
__version__
=
'$Revision: 1.
29
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
30
$'
[
11
:
-
2
]
import
regex
,
regsub
,
string
,
copy
import
regex
,
regsub
,
string
,
copy
...
@@ -289,7 +292,7 @@ class ResultList:
...
@@ -289,7 +292,7 @@ class ResultList:
return
result
return
result
def
and_not
(
self
,
x
):
def
and_not
(
self
,
x
):
'''Return items in the rec
ie
ver that are not in the argument'''
'''Return items in the rec
ei
ver that are not in the argument'''
result
=
self
.
__class__
()
result
=
self
.
__class__
()
...
@@ -374,6 +377,8 @@ class ResultList:
...
@@ -374,6 +377,8 @@ class ResultList:
if
value
is
None
:
if
value
is
None
:
continue
continue
score
=
pow
(
v
[
0
]
*
value
[
0
],
0.5
)
positions
=
v
[
1
]
+
value
[
1
]
positions
=
v
[
1
]
+
value
[
1
]
positions
.
sort
()
positions
.
sort
()
positionsr
=
[]
positionsr
=
[]
...
@@ -392,7 +397,7 @@ class ResultList:
...
@@ -392,7 +397,7 @@ class ResultList:
pl
=
p
pl
=
p
if
(
len
(
positionsr
)):
if
(
len
(
positionsr
)):
result
[
key
]
=
positionsr
result
[
key
]
=
score
,
positionsr
return
result
return
result
...
...
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