ch.uzh.ifi.attempto.ape
Class Lexicon

java.lang.Object
  extended by ch.uzh.ifi.attempto.ape.Lexicon

public class Lexicon
extends java.lang.Object

This class represents a lexicon which consists of a set of lexicon entries.

Author:
Tobias Kuhn

Constructor Summary
Lexicon()
          Creates an empty lexicon.
 
Method Summary
 void addEntries(java.util.Collection<LexiconEntry> entries)
          Adds a collection of lexicon entries to this lexicon.
 void addEntry(LexiconEntry entry)
          Adds a lexicon entry to this lexicon.
 java.util.List<LexiconEntry> getEntries()
          Returns a list of all lexicon entries that are contained in this lexicon.
 void removeAllEntries()
          Removes all entries from this lexicon.
 void removeEntry(LexiconEntry entry)
          Removes the lexicon entry from this lexicon.
 java.lang.String toList()
          Returns the lexicon as a serialized Prolog list.
 java.lang.String toString()
          Returns this lexicon as a contents of an APE lexicon file, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Lexicon

public Lexicon()
Creates an empty lexicon.

Method Detail

addEntry

public void addEntry(LexiconEntry entry)
Adds a lexicon entry to this lexicon.

Parameters:
entry - The lexicon entry to be added.

addEntries

public void addEntries(java.util.Collection<LexiconEntry> entries)
Adds a collection of lexicon entries to this lexicon.

Parameters:
entries - The lexicon entries to be added.

removeEntry

public void removeEntry(LexiconEntry entry)
Removes the lexicon entry from this lexicon.

Parameters:
entry - The lexicon entry to be removed.

removeAllEntries

public void removeAllEntries()
Removes all entries from this lexicon.


getEntries

public java.util.List<LexiconEntry> getEntries()
Returns a list of all lexicon entries that are contained in this lexicon.

Returns:
A list of all lexicon entries.

toList

public java.lang.String toList()
Returns the lexicon as a serialized Prolog list.

Returns:
The lexicon as a serialized Prolog list.

toString

public java.lang.String toString()
Returns this lexicon as a contents of an APE lexicon file, i.e. each entry is followed by a dot ('.') and a space (' ').

Overrides:
toString in class java.lang.Object


Copyright 2008-2010, Attempto Group, University of Zurich (see http://attempto.ifi.uzh.ch)