rita
Class RiConjugator

java.lang.Object
  extended by rita.RiObject
      extended by rita.RiConjugator
All Implemented Interfaces:
processing.core.PConstants, RiConstants

public class RiConjugator
extends RiObject
implements RiConstants

Handles verb conjugation based on tense, person, number for simple, passive, progressive, and perfect forms. An example:

    RiConjugator rc = new RiConjugator(this);    
    rc.setNumber("plural");
    rc.setPerson("2nd");
    rc.setTense("past");      
    rc.setPassive(true);
    rc.setPerfect(true);
    rc.setProgressive(false);
    String c = rc.conjugate("announce");

Note: this implementation is based closely on rules found in the MorphG package, further described here:

Minnen, G., Carroll, J., and Pearce, D. (2001). Applied Morphological Processing of English. Natural Language Engineering 7(3): 207--223.


Field Summary
static boolean DBUG
           
 
Fields inherited from interface rita.support.RiConstants
BEHAVIOR_COMPLETED, BOUNDING_BOX_ALPHA, BRILL_POS_TAGGER, EASE_IN, EASE_IN_CUBIC, EASE_IN_EXPO, EASE_IN_OUT, EASE_IN_OUT_CUBIC, EASE_IN_OUT_EXPO, EASE_IN_OUT_QUARTIC, EASE_IN_OUT_SINE, EASE_IN_QUARTIC, EASE_IN_SINE, EASE_OUT, EASE_OUT_CUBIC, EASE_OUT_EXPO, EASE_OUT_QUARTIC, EASE_OUT_SINE, ESS, FADE_COLOR, FADE_IN, FADE_OUT, FADE_TO_TEXT, FIRST_PERSON, FUTURE_TENSE, ID, LERP, LINEAR, MAXENT_POS_TAGGER, MINIM, MOVE, MUTABLE, PAST_TENSE, PHONEME_BOUNDARY, PHONEMES, PLING_STEMMER, PLURAL, PORTER_STEMMER, POS, PRESENT_TENSE, SCALE_TO, SECOND_PERSON, SENTENCE_BOUNDARY, SINGULAR, SONIA, SPEECH_COMPLETED, STRESSES, SYLLABLE_BOUNDARY, SYLLABLES, TEXT, TEXT_ENTERED, THIRD_PERSON, TIMER, TIMER_COMPLETED, TIMER_TICK, TOKENS, UNKNOWN, WORD_BOUNDARY
 
Fields inherited from interface processing.core.PConstants
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MULTIPLY, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z
 
Constructor Summary
RiConjugator()
           
RiConjugator(processing.core.PApplet pApplet)
           
 
Method Summary
 java.lang.String conjugate()
          Conjugates the current head verb based on the state of the conjugator
 java.lang.String conjugate(int numberConstant, int personConstant, int tenseConstant, java.lang.String verb)
          A convenience method to set number, person, & tense, then conjugate, all in one call
 java.lang.String conjugate(java.lang.String verb)
          Conjugates the verb based on the current state of the conjugator
 java.lang.String conjugate(java.lang.String number, java.lang.String person, java.lang.String tense, java.lang.String verb)
          A convenience method to set number, person, & tense, then conjugate, all in one call
 java.lang.String[] conjugateAll(java.lang.String verb)
          Returns all possible conjugations of the specified verb (contains duplicates)
 void conjugateAll(java.lang.String verb, java.util.Set result)
          Returns all unique possible conjugations of the specified verb
 java.lang.String getNumber()
          Returns a String representing the current number from one of (singular, plural)
 java.lang.String getPast(java.lang.String v)
           
 java.lang.String getPast(java.lang.String verb, int pers, int numb)
           
 java.lang.String getPastParticiple(java.lang.String v)
           
 java.lang.String getPerson()
          Returns a String representing the current person from one of (first, second, third)
 java.lang.String getPresent(java.lang.String baseForm, int person, int number)
          Processes the baseform of this Verb to obtain the present tense form for a specific Person and Number combination.
 java.lang.String getPresentParticiple(java.lang.String v)
           
 java.lang.String getTense()
          Returns a String representing the current tense from one of (past, present, future)
 java.lang.String getVerb()
          Returns the current verb
 boolean isPassive()
          Returns whether the conjugation will use passive tense
 boolean isPerfect()
          Returns whether the conjugation will use perfect tense
 boolean isProgressive()
          Returns whether the conjugation will use progressive tense
