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
c2b97bff
Commit
c2b97bff
authored
Sep 12, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added logic to allow "blank" inputs.
parent
c6dcd73c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
lib/python/SearchIndex/TextIndex.py
lib/python/SearchIndex/TextIndex.py
+16
-6
No files found.
lib/python/SearchIndex/TextIndex.py
View file @
c2b97bff
...
@@ -127,8 +127,8 @@ Notes on a new text index design
...
@@ -127,8 +127,8 @@ Notes on a new text index design
$Id: TextIndex.py,v 1.
1 1997/09/11 22:19:09
jim Exp $'''
$Id: TextIndex.py,v 1.
2 1997/09/12 14:25:40
jim Exp $'''
__version__
=
'$Revision: 1.
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
from
Globals
import
Persistent
from
Globals
import
Persistent
from
Trie
import
Trie
from
Trie
import
Trie
...
@@ -139,6 +139,7 @@ from InvertedIndex import ResultList
...
@@ -139,6 +139,7 @@ from InvertedIndex import ResultList
import
operator
import
operator
getitem
=
operator
.
__getitem__
getitem
=
operator
.
__getitem__
from
WordSequence
import
WordSequence
from
WordSequence
import
WordSequence
from
string
import
strip
class
TextIndex
(
Persistent
):
class
TextIndex
(
Persistent
):
...
@@ -261,15 +262,21 @@ class TextIndex(Persistent):
...
@@ -261,15 +262,21 @@ class TextIndex(Persistent):
except
:
return
None
except
:
return
None
if
type
(
keys
)
is
not
ListType
:
keys
=
[
keys
]
if
type
(
keys
)
is
not
ListType
:
keys
=
[
keys
]
r
=
intSet
()
r
=
None
for
key
in
keys
:
for
key
in
keys
:
key
=
strip
(
key
)
if
not
key
:
continue
rr
=
intSet
()
try
:
try
:
for
i
in
query
(
key
,
self
).
keys
():
for
i
in
query
(
key
,
self
).
keys
():
r
.
insert
(
i
)
r
r
.
insert
(
i
)
except
KeyError
:
pass
except
KeyError
:
pass
if
r
is
None
:
r
=
rr
else
:
# Note that we *and*/*narrow* multiple search terms.
r
=
r
.
intersection
(
rr
)
if
r
is
not
None
:
return
r
,
(
id
,)
return
r
,
(
id
,)
...
@@ -277,6 +284,9 @@ class TextIndex(Persistent):
...
@@ -277,6 +284,9 @@ class TextIndex(Persistent):
##############################################################################
##############################################################################
#
#
# $Log: TextIndex.py,v $
# $Log: TextIndex.py,v $
# Revision 1.2 1997/09/12 14:25:40 jim
# Added logic to allow "blank" inputs.
#
# Revision 1.1 1997/09/11 22:19:09 jim
# Revision 1.1 1997/09/11 22:19:09 jim
# *** empty log message ***
# *** empty log message ***
#
#
...
...
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