de.tudarmstadt.ukp.jwktl.parser.components
Class InterwikiLinkHandler

java.lang.Object
  extended by de.tudarmstadt.ukp.jwktl.parser.components.BlockHandler
      extended by de.tudarmstadt.ukp.jwktl.parser.components.InterwikiLinkHandler
All Implemented Interfaces:
IBlockHandler

public class InterwikiLinkHandler
extends BlockHandler

Generic parser component for extracting interwiki links (e.g., [de:dog]) from the Wiktionary article pages.

Author:
Christian M. Meyer, Lizhen Qu

Field Summary
protected  String categoryHead
           
protected  String language
           
 
Fields inherited from class de.tudarmstadt.ukp.jwktl.parser.components.BlockHandler
labels
 
Constructor Summary
InterwikiLinkHandler(String categoryHead)
          Initializes the handler for the specified category head (e.g., "Category").
 
Method Summary
 boolean canHandle(String blockHeader)
          Return true if the handler requests to process the article constituent starting at the given line of text.
 void fillContent(ParsingContext context)
          This hotspot is invoked if the parser releases this handler.
 boolean processHead(String textLine, ParsingContext context)
          If the handler requested to process this constituent, this hotspot will be called for processing the section header of this article constituent.
 
Methods inherited from class de.tudarmstadt.ukp.jwktl.parser.components.BlockHandler
getLabels, processBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

categoryHead

protected String categoryHead

language

protected String language
Constructor Detail

InterwikiLinkHandler

public InterwikiLinkHandler(String categoryHead)
Initializes the handler for the specified category head (e.g., "Category"). The category head is required for distinugishing between categories and interwiki links.

Method Detail

canHandle

public boolean canHandle(String blockHeader)
Description copied from interface: IBlockHandler
Return true if the handler requests to process the article constituent starting at the given line of text.

Specified by:
canHandle in interface IBlockHandler
Overrides:
canHandle in class BlockHandler

processHead

public boolean processHead(String textLine,
                           ParsingContext context)
Description copied from interface: IBlockHandler
If the handler requested to process this constituent, this hotspot will be called for processing the section header of this article constituent. Return true if the handler requests to handle also the body of this constituent.

Specified by:
processHead in interface IBlockHandler
Overrides:
processHead in class BlockHandler

fillContent

public void fillContent(ParsingContext context)
Description copied from interface: IBlockHandler
This hotspot is invoked if the parser releases this handler. It can be used to store the extracted information to the Wiktionary data objects stored in the parsing context.

Specified by:
fillContent in interface IBlockHandler
Overrides:
fillContent in class BlockHandler


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