CN111475999B - Error prompt generation method and device - Google Patents
Error prompt generation method and device Download PDFInfo
- Publication number
- CN111475999B CN111475999B CN201910060106.3A CN201910060106A CN111475999B CN 111475999 B CN111475999 B CN 111475999B CN 201910060106 A CN201910060106 A CN 201910060106A CN 111475999 B CN111475999 B CN 111475999B
- Authority
- CN
- China
- Prior art keywords
- text
- displayed
- text segment
- visible
- segment
- 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
- 238000000034 method Methods 0.000 title claims abstract description 41
- 230000003111 delayed effect Effects 0.000 abstract 1
- 238000004891 communication Methods 0.000 description 11
- 238000007689 inspection Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
Images
Landscapes
- User Interface Of Digital Computer (AREA)
Abstract
The embodiment of the invention provides a method and a device for generating an error prompt, wherein the method for generating the error prompt comprises the following steps: determining a displayed text segment according to the visible text displayed in the screen effective display area; and performing grammar check on the displayed text segment, and generating an error prompt aiming at the visible text according to a check result. According to the scheme for generating the error prompt, the text segment corresponding to the visible text is determined, the error prompt is generated aiming at the visible text, single full grammar check on the complete text is not needed, time consumption for generating the error prompt can be greatly reduced, the error prompt can be fed back to a user quickly, and therefore the problem that due to the fact that time consumption is long in the existing scheme, the error prompt cannot be fed back to the user timely, editing time of the user is delayed, and user experience is poor is solved.
Description
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a method and a device for generating an error prompt.
Background
Generally, people edit texts through various editors, and grammar errors and other situations inevitably occur in the editing process, and at the moment, users can find and correct the grammar errors in the edited texts through an error prompt function of the editors in time.
However, when determining an error in a text, an editor generally performs syntax check on all texts and then generates all error information corresponding to all texts according to the check result. However, when some large texts are encountered, for example, a user edits multiple segments of SQL in an editor, the editor may consume a long time in the process of performing syntax checking on the text, so that the editor cannot timely feed back an error prompt to the user, and further hysteresis is generated when editing the text for the user, which results in poor user experience.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for generating an error prompt to solve the above problems.
According to a first aspect of the embodiments of the present invention, a method for generating an error prompt is provided, including: determining a displayed text segment according to the visible text displayed in the screen effective display area; and carrying out grammar check on the displayed text segment, and generating an error prompt aiming at the visible text according to a check result.
According to a second aspect of the embodiments of the present invention, there is provided an error prompt generation apparatus, including: the display determining module is used for determining a displayed text segment according to the visible text displayed in the screen effective display area; and the checking module is used for carrying out grammar checking on the displayed text segment and generating an error prompt aiming at the visible text according to a checking result.
According to the scheme provided by the embodiment of the invention, the error prompt is generated aiming at the visible text by determining the text segment corresponding to the visible text without carrying out single full grammar check on the complete text, so that the time consumption for generating the error prompt can be greatly reduced, and the error prompt can be fed back to the user relatively quickly, thereby avoiding the problem that the error prompt cannot be fed back to the user in time due to long time consumption in the existing scheme, so that the user has hysteresis when editing the user, and the user experience is poor.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present invention, and it is also possible for a person skilled in the art to obtain other drawings based on the drawings.
Fig. 1 is a flowchart illustrating steps of a method for generating an error prompt according to a first embodiment of the present invention;
FIG. 2 is a diagram illustrating an effective display area of a screen according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating steps of a method for generating an error prompt according to a second embodiment of the present invention;
fig. 4 is a block diagram of a device for generating an error prompt according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments of the present invention shall fall within the scope of the protection of the embodiments of the present invention.
The following further describes concrete implementation of the embodiment of the invention by combining the drawings of the embodiment of the invention.
Example one
Referring to fig. 1, a flowchart illustrating steps of a method for generating an error prompt according to a first embodiment of the present invention is shown.
The method provided by the embodiment comprises the following steps:
s102, determining a displayed text segment according to the visible text displayed in the screen effective display area.
In this embodiment, when the method is applied to an editor for editing a scene of multiple pieces of SQL, the editor may be an editor for writing a source code of a program, a user may edit multiple pieces of individual SQL codes in one editor, and the multiple pieces of SQL codes are integrally used as a unit for task execution, so that the multiple pieces of SQL codes form complete text content, and each individual piece of SQL code is a text piece. However, for various electronic devices, when a visible text is displayed on a screen of the electronic device, due to the limitation of the effective display area of the screen, a complete text content cannot be completely displayed at one time, that is, only part of the content in the display is visible to a user to form a visible text, and the complete text content can be displayed by scrolling.
In this embodiment, as described above, the visible text may actually be considered as the text that is actually displayed in the screen effective display area, and the content that is actually displayed may be a part of text or all text in one text segment, which is not limited in this embodiment.
In contrast, in the case of the above, when the grammar check is performed before the error prompt is generated, the grammar check must be performed depending on the context in the text segment to obtain an accurate check result. However, even if the text is visible text, there may be a case where a certain text segment is not completely displayed, and therefore, the displayed text segment is determined according to the visible text in the present embodiment.
For example, referring to FIG. 2, the positional relationship between the screen active display area and a plurality of text segments is shown. As shown in fig. 3, the complete text content includes text segments as follows: the method comprises the steps of displaying a text segment, wherein the text segment comprises a first text, a second text, a third text, a fourth text and a fifth text, 8230, wherein a visible text displayed in an effective display area of a screen in the figure comprises a part of text of the second text, all text of the third text and a part of text of the fourth text, and therefore the displayed text segment determined according to the visible text comprises the second text, the third text and the fourth text.
In this embodiment, the displayed text segment may be determined according to the display mode of the text segment; or the text segment may be marked up in advance and then the displayed text segment may be determined from the text segment mark-up in the visible text, etc. The present embodiment is not limited as long as the displayed text segment can be determined.
S104, grammar check is carried out on the displayed text segment, and an error prompt aiming at the visible text is generated according to a check result.
In this embodiment, after the displayed text segment is determined in step S102, an accurate syntax check may be performed according to the context in the text segment, and a check result of the syntax check is determined, where the syntax check is to check whether the syntax in the checked text conforms to the preset syntax rule. Those skilled in the art can adaptively select a syntax checking method according to the type of the edited text, and the embodiment does not limit the type of the text and the syntax checking method.
In this embodiment, the displayed text segment is determined according to the visible text, and therefore, the check result obtained by performing syntax check on the displayed text segment includes the check result corresponding to the visible text. In this embodiment, the error prompt for the visible text may be directly generated according to the inspection result, and specifically, the method for generating the error prompt according to the inspection result may refer to related technologies, which is not described in detail herein.
The method provided by the embodiment can be applied to scenes including but not limited to scenes with more complete text contents such as the multi-segment SQL editing and the like, and can greatly reduce the time consumption for generating the error prompt by determining the text segment corresponding to the visible text without carrying out single full grammar check on the complete text, so that the error prompt can be fed back to the user more quickly, and the problem that the error prompt cannot be fed back to the user in time due to long time consumption in the existing scheme, so that the editing time lag exists for the user and the user experience is poor is solved; meanwhile, when editing is performed, the focus of attention of the user is the visible text visible to the user, and the scheme provided by the embodiment can also accurately provide error prompt for the user according to the focus of attention of the user.
Example two
Referring to fig. 3, a flowchart of steps of a method for generating an error prompt according to a second embodiment of the present invention is shown.
The method provided by the embodiment comprises the following steps:
s202, determining the visible text according to the position data of the screen effective display area and the complete text content.
In this embodiment, the position data of the effective display area of the screen may be width and height data, coordinate data, and the like of the effective display area of the screen. For example, if editing is performed by a browser, the screen effective display area may specifically be a web page visible area of the browser, and the position data thereof may be web page visible area height, web page visible area width, and the like.
In this embodiment, if the editing is performed by the editor, the complete text content is all the text content in the editor.
After the position data of the effective display area of the screen is determined, the visible text can be determined by combining the complete text content, and the specific determination method refers to the related technology, which is not described herein again.
And S204, determining a display result of a text segment in the visible text according to the visible text.
In this embodiment, the display result includes complete display and partial display. The display result is partially displayed, which means that the text segment of the visible text must include the partially displayed text segment, and may also include the completely displayed text segment; the display result is complete display, which means that only the completely displayed text segment is included in the text segments of the visible text, and the partially displayed text segment is not included.
For example, referring to fig. 2, if the text two and the text four in fig. 2 are text segments that are partially displayed, and the text three in fig. 2 is text segments that are completely displayed, it may be determined that the display result of the text segments in the visible text in fig. 2 is partially displayed.
The display result may specifically be determined according to the boundaries of the visible text.
For local display, for example, as shown in fig. 2, if the upper boundary of the visible region is the middle part of the text two, it may be determined that the display result of the text segment in the visible text in fig. 2 is local display; or the lower boundary of the visible region is the middle part of the text four, it may be determined that the display result of the text segment in the visible text in fig. 2 is a partial display. After the display result is determined to be partially displayed, whether the text segment which is completely displayed exists in the visible text can be determined by determining whether the boundary of the text segment is included in the visible text. The boundary of the text segment may be a segment drop mark, such as a segment mark in SQL code "; ".
For the complete display, if the upper boundary and the lower boundary of the visible region are both the junctions of the text segments, for example, the upper boundary of the visible text is the junction of the text two and the text one, and the lower boundary of the visible text is the junction of the text four and the text five, it may be determined that the display result is the complete display.
In addition, the display result may also be determined in other ways, for example, if the visible text includes a text segment displayed in a hidden display form, that is, if a part of the content in the text segment is displayed and another part is hidden, the text segment is a text segment that is partially displayed, so that the display result of the text segment in the visible text is partially displayed.
S206, determining the displayed text segment according to the display result of the text segment in the visible text.
In this embodiment, the display result includes partial display and complete display.
And if the display result is local display, performing a full finding operation on the text segment which is locally displayed, and determining the displayed text segment according to the text segment obtained by the full finding operation. Through finding the full operation, need not to carry on other operations, can simply, conveniently, swiftly find the text section that is totally displayed by part.
For example, as shown in fig. 2, if the second text and the fourth text in fig. 2 are partially displayed text segments, a find-all operation may be performed on the second text and the fourth text, so as to determine the second complete text and the fourth complete text according to the second partial text and the fourth partial text included in the visible text, and determine the second complete text and the fourth complete text and the third text between the second text and the fourth text as the displayed text segments.
It should be noted that, the screen active display area may also include only one partially displayed text segment. For example, the screen effective display area may include a partially displayed second text and a completely displayed third text, and at this time, the partially displayed second text and the completely displayed third text may be found and determined as text segments to be displayed; or the screen effective display area may include a completely displayed text three and a partially displayed text four, and at this time, the completely partially displayed text four may be found, and the text four and the text three may be determined as displayed text segments; or, only the partially displayed text three may be included in the screen effective display area, and at this time, the partially displayed text three may be found and determined as the displayed text segment.
Further, the performing a search operation on the partially displayed text segment includes: determining the position of the text segment displayed by the local display in the screen effective display area; and carrying out a search operation on the partially displayed text segment according to the determined position. Specifically, if it is determined that the partially displayed text segment is displayed at the top of the screen effective display area, for example, the text two in fig. 2, the text segment is searched upward until the partially displayed text segment is found from the visible text displayed at the top of the screen effective display area. Or, if it is determined that the partially displayed text segment is displayed at the bottom of the screen effective display area, for example, the text four in fig. 2, the text segment is searched downwards until the partially displayed text segment is found, taking the visible text displayed at the bottom of the screen effective display area as a starting point. In this embodiment, it may be determined by looking up the paragraph mark that the text segment that is globally displayed has been found.
In an actual use process, if the display result is a partial display, the partially displayed text segment may be located at the top or the bottom of the screen effective display area, and the partially displayed text segment may be subjected to a find-all operation by searching for a paragraph mark. After the completion operation is performed, two paragraph marks corresponding to the beginning or the end of the visible text respectively can be determined, and then the text segment between the two paragraph marks can be directly determined as the displayed text segment. For example, for the visible text shown in fig. 2, it is possible to find all the paragraph marks between text one and text two upward, and all the paragraph marks between text four and text five downward, and then determine that text two, text three, and text four between the two paragraph marks are the displayed text segments.
Of course, the above is only exemplified by using the arrangement direction of the text segments as the vertical arrangement, which is not limited in this embodiment, and in other implementation manners of this embodiment, the text segments may also be text segments typeset in other typesetting manners. For example, the arrangement directions of the first text, the second text, the third text, the fourth text and the fifth text may be arranged horizontally, at this time, the partially displayed text segment may be displayed on the left side or the right side of the effective display area of the screen, and when the search completion operation is performed on the partially displayed text segment, the visible text on the left side or the right side of the effective display area of the screen may be used as a starting point to search left or right until the partially displayed text segment is searched.
In this embodiment, the partially displayed text segment may also be displayed in other display manners, for example, in a hidden display manner. Specifically, in the case of the text three, when displayed, the text three may be partially displayed and partially hidden, so that the text three is a text segment that is partially displayed. When the search and completion operation is carried out on the text segment displayed in the mode, the position of the text segment displayed in the effective display area of the screen does not need to be determined, and the search and completion operation can be directly carried out by taking the content of the displayed part of the text segment as a starting point.
In addition, if the display result is complete display, and the display result is complete display means that only the completely displayed text segment is included in the visible text, it is sufficient to determine that the completely displayed text segment in the visible text is the displayed text segment. For example, if the visible text displayed in the screen effective display area is the complete text three, it is sufficient to directly determine that the text three is the displayed text segment.
S208, grammar check is carried out on the displayed text segment, and an error prompt aiming at the visible text is generated according to a check result.
The specific implementation manner of this step may refer to step S104 in the above embodiment.
Specifically, when the displayed text segment includes a partially displayed text segment, after the syntax check is performed on the displayed text segment in this step, a part of the check result is a check result corresponding to the invisible text. For example, referring to fig. 2, the text two is a text segment that is partially displayed, but in order to obtain an accurate check result, the grammar check is performed on the entire text two, so that the check result is a check result corresponding to the entire text two, that is, the check result includes not only the check result of the displayed part of the text two but also the check result corresponding to the part text that is not visible in the text two.
If the displayed text segment comprises the text segment which is locally displayed, when an error prompt aiming at the visible text is generated according to the inspection result, the inspection result of the invisible part can be directly ignored, and only the inspection result corresponding to the visible text is generated; or generating error prompts corresponding to all displayed text segments without ignoring the checking result of the invisible part. The check result of whether to ignore the invisible part may be preset, or may be dynamically set according to other conditions, for example, dynamically set according to an occupation ratio of the check result corresponding to the invisible part in the check result, dynamically set according to a ratio between a text of the invisible part and a visible text, and the like, which is not limited in this embodiment.
The method provided by the embodiment can be applied to scenes including but not limited to scenes with more complete text contents such as the multi-segment SQL editing and the like, and can greatly reduce the time consumption for generating the error prompt by determining the text segment corresponding to the visible text without carrying out single full grammar check on the complete text, so that the error prompt can be fed back to the user more quickly, and the problem that the error prompt cannot be fed back to the user in time due to long time consumption in the existing scheme, so that the editing time lag exists for the user and the user experience is poor is solved; meanwhile, when editing is carried out, the focus of attention of the user is the visible text visible to the user, so the scheme provided by the embodiment can also accurately provide error prompt for the user according to the focus of attention of the user; in addition, in the embodiment, the displayed text segment can be simply, conveniently and quickly determined by performing the find-all operation on the partially displayed text segment without performing other operations.
The method for generating the error prompt in the first and second embodiments of the present application may be executed by any suitable terminal device with data processing capability, including but not limited to: mobile terminals (such as tablet computers, mobile phones and the like) and PCs.
EXAMPLE III
Referring to fig. 4, a block diagram of an error prompt generation apparatus according to a third embodiment of the present invention is shown.
Referring to fig. 4, an apparatus provided in an embodiment of the present application includes: a display determination module 302, an inspection module 304.
The display determination module 302 is configured to determine the displayed text segment according to the visible text displayed in the screen active display area.
The checking module 304 is configured to perform syntax checking on the displayed text segment, and generate an error prompt for the visible text according to a checking result.
In an alternative embodiment, the display determination module comprises: the display result determining module is used for determining the display result of the text segment in the visible text according to the visible text, and the display result comprises complete display and partial display; and the text segment determining module is used for determining the displayed text segment according to the display result of the text segment in the visible text.
In an alternative embodiment, the text passage determination module comprises: and the local determining module is used for carrying out the full finding operation on the text segment which is locally displayed if the display result is local display, and determining the displayed text segment according to the text segment obtained by the full finding operation.
In an alternative embodiment, the local determination module comprises: and the searching and completing module is used for determining the position of the text segment which is locally displayed and displayed in the effective display area of the screen and performing searching and completing operation on the text segment which is locally displayed according to the determined position.
In an alternative embodiment, if it is determined that the partially displayed text segment is displayed at the top of the screen effective display area, the partially displayed text segment is searched upwards until the partially displayed text segment is found completely, with the visible text displayed at the top of the screen effective display area as a starting point.
In an alternative embodiment, if it is determined that the partially displayed text segment is displayed at the bottom of the screen effective display area, the partially displayed text segment is searched downwards until the partially displayed text segment is found completely, with the visible text displayed at the bottom of the screen effective display area as a starting point.
In an alternative embodiment, the text passage determination module comprises: and the complete determination module is used for determining the completely displayed text segment as the displayed text segment if the display result is complete display.
In an alternative embodiment, the displayed text segment is a text segment in which some or all of the text in the text segment belongs to the visible text.
The scenario that the scheme provided by this embodiment can be applied to includes, but is not limited to, the scenario that the content of the complete text such as the multi-segment SQL is edited is more, and an error prompt is generated for the visible text by determining the text segment corresponding to the visible text, instead of performing a single full grammar check on the complete text, so that time consumed for generating the error prompt can be greatly reduced, and the error prompt can be fed back to the user relatively quickly, thereby avoiding a problem that the error prompt cannot be fed back to the user in time due to long time consumption in the existing scheme, and further causing a hysteresis to occur in editing the user, and causing poor user experience; meanwhile, when editing is performed, the focus of attention of the user is the visible text visible to the user, and the scheme provided by the embodiment can also accurately provide error prompt for the user according to the focus of attention of the user.
Example four
A terminal device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the error prompt generation method.
Specifically, referring to fig. 5, a schematic structural diagram of a terminal device according to a fourth embodiment of the present invention is shown, and the specific embodiment of the present invention does not limit the specific implementation of the terminal device.
As shown in fig. 5, the terminal device may include: a processor (processor) 502, a Communications Interface (Communications Interface) 504, a memory 506, and a communication bus 508.
Wherein:
the processor 502, communication interface 504, and memory 506 communicate with one another via a communication bus 508.
A communication interface 504 for communicating with other terminal devices or servers.
The processor 502 is configured to execute the program 510, and may specifically execute relevant steps in the above-described method for generating an error prompt.
In particular, program 510 may include program code that includes computer operating instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit ASIC (Application Specific Integrated Circuit), or one or more Integrated circuits configured to implement an embodiment of the present invention. The terminal device comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 506 for storing a program 510. The memory 506 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may specifically be used to cause the processor 502 to perform the following operations: determining a displayed text segment according to the visible text displayed in the screen effective display area; and performing grammar check on the displayed text segment, and generating an error prompt aiming at the visible text according to a check result.
In an alternative embodiment, the determining the displayed text segment according to the visible text displayed in the screen active display area includes: determining a display result of a text segment in the visible text according to the visible text, wherein the display result comprises complete display and partial display; and determining the displayed text segment according to the display result of the text segment in the visible text.
In an optional embodiment, the determining the displayed text segment according to the display result of the text segment in the visible text includes: and if the display result is local display, performing a full finding operation on the text segment which is locally displayed, and determining the displayed text segment according to the text segment obtained by the full finding operation.
In an alternative embodiment, the performing the full operation on the partially displayed text segment includes: determining the position of the text segment which is partially displayed in the screen effective display area; and carrying out a search operation on the partially displayed text segment according to the determined position.
In an alternative embodiment, if it is determined that the partially displayed text segment is displayed at the top of the screen effective display area, the partially displayed text segment is searched upwards until the partially displayed text segment is found out, with the visible text displayed at the top of the screen effective display area as a starting point.
In an alternative embodiment, if it is determined that the partially displayed text segment is displayed at the bottom of the screen effective display area, the partially displayed text segment is searched downwards until the partially displayed text segment is found completely, with the visible text displayed at the bottom of the screen effective display area as a starting point.
In an alternative embodiment, the determining the displayed text segment according to the display result of the text segment in the visible text includes: and if the display result is complete display, determining that the completely displayed text segment is the displayed text segment.
In an alternative embodiment, the displayed text segment is a text segment in which some or all of the text in the text segment belongs to the visible text.
For specific implementation of each step in the program 510, reference may be made to corresponding steps and corresponding descriptions in units in the above-described embodiment of the error prompt generating method, which are not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
The terminal device of the embodiment generates the error prompt aiming at the visible text by determining the text segment corresponding to the visible text, and does not need to perform single-time full grammar check on the complete text, so that the time consumption for generating the error prompt can be greatly reduced, and the error prompt can be fed back to a user relatively quickly, thereby avoiding the problem that the error prompt cannot be fed back to the user in time due to long time consumption in the existing scheme, and further leading to hysteresis in editing the user, and leading to poor user experience.
EXAMPLE six
An embodiment of the present application provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for generating an error prompt as described above is implemented.
The computer storage medium of the embodiment generates the error prompt aiming at the visible text by determining the text segment corresponding to the visible text without carrying out single full grammar check on the complete text, so that the time consumption for generating the error prompt can be greatly reduced, and the error prompt can be fed back to a user relatively quickly, thereby avoiding the problem that the error prompt cannot be fed back to the user in time due to long time consumption in the existing scheme, further resulting in hysteresis in editing the user, and leading to poor user experience.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present invention may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present invention.
The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the error alert generation methods described herein. Further, when a general-purpose computer accesses code for implementing the error prompt generation method shown herein, execution of the code converts the general-purpose computer into a special-purpose computer for executing the error prompt generation method shown herein.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The above embodiments are only for illustrating the embodiments of the present invention and not for limiting the embodiments of the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention, so that all equivalent technical solutions also belong to the scope of the embodiments of the present invention, and the scope of patent protection of the embodiments of the present invention should be defined by the claims.
Claims (6)
1. A method for generating an error prompt, comprising:
determining a display result of a text segment in the visible text according to the visible text, wherein the display result comprises complete display and partial display;
if the display result is local display, determining the position of the text segment which is locally displayed in the effective display area of the screen;
if the text segment which is partially displayed is determined to be displayed at the top of the screen effective display area, upward searching until the text segment which is partially displayed is found; or if the text segment which is partially displayed is determined to be displayed at the bottom of the screen effective display area, the visible text displayed at the bottom of the screen effective display area is taken as a starting point, and the text segment which is partially displayed is searched downwards until the text segment which is partially displayed is found;
determining a displayed text segment according to the text segment obtained by the finding operation;
determining a displayed text segment according to the visible text displayed in the screen effective display area;
and carrying out grammar check on the displayed text segment, and generating an error prompt aiming at the visible text according to a check result.
2. The method of claim 1, wherein if the display result is a full display, determining that the text segment that is displayed in full is the text segment that is displayed.
3. The method of any of claims 1-2, wherein the displayed text segment is a text segment in which some or all of the text in the text segment belongs to the visible text.
4. An apparatus for generating an error message, comprising:
the display result determining module is used for determining the display result of the text segment in the visible text according to the visible text, wherein the display result comprises complete display and partial display;
the local determining module is used for carrying out the searching and completing operation on the text segment which is locally displayed through the searching and completing module if the display result is local display;
the finding-all module is used for upwards finding until the partially displayed text segment is found all by taking a visible text displayed at the top of the screen effective display area as a starting point if the partially displayed text segment is determined to be displayed at the top of the screen effective display area; or if the text segment which is partially displayed is determined to be displayed at the bottom of the screen effective display area, the visible text displayed at the bottom of the screen effective display area is taken as a starting point, and the text segment which is partially displayed is searched downwards until the text segment which is partially displayed is found;
the text segment determining module is used for determining the displayed text segment according to the display result of the text segment in the visible text;
the display determining module is used for determining a displayed text segment according to the visible text displayed in the screen effective display area;
and the checking module is used for carrying out grammar checking on the displayed text segment and generating an error prompt aiming at the visible text according to a checking result.
5. The apparatus of claim 4, wherein the completeness determination module is configured to determine the completely displayed text segment as the displayed text segment if the display result is a complete display.
6. The apparatus according to any one of claims 4-5, wherein the displayed text segment is a text segment in which some or all of the text in the text segment belongs to the visible text.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910060106.3A CN111475999B (en) | 2019-01-22 | 2019-01-22 | Error prompt generation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910060106.3A CN111475999B (en) | 2019-01-22 | 2019-01-22 | Error prompt generation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111475999A CN111475999A (en) | 2020-07-31 |
CN111475999B true CN111475999B (en) | 2023-04-14 |
Family
ID=71743218
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910060106.3A Active CN111475999B (en) | 2019-01-22 | 2019-01-22 | Error prompt generation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111475999B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1335571A (en) * | 2000-06-23 | 2002-02-13 | 微软公司 | Method and system for filtering & selecting from a candidate listing generated by random inputting method |
CN108519848A (en) * | 2018-03-30 | 2018-09-11 | 联想(北京)有限公司 | A kind of display control method and electronic equipment |
CN108664201A (en) * | 2017-03-29 | 2018-10-16 | 北京搜狗科技发展有限公司 | A kind of method for editing text, device and electronic equipment |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8373724B2 (en) * | 2009-01-28 | 2013-02-12 | Google Inc. | Selective display of OCR'ed text and corresponding images from publications on a client device |
-
2019
- 2019-01-22 CN CN201910060106.3A patent/CN111475999B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1335571A (en) * | 2000-06-23 | 2002-02-13 | 微软公司 | Method and system for filtering & selecting from a candidate listing generated by random inputting method |
CN108664201A (en) * | 2017-03-29 | 2018-10-16 | 北京搜狗科技发展有限公司 | A kind of method for editing text, device and electronic equipment |
CN108519848A (en) * | 2018-03-30 | 2018-09-11 | 联想(北京)有限公司 | A kind of display control method and electronic equipment |
Non-Patent Citations (2)
Title |
---|
Feng Cheng等. Visual speaker authentication with random prompt texts by a dual-task CNN framework.《Pattern Recognition》.2018,全文. * |
马金山,张宇,刘挺,李生.利用三元模型及依存分析查找中文文本错误.情报学报.2004,(第06期),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN111475999A (en) | 2020-07-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103984502B (en) | The method and portable terminal of a kind of screen printing content | |
US9507480B1 (en) | Interface optimization application | |
CN112818457A (en) | BIM (building information modeling) model intelligent generation method and system based on CAD (computer-aided design) drawing | |
US9811505B2 (en) | Techniques to provide processing enhancements for a text editor in a computing environment | |
KR20150095658A (en) | Preserving layout of region of content during modification | |
HK1204697A1 (en) | Method for form processing and terminal thereof | |
CN113282488A (en) | Terminal test method and device, storage medium and terminal | |
CN104424318A (en) | Method and device for controlling page elements | |
CN110378566B (en) | Information checking method, device, storage medium and apparatus | |
CN106484726A (en) | A kind of page display method and device | |
US20140053051A1 (en) | Application server and method for editing drawings of webpage | |
CN113935289A (en) | Document online processing method and device | |
CN116933350A (en) | Inventory compiling method, device, equipment and storage medium based on drawing sheet | |
CN111475999B (en) | Error prompt generation method and device | |
CN106776527B (en) | Electronic book data display method and device and terminal equipment | |
CN114491720A (en) | Method and device for generating detailed diagram of steel structure, electronic equipment and storage medium | |
CN108268681B (en) | PCB (printed Circuit Board) silk-screen adjustment system and method | |
KR102039422B1 (en) | Apparatus and method for automatically processing images | |
JP2016532897A (en) | Method and apparatus for building an intermediate character library | |
CN117493478A (en) | Map data inspection method, device, equipment and storage medium | |
WO2024002051A1 (en) | Document editing method and apparatus, and electronic device and storage medium | |
KR101996159B1 (en) | Information presentation method and apparatus | |
CN117974876A (en) | Model generation method and device, electronic equipment and storage medium | |
CN108363525B (en) | Method and device for responding to user gesture operation in webpage and terminal equipment | |
CN112818194A (en) | Hot spot generation method and equipment for home decoration panorama and storage medium |
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 |