|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.site.elkb.Index
public class Index
Represents the computer index of the words and phrases of Roget's Thesaurus. According to Kirkpatrick (1998) "The index consists of a list of items, each of which is followed by one or more references to the text. These references consist of a Head number, a keyword in italics, and a part of speech label (n. for nouns, adj. for adjectives, vb. for verbs, adv. for adverbs, and int. for interjections). The keyword is given to identify the paragraph which contains the word you have looked up; it also gives and indication of the ideas contained in that paragraph, so it can be used as a clue where a word has several meanings and therefire several references." An example of an Index Entry is:
Constructor Summary | |
---|---|
Index()
Default constructor. |
|
Index(java.lang.String filename)
Constructor that builds the Index object using the information contained in a file. |
|
Index(java.lang.String fileName,
int size,
boolean breakPhrases)
Constructor that builds the Index object using the information contained in a file and sets the initial size of the index hashtable. |
Method Summary | |
---|---|
void |
addEntry(java.lang.String item,
java.lang.String refs)
addEntry Associates an index entry with its references The references are stored as a long string of pointers separated by colons, ex: 1234:7632:8732: If a phrase contains exactly two words, then it both of the words of the phrase are indexed ex: running track, running, track |
java.lang.String |
addReference(java.lang.String strPtr,
java.lang.String sRef)
addReference |
java.lang.String |
addReference(java.lang.String strPtr,
java.lang.String sRef,
java.lang.String sgNum,
java.lang.String wordNum)
Adds a reference. |
boolean |
containsEntry(java.lang.String key)
Returns true if the specified entry is contained in this index. |
java.lang.String |
convertToPOS(int number)
This converts the number, passed in string format to the correct POS |
java.lang.String |
convertToPOS(java.lang.String number)
This converts the number, passed in string format to the correct POS |
int |
convertToPOSNumber(java.lang.String pos)
Returns the number corresponding to a given pos, or -1 if an incorrect posis passed as an argument. |
java.util.TreeSet<java.lang.String> |
getEntry(java.lang.String key)
Returns references to a word or phrase, but by default applies morphology rules. |
java.util.TreeSet<java.lang.String> |
getEntry(java.lang.String key,
boolean morphology)
Returns all references for a given word or phrase in the index. |
java.util.ArrayList<java.lang.String> |
getEntryList(java.lang.String key)
Returns the list of references for a given word or phrase in the index. |
java.util.ArrayList<java.lang.String> |
getEntryList(java.lang.String key,
int itemNo)
Returns the list of references for a given word or phrase in the index preceded by a number to identify the reference. |
java.util.ArrayList<int[]> |
getEntryListNumerical(java.lang.String key)
Returns the list of references for a given word or phrase in the index preceded by a number to identify the reference. |
java.util.ArrayList<int[]> |
getEntryListNumerical(java.lang.String key,
boolean morphology)
Returns the list of references for a given word or phrase in the index preceded by a number to identify the reference. |
java.util.ArrayList<int[]> |
getEntryListNumerical(java.lang.String key,
boolean morphology,
java.lang.String pos)
Returns the list of references for a given word or phrase in the index preceded by a number to identify the reference. |
java.util.TreeSet<java.lang.String> |
getHeadNumbers(java.lang.String key)
Returns a set of head numbers in which a word or phrase can be found. |
int |
getItemCount()
Returns the number of entries in this index. |
int |
getItemsMapSize()
Returns the number of items contained in the hash map of this index. |
int |
getRefCount()
Returns the number of references in this index. |
java.util.ArrayList<Reference> |
getRefObjList(java.lang.String key)
Returns an array of Reference objects. |
java.lang.String |
getRefPOS(java.lang.String key)
Returns a string containing the part-of-speech of the references for a given index entry. |
java.lang.String |
getStrRef(java.lang.String strIndex)
Returns a reference in String format as printed in Roget's Thesaurus. |
java.util.ArrayList<java.lang.String> |
getStrRefList(java.lang.String key)
Returns a list of references in string format instead of pointers. |
int[] |
getStrRefNumerical(java.lang.String strIndex)
Returns a reference in new String format as printed in Roget's Thesaurus. |
int |
getUniqRefCount()
Returns the number of unique references in this index. |
void |
printEntry(java.lang.String key)
Prints the index entry along with its references to the standard output. |
void |
printEntry(java.lang.String key,
int itemNo)
Prints the index entry along with its numbered references to the standard output. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Index()
public Index(java.lang.String filename)
filename
- public Index(java.lang.String fileName, int size, boolean breakPhrases)
fileName
- size
- Method Detail |
---|
public java.lang.String convertToPOS(java.lang.String number)
number
-
public java.lang.String convertToPOS(int number)
number
-
public int convertToPOSNumber(java.lang.String pos)
pos
-
public void addEntry(java.lang.String item, java.lang.String refs)
item
- refs
- public int getItemCount()
public int getRefCount()
public int getUniqRefCount()
public int getItemsMapSize()
public boolean containsEntry(java.lang.String key)
key
-
public void printEntry(java.lang.String key)
key
- public void printEntry(java.lang.String key, int itemNo)
key
- itemNo
- public java.util.ArrayList<java.lang.String> getEntryList(java.lang.String key)
key
-
public java.util.ArrayList<java.lang.String> getEntryList(java.lang.String key, int itemNo)
key
- itemNo
-
public java.util.ArrayList<int[]> getEntryListNumerical(java.lang.String key)
key
-
public java.util.ArrayList<int[]> getEntryListNumerical(java.lang.String key, boolean morphology)
key
-
public java.util.ArrayList<int[]> getEntryListNumerical(java.lang.String key, boolean morphology, java.lang.String pos)
key
- POS
-
public java.lang.String addReference(java.lang.String strPtr, java.lang.String sRef)
strPtr
- sRef
-
public java.util.TreeSet<java.lang.String> getEntry(java.lang.String key)
key
-
public java.util.TreeSet<java.lang.String> getEntry(java.lang.String key, boolean morphology)
key
- morphology
-
public java.lang.String getRefPOS(java.lang.String key)
key
-
public java.util.ArrayList<java.lang.String> getStrRefList(java.lang.String key)
key
-
public java.lang.String getStrRef(java.lang.String strIndex)
strIndex
-
public int[] getStrRefNumerical(java.lang.String strIndex)
strIndex
-
public java.util.ArrayList<Reference> getRefObjList(java.lang.String key)
key
-
public java.util.TreeSet<java.lang.String> getHeadNumbers(java.lang.String key)
key
-
public java.lang.String addReference(java.lang.String strPtr, java.lang.String sRef, java.lang.String sgNum, java.lang.String wordNum)
strPtr
- sRef
- sgNum
- wordNum
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |