sg.edu.nus.comp.nlp.ims.corpus
Interface ICorpus

All Known Implementing Classes:
ACorpus, CAllWordsCoarseTaskCorpus, CAllWordsFineTaskCorpus, CAllWordsPlainCorpus, CLexicalCorpus

public interface ICorpus

corpus interface. a corpus consists of several sentences

Author:
zhongzhi

Method Summary
 void clear()
          clear the corpus
 int getIndexInSentence(int p_Index)
          get the index of an instance in sentence
 int getLength(int p_Index)
          get number of words of instance p_Index
 int getLowerBoundary(int p_SentenceID)
          get lower boundary
 ISentence getSentence(int p_SentenceID)
          get the sentence
 int getSentenceID(int p_Index)
          get the id of sentence which contains the instance
 java.lang.String[] getTag(int p_Index)
          get the class of an instance
 int getUpperBoundary(int p_SentenceID)
          get upper boundary
 java.lang.String getValue(int p_Index, java.lang.String p_Key)
          get special value of key of instance index
 boolean load(java.io.Reader p_XmlReader)
          load data into corpus
 int numOfSentences()
          get the number of sentences
 int size()
          get the number of instances
 

Method Detail

clear

void clear()
clear the corpus


size

int size()
get the number of instances

Returns:
size

numOfSentences

int numOfSentences()
get the number of sentences

Returns:
number of sentence

getValue

java.lang.String getValue(int p_Index,
                          java.lang.String p_Key)
get special value of key of instance index

Parameters:
p_Index - instance index
p_Key - value key
Returns:
value

getIndexInSentence

int getIndexInSentence(int p_Index)
get the index of an instance in sentence

Parameters:
p_Index - instance index
Returns:
index in sentence

getLength

int getLength(int p_Index)
get number of words of instance p_Index

Parameters:
p_Index - instance index
Returns:
number of words

getSentenceID

int getSentenceID(int p_Index)
get the id of sentence which contains the instance

Parameters:
p_Index - instance index
Returns:
sentence number

getTag

java.lang.String[] getTag(int p_Index)
get the class of an instance

Parameters:
p_Index - instance index
Returns:
instance tags

getSentence

ISentence getSentence(int p_SentenceID)
get the sentence

Parameters:
p_SentenceID - sentence number
Returns:
sentence

getUpperBoundary

int getUpperBoundary(int p_SentenceID)
get upper boundary

Parameters:
p_SentenceID - sentence number
Returns:
upper boundary

getLowerBoundary

int getLowerBoundary(int p_SentenceID)
get lower boundary

Parameters:
p_SentenceID - sentence number
Returns:
lower boundary

load

boolean load(java.io.Reader p_XmlReader)
             throws java.lang.Exception
load data into corpus

Parameters:
p_XmlReader - reader of the input stream
Returns:
ready or not
Throws:
java.lang.Exception - exception while loading file