|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrita.RiTa
public abstract class RiTa
A range of constants and (static) utility functions for the rita package
| Field Summary | |
|---|---|
static java.lang.String |
BN
|
static java.lang.String[] |
CLOSED_CLASS_WORDS
|
static java.lang.String |
COMMA
|
static int |
DEFAULT_SERVER_PORT
|
static java.lang.String |
DOT
|
static java.lang.String |
LINE_BREAK
|
static java.lang.String |
LINUX
|
static java.lang.String |
MAC
|
static java.lang.String |
OS_SLASH
|
static java.lang.String |
OS_UNDEFINED
|
static int |
port
|
static java.lang.String |
PUNCTUATION
|
static java.lang.String |
QQ
|
static java.lang.String |
SPC
|
static java.lang.String[] |
STOP_WORDS
|
static java.lang.String |
textEncoding
|
static java.lang.String |
VERSION
The current version number for the RiTa package. |
static java.lang.String |
WINDOWS
|
| 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, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MULTIPLY, NORMAL, 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, X, Y, Z |
| Constructor Summary | |
|---|---|
RiTa()
|
|
| Method Summary | |
|---|---|
static boolean |
allCaps(java.lang.String word)
Verifies all chars are are capital letters |
static boolean |
allLetters(java.lang.String[] words)
Verifies all characters in all words are lowercase letters |
static boolean |
allLowerCase(java.lang.String word)
Verifies all characters are lowercase & letters |
static boolean |
allLowerCase(java.lang.String[] words)
Verifies all characters in all (non-null) words are lowercase letters |
static java.util.List |
asList(char[] chars)
|
static java.util.List |
asList(float[] floats)
|
static java.util.List |
asList(int[] ints)
|
static java.util.List |
asList(long[] longs)
|
static java.util.List |
asList(java.lang.Object[] o)
|
static java.util.List |
asList(java.util.Set s)
|
static java.awt.image.BufferedImage |
captureScreen(java.lang.String outFileName)
Takes a screenshot of the specified width and height (starting in the upper left-hand corner) |
static java.awt.image.BufferedImage |
captureScreen(java.lang.String outFileName,
int width,
int height)
Takes a screenshot of the specified width and height (starting in the upper left-hand corner) |
static java.awt.image.BufferedImage |
captureScreen(java.lang.String outFileName,
int x,
int y,
int width,
int height)
Takes a screenshot of the specified width and height (starting at x,y), writes it to a JPG file, and returns the generated BufferedImage. |
static java.lang.String |
chomp(java.lang.String s)
Removes white-space and line breaks from start and end of String |
static float |
constrain(float amt,
float min,
float max)
|
static int |
constrain(int amt,
int min,
int max)
|
static boolean |
contains(java.lang.CharSequence word,
java.lang.CharSequence[] searches,
boolean ignoreCase)
Return true if any of the words in 'searches' are a substring of 'full' |
static boolean |
contains(java.lang.CharSequence word,
java.lang.CharSequence search,
boolean ignoreCase)
Return true if 'search' is a substring of 'full' |
static boolean |
contains(java.lang.Object[] array,
java.lang.Object item)
Returns true if array contains the item, else false |
static boolean |
contains(java.lang.String full,
char search)
|
static boolean |
contains(java.lang.String full,
char search,
boolean ignoreCase)
Returns true if 'search' is found in the String, else false. |
static boolean |
contains(java.lang.String full,
java.lang.String search)
|
static int |
count(java.lang.String input,
char toMatch)
counts the # of times char c appears in input |
static int |
count(java.lang.String input,
java.lang.String toMatch)
counts the # of times 'toMatch' appears in input |
static Xmlable |
create(processing.core.PApplet p,
java.lang.String xml)
Creates and returns an Xmlable from the contents of String xml
after calling the no-argument constructor. |
static Xmlable |
createFromFile(processing.core.PApplet p,
java.lang.String fileName)
Creates and returns an Xmlable from the XML contents of fileName
after calling the no-argument constructor. |
static java.lang.String |
cwd()
Returns a String holding the current working directory |
static java.lang.String |
decimalFormat(double d)
Returns a decimal formatted to one place, (eg. |
static void |
die(processing.core.PApplet papplet,
java.lang.String errStr)
|
static void |
disableServer()
Disables server processing for RiTa. |
static java.lang.Object |
dynamicCast(java.lang.Object toCast,
java.lang.Class iface)
Returns the passed in Object after dynamically casting it to the specified interface. |
static java.lang.Object |
dynamicCast(java.lang.Object toCast,
java.lang.Class[] ifaces)
Returns the passed in Object after dynamically casting it to the specified interfaces. Note: 'toCast' must be a an instance of a public class. |
static float |
elapsed()
Returns time since start of program as float (in seconds) |
static float |
elapsed(long start)
Returns time since start as float (in seconds) |
static java.lang.String |
elapsedStr()
Returns time since start of program as string, e.g., '4.33s' |
static java.lang.String |
elapsedStr(long start)
Returns time since start as string, e.g., '4.33s' |
static boolean |
endsWith(java.lang.String full,
char[] search)
|
static boolean |
endsWithPunctuation(java.lang.String input)
Returns true if 'input' ends with a punctuation character |
static boolean |
equals(java.util.List l1,
java.util.List l2)
Returns true if all elements of the 2 lists are equal, and have the same ordering, testing the elements in each with Object.equals(Object) |
static java.lang.String |
escapeXml(java.lang.String string)
|
static java.lang.String |
exceptionToString(java.lang.Throwable e)
Returns a String representation of Exception and stacktrace (only elements with line numbers) |
static java.lang.reflect.Method |
findMethod(java.lang.Object callee,
java.lang.String methodName,
java.lang.Class[] argTypes,
java.lang.Object[] args,
boolean isPublic)
|
static boolean |
fireEvent(java.lang.Object pApplet,
RiTaEvent rte)
Fires a RiTaEvent as a callback to the parent which is generally (but now always) a PApplet |
static java.lang.String[] |
getDataDirectoryGuesses()
|
static java.lang.String |
getModelDir()
Returns the directory from which statistical models are loaded |
static java.lang.String[] |
getOpenClassWords(java.lang.String[] words)
Returns an array without the closed-class words |
static java.lang.String |
getOS()
Returns a String representing the current OS ["mac", "windows", "linux" ] |
static void |
hideCursor(processing.core.PApplet p)
Hides the cursor for the duration of the program (requires an application or signed applet). |
static java.lang.Object |
invoke(java.lang.Object callee,
java.lang.String methodName)
Calls 'methodName' on 'callee' Object via reflection |
static java.lang.Object |
invoke(java.lang.Object callee,
java.lang.String methodName,
java.lang.Class[] argTypes,
java.lang.Object[] args)
Calls 'methodName' on 'callee' Object with args via reflection |
static java.lang.Object |
invoke(java.lang.Object callee,
java.lang.String methodName,
java.lang.Object[] args)
Calls 'method' on 'object' via reflection, passing 'args' and inferring the Class[] of argument types by calls to Object.getClass() for each arg. |
static java.lang.Object |
invokeHidden(java.lang.Object callee,
java.lang.String methodName,
java.lang.Class[] argTypes,
java.lang.Object[] args)
Calls inaccessible (default, private, or protected) 'methodName' on 'callee' Object with 'args' via reflection. |
static boolean |
is3D(processing.core.PGraphics graphics)
|
static boolean |
isAbbreviation(java.lang.String input)
Returns true if 'input' is an abbreviation |
static boolean |
isAbsolutePath(java.lang.String fileName)
|
static boolean |
isAllCaps(java.lang.String word)
Verifies only the absence of lowercase letters |
static boolean |
isClosedClass(java.lang.String word)
Returns true if word is a close-class word. |
static boolean |
isLowerCase(java.lang.String word)
Verifies that every character in word is lowerCase |
static boolean |
isQuestion(java.lang.String[] sentence)
Returns true if sentence starts with a question sword. |
static boolean |
isSentenceEnd(java.lang.String currentWord,
java.lang.String nextWord)
Returns true if 'currentWord' is the final word of a sentence. |
static boolean |
isServerEnabled()
Returns whether RiTa will attempt to use the server for processing. |
static boolean |
isStopWord(java.lang.String keyword)
Returns true if the word is a so-called 'stop-word' |
static boolean |
isTitleCase(java.lang.String word)
Verifies the first char is upperCase and the rest are lowerCase |
static boolean |
isUpperCase(java.lang.String word)
Returns true if all characters are uppercase letters |
static boolean |
isVowel(char c)
Returns true if c is a vowel |
static boolean |
isW_Question(java.lang.String[] sentence)
Returns true if sentence starts with a w-question word,
eg (who,what,why,where,when,etc.) |
static java.lang.String |
join(java.util.List tokenList)
Joins a list using space as a delimiter. |
static java.lang.String |
join(java.util.List input,
java.lang.String delim)
Concatenates the list 'input' into a single String, spearated by 'delim' |
static java.lang.String |
join(java.lang.Object[] full)
Joins Array of String into space-delimited String. |
static java.lang.String |
join(java.lang.Object[] full,
java.lang.String delim)
Joins Array of String into delimited String. |
static java.lang.String |
join(java.lang.String[] input,
char delim)
Concatenates the array 'input' into a single String, spearated by 'delim' |
static boolean |
lastCharIs(java.lang.String string,
char c)
|
static boolean |
lastCharMatches(java.lang.String string,
char[] chars)
|
static java.lang.String |
libPath(processing.core.PApplet p)
Returns the path to the 'libaries' directory in the Processing sketchbook |
static byte[] |
loadBytes(processing.core.PApplet p,
java.io.InputStream is)
|
static java.util.Map |
loadPropertyFile(processing.core.PApplet p,
java.lang.String fName)
Loads a properties-format (key=value) File from the 'data' directory (if the path is relative) and parses it into a Map |
static RiSample |
loadSample(processing.core.PApplet p,
java.lang.String sampleFileName)
|
static RiSample |
loadSample(processing.core.PApplet p,
java.lang.String sampleFileName,
int playerType)
|
static RiSample |
loadSample(processing.core.PApplet p,
java.lang.String sampleFileName,
int playerType,
boolean setLooping)
Convenience method that loads a RiSample object and (if 'setLooping' is true) starts it looping. |
static java.lang.String |
loadString(processing.core.PApplet pApplet,
java.lang.String fileName)
Loads a File by name and reads the contents into a single String |
static java.lang.String[] |
loadStrings(processing.core.PApplet pApplet,
java.lang.String fileName)
Same as pApplet.loadStrings but correctly handles UTF-8 characters. |
static java.lang.String[] |
loadStrings(java.net.URL url)
Opens a URL (line-by-line) and reads the contents into a String[], one line per array element |
static RiSample |
loopSample(processing.core.PApplet p,
java.lang.String sampleFileName)
|
static RiSample |
loopSample(processing.core.PApplet p,
java.lang.String sampleFileName,
int playerType)
Convenience method that loads a RiSample object and starts it looping. |
static java.lang.String |
ls()
|
static void |
main(java.lang.String[] args)
|
static void |
mainc(java.lang.String[] args)
|
static java.lang.String |
mapToString(java.util.Map m)
|
static int |
millis()
Returns time since 'start' of program in ms |
static int |
millis(long start)
Returns time since start as an int (milliseconds) |
static boolean |
noCaps(java.lang.String word)
Verifies the absence of uppercase letters |
static java.io.InputStream |
openStream(java.lang.Class resourceDir,
java.lang.String fileName)
Opens an InputStream to the specified filename |
static java.io.InputStream |
openStream(processing.core.PApplet p,
java.lang.String fileName)
Opens an InputStream for the specified file |
static int |
pack(int a,
int r,
int g,
int b)
|
int |
pack(processing.core.PApplet pApplet,
float[] c)
Packs an array of floats (1,2,3, or 4 elements) into a single integer. |
static void |
pauseCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
boolean paused)
Pauses (or unpauses) the callback timer with the specified name |
static void |
pauseCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float pauseTime)
Pauses the callback timer with the specified name for 'pauseTime' seconds |
static void |
pcwd()
|
static void |
pElapsed(long timestamp)
|
static void |
persist(Xmlable persistent,
java.lang.String fileName)
Creates a file with fileName and writes the contents
of persistent to it in XML format |
static RiSample |
playSample(processing.core.PApplet p,
java.lang.String sampleFileName)
|
static RiSample |
playSample(processing.core.PApplet p,
java.lang.String sampleFileName,
int playerType)
Convenience method that loads a RiSample object and starts it playing. |
static void |
pls()
|
static java.lang.String[] |
posTag(FeaturedIF[] tokens)
Uses the default PosTagger to tag (and add features for) each element of words. |
static java.lang.String[] |
posTag(java.lang.String[] tokens)
Uses the default PosTagger to tag the input with the PENN tag set |
static RiProbable |
probabalisticSelect(java.util.Collection c)
|
static java.util.Map |
propertiesFromXml(java.lang.String xml)
Returns a map of key-value pairs in an XML string with format: <... |
static java.lang.Object |
random(java.util.Collection c)
Returns a random element from a Collection |
static java.lang.Object |
random(java.util.List list)
Returns a random element from a List |
static java.lang.Object |
random(java.lang.Object[] list)
Returns a random element from a List |
static int[] |
randomOrdering(int numElements)
Returns a randomly ordered array of unique integers from 0 to numElements -1. |
static void |
refreshServer()
Clears all objects from the RiTaServer so that they can be reloaded |
static java.lang.Object |
removeRandom(java.util.Collection c)
Removes a random element from a Collection, maintaining the ordering |
static java.lang.Object |
removeRandom(java.util.List list)
Removes a random element from a List, maintaining the ordering |
static java.lang.String |
replaceEntities(java.lang.String input)
Returns input String with XML/HTML entities replaced |
static RiTextBehavior |
resetCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float startOffset,
float duration,
boolean repeat)
Resets the callback timer with the specified name |
static RiTextBehavior |
resetCallbackTimer(processing.core.PApplet pApplet,
java.lang.String timerName,
float startOffset,
float duration)
Resets the callback timer with the specified name |
static RiProbable |
select(java.util.Collection c,
boolean probabalisticSelect)
|
static RiTextBehavior |
setCallbackTimer(java.lang.Object pApplet,
float duration)
|
static RiTextBehavior |
setCallbackTimer(java.lang.Object pApplet,
float duration,
boolean repeat)
|
static RiTextBehavior |
setCallbackTimer(java.lang.Object pApplet,
float startOffset,
float duration)
|
static RiTextBehavior |
setCallbackTimer(java.lang.Object pApplet,
float startOffset,
float duration,
boolean repeat)
|
static RiTextBehavior |
setCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float duration)
|
static RiTextBehavior |
setCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float duration,
boolean repeat)
|
static RiTextBehavior |
setCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float startOffset,
float duration)
|
static RiTextBehavior |
setCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float startOffset,
float duration,
boolean repeat)
Creates and returns a new callback timer which will generate callbacks to pApplet.onRiTaEvent(RiTaEvent) according to the parameters specified. |
static void |
setModelDir(java.lang.String modelDirectory)
Set the directory from which statistical models should be loaded |
static java.lang.String |
shortName(java.lang.Class c)
|
static java.lang.String |
shortName(java.lang.Object c)
|
static void |
shuffle(java.lang.Object[] items)
|
static java.util.List |
shuffleKeys(java.util.Map m)
Returns a shuffled view of the key list for a map |
static java.lang.String[] |
split(java.lang.String toSplit,
java.util.regex.Pattern regexPattern,
boolean returnDelims)
An alternative to String.split(String) that optionally
returns the delimiters. |
static java.lang.String[] |
splitSentences(java.lang.String text)
Delegates to the default sentencer parser to split text into sentences |
static void |
stopCallbackTimer(java.lang.String timerName)
Stops the callback timer with the specified name |
static void |
stopCallbackTimers()
Stops all callback timers currently running |
static java.lang.String[] |
strArr(java.util.List l)
Converts the List to a String array |
static java.util.Map |
stringToMap(java.lang.String parameters)
|
static java.lang.String |
stripMarkup(java.lang.String input)
Returns input String stripped of HTML markup |
static void |
stripPunctuation(RiText phrase)
|
static java.lang.String |
stripPunctuation(java.lang.String phrase)
|
static java.lang.String |
stripPunctuation(java.lang.String phrase,
char[] charsToIgnore)
Strips any punctuation characters from the String |
static java.lang.String[] |
tokenize(java.lang.String line)
Uses the default WordTokenizer to split the line into words |
static void |
tokenize(java.lang.String line,
java.util.List result)
Uses the default WordTokenizer to split the line into words and places, then the results in result |
static java.lang.String |
toString(char[] c)
|
static java.lang.String |
toString(float[] floats)
Returns a formatted String from a float[] |
static java.lang.Object[] |
trim(java.lang.Object[] input)
Trims null entries off the end of an array. |
static java.lang.String |
trimEnds(java.lang.String token)
Trims whitespace from both ends of token |
static java.lang.String |
trimPunctuation(java.lang.String token)
Trims punctuation from each side of the token
(does not trim whitespace or internal punctuation). |
static java.lang.String |
trimRegex(java.lang.String input,
java.lang.String regex)
Removes the regex pattern from either side of the string. |
static int |
unbinary(java.lang.String what)
Unpack a binary String into an int. |
static java.lang.String |
unescapeXml(java.lang.String xmlStr)
|
static float[] |
unhex(int hexColor)
|
static int[] |
unpack(int pix)
Unpacks a integer into an array of floats (size 4) representing (a,r,g,b) color values |
static java.lang.String |
upperCaseFirst(java.lang.String value)
|
static void |
useServer()
Enables the RiTaServer on localhost using the default port |
static void |
useServer(int port)
Enables the RiTaServer on port (default=4444) |
static void |
useServer(java.lang.String host,
int port)
Enables the RiTaServer on host (default=localhost)
using port (default=4444). |
static void |
writeFile(java.lang.String fileName,
java.lang.String text)
Creates a File with fname and writes the String 'text' to it |
static void |
writeFile(java.lang.String fileName,
java.lang.String[] lines)
Creates a File with fname and writes the String[] 'lines' to it |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VERSION
This is the # output to the console when the first RiTa class is loaded.
public static final int DEFAULT_SERVER_PORT
public static int port
public static java.lang.String textEncoding
public static final java.lang.String QQ
public static final java.lang.String BN
public static final java.lang.String DOT
public static final java.lang.String COMMA
public static final java.lang.String SPC
public static java.lang.String OS_SLASH
public static java.lang.String LINE_BREAK
public static final java.lang.String MAC
public static final java.lang.String LINUX
public static final java.lang.String WINDOWS
public static final java.lang.String OS_UNDEFINED
public static final java.lang.String PUNCTUATION
public static final java.lang.String[] CLOSED_CLASS_WORDS
public static java.lang.String[] STOP_WORDS
| Constructor Detail |
|---|
public RiTa()
| Method Detail |
|---|
public static void refreshServer()
public static void useServer(java.lang.String host,
int port)
host (default=localhost)
using port (default=4444). Note: one must still
start the server process (via the scripts provided).
public static void useServer(int port)
port (default=4444)
public static void useServer()
public static void disableServer()
public static boolean isServerEnabled()
public static java.awt.image.BufferedImage captureScreen(java.lang.String outFileName,
int x,
int y,
int width,
int height)
public static java.awt.image.BufferedImage captureScreen(java.lang.String outFileName,
int width,
int height)
public static java.awt.image.BufferedImage captureScreen(java.lang.String outFileName)
public int pack(processing.core.PApplet pApplet,
float[] c)
public static int pack(int a,
int r,
int g,
int b)
public static int[] unpack(int pix)
public static java.lang.String escapeXml(java.lang.String string)
public static java.lang.String unescapeXml(java.lang.String xmlStr)
public static RiTextBehavior setCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float startOffset,
float duration)
public static RiTextBehavior setCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float duration)
public static RiTextBehavior setCallbackTimer(java.lang.Object pApplet,
float duration,
boolean repeat)
public static RiTextBehavior setCallbackTimer(java.lang.Object pApplet,
float startOffset,
float duration)
public static RiTextBehavior setCallbackTimer(java.lang.Object pApplet,
float startOffset,
float duration,
boolean repeat)
public static RiTextBehavior setCallbackTimer(java.lang.Object pApplet,
float duration)
public static RiTextBehavior setCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float duration,
boolean repeat)
public static RiTextBehavior setCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float startOffset,
float duration,
boolean repeat)
pApplet - The parent applet to call back totimerName - The name associated with this timer (optional)startOffset - Time before the timer starts (in seconds)duration - The timer's period (in seconds)repeat - Whether the timer fires just once, or repeats indefinitely (default=true)
public static RiTextBehavior resetCallbackTimer(processing.core.PApplet pApplet,
java.lang.String timerName,
float startOffset,
float duration)
public static RiTextBehavior resetCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float startOffset,
float duration,
boolean repeat)
public static void pauseCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
float pauseTime)
public static void pauseCallbackTimer(java.lang.Object pApplet,
java.lang.String timerName,
boolean paused)
public static void stopCallbackTimers()
public static void stopCallbackTimer(java.lang.String timerName)
public static RiSample loadSample(processing.core.PApplet p,
java.lang.String sampleFileName)
public static RiSample loadSample(processing.core.PApplet p,
java.lang.String sampleFileName,
int playerType)
public static RiSample loadSample(processing.core.PApplet p,
java.lang.String sampleFileName,
int playerType,
boolean setLooping)
RiConstants.MINIM,
RiConstants.ESS,
RiConstants.SONIA,
loadSample(PApplet, String, int),
loadSample(PApplet, String)
public static RiSample loopSample(processing.core.PApplet p,
java.lang.String sampleFileName)
public static RiSample loopSample(processing.core.PApplet p,
java.lang.String sampleFileName,
int playerType)
RiConstants.MINIM,
RiConstants.ESS,
RiConstants.SONIA,
playSample(PApplet, String, int)
public static RiSample playSample(processing.core.PApplet p,
java.lang.String sampleFileName)
public static RiSample playSample(processing.core.PApplet p,
java.lang.String sampleFileName,
int playerType)
RiConstants.MINIM,
RiConstants.ESS,
RiConstants.SONIA,
playSample(PApplet, String, int)public static java.util.Map stringToMap(java.lang.String parameters)
public static java.lang.String mapToString(java.util.Map m)
public static java.lang.String[] split(java.lang.String toSplit,
java.util.regex.Pattern regexPattern,
boolean returnDelims)
String.split(String) that optionally
returns the delimiters.
public static java.lang.Object[] trim(java.lang.Object[] input)
public static java.lang.String trimEnds(java.lang.String token)
token
public static java.lang.String trimPunctuation(java.lang.String token)
token
(does not trim whitespace or internal punctuation).
public static java.lang.String getOS()
public static java.lang.String exceptionToString(java.lang.Throwable e)
public static java.lang.Object invoke(java.lang.Object callee,
java.lang.String methodName,
java.lang.Class[] argTypes,
java.lang.Object[] args)
public static java.lang.Object invoke(java.lang.Object callee,
java.lang.String methodName,
java.lang.Object[] args)
Object.getClass() for each arg.
public static java.lang.Object invoke(java.lang.Object callee,
java.lang.String methodName)
public static boolean fireEvent(java.lang.Object pApplet,
RiTaEvent rte)
public static java.lang.reflect.Method findMethod(java.lang.Object callee,
java.lang.String methodName,
java.lang.Class[] argTypes,
java.lang.Object[] args,
boolean isPublic)
public static java.lang.Object invokeHidden(java.lang.Object callee,
java.lang.String methodName,
java.lang.Class[] argTypes,
java.lang.Object[] args)
public static java.lang.Object removeRandom(java.util.List list)
public static java.lang.Object removeRandom(java.util.Collection c)
public static java.lang.Object random(java.util.Collection c)
public static java.lang.Object random(java.util.List list)
public static java.lang.Object random(java.lang.Object[] list)
public static void shuffle(java.lang.Object[] items)
public static int[] randomOrdering(int numElements)
numElements -1.
The size of the array will be numElements.
public static java.lang.String toString(float[] floats)
public static java.util.List shuffleKeys(java.util.Map m)
public static java.lang.String join(java.util.List tokenList)
public static boolean equals(java.util.List l1,
java.util.List l2)
Object.equals(Object)
public static float constrain(float amt,
float min,
float max)
public static int constrain(int amt,
int min,
int max)
public static boolean isLowerCase(java.lang.String word)
word is lowerCase
public static boolean isUpperCase(java.lang.String word)
public static java.lang.String replaceEntities(java.lang.String input)
public static java.lang.String shortName(java.lang.Class c)
public static java.lang.String shortName(java.lang.Object c)
public static void pcwd()
public static java.lang.String cwd()
public static void pls()
public static java.lang.String ls()
public static java.lang.String stripMarkup(java.lang.String input)
input - String containing HTML markup
public static boolean isClosedClass(java.lang.String word)
word is a close-class word.
public static boolean isSentenceEnd(java.lang.String currentWord,
java.lang.String nextWord)
This is a simplified version of the OAK/JET sentence splitter method.
public static boolean isQuestion(java.lang.String[] sentence)
sentence starts with a question sword.
public static boolean isW_Question(java.lang.String[] sentence)
sentence starts with a w-question word,
eg (who,what,why,where,when,etc.)
public static boolean isVowel(char c)
c is a vowel
public static java.lang.String[] getOpenClassWords(java.lang.String[] words)
public static java.lang.String toString(char[] c)
public static boolean isAbbreviation(java.lang.String input)
public static boolean isTitleCase(java.lang.String word)
public static boolean isAllCaps(java.lang.String word)
public static boolean allCaps(java.lang.String word)
public static boolean noCaps(java.lang.String word)
public static boolean allLowerCase(java.lang.String word)
public static boolean allLowerCase(java.lang.String[] words)
public static boolean allLetters(java.lang.String[] words)
public static java.lang.String join(java.lang.String[] input,
char delim)
public static java.lang.String join(java.util.List input,
java.lang.String delim)
public static boolean contains(java.lang.String full,
java.lang.String search)
public static int count(java.lang.String input,
java.lang.String toMatch)
public static int count(java.lang.String input,
char toMatch)
public static java.lang.String join(java.lang.Object[] full)
full - - Array of Strings to be joined
public static java.lang.String join(java.lang.Object[] full,
java.lang.String delim)
full - - Array of Strings to be joineddelim - - Delimiter to parse elements in resulting String
public static java.util.Map loadPropertyFile(processing.core.PApplet p,
java.lang.String fName)
public static java.lang.String[] getDataDirectoryGuesses()
public static java.lang.String libPath(processing.core.PApplet p)
public static java.lang.String[] loadStrings(java.net.URL url)
public static java.lang.String loadString(processing.core.PApplet pApplet,
java.lang.String fileName)
public static java.lang.String[] loadStrings(processing.core.PApplet pApplet,
java.lang.String fileName)
public static java.util.Map propertiesFromXml(java.lang.String xml)
public static java.io.InputStream openStream(java.lang.Class resourceDir,
java.lang.String fileName)
public static java.io.InputStream openStream(processing.core.PApplet p,
java.lang.String fileName)
public static boolean contains(java.lang.String full,
char search,
boolean ignoreCase)
public static boolean contains(java.lang.String full,
char search)
public static boolean endsWith(java.lang.String full,
char[] search)
public static boolean endsWithPunctuation(java.lang.String input)
PUNCTUATIONpublic static java.lang.String stripPunctuation(java.lang.String phrase)
public static void stripPunctuation(RiText phrase)
public static java.lang.String stripPunctuation(java.lang.String phrase,
char[] charsToIgnore)
PUNCTUATIONpublic static boolean isStopWord(java.lang.String keyword)
STOP_WORDSpublic static java.util.List asList(java.util.Set s)
public static java.util.List asList(int[] ints)
public static java.util.List asList(char[] chars)
public static java.util.List asList(long[] longs)
public static java.util.List asList(float[] floats)
public static java.util.List asList(java.lang.Object[] o)
public static final float[] unhex(int hexColor)
public static final java.lang.String upperCaseFirst(java.lang.String value)
public static final int unbinary(java.lang.String what)
public static void die(processing.core.PApplet papplet,
java.lang.String errStr)
public static byte[] loadBytes(processing.core.PApplet p,
java.io.InputStream is)
public static void pElapsed(long timestamp)
public static java.lang.Object dynamicCast(java.lang.Object toCast,
java.lang.Class iface)
Object o = new Object() {
public void run() {
System.out.println("running...");
}};
Runnable r = (Runnable)RiTa.dynamicCast(o, Runnable.class);
r.run();
Note: 'toCast' must be a an instance of a public class.
public static java.lang.Object dynamicCast(java.lang.Object toCast,
java.lang.Class[] ifaces)
dynamicCast(Object, Class)public static java.lang.String elapsedStr(long start)
start as string, e.g., '4.33s'
public static java.lang.String elapsedStr()
public static float elapsed()
public static float elapsed(long start)
start as float (in seconds)
public static int millis()
public static int millis(long start)
start as an int (milliseconds)
public static java.lang.String[] splitSentences(java.lang.String text)
text into sentences
public static void tokenize(java.lang.String line,
java.util.List result)
result
RiTokenizerpublic static java.lang.String[] tokenize(java.lang.String line)
RiTokenizerpublic static java.lang.String[] posTag(java.lang.String[] tokens)
RiPosTaggerpublic static java.lang.String[] posTag(FeaturedIF[] tokens)
words.
public static void writeFile(java.lang.String fileName,
java.lang.String text)
fname and writes the String 'text' to it
fileName - by which to create the Filetext - contents to be written to the file as a String
public static void writeFile(java.lang.String fileName,
java.lang.String[] lines)
fname and writes the String[] 'lines' to it
fileName - by which to create the Filelines - contents to be written to the file
public static void persist(Xmlable persistent,
java.lang.String fileName)
fileName and writes the contents
of persistent to it in XML format
public static Xmlable create(processing.core.PApplet p,
java.lang.String xml)
xml
after calling the no-argument constructor.
public static Xmlable createFromFile(processing.core.PApplet p,
java.lang.String fileName)
fileName
after calling the no-argument constructor.
public static java.lang.String[] strArr(java.util.List l)
public static java.lang.String chomp(java.lang.String s)
s - String to be chomped
public static RiProbable select(java.util.Collection c,
boolean probabalisticSelect)
public static RiProbable probabalisticSelect(java.util.Collection c)
public static boolean lastCharIs(java.lang.String string,
char c)
public static boolean lastCharMatches(java.lang.String string,
char[] chars)
public static boolean contains(java.lang.Object[] array,
java.lang.Object item)
public static void setModelDir(java.lang.String modelDirectory)
Note: expects an absolute path: e.g., '/Users/jill/models'
public static java.lang.String getModelDir()
public static boolean isAbsolutePath(java.lang.String fileName)
public static java.lang.String decimalFormat(double d)
public static boolean contains(java.lang.CharSequence word,
java.lang.CharSequence search,
boolean ignoreCase)
public static void hideCursor(processing.core.PApplet p)
public static boolean contains(java.lang.CharSequence word,
java.lang.CharSequence[] searches,
boolean ignoreCase)
public static boolean is3D(processing.core.PGraphics graphics)
public static void mainc(java.lang.String[] args)
throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static java.lang.String trimRegex(java.lang.String input,
java.lang.String regex)
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||