kr.ac.kaist.swrc.jhannanum.comm
Class Sentence

java.lang.Object
  extended by kr.ac.kaist.swrc.jhannanum.comm.CommObject
      extended by kr.ac.kaist.swrc.jhannanum.comm.Sentence

public class Sentence
extends CommObject

This class represents a sentence which is the sequence of eojeols that are morphologically analyzed. Each eojeol has a plain eojeol, a morpheme list, and a tag list for a sequence of morphemes.

Author:
Sangwon Park (hudoni@world.kaist.ac.kr), CILab, SWRC, KAIST

Field Summary
private  Eojeol[] eojeols
          The array of the eojeols that are morphologically analyzed.
 int length
          The number of eojeols.
private  java.lang.String[] plainEojeols
          The array of the plain eojeols.
 
Constructor Summary
Sentence(int documentID, int sentenceID, boolean endOfDocument)
          Constructor.
Sentence(int documentID, int sentenceID, boolean endOfDocument, java.lang.String[] plainEojeols, Eojeol[] eojeols)
          Constructor.
 
Method Summary
 Eojeol getEojeol(int index)
          Returns the eojeol object at the specified index.
 Eojeol[] getEojeols()
          Getter of the array of the eojeols that consist of morphemes and their tags.
 java.lang.String[] getPlainEojeols()
          Returns the array of the plain eojeols.
 void setEojeol(int index, Eojeol eojeol)
          Set an eojeol at the specified index.
 void setEojeol(int index, java.lang.String[] morphemes, java.lang.String[] tags)
          Set an eojeol at the specified index with morphemes and their tags.
 void setEojeols(Eojeol[] eojeols)
          Set the eojeols list with the specified array.
 void setPlainEojeols(java.lang.String[] plainEojeols)
          It sets the plain eojeol list with the specified array.
 java.lang.String toString()
          Returns the string representation of this sentence.
 
Methods inherited from class kr.ac.kaist.swrc.jhannanum.comm.CommObject
getDocumentID, getSentenceID, isEndOfDocument, setDocumentID, setEndOfDocument, setSentenceID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

length

public int length
The number of eojeols.


plainEojeols

private java.lang.String[] plainEojeols
The array of the plain eojeols.


eojeols

private Eojeol[] eojeols
The array of the eojeols that are morphologically analyzed.

Constructor Detail

Sentence

public Sentence(int documentID,
                int sentenceID,
                boolean endOfDocument)
Constructor.

Parameters:
documentID - - ID of the document which this sentence belong to
sentenceID - - ID of the sentence
endOfDocument - - If this flag is true, this sentence is the last one of the document.

Sentence

public Sentence(int documentID,
                int sentenceID,
                boolean endOfDocument,
                java.lang.String[] plainEojeols,
                Eojeol[] eojeols)
Constructor.

Parameters:
documentID - - ID of the document which this sentence belong to
sentenceID - - ID of the sentence
endOfDocument - - If this flag is true, this sentence is the last one of the document.
Method Detail

getEojeols

public Eojeol[] getEojeols()
Getter of the array of the eojeols that consist of morphemes and their tags.

Returns:
the array of the eojeols

getEojeol

public Eojeol getEojeol(int index)
Returns the eojeol object at the specified index.

Parameters:
index - - the index of the eojeol
Returns:
eojeol at the specified index

setEojeols

public void setEojeols(Eojeol[] eojeols)
Set the eojeols list with the specified array.

Parameters:
eojeols - - new eojeol array for this sentence

setEojeol

public void setEojeol(int index,
                      Eojeol eojeol)
Set an eojeol at the specified index.

Parameters:
index - - the index of the eojeol to set up
eojeol - - the new eojeol

setEojeol

public void setEojeol(int index,
                      java.lang.String[] morphemes,
                      java.lang.String[] tags)
Set an eojeol at the specified index with morphemes and their tags.

Parameters:
index - - the index of the eojeol to set up
morphemes - - the new morpheme list
tags - - the new tag list

toString

public java.lang.String toString()
Returns the string representation of this sentence. For example, 나는 나/npp+는/jxc 학교에서 학교/ncn+에서/jca 공부를 공부/ncpa+를/jco 하고 하/pvg+고/ecc 있다. 있/paa+다/ef+./sf

Overrides:
toString in class java.lang.Object

getPlainEojeols

public java.lang.String[] getPlainEojeols()
Returns the array of the plain eojeols.

Returns:
the plain eojeol array

setPlainEojeols

public void setPlainEojeols(java.lang.String[] plainEojeols)
It sets the plain eojeol list with the specified array.

Parameters:
plainEojeols - - the array of the plain eojeols