static void main(java.lang.String[] args)
           
 void setNumber(int numberConstant)
          Sets the number for the conjugation, from one of the constants: [SINGULAR, PLURAL]
 void setNumber(java.lang.String numberString)
          Sets the number from one of (singular, plural)
 void setPassive(boolean passive)
          Sets whether the conjugation should use passive tense
 void setPerfect(boolean perfect)
          Sets whether the conjugation should use perfect tense
 void setPerson(int personConstant)
          Sets the person for the conjugation, from one of the constants: [FIRST_PERSON, SECOND_PERSON, THIRD_PERSON]
 void setPerson(java.lang.String personString)
          Sets the number from one of (first, second, third)
 void setProgressive(boolean progressive)
          Sets whether the conjugation should use progressive tense
 void setState(int numberConstant, int personConstant, int tenseConstant)
          A convenience method to set number, person, & tense in one call
 void setState(java.lang.String number, java.lang.String person, java.lang.String tense)
          A convenience method to set number, person, & tense in one call
 void setTense(int tenseConstant)
          Sets the tense for the conjugation, from one of the constants: [PAST_TENSE, PRESENT_TENSE, FUTURE_TENSE]
 void setTense(java.lang.String tenseString)
          Sets the number from one of (past, present, future)
 void setVerb(java.lang.String verb)
          Sets the verb to be conjugated
 java.lang.String toString()
           
 
Methods inherited from class rita.RiObject
dispose, getId, getPApplet, nextId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DBUG

public static final boolean DBUG
See Also:
Constant Field Values
Constructor Detail

RiConjugator

public RiConjugator()
Invisible:

RiConjugator

public RiConjugator(processing.core.PApplet pApplet)
Method Detail

getPresent

public java.lang.String getPresent(java.lang.String baseForm,
                                   int person,
                                   int number)
Processes the baseform of this Verb to obtain the present tense form for a specific Person and Number combination. The default behaviour is to assume that all present tense forms except for 3rd person singular are identical to the baseform. This is only every not the case with the verb be which has different forms for different person and number values (am, are etc).


conjugate

public java.lang.String conjugate()
Conjugates the current head verb based on the state of the conjugator

See Also:
setVerb(String), setNumber(int), setPerson(int), setTense(int), setPassive(boolean), setProgressive(boolean), setPerfect(boolean)

conjugate

public java.lang.String conjugate(java.lang.String verb)
Conjugates the verb based on the current state of the conjugator

See Also:
setNumber(int), setPerson(int), setTense(int), setPassive(boolean), setProgressive(boolean), setPerfect(boolean)

getPast

public java.lang.String getPast(java.lang.String verb,
                                int pers,
                                int numb)

getPast

public java.lang.String getPast(java.lang.String v)

getPresentParticiple

public java.lang.String getPresentParticiple(java.lang.String v)

getPastParticiple

public java.lang.String getPastParticiple(java.lang.String v)

setVerb

public void setVerb(java.lang.String verb)
Sets the verb to be conjugated


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setNumber

public void setNumber(int numberConstant)
Sets the number for the conjugation, from one of the constants: [SINGULAR, PLURAL]


setPerson

public void setPerson(int personConstant)
Sets the person for the conjugation, from one of the constants: [FIRST_PERSON, SECOND_PERSON, THIRD_PERSON]


setTense

public void setTense(int tenseConstant)
Sets the tense for the conjugation, from one of the constants: [PAST_TENSE, PRESENT_TENSE, FUTURE_TENSE]


getTense

public java.lang.String getTense()
Returns a String representing the current tense from one of (past, present, future)


getPerson

public java.lang.String getPerson()
Returns a String representing the current person from one of (first, second, third)


getNumber

public java.lang.String getNumber()
Returns a String representing the current number from one of (singular, plural)


setNumber

public void setNumber(java.lang.String numberString)
Sets the number from one of (singular, plural)


setPerson

public void setPerson(java.lang.String personString)
Sets the number from one of (first, second, third)


setTense

public void setTense(java.lang.String tenseString)
Sets the number from one of (past, present, future)


setPassive

public void setPassive(boolean passive)
Sets whether the conjugation should use passive tense


setPerfect

public void setPerfect(boolean perfect)
Sets whether the conjugation should use perfect tense


setProgressive

public void setProgressive(boolean progressive)
Sets whether the conjugation should use progressive tense


setState

public void setState(java.lang.String number,
                     java.lang.String person,
                     java.lang.String tense)
A convenience method to set number, person, & tense in one call

Invisible:

setState

public void setState(int numberConstant,
                     int personConstant,
                     int tenseConstant)
A convenience method to set number, person, & tense in one call

Invisible:

conjugate

public java.lang.String conjugate(java.lang.String number,
                                  java.lang.String person,
                                  java.lang.String tense,
                                  java.lang.String verb)
A convenience method to set number, person, & tense, then conjugate, all in one call


conjugate

public java.lang.String conjugate(int numberConstant,
                                  int personConstant,
                                  int tenseConstant,
                                  java.lang.String verb)
A convenience method to set number, person, & tense, then conjugate, all in one call


isPassive

public boolean isPassive()
Returns whether the conjugation will use passive tense


isPerfect

public boolean isPerfect()
Returns whether the conjugation will use perfect tense


isProgressive

public boolean isProgressive()
Returns whether the conjugation will use progressive tense


getVerb

public java.lang.String getVerb()
Returns the current verb


conjugateAll

public void conjugateAll(java.lang.String verb,
                         java.util.Set result)
Returns all unique possible conjugations of the specified verb


conjugateAll

public java.lang.String[] conjugateAll(java.lang.String verb)
Returns all possible conjugations of the specified verb (contains duplicates)


main

public static void main(java.lang.String[] args)