edu.columbia.cs.ref.model
Class Sentence

java.lang.Object
  extended by edu.columbia.cs.ref.model.FeaturableObject
      extended by edu.columbia.cs.ref.model.Sentence
All Implemented Interfaces:
java.io.Serializable

public class Sentence
extends FeaturableObject
implements java.io.Serializable

The Class Sentence represents sentences that are present in a document.

A sentence is composed by three basic attributes:

1) The document where the sentence is contained

2) The starting index of the sentence in the document

3) The length of the sentence

Since:
2011-09-27
Version:
0.1
Author:
Pablo Barrio, Goncalo Simoes
See Also:
Serialized Form

Constructor Summary
Sentence(Document d, int offset, int length)
          Instantiates a new sentence.
 
Method Summary
 int getLength()
          Gets the length of the sentence.
 int getOffset()
          Gets the starting index of the sentence in the document.
 java.lang.String getValue()
          Gets the value of the sentence.
 Sentence merge(Sentence nextSentence)
          Merge.
 void setLength(int length)
          Sets the length of the sentence.
 void setOffset(int offset)
          Sets the starting index of the sentence in the document.
 java.lang.String toString()
           
 
Methods inherited from class edu.columbia.cs.ref.model.FeaturableObject
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sentence

public Sentence(Document d,
                int offset,
                int length)
Instantiates a new sentence.

Parameters:
d - the d
offset - the offset
length - the length
Method Detail

setOffset

public void setOffset(int offset)
Sets the starting index of the sentence in the document.

Parameters:
offset - the new starting index of the sentence in the document

getOffset

public int getOffset()
Gets the starting index of the sentence in the document.

Returns:
the starting index of the sentence in the document

setLength

public void setLength(int length)
Sets the length of the sentence.

Parameters:
length - the new length of the sentence

getLength

public int getLength()
Gets the length of the sentence.

Returns:
the length of the sentence

getValue

public java.lang.String getValue()
Gets the value of the sentence.

Returns:
the value of the sentence

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

merge

public Sentence merge(Sentence nextSentence)
Merge.

Parameters:
nextSentence - the next sentence
Returns:
the sentence