ca.site.elkb
Class Head

java.lang.Object
  extended by ca.site.elkb.Head

public class Head
extends java.lang.Object

Represents a Roget's Thesaurus Head. A Head is defined by the following attributes:

The relative postions of the noun, adjective verb, adverb and interjection paragraphs in the array of paragarphs is kept by the nStart, adjStart, vbStart, advStart, and intStart attributes.

Version:
1.4 2013
Author:
Mario Jarmasz and Alistsair Kennedy

Constructor Summary
Head()
          Default constructor.
Head(int num, java.lang.String name, int clNum, int section)
          Constructor which sets the Head number and name, as well as the Class and Section number.
Head(java.lang.String fname)
          Constructor that builds the Head object using the information contained in a file.
 
Method Summary
 void addPara(Paragraph para, java.lang.String pos)
          Adds a paragraph with a given POS to the paragraph list.
 int getAdjCount()
          Returns the number of adjective word and phrases of this Head.
 int getAdjCRefCount()
          Returns the number of adjective cross-references of this Head.
 int getAdjParaCount()
          Returns the number of adjective paragraphs of this Head.
 int getAdjSeeCount()
          Returns the number of adjective references of this Head.
 int getAdjSGCount()
          Returns the number of adjective semicolon groups of this Head.
 int getAdjStart()
          Returns the index of the first adjective paragraph in the array of Pragraph objects of this Head.
 int getAdvCount()
          Returns the number of adverb word and phrases of this Head.
 int getAdvCRefCount()
          Returns the number of adverb cross-references of this Head.
 int getAdvParaCount()
          Returns the number of adverb paragraphs of this Head.
 int getAdvSeeCount()
          Returns the number of adverb references of this Head.
 int getAdvSGCount()
          Returns the number of adverb groups of this Head.
 int getAdvStart()
          Returns the index of the first adverb paragraph in the array of Pragraph objects of this Head.
 int getClassNum()
          Returns the Class number of this Head.
 int getCRefCount()
          Returns the number of cross-references of this Head.
 int getHeadGroupNum()
          Returns the Head Group number of this Head.
 java.lang.String getHeadName()
          Returns the name of this Head.
 int getHeadNum()
          Returns the number of this Head.
 int getIntCount()
          Returns the number of interjection word and phrases of this Head.
 int getIntCRefCount()
          Returns the number of interjection cross-references of this Head.
 int getIntParaCount()
          Returns the number of interjection paragraphs of this Head.
 int getIntSeeCount()
          Returns the number of interjection references of this Head.
 int getIntSGCount()
          Returns the number of interjection semicolon groups of this Head.
 int getIntStart()
          Returns the index of the first interjection paragraph in the array of Pragraph objects of this Head.
 int getNCount()
          Returns the number of noun word and phrases of this Head.
 int getNCRefCount()
          Returns the number of noun cross-references of this Head.
 int getNParaCount()
          Returns the number of noun paragraphs of this Head.
 int getNSeeCount()
          Returns the number of noun see references of this Head.
 int getNSGCount()
          Returns the number of noun semicolon groups of this Head.
 int getNStart()
          Returns the index of the first noun paragraph in the array of Pragraph objects of this Head.
 Paragraph getPara(int paraNum, java.lang.String pos)
          Returns the a Paragraph object specified by the paragraph number and part-of-speech.
 Paragraph getPara(java.lang.String paraKey, java.lang.String pos)
          Returns the a Paragraph object specified by the paragraph key and part-of-speech.
 int getParaCount()
          Returns the number of paragraphs of this Head.
 int getParaCount(java.lang.String pos)
          The number of paragraphs for a given part of speech.
 int getPhrCount()
          Returns the number of phrase word and phrases of this Head.
 int getPhrCRefCount()
          Returns the number of phrase cross-references of this Head.
 int getPhrParaCount()
          Returns the number of phrase paragraphs of this Head.
 int getPhrSeeCount()
          Returns the number of Phrase references of this Head.
 int getPhrSGCount()
          Returns the number of phrase semicolon groups of this Head.
 int getPhrStart()
          Returns the index of the first phrase paragraph in the array of Pragraph objects of this Head.
 int getPrefCount()
          Returns the number of pref word and phrases of this Head.
 int getPrefCRefCount()
          Returns the number of pref cross-references of this Head.
 int getPrefParaCount()
          Returns the number of pref paragraphs of this Head.
 int getPrefSeeCount()
          Returns the number of pref references of this Head.
 int getPrefSGCount()
          Returns the number of pref semicolon groups of this Head.
 int getPrefStart()
          Returns the index of the first preface paragraph in the array of Pragraph objects of this Head.
 int getPronCount()
          Returns the number of pronoun word and phrases of this Head.
 int getPronCRefCount()
          Returns the number of pronoun cross-references of this Head.
 int getPronParaCount()
          Returns the number of pronoun paragraphs of this Head.
 int getPronSeeCount()
          Returns the number of Pronoun references of this Head.
 int getPronSGCount()
          Returns the number of pronoun semicolon groups of this Head.
 int getPronStart()
          Returns the index of the first pronoun paragraph in the array of Pragraph objects of this Head.
 int getSectionNum()
          Returns the Section number of this Head.
 int getSeeCount()
          Returns the number of see references of this Head.
 int getSGCount()
          Returns the number of semicolon groups of this Head.
 int getSubSectionNum()
          Returns the Sub-Section number of this Head.
 int getVbCount()
          Returns the number of verb word and phrases of this Head.
 int getVbCRefCount()
          Returns the number of verb cross-references of this Head.
 int getVbParaCount()
          Returns the number of verb paragraphs of this Head.
 int getVbSeeCount()
          Returns the number of verb references of this Head.
 int getVbSGCount()
          Returns the number of verb groups of this Head.
 int getVbStart()
          Returns the index of the first verb paragraph in the array of Pragraph objects of this Head.
 int getWordCount()
          Returns the number of words of this Head.
 void incrementParaCount()
          Increments the paragraph count of this Head.
 void print()
          Prints the contents of this Head to the standard output.
 void printAllSG()
          Prints all the semicolon groups of this Head separated on a separate line to the standard output.
 void printAllWords()
          Prints all the words and phrases of this Head separated on a separate line to the standard output.
 void setClassNum(int num)
          Sets the Class number of this Head.
 void setHeadGroupNum(int num)
          Sets the Head Group number of this Head.
 void setHeadName(java.lang.String name)
          Sets the name of this Head.
 void setHeadNum(int num)
          Sets the number of this Head.
 void setPOSStart(java.lang.String pos)
          We assume here that a pos tag is sent to this function when there has been a change to the pos of a paragraph in the Thesaurus
 void setSectionNum(int num)
          Sets the Section number of this Head.
 void setSubSectionNum(int num)
          Sets the Sub-Section number of this Head.
 java.lang.String toString()
          Converts to a string representation the Head object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Head

