Skip to content

Commit

Permalink
dkpro#58 Gender for singular German word forms
Browse files Browse the repository at this point in the history
  - Added Javadocs
  • Loading branch information
highsource committed Aug 11, 2018
1 parent 6871923 commit bc97e73
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,25 @@ public void reset() {

protected DEGenderText[] genera = new DEGenderText[4];

/**
* Returns genus by index.
* @param index index of the genus, must be between 1 and 4.
* @return Genus by index or <code>null</code> if genus by this index was not set yet.
* @throws IllegalArgumentException If index is not between 1 and 4.
*/
DEGenderText getGenusByIndex(int index) {
if (index < 1 || index > 4) {
throw new IllegalArgumentException("Genus index must be 1, 2, 3 or 4.");
}
return genera[index - 1];
}

/**
* Sets genus by index
* @param genderText genus.
* @param index index of the genus, must be between 1 and 4.
* @throws IllegalArgumentException If index is not between 1 and 4.
*/
void setGenusByIndex(DEGenderText genderText, Integer index) {
if (index < 1 || index > 4) {
throw new IllegalArgumentException("Genus index must be 1, 2, 3 or 4.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,48 @@

import de.tudarmstadt.ukp.jwktl.api.entry.WiktionaryWordForm;

/**
* Implementation of this interface are used to handle parameters of templates.
*
* @author Alexey Valikov
*/
public interface ITemplateParameterHandler {


/**
* Parameter handlers may keep state while processing Wiktionary entries. This
* method will be called for each new Wiktionary entry before handling.
*/
public void reset();

/**
* Checks if this handler can handle the given template parameter.
*
* @param label
* parameter label.
* @param value
* parameter value, may be <code>null</code>.
* @param wordForm
* word form.
* @param context
* parsing context.
* @return <code>true<code> if this handler can handle the given parameter,
* <code>false<code> otherwise.
*/
public boolean canHandle(String label, String value, WiktionaryWordForm wordForm, ParsingContext context);

/**
* Handles the given parameter. This should only be called if
* {@see #canHandle(String, String, WiktionaryWordForm, ParsingContext)}
* returned true.
*
* @param label
* parameter label.
* @param value
* parameter value, may be <code>null</code>.
* @param wordForm
* word form.
* @param context
* parsing context.
*/
public void handle(String label, String value, WiktionaryWordForm wordForm, ParsingContext context);
}

0 comments on commit bc97e73

Please sign in to comment.