PenProfile 2.x

com.livescribe.event
Interface HWRListener


public interface HWRListener

Implementors of this interface will receive Handwriting Recognition (HWR) events. HWR events are sent as the system processes strokes written by the user.


Method Summary
 void hwrCrossingOut(long time, String result)
          This method is not currently supported, but may be supported in a future release.
 void hwrError(long time, String error)
          Called when the HWR engine is unable to process strokes due to an error.
 void hwrResult(long time, String result)
          Called when the HWR engine has recognized a set of user drawn strokes as text.
 void hwrUserPause(long time, String result)
          Called when the HWR engine has not processed input for a specified time interval.
 

Method Detail

hwrResult

void hwrResult(long time,
               String result)
Called when the HWR engine has recognized a set of user drawn strokes as text. This may be called for single letters, multiple letters, or words. Developer configuration of the HWR engine will result in this method being called with a higher or lower frequency.

The result text contains all the handwriting recognized since the last time the strokes were cleared.

Note that there is no guarantee that all the strokes pending in the recognition queue will have been sent and/or processed. In other words, the result given here may not be so-called "final". If it is known that no more strokes will be added to the engine then the application should wait for the user pause event.

Parameters:
time - the timestamp of this event
result - all the handwriting recognized as text since the strokes were cleared
See Also:
ICRContext.clearStrokes()

hwrUserPause

void hwrUserPause(long time,
                  String result)
Called when the HWR engine has not processed input for a specified time interval. The time window is specified by the developer at the time of HWR engine creation and configuration. Additionally, this method is only called after all pending strokes have been processed by the engine; in other words, a call to this method will always happen after calls to hwrResult(long, java.lang.String).

More specifically, the time interval starts when one of the addStroke methods is called.

The result text contains all the handwriting recognized since the the strokes were cleared or the context was created.

Parameters:
time - the timestamp of this event
result - all the handwriting recognized as text since the strokes were cleared or the context was created
See Also:
ICRContext.addStroke(PageInstance, long), ICRContext.addStroke(Stroke), ICRContext.clearStrokes(), PenletContext.getICRContext(int, HWRListener)

hwrError

void hwrError(long time,
              String error)
Called when the HWR engine is unable to process strokes due to an error.

Parameters:
time - the timestamp of this event
error - the error message

hwrCrossingOut

void hwrCrossingOut(long time,
                    String result)
This method is not currently supported, but may be supported in a future release.

Called when the HWR engine detects that the user has crossed out previously written strokes.

Parameters:
time - the timestamp of this event
result - all the handwriting recognized as text up to this point

PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.