de.tudarmstadt.ukp.jwktl.api.entry
Class WiktionarySense

java.lang.Object
  extended by de.tudarmstadt.ukp.jwktl.api.entry.WiktionarySense
All Implemented Interfaces:
IWiktionarySense

@Persistent
public class WiktionarySense
extends Object
implements IWiktionarySense

Default implementation of the IWiktionarySense interface. See there for details.

Author:
Christian M. Meyer

Field Summary
protected  WiktionaryEntry entry
           
protected  long entryId
           
protected  List<IWikiString> examples
           
protected  IWikiString gloss
           
protected  int index
           
protected  String marker
           
protected  List<IQuotation> quotations
           
protected  List<IWikiString> references
           
protected  List<IWiktionaryRelation> relations
           
protected  List<IWiktionaryTranslation> translations
           
 
Constructor Summary
WiktionarySense()
           
 
Method Summary
 void addExample(IWikiString example)
          Add the given example to this sense.
 void addQuotation(IQuotation quotation)
          Add the given quotation to this sense.
 void addReference(IWikiString reference)
          Add the given reference to this sense.
 void addRelation(IWiktionaryRelation relation)
          Add the given relation to this sense.
 void addTranslation(IWiktionaryTranslation translation)
          Add the given translation to this sense.
 IWiktionaryEntry getEntry()
          Returns a reference to the IWiktionaryEntry that contains this sense.
 long getEntryId()
          Shorthand for getEntry().getId().
 List<IWikiString> getExamples()
          Returns a list of sense examples or null if no sense examples are encoded.
 IWikiString getGloss()
          Returns the sense description as a IWikiString.
 String getId()
          Returns an ID of this sense that is unique for all senses of the containing IWiktionaryEntry.
 int getIndex()
          Returns the index of this sense.
 String getKey()
          Returns a unique ID for this word sense.
 String getMarker()
          Returns the marker for this sense as defined in Wiktionary.
 IWiktionaryPage getPage()
          Returns a reference to the IWiktionaryPage that contains this sense.
 List<IQuotation> getQuotations()
          Returns a list of quotations or null if no quotations are encoded.
 List<IWikiString> getReferences()
          Returns a list of references for this sense or null if no referemces are encoded.
 List<IWiktionaryRelation> getRelations()
          Returns the list of all sense relations (or null if no relations are encoded).
 List<IWiktionaryRelation> getRelations(RelationType relationType)
          Returns the list of sense relations of the given relation type.
 List<IWiktionaryTranslation> getTranslations()
          Returns the list of all translations (or null if no translations are encoded).
 List<IWiktionaryTranslation> getTranslations(ILanguage language)
          Returns the list of translations into the given language.
 void init(WiktionaryEntry entry)
          Initialize the sense using the given Wiktionary entry.
 void setGloss(IWikiString gloss)
          Add the given sense definition to this sense.
protected  void setIndex(int index)
          Assigns the given index to this sense.
 void setMarker(String marker)
          Assigns the given sense marker to this sense.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

index

protected int index

marker

protected String marker

entry

protected transient WiktionaryEntry entry

entryId

protected long entryId

gloss

protected IWikiString gloss

examples

protected List<IWikiString> examples

quotations

protected List<IQuotation> quotations

references

protected List<IWikiString> references

relations

protected List<IWiktionaryRelation> relations

translations

protected List<IWiktionaryTranslation> translations
Constructor Detail

WiktionarySense

public WiktionarySense()
Method Detail

init

public void init(WiktionaryEntry entry)
Initialize the sense using the given Wiktionary entry. This is necessary to initialize the back references to the parent entry, which are not explicitly stored in the database.


getKey

public String getKey()
Description copied from interface: IWiktionarySense
Returns a unique ID for this word sense. The ID is unique for all IWiktionarySenses of the IWiktionaryEdition. Note however that the ID of a sense may differ between different software versions or dump dates.

Specified by:
getKey in interface IWiktionarySense

getId