public Head()
Default constructor.


Head

public Head(int num,
            java.lang.String name,
            int clNum,
            int section)
Constructor which sets the Head number and name, as well as the Class and Section number.

Parameters:
num -
name -
clNum -
section -

Head

public Head(java.lang.String fname)
Constructor that builds the Head object using the information contained in a file. The default location of the head files for the ELKB is $HOME/roget_elkb/heads directory.

Parameters:
fname -
Method Detail

getHeadNum

public int getHeadNum()
Returns the number of this Head.

Returns:
head number

setHeadNum

public void setHeadNum(int num)
Sets the number of this Head.

Parameters:
num -

getHeadName

public java.lang.String getHeadName()
Returns the name of this Head.

Returns:
head name

setHeadName

public void setHeadName(java.lang.String name)
Sets the name of this Head.

Parameters:
name -

getClassNum

public int getClassNum()
Returns the Class number of this Head.

Returns:
class number

setClassNum

public void setClassNum(int num)
Sets the Class number of this Head.

Parameters:
num -

getSectionNum

public int getSectionNum()
Returns the Section number of this Head.

Returns:
section number

setSectionNum

public void setSectionNum(int num)
Sets the Section number of this Head.

Parameters:
num -

getSubSectionNum

public int getSubSectionNum()
Returns the Sub-Section number of this Head.

Returns:
sub section number

setSubSectionNum

public void setSubSectionNum(int num)
Sets the Sub-Section number of this Head.

Parameters:
num -

getHeadGroupNum

public int getHeadGroupNum()
Returns the Head Group number of this Head.

Returns:
head group number

setHeadGroupNum

