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

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

public class SetOfSentences
extends CommObject

This class represents the set of sentences that were results of the morphological analysis about a input sentence. Each eojeol has more than one morphological analysis result which consists of a morpheme list and their tags. So a morphologically analyzed sentence is a sequence of analysis result of each eojeol. For example,

나는 학교에 간다.
---------------------------------------------------------------------------
나/ncn+는/jxc 학교/ncn+에/jca 갈/pvg+ㄴ다/ef+./sf
나/npp+는/jxc 가/pvg+ㄴ다/ef+./sf
나/pvg+는/etm 가/px+ㄴ다/ef+./sf
나/px+는/etm
나/pvg+아/ecs+는/jxc
나/pvg+아/ef+는/etm
나/px+아/ecs+는/jxc
나/px+아/ef+는/etm
날/pvg+는/etm

In this example, there are 9 x 1 x 3 = 27 morphologically analyzed sentences.

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

Field Summary
private  java.util.ArrayList<Eojeol[]> eojeolSetArray
          The array of the morphologically analyzed eojeol lists.
 int length
          The number of eojeols.
private  java.util.ArrayList<java.lang.String> plainEojeolArray
          The array of the plain eojeols.
 
Constructor Summary
SetOfSentences(int documentID, int sentenceID, boolean endOfDocument)
          Constructor.
SetOfSentences(int documentID, int sentenceID, boolean endOfDocument, java.util.ArrayList<java.lang.String> plainEojeolArray, java.util.ArrayList<Eojeol[]> eojeolSetArray)
          Constructor.
 
Method Summary
 boolean addEojeolSet(Eojeol[] eojeols)
          Adds eojeols that are morphologically analyzed about one eojeol to the end of the sentence.
 boolean addPlainEojeol(java.lang.String eojeol)
          Adds an plain eojeol to the end of the sentence.
 java.util.ArrayList<Eojeol[]> getEojeolSetArray()
          Returns the array of the morphologically analyzed eojeol list.
 java.util.ArrayList<java.lang.String> getPlainEojeolArray()
          Returns the array of the plain eojeol.
 void setEojeolSetArray(java.util.ArrayList<Eojeol[]> eojeolSetArray)
          Sets the array of the morphologically analyzed eojeol list.
 void setPlainEojeolArray(java.util.ArrayList<java.lang.String> plainEojeolArray)
          Sets the array of the plain eojeols.
 java.lang.String toString()
          Returns the string representation of the morphologically analyzed sentences.
 
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.


eojeolSetArray

private java.util.ArrayList<Eojeol[]> eojeolSetArray
The array of the morphologically analyzed eojeol lists.


plainEojeolArray

private java.util.ArrayList<java.lang.String> plainEojeolArray
The array of the plain eojeols.

Constructor Detail

SetOfSentences

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

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

SetOfSentences

public SetOfSentences(int documentID,
                      int sentenceID,
                      boolean endOfDocument,
                      java.util.ArrayList<java.lang.String> plainEojeolArray,
                      java.util.ArrayList<Eojeol[]> eojeolSetArray)
Constructor.

Parameters:
documentID - - ID of the document which this sentence is belong to
sentenceID - - ID of the sentence
endOfDocument - - If this flag is true, the sentence is the last one of the document.
plainEojeolArray - - the array of the plain eojeols
eojeolSetArray - - the array of the eojeol lists
Method Detail

getPlainEojeolArray

public java.util.ArrayList<java.lang.String> getPlainEojeolArray()
Returns the array of the plain eojeol.

Returns:
the array of the plain eojeol

setPlainEojeolArray

public void setPlainEojeolArray(java.util.ArrayList<java.lang.String> plainEojeolArray)
Sets the array of the plain eojeols.

Parameters:
plainEojeolArray -

addPlainEojeol

public boolean addPlainEojeol(java.lang.String eojeol)
Adds an plain eojeol to the end of the sentence.

Parameters:
eojeol - - plain eojeol
Returns:
true: when it is added correctly, otherwise false

addEojeolSet

public boolean addEojeolSet(Eojeol[] eojeols)
Adds eojeols that are morphologically analyzed about one eojeol to the end of the sentence.

Parameters:
eojeols - - morphologically analyzed eojeol list about one eojeol
Returns:
true: when it is added correctly, otherwise false

getEojeolSetArray

public java.util.ArrayList<Eojeol[]> getEojeolSetArray()
Returns the array of the morphologically analyzed eojeol list.

Returns:
the array of the morphologically analyzed eojeol list

setEojeolSetArray

public void setEojeolSetArray(java.util.ArrayList<Eojeol[]> eojeolSetArray)
Sets the array of the morphologically analyzed eojeol list.

Parameters:
eojeolSetArray - - the array of the morphologically analyzed eojeol list

toString

public java.lang.String toString()
Returns the string representation of the morphologically analyzed sentences. For example, 나는 나/ncn+는/jxc 나/npp+는/jxc 나/pvg+는/etm 나/px+는/etm 나/pvg+아/ecs+는/jxc 나/pvg+아/ef+는/etm 나/px+아/ecs+는/jxc 나/px+아/ef+는/etm 날/pvg+는/etm 학교에 학교/ncn+에/jca 간다. 갈/pvg+ㄴ다/ef+./sf 가/pvg+ㄴ다/ef+./sf 가/px+ㄴ다/ef+./sf

Overrides:
toString in class java.lang.Object