|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.components.javascript.ERXGoogleSpell
public class ERXGoogleSpell
ERXGoogleSpell provides a simple API to spell checking with Google's web service. This code is based on the work from the blog post http://immike.net/blog/2007/04/07/hacking-google-spell-checker-for-fun-and-profit/.
Nested Class Summary | |
---|---|
static class |
ERXGoogleSpell.Correction
Correction encapsulates a suggested spelling correction for a word in a string of text. |
static class |
ERXGoogleSpell.CorrectionException
CorrectionException is thrown if anything fails during the correction process. |
Constructor Summary | |
---|---|
ERXGoogleSpell()
|
Method Summary | |
---|---|
static java.lang.String |
correct(java.lang.String text)
Corrects the spelling of the given text (language = "en", escaping XML). |
static java.lang.String |
correct(java.lang.String text,
java.lang.String lang)
Corrects the spelling of the given text (escaping XML). |
static java.lang.String |
correct(java.lang.String text,
java.lang.String lang,
java.lang.String hl)
Corrects the spelling of the given text (escaping XML). |
static java.lang.String |
correct(java.lang.String text,
java.lang.String lang,
java.lang.String hl,
boolean escapeXml)
Corrects the spelling of the given text. |
static void |
main(java.lang.String[] args)
|
static ERXGoogleSpell.Correction[] |
suggestions(java.lang.String text)
Returns possible spelling corrections of the given text (language = "en", escaping XML). |
static ERXGoogleSpell.Correction[] |
suggestions(java.lang.String text,
java.lang.String lang)
Returns possible spelling corrections of the given text (escaping XML). |
static ERXGoogleSpell.Correction[] |
suggestions(java.lang.String text,
java.lang.String lang,
java.lang.String hl)
Returns possible spelling corrections of the given text (escaping XML). |
static ERXGoogleSpell.Correction[] |
suggestions(java.lang.String text,
java.lang.String lang,
java.lang.String hl,
boolean escapeXml)
Returns possible spelling corrections of the given text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ERXGoogleSpell()
Method Detail |
---|
public static void main(java.lang.String[] args) throws ERXGoogleSpell.CorrectionException
ERXGoogleSpell.CorrectionException
public static java.lang.String correct(java.lang.String text) throws ERXGoogleSpell.CorrectionException
text
- the misspelled text
ERXGoogleSpell.CorrectionException
- if there is a problem correcting the textpublic static java.lang.String correct(java.lang.String text, java.lang.String lang) throws ERXGoogleSpell.CorrectionException
text
- the misspelled textlang
- the language of the text
ERXGoogleSpell.CorrectionException
- if there is a problem correcting the textpublic static java.lang.String correct(java.lang.String text, java.lang.String lang, java.lang.String hl) throws ERXGoogleSpell.CorrectionException
text
- the misspelled textlang
- the language of the texthl
- the human interface language
ERXGoogleSpell.CorrectionException
- if there is a problem correcting the textpublic static java.lang.String correct(java.lang.String text, java.lang.String lang, java.lang.String hl, boolean escapeXml) throws ERXGoogleSpell.CorrectionException
text
- the misspelled textlang
- the language of the texthl
- the human interface languageescapeXml
- if true, xml characters in the text will be escaped
ERXGoogleSpell.CorrectionException
- if there is a problem correcting the textpublic static ERXGoogleSpell.Correction[] suggestions(java.lang.String text) throws ERXGoogleSpell.CorrectionException
text
- the misspelled text
ERXGoogleSpell.CorrectionException
- if there is a problem correcting the textpublic static ERXGoogleSpell.Correction[] suggestions(java.lang.String text, java.lang.String lang) throws ERXGoogleSpell.CorrectionException
text
- the misspelled textlang
- the language of the text
ERXGoogleSpell.CorrectionException
- if there is a problem correcting the textpublic static ERXGoogleSpell.Correction[] suggestions(java.lang.String text, java.lang.String lang, java.lang.String hl) throws ERXGoogleSpell.CorrectionException
text
- the misspelled textlang
- the language of the texthl
- the human interface language
ERXGoogleSpell.CorrectionException
- if there is a problem correcting the textpublic static ERXGoogleSpell.Correction[] suggestions(java.lang.String text, java.lang.String lang, java.lang.String hl, boolean escapeXml) throws ERXGoogleSpell.CorrectionException
text
- the misspelled textlang
- the language of the texthl
- the human interface languageescapeXml
- if true, xml characters in the text will be escaped
ERXGoogleSpell.CorrectionException
- if there is a problem correcting the text
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |