|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectedu.northwestern.at.monk.model.Concordance
public class Concordance
A concordance.
Concordances are used to construct traditional "KWIC" ("keyword in context") lists of the results of a word search.
Given a collection of word search results, call the static method
Concordance.find to generate the concordance, specifying the distance
for the number of words to the left and right of the matches that you want to find.
Concordance.find returns a collection of concordance objects for the
words, in the same order as the words. For each of these objects, methods are provided
to get the left and right context as well as the matching word in the middle.
| Constructor Summary | |
|---|---|
Concordance(java.util.Collection<Word> left,
Word word,
java.util.Collection<Word> right)
Creates a new concordance. |
|
| Method Summary | |
|---|---|
static java.util.Collection<Concordance> |
find(long distance,
java.util.Collection<Word> words)
Finds concordances. |
static java.util.Collection<Concordance> |
find(long distance,
Word... words)
Finds concordances. |
java.util.Collection<Word> |
getLeft()
Gets the words to the left of the word. |
java.lang.String |
getLeftText()
Gets the text to the left of the word formatted as a string. |
java.lang.String |
getLeftText(int trunc)
Gets the text to the left of the word formatted as a string. |
java.util.Collection<Word> |
getRight()
Gets the words to the right of the word. |
java.lang.String |
getRightText()
Gets the text to the right of the word formatted as a string. |
java.lang.String |
getRightText(int trunc)
Gets the text to the right of the word formatted as a string. |
Word |
getWord()
Gets the word. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Concordance(java.util.Collection<Word> left,
Word word,
java.util.Collection<Word> right)
left - Words to left of word.word - Word.right - Words to right of word.| Method Detail |
|---|
public static java.util.Collection<Concordance> find(long distance,
Word... words)
throws ModelException
distance - The number of words to the left and the right to find for
each word.words - Words.
ModelException -
public static java.util.Collection<Concordance> find(long distance,
java.util.Collection<Word> words)
throws ModelException
distance - The number of words to the left and the right to find for
each word.words - Collection of words.
ModelException - public java.util.Collection<Word> getLeft()
public Word getWord()
public java.util.Collection<Word> getRight()
public java.lang.String getLeftText(int trunc)
trunc - Maximum number of characters to return, or 0 if no limit.
public java.lang.String getLeftText()
public java.lang.String getRightText(int trunc)
trunc - Maximum number of characters to return, or 0 if no limit.
public java.lang.String getRightText()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||