Skip to content

Commit

Permalink
Added stop word interface to Lexicon.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Pelletier committed Mar 25, 2000
1 parent 884298b commit 5751eda
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Vocabulary.py
Expand Up @@ -91,7 +91,7 @@
from OFS.SimpleItem import Item
from SearchIndex import Lexicon, GlobbingLexicon

from VocabularyInterface import VocabularyInterface
from SearchIndex.Lexicon import stop_word_dict

manage_addVocabularyForm=HTMLFile('addVocabulary',globals())

Expand All @@ -113,7 +113,6 @@ class Vocabulary(Item, Persistent, Implicit):
meta_type = "Vocabulary"
_isAVocabulary = 1

__extends__=(VocabularyInterface,)

manage_options=(

Expand All @@ -137,6 +136,7 @@ class Vocabulary(Item, Persistent, Implicit):
['Anonymous', 'Manager']),
)



## manage_main = HTMLFile('vocab_manage_main', globals())
manage_vocabulary = HTMLFile('manage_vocab', globals())
Expand All @@ -151,7 +151,7 @@ def __init__(self, id, title='', globbing=None):
if globbing:
self.lexicon = GlobbingLexicon.GlobbingLexicon()
else:
self.lexicon = Lexicon.Lexicon()
self.lexicon = Lexicon.Lexicon(stop_word_dict)

def query(self, pattern):
""" """
Expand All @@ -171,6 +171,11 @@ def manage_insert(self, word='', URL1=None, RESPONSE=None):
if RESPONSE:
RESPONSE.redirect(URL1 + '/manage_vocabulary')

def manage_stop_syn(self, stop_syn, REQUEST=None):
pass



def insert(self, word=''):
self.lexicon.set(word)

Expand Down
17 changes: 17 additions & 0 deletions edit_stop_syn.dtml
@@ -0,0 +1,17 @@
<html>
<head>
<title>Edit <dtml-var title_or_id></title>
</head>
<body bgcolor="#ffffff" link="#000099" vlink="#555555" alink="#77003b">

<dtml-var manage_tabs>

<form action="manage_stop_syn" method="POST">
<textarea name="stop_syn:lines">
</textarea>
</form>
<br>


</body>
</html>

0 comments on commit 5751eda

Please sign in to comment.