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
c30ec163
Commit
c30ec163
authored
Apr 30, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed highlighting for searches where a word occurs more than once in
the search.
parent
037bc700
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
lib/python/SearchIndex/InvertedIndex.py
lib/python/SearchIndex/InvertedIndex.py
+12
-4
No files found.
lib/python/SearchIndex/InvertedIndex.py
View file @
c30ec163
...
...
@@ -30,7 +30,7 @@ Example usage:
print i['blah']
$Id: InvertedIndex.py,v 1.4
5 1997/04/25 17:50:26 chris
Exp $'''
$Id: InvertedIndex.py,v 1.4
6 1997/04/30 21:56:12 jim
Exp $'''
# Copyright
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
...
...
@@ -82,6 +82,10 @@ $Id: InvertedIndex.py,v 1.45 1997/04/25 17:50:26 chris Exp $'''
# (540) 371-6909
#
# $Log: InvertedIndex.py,v $
# Revision 1.46 1997/04/30 21:56:12 jim
# Fixed highlighting for searches where a word occurs more than once in
# the search.
#
# Revision 1.45 1997/04/25 17:50:26 chris
# Fixed problem with tuple positions in ResultList.near()
#
...
...
@@ -233,7 +237,7 @@ $Id: InvertedIndex.py,v 1.45 1997/04/25 17:50:26 chris Exp $'''
#
#
#
__version__
=
'$Revision: 1.4
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
6
$'
[
11
:
-
2
]
import
regex
,
string
,
copy
...
...
@@ -791,9 +795,13 @@ class Index:
positions
.
sort
()
positions
.
reverse
()
lpos
=
None
for
position
in
positions
:
start
,
end
=
ws
.
pos
(
position
)
text
=
text
[:
start
]
+
before
+
text
[
start
:
end
]
+
after
+
text
[
end
:]
if
lpos
!=
position
:
lpos
=
position
start
,
end
=
ws
.
pos
(
position
)
text
=
(
text
[:
start
]
+
before
+
text
[
start
:
end
]
+
after
+
text
[
end
:])
return
text
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