de.tudarmstadt.ukp.jwktl.parser.util
Class DumpInfo

java.lang.Object
  extended by de.tudarmstadt.ukp.jwktl.parser.util.DumpInfo
All Implemented Interfaces:
IDumpInfo

public class DumpInfo
extends Object
implements IDumpInfo

Default implementation of the IDumpInfo interface.

Author:
Christian M. Meyer

Field Summary
protected  File dumpFile
           
protected  ILanguage dumpLanguage
           
protected  Set<String> namespaces
           
protected  IWiktionaryDumpParser parser
           
protected  int processedPages
           
 
Constructor Summary
DumpInfo(File dumpFile, IWiktionaryDumpParser parser)
          Instanciate the dump info object for the given dump file and parser object.
 
Method Summary
 void addNamespace(String namespace)
          Add the given namespace to the list of namespaces defined for this dump file.
 File getDumpFile()
          Returns the current Wiktionary XML dump file, which is being parsed.
 ILanguage getDumpLanguage()
          Returns the language of the Wiktionary edition this dump file belongs to.
 Set<String> getNamespaces()
          Returns a set containing all namespaces registered in the siteinfo header of the XML dump file.
 IWiktionaryDumpParser getParser()
          Returns the Wiktionary dump parser instance that maintains this dump info object.
 int getProcessedPages()
          Returns the number of pages in the dump file that have been processed.
 boolean hasNamespace(String namespace)
          Returns true if the specified namespace has been defined within the siteinfo header of the XML dump file.
 void incrementProcessedPages()
          Increment the number of processed pages by one.
 void reset()
          Reset the dump information, such the number of processed pages.
 void setDumpLanguage(ILanguage dumpLanguage)
          Assign the specified dump language.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dumpFile

protected File dumpFile

dumpLanguage

protected ILanguage dumpLanguage

namespaces

protected Set<String> namespaces

processedPages

protected int processedPages

parser

protected IWiktionaryDumpParser parser
Constructor Detail

DumpInfo

public DumpInfo(File dumpFile,
                IWiktionaryDumpParser parser)
Instanciate the dump info object for the given dump file and parser object.

Method Detail

reset

public void reset()
Description copied from interface: IDumpInfo
Reset the dump information, such the number of processed pages. This is to be called before a new dump file is being processed. Users of this interface should normally not invoke this method.

Specified by:
reset in interface IDumpInfo

getDumpFile

public File getDumpFile()
Description copied from interface: IDumpInfo
Returns the current Wiktionary XML dump file, which is being parsed.

Specified by:
getDumpFile in interface IDumpInfo

getDumpLanguage

public ILanguage getDumpLanguage()
Description copied from interface: IDumpInfo
Returns the language of the Wiktionary edition this dump file belongs to. The language is automatically determined from the base URL of the Wiktionary edition.

Specified by:
getDumpLanguage in interface IDumpInfo

setDumpLanguage

public void setDumpLanguage(ILanguage dumpLanguage)
Assign the specified dump language.


getNamespaces

public Set<String> getNamespaces()
Description copied from interface: IDumpInfo
Returns a set containing all namespaces registered in the siteinfo header of the XML dump file.

Specified by:
getNamespaces in interface IDumpInfo

hasNamespace

public boolean hasNamespace(String namespace)
Description copied from interface: IDumpInfo
Returns true if the specified namespace has been defined within the siteinfo header of the XML dump file.

Specified by:
hasNamespace in interface IDumpInfo

addNamespace

public void addNamespace(String namespace)
Add the given namespace to the list of namespaces defined for this dump file.


getProcessedPages

public int getProcessedPages()
Description copied from interface: IDumpInfo
Returns the number of pages in the dump file that have been processed.

Specified by:
getProcessedPages in interface IDumpInfo

incrementProcessedPages

public void incrementProcessedPages()
Increment the number of processed pages by one.


getParser

public IWiktionaryDumpParser getParser()
Description copied from interface: IDumpInfo
Returns the Wiktionary dump parser instance that maintains this dump info object.

Specified by:
getParser in interface IDumpInfo


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