ch.uzh.ifi.attempto.base
Interface TextOperator

All Known Implementing Classes:
ACETextOperator, DefaultTextOperator

public interface TextOperator

This interface defines text operations that are needed by the predictive editor.

Author:
Tobias Kuhn

Method Summary
 TextElement createTextElement(java.lang.String text)
          This method should create a text element for the given text.
 java.lang.String getGlue(TextElement left, TextElement right)
          This method should return the "glue" to connect two text elements.
 java.lang.String getTextInContext(TextElement textElement, java.lang.String preceding, java.lang.String following)
          This method checks the context of a text element and can do small surface adaptations of a token according to the surrounding text.
 java.util.List<java.lang.String> splitIntoTokens(java.lang.String text)
          This method should split a text into its tokens.
 

Method Detail

splitIntoTokens

java.util.List<java.lang.String> splitIntoTokens(java.lang.String text)
This method should split a text into its tokens.

Parameters:
text - The input text.
Returns:
A list of strings representing the tokens.

getTextInContext

java.lang.String getTextInContext(TextElement textElement,
                                  java.lang.String preceding,
                                  java.lang.String following)
This method checks the context of a text element and can do small surface adaptations of a token according to the surrounding text. E.g. in English "a" should become "an" in front of "apple".

Parameters:
textElement - The text element whose text should be adapted to the context.
preceding - The preceding text.
following - The following text.
Returns:
The adapted text.

createTextElement

TextElement createTextElement(java.lang.String text)
This method should create a text element for the given text.

Parameters:
text - The text.
Returns:
The text element.

getGlue

java.lang.String getGlue(TextElement left,
                         TextElement right)
This method should return the "glue" to connect two text elements. Mostly, this should be a single blank space or the empty string.

Parameters:
left - The left-hand side text element.
right - The right-hand side text element.
Returns:
The glue string.


Copyright 2008-2012, AceWiki developers