001 // This file is part of AceWiki. 002 // Copyright 2008-2012, AceWiki developers. 003 // 004 // AceWiki is free software: you can redistribute it and/or modify it under the terms of the GNU 005 // Lesser General Public License as published by the Free Software Foundation, either version 3 of 006 // the License, or (at your option) any later version. 007 // 008 // AceWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 009 // even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 010 // Lesser General Public License for more details. 011 // 012 // You should have received a copy of the GNU Lesser General Public License along with AceWiki. If 013 // not, see http://www.gnu.org/licenses/. 014 015 package ch.uzh.ifi.attempto.acewiki.core; 016 017 import java.util.List; 018 019 import ch.uzh.ifi.attempto.base.TextElement; 020 021 /** 022 * This interface represents a sentence in the given controlled natural language. It includes 023 * declarative sentences as well as questions. 024 * 025 * @author Tobias Kuhn 026 */ 027 public interface Sentence extends Statement { 028 029 /** 030 * Returns a list of text elements that represent the tokens of this sentence in the given 031 * language. 032 * 033 * @param language The language. 034 * @return A token list. 035 */ 036 public List<TextElement> getTextElements(String language); 037 038 /** 039 * Returns true if this sentence can participate in reasoning. 040 * 041 * @return true if this sentence can participate in reasoning. 042 */ 043 // TODO move to ontology or reasoner class? 044 public boolean isReasonable(); 045 046 /** 047 * Returns true if the sentence is integrated into the ontology. 048 * 049 * @return true if the sentence is integrated into the ontology. 050 */ 051 public boolean isIntegrated(); 052 053 /** 054 * Informs the sentence object whether it is integrated into the ontology or not. This 055 * method should only be called from the ontology or an ontology loader. 056 * 057 * @param integrated true if the sentence is integrated into the ontology. 058 */ 059 public void setIntegrated(boolean integrated); 060 061 /** 062 * Checks whether the sentence contains the given ontology element (no matter which 063 * word form). 064 * 065 * @param e The ontology element. 066 * @return true if the ontology element occurs in this sentence. 067 */ 068 public boolean contains(OntologyElement e); 069 070 /** 071 * This method is called whenever some words of the sentence are modified. 072 */ 073 public void update(); 074 075 /** 076 * Returns whether the sentence can be changed or is immutable. 077 * 078 * @return true if the sentence cannot be changed. 079 */ 080 public boolean isImmutable(); 081 082 /** 083 * Returns a list of sentence details in the given language. 084 * 085 * @param language The language. 086 * @return A list of sentence details. 087 */ 088 public List<SentenceDetail> getDetails(String language); 089 090 }