|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.util.SpellCheck
public class SpellCheck
This static class provides methods to access and modify the global spell check setting, as well as methods to check spelling and correct mistakes.
Spell checking is done independently of any AutoText replacements.
For AutoText, see ShortcutRules.
To access the user's spell check dictionary, see
SpellCheckUserDictionary.
| Method Summary | |
|---|---|
static String |
correctMistake(String text,
SpellCheckUserDictionary extraDictionary)
Finds a word to automatically replace the given misspelling. |
static String |
correctMistake(String text,
String[] replacements)
Given a list of possible replacements, finds a word to automatically replace the given misspelling. |
static String[] |
findReplacements(String text,
SpellCheckUserDictionary extraDictionary)
Returns an array of up to 10 possible spelling corrections. |
static SpellCheckUserDictionary |
getUserDictionary()
Get the user's spell check dictionary. |
static boolean |
isAutoCorrectionEnabled()
Determine whether the auto-correction is enabled, via setAutoCorrectionEnabled(boolean). |
static boolean |
isHighlightEnabled()
Determine whether the global highlight setting is turned on. |
static boolean |
isSlangDictionaryEnabled()
Determine whether the slang dictionary is used while spell checking. |
static boolean |
isSpellCheckEnabled()
Determine if highlighting or auto-correction is enabled. |
static void |
setAutoCorrectionEnabled(boolean flag)
Set the global auto-correction setting. |
static void |
setHighlightEnabled(boolean flag)
Set the global highlight setting. |
static void |
setSlangDictionaryEnabled(boolean flag)
Specify whether the slang dictionary should be used. |
static boolean |
spelledCorrectly(String text,
SpellCheckUserDictionary extraDictionary)
Determine if a word is spelled correctly. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SpellCheckUserDictionary getUserDictionary()
public static boolean isSpellCheckEnabled()
isHighlightEnabled() or isAutoCorrectionEnabled()
is true.
public static boolean isHighlightEnabled()
public static void setHighlightEnabled(boolean flag)
flag - if true, highlighting is turned on.public static void setAutoCorrectionEnabled(boolean flag)
setHighlightEnabled(boolean)).
flag - if true, auto-correct is turned on.public static boolean isAutoCorrectionEnabled()
Determine whether the auto-correction is enabled, via
setAutoCorrectionEnabled(boolean).
public static boolean isSlangDictionaryEnabled()
Determine whether the slang dictionary is used while spell checking.
Note that the slang dictionary is currently only supported in English and Spanish.
public static void setSlangDictionaryEnabled(boolean flag)
Specify whether the slang dictionary should be used.
Note that the slang dictionary is currently only supported in English and Spanish.
flag - if true, the "slang dictionary" is used.
public static boolean spelledCorrectly(String text,
SpellCheckUserDictionary extraDictionary)
Determine if a word is spelled correctly. Returns true if the word is spelled correctly.
Any text with a number in it is considered correct unless it is an incorrect use of an ordinal (for example, "32st").
Text that is considered a URL is considered correct.
All 1-letter words are considered correct.
text - the text to check.extraDictionary - a dictionary to use in addition to
the built-in, slang, and main user dictionaries. Use null
if no additional dictionary should be used.
public static String correctMistake(String text,
SpellCheckUserDictionary extraDictionary)
text - the word to correct.
public static String correctMistake(String text,
String[] replacements)
correctMistake(String,SpellCheckUserDictionary)
instead, but might want to use this if
you've already called findReplacements(java.lang.String, danger.util.SpellCheckUserDictionary) for another reason.
correctMistake(String,SpellCheckUserDictionary) simply
calls findReplacements(java.lang.String, danger.util.SpellCheckUserDictionary) and this method.
text - the word to correct.
public static String[] findReplacements(String text,
SpellCheckUserDictionary extraDictionary)
text - the word to find replacements for.extraDictionary - a dictionary to use in addition to
the built-in, slang, and main user dictionaries. Use null
if no additional dictionary should be used.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||