de.tudarmstadt.ukp.jwktl.parser.en.components
Class ENWordFormHandler
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
wordForms
protected List<IWiktionaryWordForm> wordForms
lemma
protected String lemma
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.
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.