cz.cuni.mff.procasor.core.helper
Class WordHelper

java.lang.Object
  extended bycz.cuni.mff.procasor.core.helper.WordHelper

public class WordHelper
extends java.lang.Object

Class with static methods for work with Word class.

Author:
michal

Field Summary
static int CONDITION_LABEL
          Constant
static int GOTO_TARGET
          Constant
static java.lang.String[] GUI_WORD_TYPES
          Type of words to be shown in GUI
static int INDIRECT_OBJECT
          Constant
static int NOT_IMPORTANT
          Constant
static int REPRESENTATIVE_OBJECT
          Constant
static int SUBJECT
          Constant
static int VERB
          Constant
 
Method Summary
static Word createWord(int index, java.lang.String word, java.lang.String lemma, java.lang.String pos)
          Returns a new Word object with given parameters
static java.lang.String getGuiIdentifesAs(Word word)
          Returns identifies as for showing in gui.
static int getWordIdentifiedAs(Word w)
          Gets the words role identified by the analyser.
static void setWordIdentifiedAs(Word w, int role)
          Sets the words identified role in sentence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_IMPORTANT

public static final int NOT_IMPORTANT
Constant

See Also:
Constant Field Values

SUBJECT

public static final int SUBJECT
Constant

See Also:
Constant Field Values

INDIRECT_OBJECT

public static final int INDIRECT_OBJECT
Constant

See Also:
Constant Field Values

VERB

public static final int VERB
Constant

See Also:
Constant Field Values

REPRESENTATIVE_OBJECT

public static final int REPRESENTATIVE_OBJECT
Constant

See Also:
Constant Field Values

GOTO_TARGET

public static final int GOTO_TARGET
Constant

See Also:
Constant Field Values

CONDITION_LABEL

public static final int CONDITION_LABEL
Constant

See Also:
Constant Field Values

GUI_WORD_TYPES

public static final java.lang.String[] GUI_WORD_TYPES
Type of words to be shown in GUI

Method Detail

createWord

public static Word createWord(int index,
                              java.lang.String word,
                              java.lang.String lemma,
                              java.lang.String pos)
Returns a new Word object with given parameters

Parameters:
index - words index in sentence
word - actual form of the word
lemma - lemma of the word
pos - pos of the word
Returns:
new Word filled with given information

setWordIdentifiedAs

public static void setWordIdentifiedAs(Word w,
                                       int role)
Sets the words identified role in sentence. Converts given role constant to a string - strings are used internally

Parameters:
w - the word
role - role to be set. Should be a constant defined in WordHelper class

getWordIdentifiedAs

public static int getWordIdentifiedAs(Word w)
Gets the words role identified by the analyser. Returns the role as an integer, comparable to constants defined in WordHelper class

Parameters:
w - the word
Returns:
word's role

getGuiIdentifesAs

public static java.lang.String getGuiIdentifesAs(Word word)
Returns identifies as for showing in gui.

Parameters:
word - word which types is required
Returns:
type of the word to be shown in GUI