public void setHeadGroupNum(int num)
Sets the Head Group number of this Head.

Parameters:
num -

incrementParaCount

public void incrementParaCount()
Increments the paragraph count of this Head.


getNStart

public int getNStart()
Returns the index of the first noun paragraph in the array of Pragraph objects of this Head.

Returns:
noun start paragraph number

getAdjStart

public int getAdjStart()
Returns the index of the first adjective paragraph in the array of Pragraph objects of this Head.

Returns:
adjective start paragraph number

getVbStart

public int getVbStart()
Returns the index of the first verb paragraph in the array of Pragraph objects of this Head.

Returns:
verb start paragraph number

getAdvStart

public int getAdvStart()
Returns the index of the first adverb paragraph in the array of Pragraph objects of this Head.

Returns:
adverb start paragraph number

getIntStart

public int getIntStart()
Returns the index of the first interjection paragraph in the array of Pragraph objects of this Head.

Returns:
interjection start paragraph number

getPhrStart

public int getPhrStart()
Returns the index of the first phrase paragraph in the array of Pragraph objects of this Head.

Returns:
phrases paragraph start number

getPrefStart

public int getPrefStart()
Returns the index of the first preface paragraph in the array of Pragraph objects of this Head.

Returns:
preface start paragraph number

getPronStart

public int getPronStart()
Returns the index of the first pronoun paragraph in the array of Pragraph objects of this Head.

Returns:
pronoun start paragraph number

getWordCount

public int getWordCount()
Returns the number of words of this Head.

Returns:
number of words

getNCount

public int getNCount()
Returns the number of noun word and phrases of this Head.

Returns:
number of nouns

getAdjCount

public int getAdjCount()
Returns the number of adjective word and phrases of this Head.

Returns:
number of adjectives

getVbCount

public int getVbCount()
Returns the number of verb word and phrases of this Head.

Returns:
number of verbs

getAdvCount

public int getAdvCount()
Returns the number of adverb word and phrases of this Head.

Returns:
number of adverbs

getIntCount

public int getIntCount()
Returns the number of interjection word and phrases of this Head.

Returns:
number of interjections

getPhrCount

public int getPhrCount()
Returns the number of phrase word and phrases of this Head.

Returns:
number of phrases

getPronCount

public int getPronCount()
Returns the number of pronoun word and phrases of this Head.

Returns:
number of pronouns

getPrefCount

public int getPrefCount()
Returns the number of pref word and phrases of this Head.

Returns:
number of prefaces

getParaCount

public int getParaCount(java.lang.String pos)
The number of paragraphs for a given part of speech.

Parameters:
pos -
Returns:
number of paragraphs

getParaCount

public int getParaCount()
Returns the number of paragraphs of this Head.

Returns:
paragraph count

getNParaCount

public int getNParaCount()
Returns the number of noun paragraphs of this Head.

Returns:
noun paragraph count

getAdjParaCount

public int getAdjParaCount()
Returns the number of adjective paragraphs of this Head.

Returns:
adjective paragraph count

getVbParaCount

public int getVbParaCount()
Returns the number of verb paragraphs of this Head.

Returns:
verb paragraph count

getAdvParaCount

public int getAdvParaCount()
Returns the number of adverb paragraphs of this Head.

Returns:
adverb paragraph count

getIntParaCount

public int getIntParaCount()
Returns the number of interjection paragraphs of this Head.

Returns:
interjection paragraph count

getPhrParaCount

public int getPhrParaCount()
Returns the number of phrase paragraphs of this Head.

Returns:
phrase paragraph count

getPronParaCount

public int getPronParaCount()
Returns the number of pronoun paragraphs of this Head.

Returns:
pronoun paragraph count

getPrefParaCount

public int getPrefParaCount()
Returns the number of pref paragraphs of this Head.

Returns:
preface paragraph count

getSGCount

public int getSGCount()
Returns the number of semicolon groups of this Head.

Returns:
semicolon group count

getNSGCount

public int getNSGCount()
Returns the number of noun semicolon groups of this Head.

Returns:
noun SG count

getAdjSGCount

public int getAdjSGCount()
Returns the number of adjective semicolon groups of this Head.

Returns:
adjective SG count

getVbSGCount

public int getVbSGCount()
Returns the number of verb groups of this Head.

