de.tudarmstadt.ukp.jwktl.api
Class WiktionaryFormatter

java.lang.Object
  extended by de.tudarmstadt.ukp.jwktl.api.WiktionaryFormatter

public class WiktionaryFormatter
extends Object

Utility class for producing simple string representations for the most commonly used JWKTL data objects. The string representations are designed for human perception rather than as an interoperable data exchange format.

Author:
Christian M. Meyer

Constructor Summary
WiktionaryFormatter()
           
 
Method Summary
 String formatEntry(IWiktionaryEntry entry)
          Returns a string representation of the given entry using separate prefixed lines for each information type.
 String formatHeader(IWiktionaryEntry entry)
          Returns the entry key, word, word language, and part of speech of the given entry.
 String formatHeader(IWiktionaryPage page)
          Returns the ID and the title of the given page.
 String formatHeader(IWiktionarySense sense)
          Returns the sense key, word, sense index, and definition of the given word sense.
protected static String formatLanguage(ILanguage language)
           
 String formatPage(IWiktionaryPage page, ILanguage... languages)
          Returns a string representation of the given page using separate prefixed lines for each information type.
 String formatSense(IWiktionarySense sense)
          Returns a string representation of the given word sense using separate prefixed lines for each information type.
static WiktionaryFormatter instance()
          Returns the static singleton reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WiktionaryFormatter

public WiktionaryFormatter()
Method Detail

instance

public static WiktionaryFormatter instance()
Returns the static singleton reference.


formatHeader

public String formatHeader(IWiktionaryPage page)
Returns the ID and the title of the given page.


formatHeader

public String formatHeader(IWiktionaryEntry entry)
Returns the entry key, word, word language, and part of speech of the given entry.


formatHeader

public String formatHeader(IWiktionarySense sense)
Returns the sense key, word, sense index, and definition of the given word sense.


formatPage

public String formatPage(IWiktionaryPage page,
                         ILanguage... languages)
Returns a string representation of the given page using separate prefixed lines for each information type.


formatEntry

public String formatEntry(IWiktionaryEntry entry)
Returns a string representation of the given entry using separate prefixed lines for each information type.


formatSense

public String formatSense(IWiktionarySense sense)
Returns a string representation of the given word sense using separate prefixed lines for each information type.


formatLanguage

protected static String formatLanguage(ILanguage language)


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