de.tudarmstadt.ukp.jwktl.api.util
Class TemplateParser

java.lang.Object
  extended by de.tudarmstadt.ukp.jwktl.api.util.TemplateParser

public class TemplateParser
extends Object

Static helper class for parsing wiki markup text that contains templates. The template parser identifies templates in the given wiki text and replaces them as specified by a TemplateParser.ITemplateHandler.

Author:
Christian M. Meyer

Nested Class Summary
static class TemplateParser.EtymologyTemplateHandler
          Implementation of an TemplateParser.ITemplateHandler for parsing etymology information in Wiktionary.
static interface TemplateParser.ITemplateHandler
          Interface that is expected by the TemplateParser.
static class TemplateParser.Template
          A template is a reusable pattern that can be added to any wiki page.
 
Constructor Summary
TemplateParser()
           
 
Method Summary
static String parse(String wikiText, TemplateParser.ITemplateHandler handler)
          Parse the given wiki text and substitute each template in the text using the specified template handler.
static TemplateParser.Template parseTemplate(String templateText)
          Creates a TemplateParser.Template from the given text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateParser

public TemplateParser()
Method Detail

parse

public static String parse(String wikiText,
                           TemplateParser.ITemplateHandler handler)
Parse the given wiki text and substitute each template in the text using the specified template handler.


parseTemplate

public static TemplateParser.Template parseTemplate(String templateText)
Creates a TemplateParser.Template from the given text. That is, the template's name and parameters are extracted from the text and stored in the template instance.



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