Skip to content

Commit

Permalink
dkpro#53 - Fixing javadoc warnings
Browse files Browse the repository at this point in the history
- Fixing de.tudarmstadt.ukp.jwktl.api.entry
  • Loading branch information
highsource committed Aug 1, 2018
1 parent 72fff63 commit dbf0b30
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 18 deletions.
17 changes: 13 additions & 4 deletions src/main/java/de/tudarmstadt/ukp/jwktl/api/entry/WikiString.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public class WikiString implements IWikiString {
// For persistence.
public WikiString() {}

/** Create a new wiki string for the given wiki markup text. */
/** Create a new wiki string for the given wiki markup text.
* @param text text as wiki markup.
*/
public WikiString(final String text) {
this.text = text;
}
Expand All @@ -49,12 +51,16 @@ public String getText() {
return text;
}

/** Assign the given text as the new wiki markup text. */
/** Assign the given text as the new wiki markup text.
* @param text text as wiki markup.
*/
public void setText(final String text) {
this.text = text;
}

/** @see #getText() */
/** @see #getText()
* @return The result of <code>getText()</code>.
*/
public String getTextIncludingWikiMarkup() {
return getText();
}
Expand Down Expand Up @@ -139,7 +145,10 @@ public String toString() {

/** Transforms the given wiki markup text into a plain text version.
* That is, wiki links, templates, and typographic markers are being
* removed or substituted in order to obtain a human-readable text. */
* removed or substituted in order to obtain a human-readable text.
* @param wikiText wiki markup text.
* @return Plain text version of the given wiki markup text.
*/
public static String makePlainText(final String wikiText) {
String result = wikiText;
result = result.replace("\t", " ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,19 @@ public WiktionaryEntry() {

/** Initialize the entry using the given Wiktionary page. This is necessary
* to initialize the back references to the parent page, which are not
* explicitly stored in the database. */
* explicitly stored in the database.
* @param page parent page.
*/
public void init(final WiktionaryPage page) {
this.page = page;
this.pageId = page.getId();
for (WiktionarySense sense : senses)
sense.init(this);
}

/** Factory method for creating a new word sense. */
/** Factory method for creating a new word sense.
* @return New word sense initialized with this entry.
*/
public WiktionarySense createSense() {
WiktionarySense result = new WiktionarySense();
result.init(this);
Expand All @@ -103,7 +107,9 @@ public long getId() {
return id;
}

/** Assign the specified entry ID. */
/** Assign the specified entry ID.
* @param id numeric ID of the entry.
*/
public void setId(long id) {
this.id = id;
}
Expand Down Expand Up @@ -134,7 +140,9 @@ public String getHeader() {
}

/** Assigns the given header text (i.e., the first headline of the entry,
* which normally correponds to a word's lemma). */
* which normally correponds to a word's lemma).
* @param header header of the entry.
*/
public void setHeader(final String header) {
this.header = header;
}
Expand All @@ -153,7 +161,9 @@ public ILanguage getWordLanguage() {
return wordLanguage;
}

/** Assigns the given word language. */
/** Assigns the given word language.
* @param wordLanguage language of the word.
*/
public void setWordLanguage(final ILanguage wordLanguage) {
this.wordLanguage = wordLanguage;
if (wordLanguage != null)
Expand All @@ -168,7 +178,9 @@ public List<PartOfSpeech> getPartsOfSpeech() {
return partsOfSpeech;
}

/** Adds the given part of speech to the list of part of speech tags. */
/** Adds the given part of speech to the list of part of speech tags.
* @param partOfSpeech part of speech.
*/
public void addPartOfSpeech(final PartOfSpeech partOfSpeech) {
partsOfSpeech.add(partOfSpeech);
}
Expand All @@ -184,7 +196,9 @@ public List<GrammaticalGender> getGenders() {
return genders;
}

/** Adds the given grammatical gender to the list of genders. */
/** Adds the given grammatical gender to the list of genders.
* @param gender grammatical gender.
*/
public void addGender(final GrammaticalGender gender) {
if (genders == null)
genders = new LinkedList<>();
Expand All @@ -196,7 +210,9 @@ public IWikiString getWordEtymology() {
return etymology;
}

/** Assigns the given etymology text. */
/** Assigns the given etymology text.
* @param etymology etymology of the word.
*/
public void setWordEtymology(final IWikiString etymology) {
this.etymology = etymology;
}
Expand All @@ -209,13 +225,18 @@ public String getEntryLinkType() {
return entryLinkType;
}

/** Assigns the given entry link. */
/** Assigns the given entry link.
* @param entryLink entry link.
* @param entryLinkType type of the entry link.
*/
public void setEntryLink(final String entryLink, final String entryLinkType) {
this.entryLink = entryLink;
this.entryLinkType = entryLinkType;
}

/** Adds the given pronunciation. */
/** Adds the given pronunciation.
* @param pronunciation pronunciation.
*/
public void addPronunciation(final IPronunciation pronunciation) {
if (pronunciations == null)
pronunciations = new ArrayList<>();
Expand All @@ -226,7 +247,9 @@ public List<IPronunciation> getPronunciations() {
return pronunciations;
}

/** Adds the given word form. */
/** Adds the given word form.
* @param wordForm word form.
*/
public void addWordForm(final IWiktionaryWordForm wordForm) {
if (wordForms == null)
wordForms = new ArrayList<>();
Expand All @@ -240,7 +263,9 @@ public List<IWiktionaryWordForm> getWordForms() {

// -- Senses --

/** Add the given sense to the list of senses. */
/** Add the given sense to the list of senses.
* @param sense sense.
*/
public void addSense(final WiktionarySense sense) {
sense.setIndex(senses.size());
senses.add(sense);
Expand Down Expand Up @@ -289,12 +314,16 @@ public List<? extends IWiktionarySense> getSenses(boolean includeUnassignedSense
return senses.subList(1, senses.size());
}

/** Internal interface that is used by the parsers. */
/** Internal interface that is used by the parsers.
* @return Senses of the entry.
*/
public List<WiktionarySense> senses() {
return senses;
}

/** Identify the first sense of this entry with the given marker. */
/** @return The first sense of this entry with the given marker.
* @param marker marker.
*/
public WiktionarySense findSenseByMarker(final String marker) {
for (WiktionarySense sense : senses)
if (marker.equals(sense.getMarker()))
Expand Down

0 comments on commit dbf0b30

Please sign in to comment.