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

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

public class Eojeol
extends java.lang.Object

This class represents an Eojeol for internal use. An eojeol consists of more than one umjeol, and each eojeol is separated with spaces. Korean is a agglutinative language so lexemes in an eojeol may be inflected.

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

Field Summary
 int length
          The number of morphemes in this eojeol.
private  java.lang.String[] morphemes
          Morphemes in the eojeol.
private  java.lang.String[] tags
          Morpheme tags of each morpheme.
 
Constructor Summary
Eojeol()
          Constructor.
Eojeol(java.lang.String[] morphemes, java.lang.String[] tags)
          Constructor.
 
Method Summary
 java.lang.String getMorpheme(int index)
          It returns the morpheme on the specific index.
 java.lang.String[] getMorphemes()
          It returns the morpheme list in the eojeol.
 java.lang.String getTag(int index)
          It returns the tag of the morpheme on the given position.
 java.lang.String[] getTags()
          It returns the tag list for the morphemes in the eojeol.
 int setMorpheme(int index, java.lang.String morpheme)
          Set a morpheme on the specific position
 void setMorphemes(java.lang.String[] morphemes)
          Set the morpheme list with a morpheme array.
 int setTag(int index, java.lang.String tag)
          It changes the tag of the morpheme on the index
 void setTags(java.lang.String[] tags)
          It sets the tag list for the morphemes of the eojeol.
 java.lang.String toString()
          It returns a string that represents the eojeol with morphemes and tags.
 
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 morphemes in this eojeol.


morphemes

private java.lang.String[] morphemes
Morphemes in the eojeol.


tags

private java.lang.String[] tags
Morpheme tags of each morpheme.

Constructor Detail

Eojeol

public Eojeol()
Constructor.


Eojeol

public Eojeol(java.lang.String[] morphemes,
              java.lang.String[] tags)
Constructor.

Parameters:
morphemes - - array of morphemes
tags - - tag array for each morpheme
Method Detail

getMorphemes

public java.lang.String[] getMorphemes()
It returns the morpheme list in the eojeol.

Returns:
morpheme list for this eojeol

getMorpheme

public java.lang.String getMorpheme(int index)
It returns the morpheme on the specific index.

Parameters:
index - - index of morpheme
Returns:
the morpheme on the index

setMorphemes

public void setMorphemes(java.lang.String[] morphemes)
Set the morpheme list with a morpheme array.

Parameters:
morphemes - - array to set the morphemes

setMorpheme

public int setMorpheme(int index,
                       java.lang.String morpheme)
Set a morpheme on the specific position

Parameters:
index - - position of the morpheme to change
morpheme - - new morpheme for the index
Returns:
index: when the morpheme was set up correctly, otherwise -1

getTags

public java.lang.String[] getTags()
It returns the tag list for the morphemes in the eojeol.

Returns:
tags list for morphemes

getTag

public java.lang.String getTag(int index)
It returns the tag of the morpheme on the given position.

Parameters:
index - - the position of the morpheme to get its tag
Returns:
morpheme tag on the given position

setTags

public void setTags(java.lang.String[] tags)
It sets the tag list for the morphemes of the eojeol.

Parameters:
tags - - new tags list for the morpheme list

setTag

public int setTag(int index,
                  java.lang.String tag)
It changes the tag of the morpheme on the index

Parameters:
index - - position of the morpheme to change its tag
tag - - new morpheme tag
Returns:
index: the new tag was set up correctly, otherwise -1

toString

public java.lang.String toString()
It returns a string that represents the eojeol with morphemes and tags. For example, 나/npp+는/jxc.

Overrides:
toString in class java.lang.Object