|
PenProfile 2.x | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
See:
Description
| Class Summary | |
|---|---|
| DetailedResult | This class is not currently supported, but may be supported in a future release. |
| DetailedResult.CandidateEnumeration | An Enumeration of recognition candidates. |
| ICRContext | This class allows the application to use the Intelligent Character Recognition (ICR) engine. |
| Language | Represents a language localized to a specific region or country. |
| LKDynamicResource | A Linguistic Knowledge resource is used to enable the recognition of a set of words. |
| Resource | This class is an abstraction of a generic ICR resource file. |
| SKDynamicResource | This class is not currently supported, but may be supported in a future release. |
| WritingStyle | This class defines the writing styles support by the Intelligent Character Recognition (ICR) feature. |
Provides classes and interfaces for Intelligent Character Recognition (ICR).
In the future:
Regarding Isolated Handwriting Style support, it can be very useful if used in the correct context. For example, utilizing this handwriting style for a "title" or "subject" boxed field on the top of a page will lead to much better accuracy than if a cursive or handprinted style is used.
The main ICR features are as follows:
SKDynamicResource
to enable only a specific set of characters (not
currently supported).
LKDynamicResource
to enable the recognition of a set of words or phrases.
DetailedResult:
Here is a list of all currently supported languages:
WritingStyle.Isolated
writing style and any of the
ICRContext SYSRES_AK_*
resources.
Use
ICRContext.startNewIsolatedCharacter(short)
to tell the engine when a character starts.WritingStyle.HandPrint
writing style and any of the
ICRContext SYSRES_AK_*
resources.
WritingStyle.Cursive
writing style and any of the
ICRContext SYSRES_AK_*
resources.
When correctly utilized by the user, they will help ICR to distinguish:
Two different guidelines can be defined, one of them being optional.
The other lines, the ascender and descender, are estimated by ICR.
See ICRContext.setGuidelines(long, long).
DetailedResult.Here is an application sample that uses ICR to recognize one English word:
import com.livescribe.event.HWRListener;
import com.livescribe.event.PenTipListener;
import com.livescribe.event.StrokeListener;
import com.livescribe.icr.ICRContext;
import com.livescribe.penlet.PenletStateChangeException;
public class ICRApp extends Penlet
implements HWRListener, StrokeListener, PenTipListener
{
private ICRContext icrContext;
public void initApp() throws PenletStateChangeException {
// Acquire the ICR engine from the PenletContext
try {
icrContext = context.getICRContext(1000, this);
icrContext.addResourceSet(icrContext.getSingleWordDefaultResourceSet());
} catch (RuntimeException ex) {
System.err.println("Error initializing HWR resources: " + ex);
throw new PenletStateChangeException(ex.toString());
}
// Add the app as a listener for stroke and pen tip events
context.addStrokeListener(this);
}
public void activateApp(int reason, Object[] params) {
// Add listeners
context.addStrokeListener(this);
context.addPenTipListener(this);
}
public void deactivateApp(int reason) {
// Remove listeners
context.removePenTipListener(this);
context.removeStrokeListener(this);
// ICR
icrContext.dispose();
icrContext = null;
}
public void destroyApp() throws PenletStateChangeException {
}
// StrokeListener Methods
public void strokeCreated(long time,
Region region,
PageInstance page) {
icrEngine.addStroke(time);
}
// PenTipListener Methods
public void penDown(long time,
Region region,
PageInstance pageInstance) {
// Notify ICR to disable user-pause during stroke writing
icrEngine.notifyPenDown(time);
}
public void doubleTap(long time, int x, int y) { }
public void penUp(long time, Region region, PageInstance page) { }
public void singleTap(long time, int x, int y) { }
// HWRListener Methods
public void hwrResult(long time, String result) {
System.out.println("Intermediate recognition result = " + result);
}
public void hwrUserPause(long time, String result) {
System.out.println("Final recognition result = " + result);
}
public void hwrError(long time, String error) {
System.out.println("Error in HWR: " + error);
}
public void hwrCrossingOut(long time, String result) {
System.out.println("Entry was crossed-out: result = " + result);
}
}
|
PenProfile 2.x | |||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||