Skip to content

Commit

Permalink
dkpro#66 Add inflection group to word form
Browse files Browse the repository at this point in the history
  - Added inflection group property to the word form interface
  • Loading branch information
highsource committed Aug 26, 2018
1 parent bc97e73 commit 03fb51e
Show file tree
Hide file tree
Showing 3 changed files with 233 additions and 209 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ public interface IWiktionaryWordForm {
/** Returns the {@link GrammaticalGender} of this word form or
* <code>null</code> if no gender is specified or applicable. */
GrammaticalGender getGender();

/**
* Returns the index of the inflection group this word form belong to.
* Semantics of this property may differ from language to language.
* Roughly speaking, inflection group corresponds to the column in
* the inflection table.
* @return Index of the inflection group, <code>-1<code> if there this word form
* does not belong to an inflection group.
*/
int getInflectionGroup();

/** Returns the {@link GrammaticalPerson} of this word form or
* <code>null</code> if no person is specified or applicable. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class WiktionaryWordForm implements IWiktionaryWordForm {
protected GrammaticalNumber grammaticalNumber;
protected GrammaticalCase grammaticalCase;
protected GrammaticalGender grammaticalGender;
protected int inflectionGroup = -1;
protected GrammaticalPerson grammaticalPerson;
protected GrammaticalTense grammaticalTense;
protected GrammaticalMood grammaticalMood;
Expand Down Expand Up @@ -93,6 +94,18 @@ public void setGender(final GrammaticalGender grammaticalGender) {
this.grammaticalGender = grammaticalGender;
}

@Override
public int getInflectionGroup() {
return this.inflectionGroup;
}

/** Assigns the given inflection group to this word form.
* @param inflectionGroup index of the inflection group.
*/
public void setInflectionGroup(int inflectionGroup) {
this.inflectionGroup = inflectionGroup;
}

public GrammaticalPerson getPerson() {
return grammaticalPerson;
}
Expand Down
Loading

0 comments on commit 03fb51e

Please sign in to comment.