public String getId()
Description copied from interface: IWiktionarySense
Returns an ID of this sense that is unique for all senses of the containing IWiktionaryEntry. Use IWiktionarySense.getKey() for a globally unique identifier.

Specified by:
getId in interface IWiktionarySense

getEntryId

public long getEntryId()
Shorthand for getEntry().getId().


getIndex

public int getIndex()
Description copied from interface: IWiktionarySense
Returns the index of this sense. That is, the running number of the sense in accordance to the list of senses of the IWiktionaryEntry. The first sense has index 1. Note that this is not generally the index marker used in Wiktionary: the first sense has for example always index 1, although it might be marked with "[2]" or "[1a]". See IWiktionarySense.getMarker() for details.

Specified by:
getIndex in interface IWiktionarySense

setIndex

protected void setIndex(int index)
Assigns the given index to this sense.


getMarker

public String getMarker()
Description copied from interface: IWiktionarySense
Returns the marker for this sense as defined in Wiktionary. This can be different for each type of Wiktionary edition; for example, running numbers, short textual labels,...

Specified by:
getMarker in interface IWiktionarySense

setMarker

public void setMarker(String marker)
Assigns the given sense marker to this sense.


getEntry

public IWiktionaryEntry getEntry()
Description copied from interface: IWiktionarySense
Returns a reference to the IWiktionaryEntry that contains this sense.

Specified by:
getEntry in interface IWiktionarySense

getPage

public IWiktionaryPage getPage()
Description copied from interface: IWiktionarySense
Returns a reference to the IWiktionaryPage that contains this sense.

Specified by:
getPage in interface IWiktionarySense

getGloss

public IWikiString getGloss()
Description copied from interface: IWiktionarySense
Returns the sense description as a IWikiString.

Specified by:
getGloss in interface IWiktionarySense

setGloss

public void setGloss(IWikiString gloss)
Add the given sense definition to this sense.


addExample

public void addExample(IWikiString example)
Add the given example to this sense.


getExamples

public List<IWikiString> getExamples()
Description copied from interface: IWiktionarySense
Returns a list of sense examples or null if no sense examples are encoded.

Specified by:
getExamples in interface IWiktionarySense

addQuotation

public void addQuotation(IQuotation quotation)
Add the given quotation to this sense.


getQuotations

public List<IQuotation> getQuotations()
Description copied from interface: IWiktionarySense
Returns a list of quotations or null if no quotations are encoded.

Specified by:
getQuotations in interface IWiktionarySense

addReference

public void addReference(IWikiString reference)
Add the given reference to this sense.


getReferences

public List<IWikiString> getReferences()
Description copied from interface: IWiktionarySense
Returns a list of references for this sense or null if no referemces are encoded.

Specified by:
getReferences in interface IWiktionarySense

addRelation

public void addRelation(IWiktionaryRelation relation)
Add the given relation to this sense.


getRelations

public List<IWiktionaryRelation> getRelations()
Description copied from interface: IWiktionarySense
Returns the list of all sense relations (or null if no relations are encoded).

Specified by:
getRelations in interface IWiktionarySense

getRelations

public List<IWiktionaryRelation> getRelations(RelationType relationType)
Description copied from interface: IWiktionarySense
Returns the list of sense relations of the given relation type. If there are no relations of this type, an empty list will be returned.

Specified by:
getRelations in interface IWiktionarySense

addTranslation

public void addTranslation(IWiktionaryTranslation translation)
Add the given translation to this sense.


getTranslations

public List<IWiktionaryTranslation> getTranslations(ILanguage language)
Description copied from interface: IWiktionarySense
Returns the list of translations into the given language. If there are no translations of this type, an empty list will be returned.

Specified by:
getTranslations in interface IWiktionarySense

getTranslations

public List<IWiktionaryTranslation> getTranslations()
Description copied from interface: IWiktionarySense
Returns the list of all translations (or null if no translations are encoded).

Specified by:
getTranslations in interface IWiktionarySense

toString

public String toString()
Overrides:
toString in class Object


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