Class Toolbox

java.lang.Object
  extended byToolbox

public class Toolbox
extends java.lang.Object

A small class prividing necessary tools.

Author:
Arthur Laub Arthur.Laub@urz.uni-hd.de Project: Kölschifier.

Constructor Summary
Toolbox()
           
 
Method Summary
static java.lang.String get_firstx_chars(java.lang.String input, int number_of_chars)
          get_firstx_chars seperates the first x chars of an input String.
static java.lang.String get_lastx_chars(java.lang.String lemma, int number_of_chars)
          get_lastx_chars checks the Auslaut of a Word.
static int getSubjektPPER(java.util.ListIterator liit)
          findSubjektPPER searches for a subject in a sentence.
static java.lang.String getSuffix(java.lang.String input, java.lang.String lemma)
          checkSuffix analyses the suffix of a word.
static boolean isWithAblaut(java.lang.String infinitiv, java.lang.String input)
          This method checks the existens of a German Ablaut.
static boolean isWithUml(java.lang.String input, java.lang.String lemma)
          withUml checks wheter there is an Umlaut in a Word or not.
static int lookAheadNomenGenus(java.util.ListIterator li)
          lookAheadNomenGenus searches for a nomen ahead of a word and returns the genus of the found nomen.
static java.lang.String replace(java.lang.String textStr, java.lang.String oldStr, java.lang.String newStr)
          This method is copied out of the "Java Codebook" This method replace a substring with a new substring.
static java.lang.String setUml(java.lang.String text)
          makeUml changes every Vocal [A, O, U] in a text into its corresponding umlaut [Ä, Ö, Ü]
static boolean toInt_check(int to_int, Word word)
          This method rechecks every entry changed to int.
static int toInt_declination_pattern(java.lang.String decclination_pattern)
          This method transforms the data of declination-pattern saved as String into the corresponding integer value.
static int toInt_genus(java.lang.String genus)
          This method transforms the data of person saved as String into the corresponding integer value.
static int toInt_person(java.lang.String person)
          This method transforms the data of person saved as String into the corresponding integer value.
static int toInt_tempus(java.lang.String tempus)
          This method transforms the data of tempus saved as String into the corresponding integer value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Toolbox

public Toolbox()
Method Detail

get_firstx_chars

public static final java.lang.String get_firstx_chars(java.lang.String input,
                                                      int number_of_chars)
get_firstx_chars seperates the first x chars of an input String.

Parameters:
input - String
number_of_chars - int
Returns:
The first number_of_chars of the input-String

get_lastx_chars

public static final java.lang.String get_lastx_chars(java.lang.String lemma,
                                                     int number_of_chars)
get_lastx_chars checks the Auslaut of a Word. The length of the returned chars is flexible. It is determined by the numberofauslaut.

Parameters:
lemma - (the text-String)
number_of_chars - (the number of chars to be returned)
Returns:
String auslaut

getSubjektPPER

public static final int getSubjektPPER(java.util.ListIterator liit)
findSubjektPPER searches for a subject in a sentence. It is needed to verify the sentence-verb. Therefore the ArrayList of words is searched through. CAREFUL: This method isn't working correctly! It needs debugging

Parameters:
liit - (listIterator for the words)
Returns:
the exact person (e.g. Cons.SG1P - NOT: Cons.SINGULAR, Cons.PLURAL) or the failure Cons.LEER

getSuffix

public static final java.lang.String getSuffix(java.lang.String input,
                                               java.lang.String lemma)
checkSuffix analyses the suffix of a word.

Parameters:
input - (normally the highgerman input like "Wörter")
lemma - (normally the highgerman lemma like "Wort")
Returns:
a String of the found suffix (in this example: "er")

isWithAblaut

public static final boolean isWithAblaut(java.lang.String infinitiv,
                                         java.lang.String input)
This method checks the existens of a German Ablaut. Make sure, that the infinitiv cames first ans the input (given by the user) comes second!

Parameters:
input - (normally the Highgerman input [trug]
Returns:
true, when the Ablaut-phaenomena is found (true with this example)

isWithUml

public static final boolean isWithUml(java.lang.String input,
                                      java.lang.String lemma)
withUml checks wheter there is an Umlaut in a Word or not.

Parameters:
input - (normally the highgerman input like "Wörter")
lemma - (normally the highgerman lemma like "Wort")
Returns:
true or false (in this example: true)

lookAheadNomenGenus

public static final int lookAheadNomenGenus(java.util.ListIterator li)
lookAheadNomenGenus searches for a nomen ahead of a word and returns the genus of the found nomen. The starting point of the search is marked by the ListIterator (ArrayList of words). Normally this method is called while generating an adjective. You have to know the genus of the followig nomen to get the right ending of the adjective.

Parameters:
li - (ListIterator of the ArrayList of words)
Returns:
genus of nomen (int - like Cons.FEMININ)

replace

public static java.lang.String replace(java.lang.String textStr,
                                       java.lang.String oldStr,
                                       java.lang.String newStr)
This method is copied out of the "Java Codebook" This method replace a substring with a new substring.

Parameters:
textStr - (the String to be modified)
oldStr - (the substring to be replaced)
newStr - (the new substring)

setUml

public static final java.lang.String setUml(java.lang.String text)
makeUml changes every Vocal [A, O, U] in a text into its corresponding umlaut [Ä, Ö, Ü]

Parameters:
text -
Returns:
new text-String with umlauts

toInt_check

public static boolean toInt_check(int to_int,
                                  Word word)
This method rechecks every entry changed to int. If the change failed it states which word was coded wrong in the dictionary. If a word was coded wrong in the dictionary the translationprocess is stopped.

Parameters:
to_int - (a changed String to int value)
word - (necessery to find the bad coded dictionary entry)
Returns:
false, if the String to int convertion went wrong.

toInt_declination_pattern

public static int toInt_declination_pattern(java.lang.String decclination_pattern)
This method transforms the data of declination-pattern saved as String into the corresponding integer value.

Returns:
the deklination class as integer (in the form of Cons.A1, Cons.A2, etc). For further Information see the Cons class.

toInt_genus

public static int toInt_genus(java.lang.String genus)
This method transforms the data of person saved as String into the corresponding integer value.

Parameters:
genus - as String
Returns:
person as integer (in the form of Cons.MASKULIN, Cons.FEMININ, Cons.NEUTRAL). For further Information see the Cons class.

toInt_person

public static int toInt_person(java.lang.String person)
This method transforms the data of person saved as String into the corresponding integer value.

Parameters:
person - as String
Returns:
person as integer (in the form of Cons.SG1P, Cons.SINGULAR, etc). For further Information see the Cons class.

toInt_tempus

public static int toInt_tempus(java.lang.String tempus)
This method transforms the data of tempus saved as String into the corresponding integer value.

Parameters:
tempus -
Returns:
person as integer (in the form of Cons.PRESENT, Cons.PAST, etc). For further Information see the Cons class.