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.Gender;
021 import ch.uzh.ifi.attempto.ape.LexiconEntry;
022
023 /**
024 * This class stands for concepts that are represented by nouns. This is the only way how
025 * concepts can be represented at the moment, but it is planned to support also adjectives.
026 * Noun concepts have two word forms.
027 *<p>
028 * 0: singular form.
029 * 1: plural form.
030 *<p>
031 * Examples: ["country", "countries"]; ["woman", "women"].
032 *
033 * @author Tobias Kuhn
034 */
035 public class NounConcept extends Concept {
036
037 private String singular, plural;
038
039 /**
040 * Creates a new noun concept.
041 */
042 public NounConcept() {
043 singular = "";
044 plural = "";
045 }
046
047 public String[] getWords() {
048 return new String[] {singular, plural};
049 }
050
051 protected void changeWords(String... words) {
052 singular = words[0];
053 plural = words[1];
054 }
055
056 List<LexiconEntry> getLexiconEntries() {
057 List<LexiconEntry> entries = new ArrayList<LexiconEntry>();
058 entries.add(LexiconEntry.createNounSgEntry(getWord(0), getWord(0), Gender.NEUTRAL));
059 entries.add(LexiconEntry.createNounPlEntry(getWord(1), getWord(0), Gender.NEUTRAL));
060 return entries;
061 }
062
063 public String getType() {
064 return "Noun";
065 }
066
067 public String getInternalType() {
068 return "noun";
069 }
070
071 }