CN107305542B - A kind of spell checking methods and device - Google Patents
A kind of spell checking methods and device Download PDFInfo
- Publication number
- CN107305542B CN107305542B CN201610257505.5A CN201610257505A CN107305542B CN 107305542 B CN107305542 B CN 107305542B CN 201610257505 A CN201610257505 A CN 201610257505A CN 107305542 B CN107305542 B CN 107305542B
- Authority
- CN
- China
- Prior art keywords
- word
- target
- target string
- string
- error detection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/232—Orthographic correction, e.g. spell checking or vowelisation
Abstract
The embodiment of the invention provides a kind of spell checking methods and devices.Wherein, the spell checking methods and device are applied to electronic equipment, including:Real-time detection character entering function;After detecting character entering function, the position that first object word hyphenation symbol and the second target word hyphenation accord with is determined from cursor current location, target string to be detected is extracted between the position that the first object word hyphenation accords with and the position that the second target word hyphenation accords with, wherein, the first object word hyphenation symbol is the nearest word hyphenation symbol in the current location left side, and the second target word hyphenation symbol is word hyphenation symbol nearest on the right of the current location;Error detection processing is carried out to the target string;It executes and is acted with processing corresponding to error detection processing acquired results.By this programme, the long problem of error detection feedback cycle can solve.
Description
Technical field
The present invention relates to error-checks, more particularly to a kind of spell checking methods and device.
Background technique
Since user often will do it spelling words in the editing process such as document, short message or mail, and in order to help to use
Family guarantees spelling words accuracy rate, and automatic spell checking methods come into being, so as to improve the quality of input text.Wherein,
So-called word is usually made of character string, for example:English word is made of at least one English alphabet.
Wherein, traditional spell checking methods applied to document are:After user inputs a complete words, to the sentence
Included multiple words carry out error detection in son.Although this method can be realized error detection, the condition being triggered due to error detection
After each end of input, error detection feedback cycle is long, leads to error detection feedback not in time.In particular, in user
When it is pressed for time, it is easy to ignore feedback result, leading to problems such as user input, the information representation meaning is indefinite, there are ambiguities.
As it can be seen that this traditional spell checking methods, nowadays this computer age high to efficiency requirements simultaneously
Needs cannot be met well.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of spell checking methods and device, to solve error detection feedback week
Phase long problem.Specific technical solution is as follows:
In a first aspect, the present invention provides a kind of spell checking methods, including:
Real-time detection character entering function;
After detecting character entering function, first object word hyphenation symbol and the second target are determined from cursor current location
The position of word hyphenation symbol, from the position that the first object word hyphenation accords with and the position that the second target word hyphenation accords with
Between extract target string to be detected, wherein first object word hyphenation symbol is that the current location left side is nearest
Word hyphenation symbol, the second target word hyphenation symbol is word hyphenation symbol nearest on the right of the current location;
Error detection processing is carried out to the target string;
It executes and is acted with processing corresponding to error detection processing acquired results.
Optionally, described that error detection processing is carried out to the target string, including:
Whether identical as the word in default dictionary judge the target string, if so, show that spelling is correct, it is no
Then, show misspelling.
Optionally, error detection processing is carried out to the target string, including:
Judge whether the target string matches at least one word in default dictionary, if so, showing
Spelling is correct, otherwise, shows misspelling, wherein the target string and word match for:Target string and word
Included with the word initial be starting character string it is identical.
Optionally, the error detection processing acquired results are when spelling correct, and corresponding processing movement is:It does not deal with;
When the error detection processing acquired results are misspelling, corresponding processing movement is:Obtain the target character
The starting position addresses of string and final position address are based on the starting position addresses and the final position address, prominent aobvious
Show the target string.
Optionally, the type of the word hyphenation symbol includes:
Punctuation mark and space.
Optionally, described to be based on the starting position addresses and the final position address, highlight the target word
Symbol string, including:
Using position corresponding to the target starting position addresses as starting point, by position corresponding to the final position address
It as terminal, is underlined to from the starting point to the distance of the terminal, to highlight the target string;
Alternatively,
Using position corresponding to the starting position addresses as starting point, using position corresponding to the final position address as
Terminal, it is described to highlight to the equal overstriking of each character, inclination or the adjustment font color from the starting point to the terminal
Target string.
Optionally, when detecting the clicking operation that click location conforms to a predetermined condition, determine that the click location institute is right
The target string answered, wherein the predetermined condition is:It is the target string of misspelling positioned at error detection processing acquired results
In region;
Show the similar words list of target string corresponding to the click location.
Optionally, when detecting when the choosing operation of a word being directed in the similar words list, using described
The word for choosing operation targeted replaces target string corresponding to the click location.
Second aspect, the embodiment of the invention also provides a kind of spell check devices, including:
Real-time monitoring module is used for real-time detection character entering function;
Target string extraction module, for determining first from cursor current location after detecting character entering function
The position of target word hyphenation symbol and the second target word hyphenation symbol, from the position and described that the first object word hyphenation accords with
Target string to be detected is extracted between the position of second target word hyphenation symbol, wherein the first object word hyphenation
Symbol is the nearest word hyphenation symbol in the current location left side, and the second target word hyphenation symbol is on the right of the current location
Nearest word hyphenation symbol;
Error detection processing module, for carrying out error detection processing to the target string;
Action executing module is handled, is acted for executing with processing corresponding to error detection processing acquired results.
Optionally, the error detection processing module, is specifically used for:
Whether identical as the word in default dictionary judge the target string, if so, show that spelling is correct, it is no
Then, show misspelling.
Optionally, the error detection processing module, is specifically used for:
Judge whether the target string matches at least one word in default dictionary, if so, showing
Spelling is correct, otherwise, shows misspelling, wherein the target string and word match for:Target string and word
Included with the word initial be starting character string it is identical.
Optionally, the error detection processing acquired results are when spelling correct, and the error detection processing module is not dealt with;
When the error detection processing acquired results are misspelling, the error detection processing module obtains the target string
Starting position addresses and final position address are based on the starting position addresses and the final position address, highlight institute
State target string.
Optionally, the type of the word hyphenation symbol includes:
Punctuation mark and space.
Optionally, described to be based on the starting position addresses and the final position address, highlight the target word
Symbol string, including:
Using position corresponding to the target starting position addresses as starting point, by position corresponding to the final position address
It as terminal, is underlined to from the starting point to the distance of the terminal, to highlight the target string;
Alternatively,
Using position corresponding to the starting position addresses as starting point, using position corresponding to the final position address as
Terminal, it is described to highlight to the equal overstriking of each character, inclination or the adjustment font color from the starting point to the terminal
Target string.
Optionally, when detecting the clicking operation that click location conforms to a predetermined condition, determine that the click location institute is right
The target string answered, wherein the predetermined condition is:It is the target string of misspelling positioned at error detection processing acquired results
In region;
Show the similar words list of target string corresponding to the click location.
Optionally, when detecting when the choosing operation of a word being directed in the similar words list, using described
The word for choosing operation targeted replaces target string corresponding to the click location.
In the embodiment of the present invention, during spelling words, after inputting each character, current existing word is extracted
Symbol string carries out error detection processing, and executes and act with processing corresponding to error detection processing acquired results, achievees the purpose that real-time detection,
As it can be seen that by being able to solve the longer problem of error detection feedback cycle using this programme.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow chart of spell checking methods provided by the embodiment of the present invention;
Fig. 2 is a kind of another flow chart of spell checking methods provided by the embodiment of the present invention;
Fig. 3 is a kind of another flow chart of spell checking methods provided by the embodiment of the present invention;
Fig. 4 is the schematic diagram of similar words list provided by the embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of spell check device provided by the embodiment of the present invention;
Fig. 6 is a kind of another structural schematic diagram of spell check device provided by the embodiment of the present invention;
Fig. 7 is a kind of another structural schematic diagram of spell check device provided by the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention provides a kind of spell checking methods and devices, long to solve error detection feedback cycle
The problem of.
A kind of spell checking methods are provided for the embodiments of the invention first below to be introduced.
It should be noted that a kind of spell checking methods provided by the embodiment of the present invention are with should be in electronic equipment, in reality
In the application of border, which may include:The equipment such as laptop, desktop computer, tablet computer, smart phone.
In addition, it is necessary to explanation, realizes a kind of functional software of spell checking methods provided by the embodiment of the present invention,
It can be the concrete function of some software carrying, or special client, for example, special client can be
Short message application program, mailbox application program, document application program etc. have the client of spelling words scene;Alternatively, realizing this
A kind of functional software of spell checking methods provided by inventive embodiments may be the feature card of existing client, lift
For example, existing plug-in unit, which can be, is embedded in short message application program, mailbox application program, document application program etc. with word
The plug-in unit, etc. in scene is spelt, this is all reasonable.
As shown in Figure 1, a kind of spell checking methods provided by the embodiment of the present invention, may include steps of:
S101, real-time detection character entering function;
Wherein, due to during spelling words, therefore the starting point that each letter can become input error be
The immediate feedback for guaranteeing error detection can input characters into the trigger condition operated as spell check, it is possible to
During spelling words, real-time detection character entering function.It is understood that can be using the prior art come real-time detection word
Symbol input operation, it is not limited here.
It is emphasized that word involved in the embodiment of the present invention is the information being made of character string.For example:English
Literary word is the word suitable for the embodiment of the present invention, is made of at least one English alphabet, certainly, the embodiment of the present invention
Word is not limited to English word, and any information being made of character string may each be list mentioned by the embodiment of the present invention
Word, such as Chinese, Korean, Japanese, Arabic etc..
S102 determines first object word hyphenation symbol and the from cursor current location after detecting character entering function
The position of two target word hyphenations symbol, from the position that the first object word hyphenation accords with and the second target word hyphenation symbol
Position between extract target string to be detected;
It is understood that the type of word hyphenation symbol may include:Punctuation mark and space.
As a specific implementation, when character entering function is the character entering function that sequence spells out the words,
After detecting character entering function, show that the trigger condition of spell check is met, hence, it can be determined that first object word
The position of hyphenation symbol and the second target word hyphenation symbol, due in input process, i.e., not deposited on the right of cursor current location at this time
In character string, therefore using cursor position as the second target word section lexicon, there are positions, so from first object word hyphenation
Between symbol and the second target phase lexicon position, target string to be detected is extracted.For example:For english sentence:
"hello word!" for comprising word hyphenation symbol be:One space and punctuation mark "!".So, in the English
In the sub- input process of sentence, after each character input, target string can be extracted according to step described in S102, be mentioned
The target string taken is followed successively by:"h","he","hel""hell","hello","w",……"word".
As another specific implementation, when character entering function is some for returning to word written by modification front
Or when operation when certain characters, after detecting character entering function, show that the trigger condition of spell check is met, it can
To determine the position of first object word hyphenation symbol and the second target word hyphenation symbol, from the position that first object word hyphenation accords with
Between the position of the second target word section lexicon, target string to be detected is extracted.For example:For english sentence:
"hello word!" for, it is assumed that two " lls " of the current location of cursor at " hello " are intermediate, every input one in " ll "
After a word, target string can be extracted according to S102 step, when inputted character is " p ", " i ", " w " according to this, then be extracted
Target string be according to this:"helplo","helpilo","helpiwlo".It is emphasized that when inputted character is
Space, then english sentence is revised as " hel loword!" when cursor is located at after space, extracted target string is
" lo ", when before cursor being located at space, extracted target string is " hel ".
It is emphasized that after each character input, it can be from the position that first object word hyphenation accords with and the second target
Target string to be detected is extracted between the position of word hyphenation symbol, therefore, target string is not necessarily entire list herein
Word is also possible to not complete the word of input.In addition, since purpose is to carry out error detection to word and phrase, not having can
Informative space and punctuation mark are removed not as the targeted object of character entering function.Also, it is to be understood that
Be can be realized using any one specific implementation in the prior art from target word hyphenation symbol between extract it is to be checked
The target string of survey, this will not be repeated here.
S103 carries out error detection processing to target string;
After extracting target string, according to predetermined way, error detection processing is carried out to target string, and according to error detection
It handles acquired results and executes corresponding processing movement.
Specifically, in one implementation, carrying out error detection processing to the target string, may include:
Whether identical as the word in default dictionary judge the target string, if so, show that spelling is correct, it is no
Then, show misspelling.
For example, it is assumed that the target string currently extracted is " wo ", carries out matching discovery in default dictionary,
Although having " woad " " woe " " word " etc. in the default dictionary, none of " wo " exists, therefore, at error detection
Reason acquired results are misspelling;Assume that the target string currently extracted is " wod " again, due to the target string
" wod " does not match with any one of default dictionary word, and therefore, it is still misspelling that error detection, which handles acquired results,.
In another implementation, error detection processing is carried out to the target string, may include:Judge the target character
Whether string matches at least one word in default dictionary, if so, showing that spelling is correct, otherwise, shows misspelling
Accidentally, wherein the target string and word match for:What target string and word were included is with the word initial
The character string of beginning is identical.
For example:Assuming that the target string currently extracted is " wo ", due to the target string " wo " and preset
" woad " " woe " " word " in dictionary ... matches, that is, the target string extracted is included with each word
It is identical with character string that target string initial is starting, therefore, it is that spelling is correct that error detection, which handles acquired results,;Assume again
The target string currently extracted is " wod ", since the target string " wod " is not at least one of with default dictionary
Word matches, and therefore, it is misspelling that error detection, which handles acquired results,.
It is understood that the building mode of default dictionary can use the prior art, this will not be repeated here.In addition,
The above-mentioned given specific implementation for carrying out error detection processing to the target string is merely exemplary, should not constitute
Restriction to the embodiment of the present invention, it is emphasized that, it is any can check target string whether be do not input it is complete certain
The implementation of one word can be with.
S104 executes processing corresponding with error detection processing acquired results and acts.
Wherein, after carrying out error detection processing to target string, it can execute and be handled corresponding to acquired results with the error detection
Processing movement, to user feedback error detection, to achieve the purpose that shorten feedback cycle in time.
Specifically, when error detection processing acquired results are to spell correct, corresponding processing movement is:It does not deal with;
If error detection processing acquired results are misspelling, corresponding processing movement is:Obtain rising for target string
Beginning location address and final position address, it is prominent based on initial position of the target string in editing area and final position
Show the target string.
Wherein, the initial position based on target string in editing area and final position highlight the target word
Accord with the specific implementation of string there are a variety of, for example:
In one implementation, described to be based on the starting position addresses and the final position address, it highlights
The target string may include:
Using position corresponding to the target starting position addresses as starting point, by position corresponding to the final position address
It as terminal, is underlined to from the starting point to the distance of the terminal, to highlight the target string;
In another implementation, described to be based on the starting position addresses and the final position address, it protrudes aobvious
Show the target string, may include:
Using position corresponding to the starting position addresses as starting point, using position corresponding to the final position address as
Terminal, it is described to highlight to the equal overstriking of each character, inclination or the adjustment font color from the starting point to the terminal
Target string.Wherein, the line style of the underscore includes at least:Single straight line, bilinear, dotted line, wave etc..Certainly,
So-called highlight can also be addition animation effect, show as target string flashes, or triggering audible alarm unit
Deng.
It is understood that the above-mentioned mode for highlighting target string can be used in combination, to improve target word
Accord with the high-lighting of string.In addition, the above-mentioned given implementation for highlighting target string is merely exemplary, do not answer
Restriction of this composition to the embodiment of the present invention.
It will be appreciated by persons skilled in the art that the starting position addresses of target string and final position address are mesh
The address that mark character string is actual recorded in the database, the initial position shown in editing area with target string and end
Stop bit, which is set, is different concept.Wherein, the position of display is adjusted according to the size of display screen, a corresponding display
Location address, and starting position addresses that above-mentioned target string is actual recorded in the database and final position address are
The character string is actually stored in the address on hardware, not different with the display condition of external display.
It is emphasized that existing skill can be passed through by obtaining the starting position addresses of target string and final position address
Art obtains.Also, target string starting position addresses and stop bit can be obtained immediately after target string is extracted
Address is set, at this point it is possible to which the starting position addresses of target string and final position address and target string correspondence are deposited
Storage is in record sheet, so as to subsequent in the starting position addresses for using the target string and final position address, directly
Starting position addresses corresponding to the target string and final position address are extracted from record sheet;Certainly, in target character
String can not obtain target string starting position addresses and final position address after being extracted immediately, but, it is handled in error detection
It when acquired results are misspelling, then goes to obtain the corresponding starting position addresses of target string and final position address, in turn
Target string is highlighted based on the starting position addresses of the target string and final position address.
In the embodiment of the present invention, during spelling words, after inputting each character, current existing word is extracted
Symbol string carries out error detection processing, and executes and act with processing corresponding to error detection processing acquired results, achievees the purpose that real-time detection,
As it can be seen that by being able to solve the longer problem of error detection feedback cycle using this programme.
Further, understand immediately in order to facilitate user error character string why mistake, and corresponding which is correct
Alternative word, on the basis of embodiment shown in Fig. 1, as shown in Fig. 2, a kind of spell check provided by the embodiment of the present invention
Method can also include step:
S105 is determined corresponding to the click location when detecting the clicking operation that click location conforms to a predetermined condition
Target string;
Wherein, predetermined condition is:The position of clicking operation is located at the target word that error detection processing acquired results are misspelling
In symbol string region.That is, obtaining the location address of the click location, which is carried out to inquiry in record sheet and is swept
It retouches, if the location address is that some starting position addresses perhaps some final position address or falls into some initial position
Between address and final position address, then it is determined that the click location conforms to a predetermined condition.It is emphasized that step is stored in advance
Result detected by rapid S103 is for initial position corresponding to the character string of mistake and detected error character string
Location, final position address, wherein specific storage method is realized that this will not be repeated here by the prior art.
For example, pass through the starting position addresses of record sheet misregistration character string and final position address and mistake
The corresponding relationship of character string, due in record sheet, having recorded the storage between some starting position addresses and final position address
The corresponding relationship in space and target string, thus determine the click location corresponding to target string the step of, be
In record sheet, location address will click on, by inquiring some starting position addresses and stop bit where finding the location address
Address is set, then will be taken out corresponding target string between some starting position addresses and final position address.
Wherein, when user wishes to check the corresponding correct alternative word of error character string, click location can be issued
The clicking operation to conform to a predetermined condition;Correspondingly, the electronic equipment is when detecting the qualified clicking operation of click location,
It can determine target string corresponding to the click location, and then execute subsequent operation.
Wherein, for supporting the electronic equipment of mouse, which can grasp for the right button issued by mouse
Make, it is of course also possible to be operated for left button;In addition, the clicking operation can be for supporting the electronic equipment of touch control operation
The clicking operation issued by touch body, the touch body can be felt pen or user's finger.
S106 shows the similar words list of target string corresponding to the click location.
After determining target string corresponding to the click location, target corresponding to the click location can be shown
The similar words list of character string, wherein the word in the similar words list be in default dictionary with the target character
String has the word of certain similitude.It in practical applications, not only may include word in the similar words list, it can be with
Including other function option, such as:All ignore, be added to dictionary, translation etc..
It is understood that error detection processing is carried out to the target string in a kind of implementation provided before, it can
To include:Whether identical as the word in default dictionary judge the target string, if so, show that spelling is correct, it is no
Then, show misspelling;
So, correspondingly, it is more than predetermined threshold that the word in the similar words list, which is with the similarity of target string,
Word, wherein the calculation of the similarity between word can be calculated using the prior art, it is not limited here.
In addition, carrying out error detection processing in another implementation provided before to the target string, can wrap
It includes:Judge whether the target string matches at least one word in default dictionary, if so, showing spelling just
Really, otherwise, show misspelling, wherein the target string and word match for:Target string and word are included
With the word initial be starting character string it is identical;
So, correspondingly, similar words list includes:With in target string corresponding to the click location, error detection knot
Fruit shows to spell the word that correct partial character string is beginning.
In addition, it is necessary to explanation, in pre-set dictionary library, in target string corresponding to the click location, error detection
The result shows that spelling the word that correct partial character string is beginning, usual quantity is more, and the show area of similar words list
Domain is limited, therefore, can be ranked up according to weighted value to multiple words, and weighted value is selected to be greater than a certain value or ranking results
Part of words before predetermined ranking is shown in similar words list.Wherein, the weighted value of each word can foundation
The frequency of use of each word counted in advance is set, and can also set the weighted value of word by other means certainly.
For example:User wishes to check why wrong the word of underscore mark is and has which correct word that can select
When selecting, the position of any one letter of the word that cursor placement to underscore can be marked, such as by cursor placement at " wod "
Between " o " and " d " in word, right mouse button is then clicked, to recall similar words list corresponding to " wod ", such as
Similar words list shown in Fig. 4, wherein not only include word in the similar words list:woad,woe,wold,wood,
Word further includes having all ignore, be added to three dictionary, translation functions.
As it can be seen that in the present embodiment while shortening feedback cycle, user can also be facilitated by similar words list
Immediately why wrong understanding error character string is and corresponds to which correct alternative word, improves the usage experience of user.
Further, it rights the wrong character string in order to facilitate user, the basis of embodiment shown in Fig. 2, such as Fig. 3 institute
Show, a kind of spell checking methods provided by the embodiment of the present invention can also include step:
S107 operates institute using choosing when detecting for when the choosing operation of a word in similar words list
For word replace target string corresponding to the click location.
Wherein, choosing operation can be:Clicking operation, such as:Left mouse button operation is grasped by the touch that touch body issues
Make.
For example:As shown in figure 4, error detection is for misspelling and at " wod " when target string is " wod "
Under highlight, show the similar words list of target string to user at this time;When detecting that user chooses Fig. 4
Shown in " woad " word in similar words list when, obtain the word " woad " that user chooses, " wod " in figure replaced with
" woad " wherein, obtains the word " woad " that user chooses, is by " wod " in figure specific method for replacing with " woad ":It obtains
The length of word " woad ", acquisition " woad " text that user chooses, the starting position addresses for obtaining " wod " and end position
Location;According to the length of " woad " text, the location address of the subsequent every other text in end position address is successively carried out
Change;" wod " is chosen, then deletes " wod ", and " woad " is put into the corresponding text of starting position addresses.
If the word that user chooses is " woo ", according to the length of " woo " text, end position address is subsequent all
The location address of other texts is not necessarily to change;" wod " is chosen, then deletes " wod ", and " woo " is put into initial position
In the corresponding text in address.
It is according to the length of " we " text, end position address is subsequent all if the word that user chooses is " we "
The location address of other texts successively changes;" wod " is chosen, then deletes " wod ", and " we " is put into start bit
It sets in the corresponding text in address, modifies the end address of the text.
It is emphasized that replacing target word corresponding to the click location using the word for choosing operation targeted
While symbol string, do not make the character string changed Forward around this replacement position, or move back.
As it can be seen that in the present embodiment while shortening feedback cycle, not only use can be facilitated by similar words list
Family understands which correct alternative word error character string corresponds to immediately, user can also be facilitated to right the wrong character string, into one
Step improves the usage experience of user.
Corresponding to above method embodiment, the embodiment of the invention also provides a kind of spell check devices, are applied to electronics
Equipment, as shown in figure 5, the apparatus may include:
Real-time detection module 510 is used for real-time detection character entering function during spelling words;
Target string extraction module 520, for determining from cursor current location after detecting character entering function
The position of one target word hyphenation symbol and the second target word hyphenation symbol, from the position that the first object word hyphenation accords with and institute
It states and extracts target string to be detected between the position of the second target word hyphenation symbol, wherein the first object word is disconnected
Lexicon is the nearest word hyphenation symbol in the current location left side, and the second target word hyphenation symbol is that the current location is right
The nearest word hyphenation symbol in side;
Error detection processing module 530, for carrying out error detection processing to the target string;
Action executing module 540 is handled, is acted for executing with processing corresponding to error detection processing acquired results.
In the embodiment of the present invention, during spelling words, after inputting each character, current existing word is extracted
Symbol string carries out error detection processing, and executes and act with processing corresponding to error detection processing acquired results, achievees the purpose that real-time detection,
As it can be seen that by being able to solve the longer problem of error detection feedback cycle using this programme.
Specifically, the error detection processing module 530, may include:
Error detection processing unit, for judging whether the target string is identical as the word in default dictionary, if
It is to show that spelling is correct, otherwise, shows misspelling;Or
For judging whether the target string matches at least one word in the default dictionary, if
Be to show that spelling is correct, otherwise, show misspelling, wherein the target string and word match for:Target character
String with word included with the word initial be originate character string it is identical.
Specifically, the error detection processing acquired results are when spelling correct, performed by the processing action executing module 540
Corresponding processing movement be:It does not deal with;
Error detection processing acquired results are misspelling, corresponding performed by the processing action executing module 540
Processing movement be:
The error detection processing module obtains starting position addresses and the final position address of the target string, is based on institute
Starting position addresses and the final position address are stated, the target string is highlighted.
Specifically, the type of the word hyphenation symbol includes:
Punctuation mark and space.
Specifically, the processing action executing module, is specifically used for when error detection processing acquired results are misspelling,
Using position corresponding to the target starting position addresses as starting point, by position corresponding to the final position address
It as terminal, is underlined to from the starting point to the distance of the terminal, to highlight the target string;
Alternatively,
Using position corresponding to the starting position addresses as starting point, using position corresponding to the final position address as
Terminal, it is described to highlight to the equal overstriking of each character, inclination or the adjustment font color from the starting point to the terminal
Target string.
In the embodiment of the present invention, during spelling words, after inputting each character, current existing word is extracted
Symbol string carries out error detection processing, and executes and act with processing corresponding to error detection processing acquired results, achievees the purpose that real-time detection,
As it can be seen that by being able to solve the longer problem of error detection feedback cycle using this programme.
Further, understand why wrong error character string is and correspondence which correctly immediately in order to facilitate user
Alternative word is including that real-time detection module 510, target string extraction module 520, error detection processing module 530 and processing are dynamic
On the basis of making execution module 540, as shown in fig. 6, a kind of spell check device provided by the embodiment of the present invention can also wrap
It includes:
Character string determining module 550, for determining institute when detecting the clicking operation that click location conforms to a predetermined condition
State target string corresponding to click location, wherein the predetermined condition is:It is misspelling positioned at error detection processing acquired results
In target string region accidentally;
List display module 560, for showing the similar words list of target string corresponding to the click location.
As it can be seen that in the present embodiment while shortening feedback cycle, user can also be facilitated by similar words list
Immediately why wrong understanding error character string is and corresponds to which correct alternative word, improves the usage experience of user.
Further, it rights the wrong character string in order to facilitate user, as shown in fig. 7, including real-time detection module
510, target string extraction module 520, error detection processing module 530, processing action executing module 540, character string determining module
550 and list display module 560 on the basis of, a kind of spell check device provided by the embodiment of the present invention can also include:
Character replacement module 570, for choosing behaviour when detect the word being directed in the similar words list
When making, target string corresponding to the click location is replaced using the word for choosing operation targeted.
As it can be seen that in the present embodiment while shortening feedback cycle, not only use can be facilitated by similar words list
Family understands which correct alternative word error character string corresponds to immediately, user can also be facilitated to right the wrong character string, into one
Step improves the usage experience of user.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method
Part explanation.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (14)
1. a kind of spell checking methods, which is characterized in that it is applied to electronic equipment, the method includes:
Real-time detection character entering function;
After detecting character entering function, first object word hyphenation symbol and the second target word are determined from cursor current location
The position of hyphenation symbol, between the position that the first object word hyphenation accords with and the position that the second target word hyphenation accords with
Extract target string to be detected, wherein the first object word hyphenation symbol is the nearest list in the current location left side
Word hyphenation symbol, the second target word hyphenation symbol are word hyphenation symbol nearest on the right of the current location;
Error detection processing is carried out to the target string;
It executes and is acted with processing corresponding to error detection processing acquired results;
The method also includes:
When detecting the clicking operation that click location conforms to a predetermined condition, target character corresponding to the click location is determined
String, wherein the predetermined condition is:It is in the target string region of misspelling positioned at error detection processing acquired results;
Show the similar words list of target string corresponding to the click location;
The predetermined condition is specially:The location address of the click location is the starting position addresses recorded in record sheet, or
Person is the final position address that records in the record sheet, or fall into the starting position addresses recorded in the record sheet and
Between final position address;
The record sheet, for recording starting position addresses and the final position address of the target string;
The starting position addresses and final position address are the address that the target string is actual recorded in the database.
2. the method according to claim 1, wherein described carry out error detection processing, packet to the target string
It includes:
Whether identical as the word in default dictionary judge the target string, if so, show that spelling is correct, otherwise,
Show misspelling.
3. the method according to claim 1, wherein to the target string carry out error detection processing, including:
Judge whether the target string matches at least one word in default dictionary, if so, showing to spell
Correctly, otherwise, show misspelling, wherein the target string and word match for:Target string is wrapped with word
Contain with the word initial be starting character string it is identical.
4. according to the method in claim 2 or 3, which is characterized in that
The error detection processing acquired results are when spelling correct, and corresponding processing movement is:It does not deal with;
When the error detection processing acquired results are misspelling, corresponding processing movement is:Obtain the target string
Starting position addresses and final position address are based on the starting position addresses and the final position address, highlight institute
State target string.
5. the method according to claim 1, wherein the type of word hyphenation symbol includes:
Punctuation mark and space.
6. according to the method described in claim 4, it is characterized in that, described be based on the starting position addresses and the stop bit
Address is set, the target string is highlighted, including:
Using position corresponding to the target starting position addresses as starting point, using position corresponding to the final position address as
Terminal is underlined to from the starting point to the distance of the terminal, to highlight the target string;
Alternatively,
Using position corresponding to the starting position addresses as starting point, using position corresponding to the final position address as eventually
Point, to the equal overstriking of each character, inclination or the adjustment font color from the starting point to the terminal, to highlight the mesh
Mark character string.
7. the method according to claim 1, wherein further including:
When detecting when the choosing operation of a word being directed in the similar words list, operation institute's needle is chosen using described
Pair word replace target string corresponding to the click location.
8. a kind of spell check device, which is characterized in that be applied to electronic equipment, described device includes:
Real-time monitoring module is used for real-time detection character entering function;
Target string extraction module, for determining first object from cursor current location after detecting character entering function
The position of word hyphenation symbol and the second target word hyphenation symbol, from the position and described second that the first object word hyphenation accords with
Target string to be detected is extracted between the position of target word hyphenation symbol, wherein the first object word hyphenation, which accords with, is
The nearest word hyphenation symbol in the current location left side, the second target word hyphenation symbol are nearest on the right of the current location
Word hyphenation symbol;
Error detection processing module, for carrying out error detection processing to the target string;
Action executing module is handled, is acted for executing with processing corresponding to error detection processing acquired results;
Described device further includes:
Character string determining module, for determining the click when detecting the clicking operation that click location conforms to a predetermined condition
Target string corresponding to position, wherein the predetermined condition is:It is the mesh of misspelling positioned at error detection processing acquired results
It marks in character string region;
List display module, for showing the similar words list of target string corresponding to the click location;
The predetermined condition is specially:The location address of the click location is the starting position addresses recorded in record sheet, or
Person is the final position address that records in the record sheet, or fall into the starting position addresses recorded in the record sheet and
Between final position address;
The record sheet, for recording starting position addresses and the final position address of the target string;
The starting position addresses and final position address are the address that the target string is actual recorded in the database.
9. device according to claim 8, which is characterized in that the error detection processing module is specifically used for:
Whether identical as the word in default dictionary judge the target string, if so, show that spelling is correct, otherwise,
Show misspelling.
10. device according to claim 8, which is characterized in that the error detection processing module is specifically used for:
Judge whether the target string matches at least one word in default dictionary, if so, showing to spell
Correctly, otherwise, show misspelling, wherein the target string and word match for:Target string is wrapped with word
Contain with the word initial be starting character string it is identical.
11. device according to claim 9 or 10, it is characterised in that:
The error detection processing acquired results are when spelling correct, and the error detection processing module is not dealt with;
When the error detection processing acquired results are misspelling, the error detection processing module obtains the starting of the target string
Location address and final position address are based on the starting position addresses and the final position address, highlight the mesh
Mark character string.
12. device according to claim 8, which is characterized in that the type of word hyphenation symbol includes:
Punctuation mark and space.
13. device according to claim 11, which is characterized in that the processing action executing module is specifically used for:
Using position corresponding to the target starting position addresses as starting point, using position corresponding to the final position address as
Terminal is underlined to from the starting point to the distance of the terminal, to highlight the target string;
Alternatively,
Using position corresponding to the starting position addresses as starting point, using position corresponding to the final position address as eventually
Point, to the equal overstriking of each character, inclination or the adjustment font color from the starting point to the terminal, to highlight the mesh
Mark character string.
14. device according to claim 8, which is characterized in that further include:
Character replacement module utilizes institute when detecting when the choosing operation of a word being directed in the similar words list
It states the word for choosing operation targeted and replaces target string corresponding to the click location.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610257505.5A CN107305542B (en) | 2016-04-21 | 2016-04-21 | A kind of spell checking methods and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610257505.5A CN107305542B (en) | 2016-04-21 | 2016-04-21 | A kind of spell checking methods and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107305542A CN107305542A (en) | 2017-10-31 |
CN107305542B true CN107305542B (en) | 2018-11-16 |
Family
ID=60150208
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610257505.5A Active CN107305542B (en) | 2016-04-21 | 2016-04-21 | A kind of spell checking methods and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107305542B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1254135A (en) * | 1998-11-12 | 2000-05-24 | 英业达集团(上海)电子技术有限公司 | Writing aid system and its method |
CN102298577A (en) * | 2011-09-21 | 2011-12-28 | 深圳市万兴软件有限公司 | Method and device for detecting spelling of document edition |
CN102629160A (en) * | 2012-03-16 | 2012-08-08 | 华为终端有限公司 | Input method, input device and terminal |
CN102937949A (en) * | 2012-10-15 | 2013-02-20 | 福建榕基软件股份有限公司 | Method and system for checking English spelling in rich text editor |
CN103885938A (en) * | 2014-04-14 | 2014-06-25 | 东南大学 | Industry spelling mistake checking method based on user feedback |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7032174B2 (en) * | 2001-03-27 | 2006-04-18 | Microsoft Corporation | Automatically adding proper names to a database |
CN101661331B (en) * | 2008-08-28 | 2012-05-30 | 北京搜狗科技发展有限公司 | Character and phrase input method and input method system |
US20120284308A1 (en) * | 2011-05-02 | 2012-11-08 | Vistaprint Technologies Limited | Statistical spell checker |
CN102750003B (en) * | 2012-05-30 | 2016-08-10 | 华为技术有限公司 | The method and apparatus of text input |
-
2016
- 2016-04-21 CN CN201610257505.5A patent/CN107305542B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1254135A (en) * | 1998-11-12 | 2000-05-24 | 英业达集团(上海)电子技术有限公司 | Writing aid system and its method |
CN102298577A (en) * | 2011-09-21 | 2011-12-28 | 深圳市万兴软件有限公司 | Method and device for detecting spelling of document edition |
CN102629160A (en) * | 2012-03-16 | 2012-08-08 | 华为终端有限公司 | Input method, input device and terminal |
CN102937949A (en) * | 2012-10-15 | 2013-02-20 | 福建榕基软件股份有限公司 | Method and system for checking English spelling in rich text editor |
CN103885938A (en) * | 2014-04-14 | 2014-06-25 | 东南大学 | Industry spelling mistake checking method based on user feedback |
Also Published As
Publication number | Publication date |
---|---|
CN107305542A (en) | 2017-10-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20190087084A1 (en) | User-centric soft keyboard predictive technologies | |
US10990511B2 (en) | Apparatus and application interface traversing method | |
US20120110459A1 (en) | Automated adjustment of input configuration | |
CN103959206B (en) | Method and apparatus for dynamically adapting dummy keyboard | |
US20130007606A1 (en) | Text deletion | |
US20150234938A1 (en) | Method and electronic terminal for searching for contact in directory | |
EP2713255A1 (en) | Method and electronic device for prompting character input | |
CN102830924B (en) | A kind of method and device adjusting entering method keyboard | |
US8976118B2 (en) | Method for character correction | |
CN109739416B (en) | Text extraction method and device | |
EP3029567B1 (en) | Method and device for updating input method system, computer storage medium, and device | |
CN106201177A (en) | A kind of operation execution method and mobile terminal | |
KR101394874B1 (en) | Device and method implementing for particular function based on writing | |
CN102937864A (en) | Method and device for determining selected texts on touch terminals | |
CN103324674A (en) | Method and device for selecting webpage content | |
EP3640788A1 (en) | Convenient operating method and terminal | |
CN104133815B (en) | The method and system of input and search | |
CN103838458B (en) | Mobile terminal and control method of input method of mobile terminal | |
CN104076945B (en) | Apparatus and method for showing input keyboard in the terminal | |
WO2016155643A1 (en) | Input-based candidate word display method and device | |
CN106909296A (en) | The extracting method of data, device and terminal device | |
CN106970899B (en) | Text processing method and device | |
CN107305542B (en) | A kind of spell checking methods and device | |
CN106354752A (en) | Words searching method and device, and electronic device | |
CN106293368B (en) | Data processing method and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |