001 // This file is part of the Attempto Java Packages. 002 // Copyright 2008-2009, Attempto Group, University of Zurich (see http://attempto.ifi.uzh.ch). 003 // 004 // The Attempto Java Packages is free software: you can redistribute it and/or modify it under the 005 // terms of the GNU Lesser General Public License as published by the Free Software Foundation, 006 // either version 3 of the License, or (at your option) any later version. 007 // 008 // The Attempto Java Packages is distributed in the hope that it will be useful, but WITHOUT ANY 009 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 010 // PURPOSE. See the GNU Lesser General Public License for more details. 011 // 012 // You should have received a copy of the GNU Lesser General Public License along with the Attempto 013 // Java Packages. If not, see http://www.gnu.org/licenses/. 014 015 package ch.uzh.ifi.attempto.preditor.text; 016 017 /** 018 * This class represents a context checker that is able to do small surface adaptations 019 * of a token according to the surrounding tokens. E.g. in English "a" should become "an" 020 * in front of "apple". 021 * 022 * @author Tobias Kuhn 023 */ 024 public interface ContextChecker { 025 026 /** 027 * This method should return the adapted text of the text element if it occurs between the given 028 * tokens. 029 * 030 * @param textElement The text element whose text should be adapted to the context. 031 * @param precedingText The preceding token. 032 * @param followingText The following token. 033 * @return The adapted text. 034 */ 035 public String getTextInContext(TextElement textElement, String precedingText, String followingText); 036 037 }