eu.monnetproject.lemon.impl
Class LexiconImpl

java.lang.Object
  extended by eu.monnetproject.lemon.URIValue
      extended by eu.monnetproject.lemon.URIElement
          extended by eu.monnetproject.lemon.impl.LemonElementImpl
              extended by eu.monnetproject.lemon.impl.LexiconImpl
All Implemented Interfaces:
IntrospectableElement, ReaderAccepter, LemonElement, LemonElementOrPredicate, Lexicon, Serializable

public class LexiconImpl
extends LemonElementImpl
implements Lexicon

Instantiated via LemonModelImpl

Author:
John McCrae
See Also:
Serialized Form

Field Summary
static URI LANGUAGE
           
 
Fields inherited from class eu.monnetproject.lemon.impl.LemonElementImpl
checkRemote, model, RDF_TYPE, referencers
 
Constructor Summary
LexiconImpl(String id, LemonModelImpl model)
           
LexiconImpl(URI uri, LemonModelImpl model)
           
 
Method Summary
 ReaderAccepter accept(URI pred, String value, LinguisticOntology lingOnto, AccepterFactory factory)
           
 void accept(URI pred, String value, String lang, LinguisticOntology lingOnto, AccepterFactory factory)
           
 ReaderAccepter accept(URI pred, URI value, LinguisticOntology lingOnto, AccepterFactory factory)
           
 boolean addEntry(LexicalEntry entry)
          Add an entry to the lexicon
 boolean addPattern(MorphPattern mp)
          Add a pattern to this lexicon
 boolean addTopic(LexicalTopic topic)
          Add a topic to the lexicon
 int countEntrys()
          Get the number of entries.
 Map<URI,Collection<Object>> getElements()
           
 Collection<LexicalEntry> getEntrys()
          Get the entries that compose this lexicon
 String getLanguage()
          Get the language of the lexicon
 LemonModel getModel()
          Get the model this lexicon is contained in
 Collection<MorphPattern> getPatterns()
          Get all patterns used by this lexicon
 Collection<LexicalTopic> getTopics()
          Get the topics of the lexicon
 boolean hasEntry(LexicalEntry entry)
          Check if the lexicon contains an entry.
 void merge(ReaderAccepter accepter, LinguisticOntology lingOnto, AccepterFactory factory)
           
 boolean removeEntry(LexicalEntry entry)
          Remove an entry from the lexicon
 boolean removePattern(MorphPattern mp)
          Remove a pattern from this lexicon
 boolean removeTopic(LexicalTopic topic)
          Remove a topic from the lexicon
protected  void resolveRemote()
           
 void setLanguage(String language)
          Set the language of the lexicon
 
Methods inherited from class eu.monnetproject.lemon.impl.LemonElementImpl
accept, acceptProperties, addAnnotation, addPredElem, addPredElemDirect, addProperty, addReference, addStrElem, addStrElemDirect, addType, addTypeDirect, clearAll, defaultAccept, defaultAccept, defaultAccept, defaultMerge, doAccept, follow, follow, getAnnotations, getAnnotations, getModelName, getPredElem, getPredElems, getProperty, getPropertys, getStrElem, getStrElems, getStrText, getTypes, isMultiReferenced, merge, merge, mergeIn, printAsBlankNode, printAsBlankNode, printURI, refers, removeAnnotation, removePredElem, removeProperty, removeReference, removeStrElem, removeType, setStrElem, setStrElemDirect, setStrText, setStrTextDirect, updateAddPredElem, updateReference, visit, write
 
Methods inherited from class eu.monnetproject.lemon.URIElement
equals, getID, hashCode, toString
 
Methods inherited from class eu.monnetproject.lemon.URIValue
getInfHash, getURI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.monnetproject.lemon.model.LemonElement
addAnnotation, addProperty, addType, getAnnotations, getAnnotations, getID, getProperty, getPropertys, getTypes, removeAnnotation, removeProperty, removeType
 
