de.tudarmstadt.ukp.jwktl.api.filter
Class WiktionaryEntryFilter

java.lang.Object
  extended by de.tudarmstadt.ukp.jwktl.api.filter.WiktionaryPageFilter
      extended by de.tudarmstadt.ukp.jwktl.api.filter.WiktionaryEntryFilter
All Implemented Interfaces:
IWiktionaryEntryFilter, IWiktionaryPageFilter
Direct Known Subclasses:
WiktionarySenseFilter

public class WiktionaryEntryFilter
extends WiktionaryPageFilter
implements IWiktionaryEntryFilter

Default implementation of the IWiktionaryEntryFilter interface which inherits all filter options of the WiktionaryPageFilter and additionally provides the possibility of filtering entries by word language and part of speech.

Author:
Christian M. Meyer

Field Summary
protected  Set<PartOfSpeech> allowedPartsOfSpeech
           
protected  Set<ILanguage> allowedWordLanguages
           
 
Fields inherited from class de.tudarmstadt.ukp.jwktl.api.filter.WiktionaryPageFilter
allowedEntryLanguages
 
Constructor Summary
WiktionaryEntryFilter()
          Initializes a page filter without any filter restrictions.
WiktionaryEntryFilter(Set<ILanguage> allowedEntryLanguages, Set<ILanguage> allowedWordLanguages, Set<PartOfSpeech> allowedPartsOfSpeech)
          Shorthand for setting the allowed entry language, word language, and parts of speech.
 
Method Summary
 boolean accept(IWiktionaryEntry entry)
          Return true if the given entry should be accepted or false if it should be filtered out.
protected  boolean acceptPartOfSpeech(IWiktionaryEntry entry)
           
protected  boolean acceptWordLanguage(IWiktionaryEntry entry)
           
 void clear()
          Clears all filter options.
 void clearAllowedPartsOfSpeech()
          Clears the list of allowed parts of speech.
 void clearAllowedWordLanguages()
          Clears the list of allowed word languages.
 Iterable<PartOfSpeech> getAllowedPartsOfSpeech()
          Return an iterable of the list of all allowed parts of speech.
 Iterable<ILanguage> getAllowedWordLanguages()
          Return an iterable of the list of all allowed word languages.
 void setAllowedPartsOfSpeech(Collection<PartOfSpeech> allowedPartsOfSpeech)
          Define the set of parts of speech which are allowed for a IWiktionaryEntry.
 void setAllowedPartsOfSpeech(PartOfSpeech... allowedPartsOfSpeech)
          Define the set of parts of speech which are allowed for a IWiktionaryEntry.
 void setAllowedWordLanguages(Collection<ILanguage> allowedWordLanguages)
          Define the set of word languages which are allowed for a IWiktionaryEntry.
 void setAllowedWordLanguages(ILanguage... allowedWordLanguages)
          Define the set of word languages which are allowed for a IWiktionaryEntry.
 
Methods inherited from class de.tudarmstadt.ukp.jwktl.api.filter.WiktionaryPageFilter
accept, acceptEntryLanguage, clearAllowedEntryLanguages, getAllowedEntryLanguages, setAllowedEntryLanguages, setAllowedEntryLanguages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allowedWordLanguages

protected Set<ILanguage> allowedWordLanguages

allowedPartsOfSpeech

protected Set<PartOfSpeech> allowedPartsOfSpeech
Constructor Detail

WiktionaryEntryFilter

public WiktionaryEntryFilter()
Initializes a page filter without any filter restrictions.


WiktionaryEntryFilter

public WiktionaryEntryFilter(Set<ILanguage> allowedEntryLanguages,
                             Set<ILanguage> allowedWordLanguages,
                             Set<PartOfSpeech> allowedPartsOfSpeech)
Shorthand for setting the allowed entry language, word language, and parts of speech. Invoking this constructor is equivalent to using the default constructor and calling the corresponding setter methods.

Method Detail

clear

public void clear()
Description copied from class: WiktionaryPageFilter
Clears all filter options.

Overrides:
clear in class WiktionaryPageFilter

clearAllowedWordLanguages

public void clearAllowedWordLanguages()
Clears the list of allowed word languages.


getAllowedWordLanguages

public Iterable<ILanguage> getAllowedWordLanguages()
Return an iterable of the list of all allowed word languages.


setAllowedWordLanguages

public void setAllowedWordLanguages(ILanguage... allowedWordLanguages)
Define the set of word languages which are allowed for a IWiktionaryEntry. If no language is specified, the restriction on the word language will be cleared.


setAllowedWordLanguages

public void setAllowedWordLanguages(Collection<ILanguage> allowedWordLanguages)
Define the set of word languages which are allowed for a IWiktionaryEntry. If no language is specified, the restriction on the word language will be cleared.


acceptWordLanguage

protected boolean acceptWordLanguage(IWiktionaryEntry entry)

clearAllowedPartsOfSpeech

public void clearAllowedPartsOfSpeech()
Clears the list of allowed parts of speech.


getAllowedPartsOfSpeech

public Iterable<PartOfSpeech> getAllowedPartsOfSpeech()
Return an iterable of the list of all allowed parts of speech.


setAllowedPartsOfSpeech

public void setAllowedPartsOfSpeech(PartOfSpeech... allowedPartsOfSpeech)
Define the set of parts of speech which are allowed for a IWiktionaryEntry. If no tag is specified, the restriction on the parts of speech will be cleared.


setAllowedPartsOfSpeech

public void setAllowedPartsOfSpeech(Collection<PartOfSpeech> allowedPartsOfSpeech)
Define the set of parts of speech which are allowed for a IWiktionaryEntry. If no tag is specified, the restriction on the parts of speech will be cleared.


acceptPartOfSpeech

protected boolean acceptPartOfSpeech(IWiktionaryEntry entry)

accept

public boolean accept(IWiktionaryEntry entry)
Description copied from interface: IWiktionaryEntryFilter
Return true if the given entry should be accepted or false if it should be filtered out.

Specified by:
accept in interface IWiktionaryEntryFilter


Copyright © 2011-2013 Ubiquitous Knowledge Processing (UKP) Lab. All Rights Reserved.