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

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

@Entity
public class WiktionaryPage
extends Object
implements IWiktionaryPage

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

Author:
Christian M. Meyer

Field Summary
protected  String author
           
protected  List<String> categories
           
protected  List<WiktionaryEntry> entries
           
protected  ILanguage entryLanguage
           
protected  String entryLanguageStr
           
protected  long id
           
protected  Set<String> interWikiLinks
           
protected  String normalizedTitle
           
protected  String redirectTarget
           
protected  long revision
           
protected  Date timestamp
           
protected  String title
           
 
Constructor Summary
WiktionaryPage()
          Instanciates a new, empty page.
 
Method Summary
 void addCategory(String category)
          Add the given category to the list of categories.
 void addEntry(WiktionaryEntry entry)
          Add the given entry to the list of senses.
 void addInterWikiLink(String language)
          Add the given interwiki link to the list of interwiki links.
 WiktionaryEntry createEntry()
          Factory method for creating a new entry.
 List<WiktionaryEntry> entries()
          Internal interface that is used by the parsers.
 String getAuthor()
          Returns the author of this revision - i.e., the name of the user that made the last change to the page.
 List<String> getCategories()
          Returns all categories of the Wiktionary page that are manually defined.
 List<IWiktionaryEntry> getEntries()
          Returns the list of all IWiktionaryEntrys.
 WiktionaryEntry getEntry(int index)
          Returns the IWiktionaryEntry with the given index.
 int getEntryCount()
          Returns the number of IWiktionaryEntrys encoded on this page.
 ILanguage getEntryLanguage()
          Returns the language that this page is written in.
 long getId()
          Returns the unique ID for this page.
 Set<String> getInterWikiLinks()
          Returns a list of inter-wiki links of this Wiktionary page.
 String getKey()
          Returns a unique ID for this page.
 String getRedirectTarget()
          Returns the page title that a redirect page targets at.
 long getRevision()
          Returns the ID of this revision - i.e., a unique number of the last change made to the page.
 Date getTimestamp()
          Returns the timestamp of this revision - i.e., the date of the last change of the page.
 String getTitle()
          Returns the title of this Wiktionary page which usually corresponds to the lemma of all lexical entries described on this page.
 void init()
          Initialize the page and all of its entries.
static String normalizeTitle(String title)
          Static helper method for normalizing the title.
 void setAuthor(String author)
          Assigns the given author name to this page.
 void setEntryLanguage(ILanguage entryLanguage)
          Assigns the given entry language to this page.
 void setId(long id)
          Assign the specified page ID.
 void setRedirectTarget(String redirectTarget)
          Assigns the given redirect target to this page.
 void setRevision(long revision)
          Assigns the given revision ID to this page.
 void setTimestamp(Date timestamp)
          Assigns the given timestamp to this page.
 void setTitle(String title)
          Assigns the given title to this page.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

@PrimaryKey
protected long id

title

@SecondaryKey(relate=ONE_TO_ONE)
protected String title

normalizedTitle

@SecondaryKey(relate=MANY_TO_ONE)
protected String normalizedTitle

timestamp

protected Date timestamp

revision

protected long revision

author

protected String author

entryLanguage

protected transient ILanguage entryLanguage

entryLanguageStr

protected String entryLanguageStr

categories

protected List<String> categories

interWikiLinks

protected Set<String> interWikiLinks

redirectTarget

protected String redirectTarget

entries

protected List<WiktionaryEntry> entries
Constructor Detail

WiktionaryPage

public WiktionaryPage()
Instanciates a new, empty page.

Method Detail

init

public void init()
Initialize the page and all of its entries.


createEntry

public WiktionaryEntry createEntry()
Factory method for creating a new entry.


getKey

public String getKey()
Description copied from interface: IWiktionaryPage
Returns a unique ID for this page. The ID is unique for all IWiktionaryPages of the IWiktionaryEdition and remains persistent regardless of the JWKTL software version or the date of the XML data dump of Wiktionary.

Specified by:
getKey in interface IWiktionaryPage

getId

public long getId()
Description copied from interface: IWiktionaryPage
Returns the unique ID for this page. This method is equivalent to IWiktionaryPage.getKey(), but returns the ID as a numerical value.

Specified by:
getId in interface IWiktionaryPage

setId

public void setId(long id)
Assign the specified page ID.


getTitle

