001    // This file is part of the Attempto Java Packages.
002    // Copyright 2008, 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.acewiki.core.ontology;
016    
017    import java.util.ArrayList;
018    import java.util.List;
019    
020    import ch.uzh.ifi.attempto.ape.LexiconEntry;
021    
022    /**
023     * This class stands for roles that are represented by transitive adjectives. Transitive
024     * adjectives consist of an adjective plus a preposition that is connected to the adjective
025     * by a hyphen "-" or an underscore "_". Underscores are replaced by
026     * blanks in the case of pretty-printing. Transitive adjectives have just one word form.
027     *<p>
028     * 0: word form consisting of an adjective plus a preposition.
029     *<p>
030     * Examples: "located-in"; "used_for".
031     * 
032     * @author Tobias Kuhn
033     */
034    public class TrAdjRole extends Role {
035            
036            private String word;
037            
038            /**
039             * Creates a new role that is represented by a transitive adjective.
040             */
041            public TrAdjRole() {
042                    word = "";
043            }
044            
045            public String[] getWords() {
046                    return new String[] {word};
047            }
048    
049            protected void changeWords(String... words) {
050                    word = words[0];
051            }
052    
053            List<LexiconEntry> getLexiconEntries() {
054                    List<LexiconEntry> entries = new ArrayList<LexiconEntry>();
055                    entries.add(LexiconEntry.createTrAdjEntry(word, word, ""));
056                    return entries;
057            }
058            
059            public String getType() {
060                    return "Transitive Adjective";
061            }
062            
063            public String getInternalType() {
064                    return "tradj";
065            }
066    
067    }