de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.util
Class WikiWord

java.lang.Object
  extended by de.tudarmstadt.ukp.jwktl.parser.ru.wikokit.base.wikt.util.WikiWord

public class WikiWord
extends Object

Word in a Wiktionary with wikilink and additional tag or comment, e.g. a word from a list of Synonyms or Translations, or definition (meaning).


Constructor Summary
WikiWord(String _word_link, String _word_visible, ContextLabel[] _labels)
          Initialize and fill WikiWord structure.
 
Method Summary
static WikiWord[] getWikiWords(String page_title, StringBuffer text)
          Extract wiki links (word_link and word_visible) from wiki texts.
 String getWordLink()
          Gets wiki link word (lemma).
 String getWordVisible()
          Gets visible word.
static StringBuffer parseDoubleBrackets(String page_title, StringBuffer text)
          Removes and expands wiki links in wiki texts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikiWord

public WikiWord(String _word_link,
                String _word_visible,
                ContextLabel[] _labels)
Initialize and fill WikiWord structure.

Parameters:
_word_link - internal wiki link, e.g. "run" in [[run]]ning
_word_visible - visible wiki word, e.g. "running" in [[run]]ning
_labels -
Method Detail

getWordVisible

public String getWordVisible()
Gets visible word.


getWordLink

public String getWordLink()
Gets wiki link word (lemma).


parseDoubleBrackets

public static StringBuffer parseDoubleBrackets(String page_title,
                                               StringBuffer text)
Removes and expands wiki links in wiki texts.
 Expands wiki links by removing brackets. There are two cases:
 (1) remove brackets, e.g. [[run]] -> run and
 (2) [[run|running]] -> running, or [[Russian language|Russian]] -> Russian,
 i.e. the visible (to reader) words will remain.

 It is recommended to call StringUtil.escapeCharDollarAndBackslash(text)
 before this function.
 This is simplified versions of parseDoubleBrackets.

Parameters:
page_title - word which are described in this article 'text'
text - source wikified definition text See also WikiParser.parseDoubleBrackets.

getWikiWords

public static WikiWord[] getWikiWords(String page_title,
                                      StringBuffer text)
Extract wiki links (word_link and word_visible) from wiki texts. There are the visible to reader words (word_visible) and internal links (word_link).
 There are cases:
 (1) [[run]] => two words [run, run],         remove brackets
 (2) [[run]]ing => two words [run, runing]    extract, remove brackets
 (3) [[run|running]] => two words [run, running],
     or [[Russian language|Russian]] => [Russian language, Russian].
 

Parameters:
page_title - word which are described in this article 'text'
text - source wikified definition text


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