Textchecker

Checks spelling in a text field.

eon_mobile_textcheckex object

Functions
of_completionsforpartialword

Description

Returns a list of words that are possible completions for a partially entered word.

Supported on mobile client only.

Syntax

textchecker.of_completionsforpartialword ( value eon_mobile_str_textcheckoption astr_textcheckoption, ref string as_completions[] )

Argument Type

Argument

Description

eon_mobile_textcheckerex

textchecker

The name of the eon_mobile_textcheckerex object.

eon_mobile_str_textcheckoption

astr_textcheck​option

Check option.

See variable list of eon_mobile_str_textcheckoption.

string

as_completions[]

Returns a list of words, each of which is a completion of a partially entered word represented by range in string.

If no possible completions are found, the method returns an empty array.

Return value

Integer.

1 - Found possible completions.

0 - Found no possible completions.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getignoredwords

Description

Returns the words that the receiver ignores when spell-checking.

The spell checker excludes ignored words as misspelled words during the current spell-checking session only.

Supported on mobile client only.

Syntax

textchecker.of_getignoredwords ( ref string as_words[] )

Argument Type

Argument

Description

eon_mobile_textcheckerex

textchecker

The name of the eon_mobile_textcheckerex object.

string

as_words[]

Returns an array of strings, each of which specifies a word the receiver ignores.

Return value

Integer.

1 - Found any ignored words.

0 - Found no ignored words.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_setignoredwords

Description

Sets the list of words that the receiver should ignore, and the ignored words are not treated as misspelled words.

Supported on mobile client only.

Syntax

textchecker.of_setignoredwords ( value string as_words[] )

Argument Type

Argument

Description

eon_mobile_textcheckerex

textchecker

The name of the eon_mobile_textcheckerex object.

string

as_words[]

Sets an array of strings, each of which specifies a word the receiver should ignore.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getlanguages

Description

Gets the languages for which the text checker can perform spell-checking.

Supported on mobile client only.

Syntax

textchecker.of_getlanguages ( ref string as_languages[] )

Argument Type

Argument

Description

eon_mobile_textcheckerex

textchecker

The name of the eon_mobile_textcheckerex object.

string

as_languages[]

Returns an array of strings representing ISO 639-1 language codes or combined ISO 639-1 language codes and ISO 3166-1 regional codes (for example, en_US).

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_getmisspelledword

Description

Gets the range of the first misspelled word encountered.

Supported on mobile client only.

Syntax

textchecker.of_getmisspelledword ( value eon_mobile_str_textcheckoption astr_textcheckoption, ref long al_start, ref long al_length )

Argument Type

Argument

Description

eon_mobile_textcheckerex

textchecker

The name of the eon_mobile_textcheckerex object.

eon_mobile_str_textcheckoption

astr_textcheck​option

Check option.

See variable list of eon_mobile_str_textcheckoption.

long

al_start

Returns a long whose value is the starting position of the first misspelled word.

long

al_length

Returns a long whose value is the length of the first misspelled word.

Return value

Integer.

1 - Found the misspelled word.

0 - Found no misspelled words.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_guessesforword

Description

Returns a list of words that are possible valid replacements for a misspelled word.

Supported on mobile client only.

Syntax

textchecker.of_guessesforword ( value eon_mobile_str_textcheckoption astr_textcheckoption, ref string as_guesses[] )

Argument Type

Argument

Description

eon_mobile_textcheckerex

textchecker

The name of the eon_mobile_textcheckerex object.

eon_mobile_str_textcheckoption

astr_textcheck​option

Check option.

See variable list of eon_mobile_str_textcheckoption.

string

as_guesses[]

Returns an array of strings each of which might be a correct substitute (that is, a guess) for a misspelled word in the given range of the string.

If no possible guesses are found, the method returns an empty array.

Return value

Integer.

1 - Found possible guesses.

0 - Found no possible guesses.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_haslearnedword

Description

Detects if the text checker has learned the specified word.

Supported on mobile client only.

Syntax

textchecker.of_haslearnedword ( value string as_word )

Argument Type

Argument

Description

eon_mobile_textcheckerex

textchecker

The name of the eon_mobile_textcheckerex object.

string

as_word

A string representing a word.

Return value

Integer.

1 - The text check has learned the word.

0 - The text check hasn't learned the word.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_learnword

Description

Tells the text checker to learn the specified word so that it is not evaluated as misspelled.

Supported on mobile client only.

Syntax

textchecker.of_learnword ( value string as_word )

Argument Type

Argument

Description

eon_mobile_textcheckerex

textchecker

The name of the eon_mobile_textcheckerex object.

string

as_word

A string representing the word for the text checker to learn.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_unlearnword

Description

Tells the text checker to unlearn the specified word.

Supported on mobile client only.

Syntax

textchecker.of_unlearnword ( value string as_word )

Argument Type

Argument

Description

eon_mobile_textcheckerex

textchecker

The name of the eon_mobile_textcheckerex object.

string

as_word

A string representing the word for the text checker to unlearn.

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

Structures
eon_mobile_str_textcheckoption

Description

Struct.

Checks spelling.

Property

Type

Variable Name

Description

string

s_source

The string which you want to check.

long

l_start

A long indicating where the check will begin in s_source.

long

l_length

Starting from the position specified by l_start, the number of characters needed to be checked.

string

s_language

The language of the words to be checked for correct spelling. This variable takes no effect on the Android OS if the text is input in multiple languages.

Code example

The following script is in the EditChanged event for a SingleLineEdit control, used to detect if the input word is correct.

long ll_start,ll_length,ll_return1,ll_return2
string ls_return[],ls_data
eon_mobile_str_textcheckoption  leon_str_textcheck
str_textcheck  lstr_textcheck

leon_str_textcheck.s_language = 'en_US'
leon_str_textcheck.s_source = this.text
leon_str_textcheck.l_start = 1
leon_str_textcheck.l_length = len(this.text)
ll_return1 = ieon_textchecker.of_getmisspelledword ( leon_str_textcheck, ll_start, ll_length) //returns the starting position and length of the first misspelled word
if ll_return1 = 1 then
   leon_str_textcheck.l_start = ll_start
   leon_str_textcheck.l_length = ll_length //IMPORTANT: passes the length to the structure so it can exactly obtain the misspelled word
   if cbx_1.checked then
       ll_return2 = ieon_textchecker.of_guessesforword ( leon_str_textcheck, ls_return) //returns a list of possible guesses
   else
       ll_return2 = ieon_textchecker.of_completionsforpartialword ( leon_str_textcheck, ls_return) //returns a list of possible completions
   end if
   if upperbound(ls_return) > 0 then
       lstr_textcheck.s_old = mid(this.text,ll_start,ll_length)
       lstr_textcheck.s_new = ls_return
       lstr_textcheck.l_x = parent.pointerx( )
       lstr_textcheck.l_y = parent.pointery( )
       openwithparm(w_rightword,lstr_textcheck)
       ls_data = message.stringparm
       if len(ls_data) > 0 then
           this.text = replace(this.text,ll_start,ll_length,ls_data)
       end if
   end if
end if