|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectkwic.KWIC
public class KWIC
Key Word in Context
| Field Summary | |
|---|---|
protected Map<Word,Set<Phrase>> |
map
|
protected PropertyChangeSupport |
pcs
|
| Constructor Summary | |
|---|---|
KWIC()
|
|
| Method Summary | |
|---|---|
void |
addPhrase(Phrase p)
For each Word in the Phrase,
add the Word
to the association. |
void |
addPhrase(String s)
Convenient interface, accepts a standrd Java String |
void |
addPhrases(File file)
Add each line in the file as a phrase. |
void |
deletePhrase(Phrase p)
For each word in the Phrase, delete the association between
the word and the phrase. |
void |
deleteWord(Word w)
Drop a word completely from the KWIC |
void |
dropAssoc(Word w,
Phrase p)
Drop the association between the specified Word and Phrase, if any |
void |
forceAssoc(Word w,
Phrase p)
Force a mapping between the speicified Word and Phrase |
PropertyChangeSupport |
getPCS()
Required for part (b) of this lab. |
Set<Phrase> |
getPhrases(Word w)
Return a Set that provides each Phrase associated with
the specified Word. |
Set<Word> |
getWords()
Rerturn a Set of all words |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PropertyChangeSupport pcs
protected Map<Word,Set<Phrase>> map
| Constructor Detail |
|---|
public KWIC()
| Method Detail |
|---|
public PropertyChangeSupport getPCS()
PropertyChangeSuppport
public void addPhrase(String s)
String
s - String to be addedpublic void addPhrases(File file)
addPhrase(String) to
add the line as a phrase.
file - the file whose lines should be loaded as phrasespublic void addPhrase(Phrase p)
Word in the Phrase,
add the Word
to the association.
Use reduction to forceAssoc(Word, Phrase).
p - Phrase to be addedpublic void deletePhrase(Phrase p)
Phrase, delete the association between
the word and the phrase.
Use reduction to dropAssoc(Word, Phrase).
public void forceAssoc(Word w,
Phrase p)
Word and Phrase
public void dropAssoc(Word w,
Phrase p)
Word and Phrase, if any
public Set<Phrase> getPhrases(Word w)
Phrase associated with
the specified Word.
public void deleteWord(Word w)
w - Word to be droppedpublic Set<Word> getWords()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||