de.danielnaber.languagetool
Class AnalyzedSentence

Object
  extended by AnalyzedSentence

public class AnalyzedSentence
extends Object

A sentence that has been tokenized and analyzed.

Author:
Daniel Naber

Constructor Summary
AnalyzedSentence(AnalyzedTokenReadings[] tokens)
          Sets AnalyzedTokenReadings.
 
Method Summary
 int getOriginalPosition(int nonWhPosition)
          Get a position of a non-whitespace token in the original sentence with whitespace.
 AnalyzedTokenReadings[] getTokens()
          Returns the AnalyzedTokenReadings of the analyzed text.
 AnalyzedTokenReadings[] getTokensWithoutWhitespace()
          Returns the AnalyzedTokenReadings of the analyzed text, with whitespace tokens removed but with the artificial SENT_START token included.
 String toString()
           
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnalyzedSentence

public AnalyzedSentence(AnalyzedTokenReadings[] tokens)
Sets AnalyzedTokenReadings. Whitespace is also a token.

Method Detail

getTokens

public final AnalyzedTokenReadings[] getTokens()
Returns the AnalyzedTokenReadings of the analyzed text. Whitespace is also a token.


getTokensWithoutWhitespace

public final AnalyzedTokenReadings[] getTokensWithoutWhitespace()
Returns the AnalyzedTokenReadings of the analyzed text, with whitespace tokens removed but with the artificial SENT_START token included.


getOriginalPosition

public final int getOriginalPosition(int nonWhPosition)
Get a position of a non-whitespace token in the original sentence with whitespace.

Parameters:
nonWhPosition - Position of a non-whitespace token
Returns:
int position in the original sentence.

toString

public final String toString()
Overrides:
toString in class Object


Copyright © 2005-2007 Daniel Naber