hultig.sumo
Class ChunkMark

java.lang.Object
  extended by hultig.sumo.ChunkMark
Direct Known Subclasses:
Chunk

public class ChunkMark
extends Object

This class represents a phrase chunk, by storing only the chunk limits and its POS label. A representation of this chunk is obtained through the toString() method, which returns a string of the form "POS(a, b)", where "POS" is the chunk label and "a" and "b" are respectively the left and right chunk limits, in terms word position in the sentence (interpreted as an sequence of words).

University of Beira Interior (UBI)
Centre For Human Language Technology and Bioinformatics (HULTIG)


Field Summary
protected  int a
          The chunk left limit, in terms of word position in the sentence.
protected  int b
          The chunk right limit, in terms of word position in the sentence.
protected  ChunkTag chtag
          The chunk's part-of-speech label.
 
Constructor Summary
ChunkMark(int a, int b, ChunkTag tag)
           
ChunkMark(int a, int b, String pos)
          The constructor involves the chunk part-of-speech label and two integers representing a sentence interval, from one word (first index) to the other one (second index).
 
Method Summary
 int a()
          Gives the chunk left limit, in terms of sentence word position.
 int b()
          Gives the chunk right limit, in terms of sentence word position.
 String POS()
          Gives the chunk tag of this mark.
 boolean posUndefined()
          Tests whether this chunk mark is labeled or not.
 void set(int a, int b, ChunkTag tag)
           
 void set(int a, int b, String pos)
          Sets this chunk mark, through their three parameters: the left and right sentence word positions, and the chunk part-of-speech label.
 String toString()
          Gives the string representation of this chunk mark.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

a

protected int a
The chunk left limit, in terms of word position in the sentence.


b

protected int b
The chunk right limit, in terms of word position in the sentence.


chtag

protected ChunkTag chtag
The chunk's part-of-speech label.

Constructor Detail

ChunkMark

public ChunkMark(int a,
                 int b,
                 String pos)
The constructor involves the chunk part-of-speech label and two integers representing a sentence interval, from one word (first index) to the other one (second index). This is so because a chunk mark can comprehend a sequence of several words.

Parameters:
a - The position of the first word.
b - The position of the second word.
pos - The part-of-speech chunk label.

ChunkMark

public ChunkMark(int a,
                 int b,
                 ChunkTag tag)
Method Detail

set

public final void set(int a,
                      int b,
                      String pos)
Sets this chunk mark, through their three parameters: the left and right sentence word positions, and the chunk part-of-speech label.

Parameters:
a - The position of the left limit.
b - The position of the right limit.
pos - char[] The part-of-speech chunk label.

set

public final void set(int a,
                      int b,
                      ChunkTag tag)

a

public int a()
Gives the chunk left limit, in terms of sentence word position.

Returns:
The position of the left limit.

b

public int b()
Gives the chunk right limit, in terms of sentence word position.

Returns:
The position of the right limit.

POS

public String POS()
Gives the chunk tag of this mark.

Returns:
A string with the label of this chunk mark.

posUndefined

public boolean posUndefined()
Tests whether this chunk mark is labeled or not.

Returns:
The appropriate logical value.

toString

public String toString()
Gives the string representation of this chunk mark.

Overrides:
toString in class Object
Returns:
The string that represents this chunk mark, in the form of "POS(a, b)", where "POS" is the chunk label and "a" and "b" are respectively the left and right chunk limits, in terms word position in the sentence.