|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.livescribe.icr.ICRContext
public abstract class ICRContext
This class allows the application to use the Intelligent Character
Recognition (ICR) engine. An instance of the context can be retrieved from
PenletContext.getICRContext(int, HWRListener).
Notes:
ICRContext object is used, say with
different resources, it must be re-retrieved with
PenletContext.getICRContext(int, com.livescribe.event.HWRListener, com.livescribe.icr.Language, com.livescribe.icr.WritingStyle).clearStrokes().
PenletContext.getICRContext(int, HWRListener),
PenletContext.getICRContext(int, HWRListener, Language, WritingStyle)| Field Summary | |
|---|---|
static String |
CALCULATOR
Deprecated. Add the resource to the application. |
static String |
CALCULATOR_BIAS1
Deprecated. Add the resource to the application. |
static short |
ISOLATED_CHARACTER_TYPE_INK
The "ink" isolated character type for use in startNewIsolatedCharacter(short). |
static short |
ISOLATED_CHARACTER_TYPE_SPACE
The "space" isolated character type for use in startNewIsolatedCharacter(short). |
static String |
SYSRES_AK_FASTER
Alphabet Knowledge for recognition. |
static String |
SYSRES_AK_FULL
Alphabet Knowledge for recognition. |
static String |
SYSRES_AK_LMEM
Alphabet Knowledge for recognition. |
static String |
SYSRES_AK_LMEM_FASTER
Alphabet Knowledge for recognition. |
static String |
SYSRES_LK_BIGRAM
Linguistic Knowledge resource that contains more than 100,000 words with associated bigram frequency. |
static String |
SYSRES_LK_BIGRAM_100K
Linguistic Knowledge resource that contains 100,000 words with associated bigram frequency. |
static String |
SYSRES_LK_BIGRAM_30K
Linguistic Knowledge resource that contains 30,000 words with associated bigram frequency. |
static String |
SYSRES_LK_BIGRAM_65K
Linguistic Knowledge resource that contains 65,000 words with associated bigram frequency. |
static String |
SYSRES_LK_FREE
A "Free" resource that allows for recognition of any words. |
static String |
SYSRES_LK_GRAMMAR
Grammar resource needed for recognition of multiple words (i.e. |
static String |
SYSRES_LK_GRAMMER
Deprecated. Use SYSRES_LK_GRAMMAR. |
static String |
SYSRES_LK_OUT_OF_LEXICON
"Out-of-Lexicon" resource that allows for recognition of words not in a lexicon. |
static String |
SYSRES_LK_TRANSLATOR_DEMO
Deprecated. Add the resource to the application. |
static String |
SYSRES_LK_WORDLIST
Linguistic Knowledge resource that contains more than 100,000 words with associated frequency. |
static String |
SYSRES_LK_WORDLIST_100K
Linguistic Knowledge resource that contains 100,000 words with associated frequency. |
static String |
SYSRES_LK_WORDLIST_30K
Linguistic Knowledge resource that contains 30,000 words with associated frequency. |
static String |
SYSRES_LK_WORDLIST_65K
Linguistic Knowledge resource that contains 65,000 words with associated frequency. |
static String |
SYSRES_SK_ALNUM
Subset Knowledge that contains only letters and digits. |
static String |
SYSRES_SK_ALPHA
Subset Knowledge that contains only alphabetic characters. |
static String |
SYSRES_SK_DIGIT
Subset Knowledge that contains only digits. |
static String |
SYSRES_SK_LOWER
Subset Knowledge that contains only lowercase letters. |
static String |
SYSRES_SK_PUNCT
Subset Knowledge that contains only certain punctuation characters. |
static String |
SYSRES_SK_UPPER
Subset Knowledge that contains only uppercase letters. |
static long |
UNDEFINED_VALUE
The "undefined value" for use in setGuidelines(long, long). |
| Method Summary | |
|---|---|
void |
addResource(Resource resource)
Adds a Resource to the ICR context. |
abstract void |
addResourceSet(Resource[] resources)
Adds a set of resources to the ICR context. |
abstract void |
addStroke(PageInstance page,
long time)
Adds a stroke referenced by its time to the recognition context. |
abstract void |
addStroke(Stroke stroke)
Adds a stroke to the recognition context. |
abstract void |
clearStrokes()
Erases all strokes from the recognition context. |
Resource |
createAKSystemResource(String resourceName)
Creates a new Resource from the specified Alphabet Knowledge
system resource name. |
abstract Resource |
createAppResource(String resourceName)
Creates a new Resource from the specified resource name. |
abstract LKDynamicResource |
createLKDynamicResource()
Creates a new Lexicon Knowledge dynamic resource. |
Resource |
createLKSystemResource(String resourceName)
Creates a new Resource from the specified Linguistic Knowledge
system resource name. |
abstract SKDynamicResource |
createSKDynamicResource()
This feature is not currently supported, but may be supported in a future release. |
Resource |
createSKSystemResource(String resourceName)
Creates a new Resource from the specified Subset Knowledge
system resource name. |
abstract void |
dispose()
Dispose all the resources added to this recognition context. |
abstract void |
enableDoubleTapFilter(boolean enable)
Indicates whether to prevent double taps from going to the recognition context. |
Resource |
getDefaultAlphabetKnowledgeResource()
Gets the default Alphabet Knowledge resource to use for handwriting recognition in the specified language and writing style. |
Resource |
getDefaultLexiconKnowledgeResource()
Gets the default lexicon resource to use for handwriting recognition in the specified language and writing style. |
abstract Locale |
getLocale()
Normally this will be the same as the requested locale passed when the ICR context is created. |
Resource[] |
getMultiWordDefaultResourceSet()
Gets a resource set that is appropriate for the recognition of multiple words in the specified language. |
Resource[] |
getSingleWordDefaultResourceSet()
Gets a resource set that is appropriate for the recognition of single words in the specified language. |
abstract Rectangle |
getTextBoundingBox()
Gets the bounding box of the recognized text. |
static boolean |
isLocaleSupported(Locale locale)
Check to see if a particular locale is supported on this pen. |
abstract void |
notifyPenDown(long time)
Notify ICR that the user is starting to write. |
abstract void |
setGuidelines(long baseline,
long midline)
Define the Guidelines to use for recognition. |
abstract void |
setOptionUseMultiLineResult(boolean flag)
If set to false, the recognizer will not try to split the
input ink into multiple lines for recognition. |
abstract void |
setOptionUseUnlimitedResult(boolean option)
Enables or disables the unlimited result recognition mechanism. |
abstract void |
startNewIsolatedCharacter(short characterType)
Start a new character in Isolated Handwriting style. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SYSRES_AK_FULL
| Writing Style | Resource Size |
|---|---|
| Cursive | 307k |
| Printing | 287k |
| Isolated | 284k |
public static final String SYSRES_AK_FASTER
| Writing Style | Resource Size |
|---|---|
| Cursive | 143k |
| Printing | 132k |
| Isolated | 130k |
public static final String SYSRES_AK_LMEM
| Writing Style | Resource Size |
|---|---|
| Cursive | 168k |
| Printing | 158k |
| Isolated | 156k |
public static final String SYSRES_AK_LMEM_FASTER
| Writing Style | Resource Size |
|---|---|
| Cursive | 75k |
| Printing | 70k |
| Isolated | 68k |
public static final String SYSRES_LK_WORDLIST_30K
public static final String SYSRES_LK_WORDLIST_65K
public static final String SYSRES_LK_WORDLIST_100K
public static final String SYSRES_LK_WORDLIST
public static final String SYSRES_LK_BIGRAM_30K
Note that this cannot be used with the unlimited result option.
public static final String SYSRES_LK_BIGRAM_65K
Note that this cannot be used with the unlimited result option.
public static final String SYSRES_LK_BIGRAM_100K
Note that this cannot be used with the unlimited result option.
public static final String SYSRES_LK_BIGRAM
Note that this cannot be used with the unlimited result option.
public static final String SYSRES_LK_OUT_OF_LEXICON
This resource should not be used if you wish to recognize only a limited set of words or expressions, exclusively.
public static final String SYSRES_LK_TRANSLATOR_DEMO
public static final String SYSRES_LK_FREE
This resource also provides an "out-of-lexicon" capability. It helps with the recognition of:
For example, "SOPHIA" may also be recognized as "S0PH1A". This resource helps the '0' and '1' be recognized as 'O' and 'I', respectively, because their surrounding letters are uppercase characters.
public static final String SYSRES_LK_GRAMMAR
public static final String SYSRES_LK_GRAMMER
SYSRES_LK_GRAMMAR.public static final String SYSRES_SK_ALPHA
public static final String SYSRES_SK_LOWER
public static final String SYSRES_SK_UPPER
public static final String SYSRES_SK_ALNUM
public static final String SYSRES_SK_DIGIT
public static final String SYSRES_SK_PUNCT
public static final String CALCULATOR
public static final String CALCULATOR_BIAS1
public static final long UNDEFINED_VALUE
setGuidelines(long, long).
public static final short ISOLATED_CHARACTER_TYPE_INK
startNewIsolatedCharacter(short).
public static final short ISOLATED_CHARACTER_TYPE_SPACE
startNewIsolatedCharacter(short).
| Method Detail |
|---|
public Resource getDefaultAlphabetKnowledgeResource()
The current default is SYSRES_AK_FASTER.
Resource object containing the default Alphabet
Knowledge resource.PenletContext.getICRContext(int, HWRListener, Language, WritingStyle)public Resource getDefaultLexiconKnowledgeResource()
The current default is SYSRES_LK_WORDLIST_30K.
Resource object containing the default Lexicon
Knowledge resource.PenletContext.getICRContext(int, HWRListener, Language, WritingStyle)public Resource[] getSingleWordDefaultResourceSet()
PenletContext.getICRContext(int, HWRListener, Language, WritingStyle)public Resource[] getMultiWordDefaultResourceSet()
PenletContext.getICRContext(int, HWRListener, Language, WritingStyle)public abstract SKDynamicResource createSKDynamicResource()
Creates a new Subset Knowledge dynamic resource. This can be added to
the resources with addResource(Resource) or
addResourceSet(Resource[]).
public abstract LKDynamicResource createLKDynamicResource()
addResource(Resource) or
addResourceSet(Resource[]).
addResource(Resource),
addResourceSet(Resource[])public abstract Resource createAppResource(String resourceName)
Resource from the specified resource name. The
resource can be a Subset Knowledge, Alphabet Knowledge, or Linguistic
Knowledge resource.
For example, if an SK resource file named MyApp.sk exists for
the application, then the resource name would be
"/icr/SK_MyApp.res".
resourceName - the application resource name
Resource object representing the specified
resource.public Resource createAKSystemResource(String resourceName)
Resource from the specified Alphabet Knowledge
system resource name.
resourceName - the resource name
Resource object representing the specified
Alphabet Knowledge system resource.
NullPointerException - if resourceName is
null.SYSRES_AK_* fields"public Resource createSKSystemResource(String resourceName)
Resource from the specified Subset Knowledge
system resource name.
resourceName - the resource name
Resource object representing the specified
Subset Knowledge system resource.
NullPointerException - if resourceName is
null.SYSRES_SK_* fields"public Resource createLKSystemResource(String resourceName)
Resource from the specified Linguistic Knowledge
system resource name.
resourceName - the resource name
Resource object representing the specified
Linguistic Knowledge system resource.
NullPointerException - if resourceName is
null.SYSRES_LK_* fields"public final void addResource(Resource resource)
resource - add this resource
NullPointerException - if resource is null.
RuntimeException - or a subclass thereof if there was an error
adding the resource.addResourceSet(Resource[]),
SKDynamicResource,
LKDynamicResourcepublic abstract void addResourceSet(Resource[] resources)
Correct usage: only one Alphabet Knowledge resource and one Subset Knowledge resource should be added. If more are added, only the latest one will stay attached. More than one Linguistic Knowledge resource may be added, however.
resources - add this set of resources, a Resource array
RuntimeException - or a subclass thereof if there was an error
adding the resource set.SKDynamicResource,
LKDynamicResourcepublic abstract void dispose()
getICRContext1
or
getICRContext2
for any new operations.
NOTE: Please see the note at
getICRContext
for a description of how to properly use this method.
PenletContext.getICRContext(int, HWRListener),
PenletContext.getICRContext(int, HWRListener, Language, WritingStyle)
public abstract void setGuidelines(long baseline,
long midline)

baseline - Y-coordinate of the baseline (mandatory)midline - Y-coordinate of the midline or UNDEFINED_VALUE
if not specifiedUNDEFINED_VALUE
public abstract void startNewIsolatedCharacter(short characterType)
throws IllegalArgumentException
characterType - specifies if the character:
ISOLATED_CHARACTER_TYPE_INK
ISOLATED_CHARACTER_TYPE_SPACE
IllegalArgumentException - If characterType value is not one of
ISOLATED_CHARACTER_TYPE_INK or
ISOLATED_CHARACTER_TYPE_SPACEISOLATED_CHARACTER_TYPE_INK,
ISOLATED_CHARACTER_TYPE_SPACEpublic abstract void notifyPenDown(long time)
This method should be called for every stroke sent to the recognition
engine with addStroke(). The best place to call this is
from within PenTipListener.penDown(long, Region, PageInstance).
time - the pen-down event time.addStroke(PageInstance, long),
addStroke(Stroke)public abstract void enableDoubleTapFilter(boolean enable)
true.
enable - indicates whether to enable the double tap filterpublic abstract void addStroke(Stroke stroke)
notifyPenDown(long).
Note that the delay time specified when creating an ICR context starts from the time this method is called.
stroke - the Stroke to addnotifyPenDown(long),
addStroke(PageInstance, long)
public abstract void addStroke(PageInstance page,
long time)
notifyPenDown(long).
Note that the delay time specified when creating an ICR context starts from the time this method is called.
page - the page on which the stroke occurredtime - the stroke event timenotifyPenDown(long),
addStroke(Stroke),
StrokeListener.strokeCreated(long, Region, PageInstance)public abstract void clearStrokes()
public abstract Rectangle getTextBoundingBox()
Rectangle containing the bounding box of the current
text result.public abstract void setOptionUseMultiLineResult(boolean flag)
false, the recognizer will not try to split the
input ink into multiple lines for recognition. This should be set to
false when the input is known to be a single line. For
example, the recognizer may fail to see a ';' character as one unit.
If set to true, the recognizer will try to recognize the
handwriting as multiple lines.
The default is false.
flag - indicates whether to use multi-line recognitionpublic abstract void setOptionUseUnlimitedResult(boolean option)
Please note that you cannot use this option in conjunction with any of
the SYSRES_LK_BIGRAM* Linguistic Knowledge resources.
(These are the [language]-lk-text.lex.level2.res files). The
feature is disabled if any of these are used.
The default is false.
option - the new value of this option
java.lang.IllegalStateException - if recognition has started.public abstract Locale getLocale()
Locale.EN_US.
public static boolean isLocaleSupported(Locale locale)
locale -
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||