public String getTitle()
Description copied from interface: IWiktionaryPage
Returns the title of this Wiktionary page which usually corresponds to the lemma of all lexical entries described on this page.

Specified by:
getTitle in interface IWiktionaryPage

setTitle

public void setTitle(String title)
Assigns the given title to this page.


getTimestamp

public Date getTimestamp()
Description copied from interface: IWiktionaryPage
Returns the timestamp of this revision - i.e., the date of the last change of the page.

Specified by:
getTimestamp in interface IWiktionaryPage

setTimestamp

public void setTimestamp(Date timestamp)
Assigns the given timestamp to this page.


getRevision

public long getRevision()
Description copied from interface: IWiktionaryPage
Returns the ID of this revision - i.e., a unique number of the last change made to the page.

Specified by:
getRevision in interface IWiktionaryPage

setRevision

public void setRevision(long revision)
Assigns the given revision ID to this page.


getAuthor

public String getAuthor()
Description copied from interface: IWiktionaryPage
Returns the author of this revision - i.e., the name of the user that made the last change to the page.

Specified by:
getAuthor in interface IWiktionaryPage

setAuthor

public void setAuthor(String author)
Assigns the given author name to this page.


getEntryLanguage

public ILanguage getEntryLanguage()
Description copied from interface: IWiktionaryPage
Returns the language that this page is written in. This is always the language of the whole Wiktionary language edition - i.e. equivalent to IWiktionaryEdition.getLanguage(). As opposed to that, the language of a word can be retrieved by IWiktionaryEntry.getWordLanguage(). There is, for example, a Wiktionary page "plant" in the German Wiktionary language edition that encodes a lexical entry on the word "plant" of the English language. The entry language would be German and the word language would be English in this case.

Specified by:
getEntryLanguage in interface IWiktionaryPage

setEntryLanguage

public void setEntryLanguage(ILanguage entryLanguage)
Assigns the given entry language to this page.


addCategory

public void addCategory(String category)
Add the given category to the list of categories.


getCategories

public List<String> getCategories()
Description copied from interface: IWiktionaryPage
Returns all categories of the Wiktionary page that are manually defined. Categories being derived automatically by using templates are not returned. The returned list is never null.

Specified by:
getCategories in interface IWiktionaryPage

addInterWikiLink

public void addInterWikiLink(String language)
Add the given interwiki link to the list of interwiki links.


getInterWikiLinks

public Set<String> getInterWikiLinks()
Description copied from interface: IWiktionaryPage
Returns a list of inter-wiki links of this Wiktionary page. Inter-wiki links are links to other language editions of Wiktionary - e.g., from the English page "plant" to the German page "plant". Note that this is not a translation, but always the same word form. Use IWiktionarySense.getTranslations() for word translations. The returned list is never null.

Specified by:
getInterWikiLinks in interface IWiktionaryPage

getRedirectTarget

public String getRedirectTarget()
Description copied from interface: IWiktionaryPage
Returns the page title that a redirect page targets at. The method returns null if the page is not a redirection page.

Specified by:
getRedirectTarget in interface IWiktionaryPage

setRedirectTarget

public void setRedirectTarget(String redirectTarget)
Assigns the given redirect target to this page.


addEntry

public void addEntry(WiktionaryEntry entry)
Add the given entry to the list of senses.


getEntry

public WiktionaryEntry getEntry(int index)
Description copied from interface: IWiktionaryPage
Returns the IWiktionaryEntry with the given index. The index is a running number starting at zero.

Specified by:
getEntry in interface IWiktionaryPage

getEntryCount

public int getEntryCount()
Description copied from interface: IWiktionaryPage
Returns the number of IWiktionaryEntrys encoded on this page.

Specified by:
getEntryCount in interface IWiktionaryPage

getEntries

public List<IWiktionaryEntry> getEntries()
Description copied from interface: IWiktionaryPage
Returns the list of all IWiktionaryEntrys. The list is never null and yields equivalent results to using IWiktionaryPage.getEntry(int) for all indices from zero to IWiktionaryPage.getEntryCount().

Specified by:
getEntries in interface IWiktionaryPage

entries

public List<WiktionaryEntry> entries()
Internal interface that is used by the parsers.


toString

public String toString()
Overrides:
toString in class Object

normalizeTitle

public static String normalizeTitle(String title)
Static helper method for normalizing the title. That is, the title is converted into lower case and non-ASCII characters are removed.



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