Returns:
verb SG count

getAdvSGCount

public int getAdvSGCount()
Returns the number of adverb groups of this Head.

Returns:
adverb SG count

getIntSGCount

public int getIntSGCount()
Returns the number of interjection semicolon groups of this Head.

Returns:
interjection SG count

getPhrSGCount

public int getPhrSGCount()
Returns the number of phrase semicolon groups of this Head.

Returns:
phrase SG count

getPronSGCount

public int getPronSGCount()
Returns the number of pronoun semicolon groups of this Head.

Returns:
pronoun SG count

getPrefSGCount

public int getPrefSGCount()
Returns the number of pref semicolon groups of this Head.

Returns:
preface SG count

getCRefCount

public int getCRefCount()
Returns the number of cross-references of this Head.

Returns:
cross reference count

getNCRefCount

public int getNCRefCount()
Returns the number of noun cross-references of this Head.

Returns:
noun cross reference count

getAdjCRefCount

public int getAdjCRefCount()
Returns the number of adjective cross-references of this Head.

Returns:
adjective cross reference count

getVbCRefCount

public int getVbCRefCount()
Returns the number of verb cross-references of this Head.

Returns:
verb cross reference count

getAdvCRefCount

public int getAdvCRefCount()
Returns the number of adverb cross-references of this Head.

Returns:
adverb cross reference count

getIntCRefCount

public int getIntCRefCount()
Returns the number of interjection cross-references of this Head.

Returns:
interjection cross reference count

getPhrCRefCount

public int getPhrCRefCount()
Returns the number of phrase cross-references of this Head.

Returns:
phrase cross reference count

getPronCRefCount

public int getPronCRefCount()
Returns the number of pronoun cross-references of this Head.

Returns:
pronoun cross reference count

getPrefCRefCount

public int getPrefCRefCount()
Returns the number of pref cross-references of this Head.

Returns:
preface cross reference count

getSeeCount

public int getSeeCount()
Returns the number of see references of this Head.

Returns:
see count

getNSeeCount

public int getNSeeCount()
Returns the number of noun see references of this Head.

Returns:
noun see count

getAdjSeeCount

public int getAdjSeeCount()
Returns the number of adjective references of this Head.

Returns:
adjective see count

getVbSeeCount

public int getVbSeeCount()
Returns the number of verb references of this Head.

Returns:
verb see count

getAdvSeeCount

public int getAdvSeeCount()
Returns the number of adverb references of this Head.

Returns:
adverb see count

getIntSeeCount

public int getIntSeeCount()
Returns the number of interjection references of this Head.

Returns:
interjection see count

getPhrSeeCount

public int getPhrSeeCount()
Returns the number of Phrase references of this Head.

Returns:
phrase see count

getPronSeeCount

public int getPronSeeCount()
Returns the number of Pronoun references of this Head.

Returns:
pronoun see count

getPrefSeeCount

public int getPrefSeeCount()
Returns the number of pref references of this Head.

Returns:
preface see count

addPara

public void addPara(Paragraph para,
                    java.lang.String pos)
Adds a paragraph with a given POS to the paragraph list.

Parameters:
para -
pos -

getPara

public Paragraph getPara(int paraNum,
                         java.lang.String pos)
Returns the a Paragraph object specified by the paragraph number and part-of-speech.

Parameters:
paraNum -
pos -
Returns:
Paragraph

getPara

public Paragraph getPara(java.lang.String paraKey,
                         java.lang.String pos)
Returns the a Paragraph object specified by the paragraph key and part-of-speech.

Parameters:
paraKey -
pos -
Returns:
Paragraph

setPOSStart

public void setPOSStart(java.lang.String pos)
We assume here that a pos tag is sent to this function when there has been a change to the pos of a paragraph in the Thesaurus

Parameters:
pos -

toString

public java.lang.String toString()
Converts to a string representation the Head object. The following following format is used - Head:headNum:headName:classNum:sectionNum:paraCount:sgCount:wordCount.

Overrides:
toString in class java.lang.Object

print

public void print()
Prints the contents of this Head to the standard output.


printAllWords

public void printAllWords()
Prints all the words and phrases of this Head separated on a separate line to the standard output.


printAllSG

public void printAllSG()
Prints all the semicolon groups of this Head separated on a separate line to the standard output.