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
2911792b
Commit
2911792b
authored
Sep 16, 1999
by
Michel Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coverted Amos's bogus DOS file to a sane format...hmm.. smells like
Notepad? :)
parent
59d506e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
59 deletions
+66
-59
lib/python/SearchIndex/UnKeywordIndex.py
lib/python/SearchIndex/UnKeywordIndex.py
+66
-59
No files found.
lib/python/SearchIndex/UnKeywordIndex.py
View file @
2911792b
from
UnIndex
import
UnIndex
,
MV
,
intSet
from
UnIndex
import
UnIndex
,
MV
,
intSet
from
types
import
ListType
,
TupleType
from
types
import
ListType
,
TupleType
class
UnKeywordIndex
(
UnIndex
):
class
UnKeywordIndex
(
UnIndex
):
"""
"""
Like an UnIndex only it indexs sequences of items
Like an UnIndex only it indexs sequences of items
Searches match any keyword.
Searches match any keyword.
"""
"""
def
index_object
(
self
,
i
,
obj
,
threshold
=
None
):
def
index_object
(
self
,
i
,
obj
,
threshold
=
None
):
""" index an object 'obj' with integer id 'i'"""
""" index an object 'obj' with integer id 'i'"""
index
=
self
.
_index
index
=
self
.
_index
unindex
=
self
.
_unindex
unindex
=
self
.
_unindex
id
=
self
.
id
id
=
self
.
id
try
:
try
:
kws
=
getattr
(
obj
,
id
)
kws
=
getattr
(
obj
,
id
)
if
callable
(
kws
):
if
callable
(
kws
):
kws
=
kws
()
kws
=
kws
()
except
:
except
:
kws
=
[
MV
]
kws
=
[
MV
]
# index each item in the sequence
# index each item in the sequence
for
kw
in
kws
:
for
kw
in
kws
:
set
=
index
.
get
(
kw
)
set
=
index
.
get
(
kw
)
if
set
is
None
:
if
set
is
None
:
index
[
kw
]
=
set
=
intSet
()
index
[
kw
]
=
set
=
intSet
()
set
.
insert
(
i
)
set
.
insert
(
i
)
unindex
[
i
]
=
kws
unindex
[
i
]
=
kws
self
.
_index
=
index
self
.
_index
=
index
self
.
_unindex
=
unindex
self
.
_unindex
=
unindex
return
1
return
1
def
unindex_object
(
self
,
i
):
def
unindex_object
(
self
,
i
):
""" Unindex the object with integer id 'i' """
""" Unindex the object with integer id 'i' """
index
=
self
.
_index
index
=
self
.
_index
unindex
=
self
.
_unindex
unindex
=
self
.
_unindex
kws
=
unindex
[
i
]
kws
=
unindex
[
i
]
if
kws
is
None
:
if
kws
is
None
:
return
None
return
None
for
kw
in
kws
:
for
kw
in
kws
:
set
=
index
.
get
(
kw
)
set
=
index
.
get
(
kw
)
if
set
is
not
None
:
set
.
remove
(
i
)
if
set
is
not
None
:
set
.
remove
(
i
)
del
unindex
[
i
]
del
unindex
[
i
]
self
.
_index
=
index
self
.
_index
=
index
self
.
_unindex
=
unindex
self
.
_unindex
=
unindex
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