de.tudarmstadt.ukp.jwktl.parser.en.components
Class ENWordFormHandler

java.lang.Object
  extended by de.tudarmstadt.ukp.jwktl.parser.en.components.ENWordFormHandler
All Implemented Interfaces:
TemplateParser.ITemplateHandler

public class ENWordFormHandler
extends Object
implements TemplateParser.ITemplateHandler

Parser component for extracting inflected word forms from the English Wiktionary.

Author:
Christian M. Meyer

Field Summary
protected  String lemma
           
protected  List<IWiktionaryWordForm> wordForms
           
 
Constructor Summary
ENWordFormHandler(String lemma)
          Initializes the handler for the specified lemma.
 
Method Summary
protected  IWiktionaryWordForm createAdjectiveForm(String wordForm, GrammaticalDegree degree)
           
protected  IWiktionaryWordForm createFormPastParticiple(String wordForm)
           
protected  IWiktionaryWordForm createFormPresentParticiple(String wordForm)
           
protected  IWiktionaryWordForm createFormSimplePast(String wordForm)
           
protected  IWiktionaryWordForm createFormThirdPerson(String wordForm)
           
protected  IWiktionaryWordForm createPlural(String wordForm, String pluralParam)
           
protected  WiktionaryWordForm createWordForm(String wordForm)
           
 List<IWiktionaryWordForm> getWordForms()
          Returns a list of extracted word forms.
 String handle(TemplateParser.Template template)
          Invoked by the TemplateParser for every template that occurs in a text.
protected  void handleAdjectiveTemplate(TemplateParser.Template template)
           
protected  void handleNounTemplate(TemplateParser.Template template)
           
protected  void handleProperNounTemplate(TemplateParser.Template template)
           
protected  void handleVerbTemplate(TemplateParser.Template template)
           
 void parse(String line)
          Start parsing the specified text for inflected word forms.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wordForms

protected List<IWiktionaryWordForm> wordForms

lemma

protected String lemma
Constructor Detail

ENWordFormHandler

public ENWordFormHandler(String lemma)
Initializes the handler for the specified lemma. The lemma is required since the inflection templates often defines only affixed that are to be added to the lemma.

Method Detail

handle

public String handle(TemplateParser.Template template)
Description copied from interface: TemplateParser.ITemplateHandler
Invoked by the TemplateParser for every template that occurs in a text. The parser replaces the template by the result of this method. If null is returned, no substitution is made, but the original template string remains in the text.

Specified by:
handle in interface TemplateParser.ITemplateHandler

handleNounTemplate

protected void handleNounTemplate(TemplateParser.Template template)

handleProperNounTemplate

protected void handleProperNounTemplate(TemplateParser.Template template)

handleVerbTemplate

protected void handleVerbTemplate(TemplateParser.Template template)

handleAdjectiveTemplate

protected void handleAdjectiveTemplate(TemplateParser.Template template)

createWordForm

protected WiktionaryWordForm createWordForm(String wordForm)

createPlural

protected IWiktionaryWordForm createPlural(String wordForm,
                                           String pluralParam)

createFormThirdPerson

protected IWiktionaryWordForm createFormThirdPerson(String wordForm)

createFormPresentParticiple

protected IWiktionaryWordForm createFormPresentParticiple(String wordForm)

createFormSimplePast

protected IWiktionaryWordForm createFormSimplePast(String wordForm)

createFormPastParticiple

protected IWiktionaryWordForm createFormPastParticiple(String wordForm)

createAdjectiveForm

protected IWiktionaryWordForm createAdjectiveForm(String wordForm,
                                                  GrammaticalDegree degree)

parse

public void parse(String line)
Start parsing the specified text for inflected word forms. The extracted forms can be accessed using getWordForms() once all lines have been parsed.


getWordForms

public List<IWiktionaryWordForm> getWordForms()
Returns a list of extracted word forms.



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