Methods inherited from interface eu.monnetproject.lemon.model.LemonElementOrPredicate
getURI
 

Field Detail

LANGUAGE

public static final URI LANGUAGE
Constructor Detail

LexiconImpl

public LexiconImpl(URI uri,
                   LemonModelImpl model)

LexiconImpl

public LexiconImpl(String id,
                   LemonModelImpl model)
Method Detail

getLanguage

public String getLanguage()
Description copied from interface: Lexicon
Get the language of the lexicon

Specified by:
getLanguage in interface Lexicon

setLanguage

public void setLanguage(String language)
Description copied from interface: Lexicon
Set the language of the lexicon

Specified by:
setLanguage in interface Lexicon

hasEntry

public boolean hasEntry(LexicalEntry entry)
Description copied from interface: Lexicon
Check if the lexicon contains an entry. Significantly faster than call getEntrys().contains(entry)

Specified by:
hasEntry in interface Lexicon

countEntrys

public int countEntrys()
Description copied from interface: Lexicon
Get the number of entries. Also significantly faster

Specified by:
countEntrys in interface Lexicon

getEntrys

public Collection<LexicalEntry> getEntrys()
Description copied from interface: Lexicon
Get the entries that compose this lexicon

Specified by:
getEntrys in interface Lexicon

addEntry

public boolean addEntry(LexicalEntry entry)
Description copied from interface: Lexicon
Add an entry to the lexicon

Specified by:
addEntry in interface Lexicon

removeEntry

public boolean removeEntry(LexicalEntry entry)
Description copied from interface: Lexicon
Remove an entry from the lexicon

Specified by:
removeEntry in interface Lexicon

getTopics

public Collection<LexicalTopic> getTopics()
Description copied from interface: Lexicon
Get the topics of the lexicon

Specified by:
getTopics in interface Lexicon

addTopic

public boolean addTopic(LexicalTopic topic)
Description copied from interface: Lexicon
Add a topic to the lexicon

Specified by:
addTopic in interface Lexicon

removeTopic

public boolean removeTopic(LexicalTopic topic)
Description copied from interface: Lexicon
Remove a topic from the lexicon

Specified by:
removeTopic in interface Lexicon

getModel

public LemonModel getModel()
Description copied from interface: Lexicon
Get the model this lexicon is contained in

Specified by:
getModel in interface Lexicon

accept

public ReaderAccepter accept(URI pred,
                             URI value,
                             LinguisticOntology lingOnto,
                             AccepterFactory factory)
Specified by:
accept in interface ReaderAccepter

accept

public ReaderAccepter accept(URI pred,
                             String value,
                             LinguisticOntology lingOnto,
                             AccepterFactory factory)
Specified by:
accept in interface ReaderAccepter

accept

public void accept(URI pred,
                   String value,
                   String lang,
                   LinguisticOntology lingOnto,
                   AccepterFactory factory)
Specified by:
accept in interface ReaderAccepter

getPatterns

public Collection<MorphPattern> getPatterns()
Description copied from interface: Lexicon
Get all patterns used by this lexicon

Specified by:
getPatterns in interface Lexicon

addPattern

public boolean addPattern(MorphPattern mp)
Description copied from interface: Lexicon
Add a pattern to this lexicon

Specified by:
addPattern in interface Lexicon

removePattern

public boolean removePattern(MorphPattern mp)
Description copied from interface: Lexicon
Remove a pattern from this lexicon

Specified by:
removePattern in interface Lexicon

getElements

public Map<URI,Collection<Object>> getElements()
Specified by:
getElements in interface IntrospectableElement
Overrides:
getElements in class LemonElementImpl

merge

public void merge(ReaderAccepter accepter,
                  LinguisticOntology lingOnto,
                  AccepterFactory factory)
Specified by:
merge in interface ReaderAccepter

resolveRemote

protected void resolveRemote()
Overrides:
resolveRemote in class LemonElementImpl


Copyright © 2012. All Rights Reserved.