org.cogroo.entities
Class Sentence

java.lang.Object
  extended by org.cogroo.entities.Sentence
All Implemented Interfaces:
Serializable, TokenGroup
Direct Known Subclasses:
SentenceCogroo

public class Sentence
extends Object
implements Serializable, TokenGroup

Data structure that represents a natural language sentence. The annotations are added to the structure while the sentence is processed.

Author:
William Colen
See Also:
Serialized Form

Constructor Summary
Sentence()
           
 
Method Summary
 boolean equals(Object object)
           
 List<Chunk> getChunks()
          Sets the Chunks of this sentence.
 String getDocumentText()
           
 int getOffset()
           
 Node getRoot()
           
 String getSentence()
          Gets the original sentence.
 opennlp.tools.util.Span getSpan()
           
 List<SyntacticChunk> getSyntacticChunks()
           
 String getSyntaxTree()
           
 List<Token> getTokens()
          Gets the Tokens of this sentence.
 String getTree()
           
 int hashCode()
           
 void setChunks(List<Chunk> chunks)
          Sets the Chunks of this sentence.
 void setDocumentText(String document)
           
 void setOffset(int offset)
           
 void setRoot(Node root)
           
 void setSentence(String sentence)
          Sets the original sentence.
 void setSpan(opennlp.tools.util.Span aSpan)
           
 void setSyntacticChunks(List<SyntacticChunk> sc)
           
 void setTokens(List<Token> tokens)
          Sets the Tokens of this sentence.
 String toPlainText()
          Gets the representation of the sentence as a plain text.
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sentence

public Sentence()
Method Detail

toPlainText

public String toPlainText()
Gets the representation of the sentence as a plain text.

Returns:
The sentence as a string.

toString

public String toString()
Overrides:
toString in class Object

getSentence

public String getSentence()
Gets the original sentence.

Returns:
the original sentence

getDocumentText

public String getDocumentText()

setSentence

public void setSentence(String sentence)
Sets the original sentence.

Parameters:
sentence -

setDocumentText

public void setDocumentText(String document)

setSpan

public void setSpan(opennlp.tools.util.Span aSpan)

getSpan

public opennlp.tools.util.Span getSpan()

getTokens

public List<Token> getTokens()
Gets the Tokens of this sentence.

Specified by:
getTokens in interface TokenGroup
Returns:
Array of Tokens

setTokens

public void setTokens(List<Token> tokens)
Sets the Tokens of this sentence.

Parameters:
tokens -

getChunks

public List<Chunk> getChunks()
Sets the Chunks of this sentence.

Returns:
Array of Chunks

setChunks

public void setChunks(List<Chunk> chunks)
Sets the Chunks of this sentence.

Parameters:
chunks -

getSyntacticChunks

public List<SyntacticChunk> getSyntacticChunks()

setSyntacticChunks

public void setSyntacticChunks(List<SyntacticChunk> sc)

setRoot

public void setRoot(Node root)

getRoot

public Node getRoot()

setOffset

public void setOffset(int offset)

getOffset

public int getOffset()

getSyntaxTree

public String getSyntaxTree()

getTree

public String getTree()

equals

public boolean equals(Object object)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2012-2013 CoGrOO. All Rights Reserved.