A text processing method, device, equipment and storage medium

By counting and managing the number of characters in the text area in real time and triggering corresponding events to automatically handle character overrun issues, it solves the problem of cumbersome operations in text editing and improves user experience and editing efficiency.

CN112446191BActive Publication Date: 2024-09-17ZHUHAI KINGSOFT OFFICE SOFTWARE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910739107.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-12
Publication Date
2024-09-17
Estimated Expiration
2039-08-12

AI Technical Summary

Technical Problem

During the text editing process, when the user needs to input characters in a designated area, he or she needs to frequently check whether the number of words exceeds the limit, which makes the operation cumbersome, and the excess parts need to be manually switched, which affects the user experience.

Method used

By counting the number of characters in a predetermined area in real time, when the current number of characters exceeds the preset number of characters, preset events are triggered, such as prohibiting input, line wrap, paragraph change, or page change operations, and excess characters are added to the new area to resume input operation to avoid manual processing by users.

Benefits of technology

It improves the user experience of text editing, reduces operating steps, automatically limits the number of characters in a specified area, avoids manual page changes, and improves editing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112446191B
    Figure CN112446191B
Patent Text Reader

Abstract

A text processing method includes, when an input operation is detected, counting the number of characters in a predetermined area in real time; when it is detected that the number of characters input in the predetermined area changes, taking the number of characters counted in real time as the current number of characters; when the current number of characters is greater than a preset number of characters, triggering a preset event. The present invention can improve the text editing function according to the number of characters in the corresponding position of the text set by the user, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This article relates to Internet technology, and in particular to a text processing method, device, equipment and storage medium. Background Art

[0002] With the development of electronic technology, users often need to edit text in text. In the process of users inputting characters into text, when users have requirements on the number of words in a specified area of ​​the text, they need to check whether the number of words exceeds the limit each time they input a part of the content. If it exceeds, they need to return to check the excess part and then switch processing, which requires multiple steps and is cumbersome. Summary of the invention

[0003] The present application provides a text processing method that can improve the text editing function and thus enhance the user experience.

[0004] The present application provides a text processing method, comprising: when an input operation is detected, counting the number of characters in a predetermined area in real time; when it is monitored that the number of characters input in the predetermined area changes, using the number of characters counted in real time as the current number of characters; when the current number of characters is greater than a preset number of characters, triggering a preset event.

[0005] In an exemplary embodiment, the predetermined area includes at least one of the following: a current line, a current paragraph, a current page, and an area selected by a user.

[0006] In an exemplary embodiment, the preset event includes at least one of the following: a line change operation, a paragraph change operation, a page change operation, and an instruction to prohibit receiving an input operation.

[0007] In an exemplary embodiment, the method previously includes: when a user triggers a character number limitation instruction, obtaining the number of characters in the predetermined area set by the user and using it as the preset number of characters.

[0008] In an exemplary embodiment, when the current number of characters is greater than the preset number of characters, a preset event is triggered, including: when the current number of characters is greater than the preset number of characters, prohibiting the reception of character input operations in a predetermined area; creating a new editing area, adding the excess N characters to the new editing area, and resuming the reception of input character operations in the new editing area; wherein N is the difference between the current number of characters and the preset number of characters.

[0009] In an exemplary embodiment, when the predetermined area includes the current page and the preset event includes a page change operation, accordingly, when the current number of characters is greater than the preset number of characters, a preset event is triggered, including: when the current number of characters is greater than the preset number of characters, prohibiting the operation of receiving input characters of the current page; creating a new page, adding the excess N characters to the new page, and resuming the operation of receiving input characters on the new page; wherein N is the difference between the current number of characters and the preset number of characters.

[0010] In an exemplary embodiment, the method further includes: the real-time counting of the number of characters input into the predetermined text area includes: real-time counting of the position of the currently input characters to determine whether it has reached the predetermined area; when reaching the predetermined area, starting to count the number of characters input into the predetermined text area in real time.

[0011] In an exemplary embodiment, the method further includes: prompting the user of the current number of characters; and / or calculating the remaining number of characters that can be input in the predetermined area based on a preset number of characters and the current number of characters, and prompting the user of the remaining number of characters.

[0012] The present application also provides a text processing device, including: a statistical module, which is used to count the number of characters in a predetermined area in real time when an input operation is detected; when a change is detected in the number of characters in the predetermined expected input, the number of characters counted in real time is used as the current number of characters; a trigger module, which is used to trigger a preset event when the current number of characters is greater than the preset number of characters.

[0013] In an exemplary embodiment, the statistical module is also used to count the position of the current input character in real time to determine whether it reaches the predetermined area; when reaching the predetermined area, count the number of characters input in the predetermined area in real time.

[0014] The present application also provides a device, comprising: a memory and a processor; characterized in that: the memory is used to store a program for text processing; the processor is used to read the program for text processing and execute the steps of any of the above-mentioned text processing methods.

[0015] The present application also provides a readable storage medium, on which a text processing program is stored, and when the text processing program is executed by a processor, the steps of any of the above-mentioned text processing methods are performed. Compared with the related art, the present application can count the number of characters in a predetermined area in real time, and when the current number of characters in the predetermined area is greater than the preset number of characters, a preset event is triggered, and the number of characters in the specified area can be limited according to user needs, thereby improving the text editing function and improving the user experience.

[0016] In an exemplary embodiment, the number of characters for a page specified by a user can be limited, and when the specified page reaches the predetermined number of characters, the page is automatically changed to avoid manual operation by the user.

[0017] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. Other advantages of the present application can be realized and obtained by the solutions described in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0019] Figure 1 This is a flowchart of the text processing method of the embodiment of the present application;

[0020] Figure 2 This is a schematic diagram of a text processing device according to an embodiment of the present application;

[0021] Figure 3 This is a flowchart of the text processing method of an embodiment of the present application based on the Android system. DETAILED DESCRIPTION

[0022] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.

[0023] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.

[0024] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.

[0025] The technical solution of the present application will be described in more detail below with reference to the accompanying drawings and embodiments.

[0026] like Figure 1 As shown, an embodiment of the present invention provides a text processing method, comprising the following steps:

[0027] S101, when an input operation is detected, counting the number of characters in a predetermined area in real time;

[0028] S102, when it is detected that the number of characters inputted in the predetermined area changes, the number of characters counted in real time is used as the current number of characters;

[0029] S103: When the current number of characters is greater than a preset number of characters, a preset event is triggered.

[0030] The characters in the embodiments of the present application are usually in the form of text. The present application can limit the number of characters in the corresponding position of the text according to the user's settings, improve the text editing function, and enhance the user experience.

[0031] In step S101 of the embodiment of the present invention, in an exemplary embodiment, the predetermined area is the current line, or the current paragraph, or the current page, or the selected area received by the user, or a combination of the above. It can be understood that the predetermined area of ​​the present application includes various forms, and the present application only lists some of them. Under the same idea, they are all included in the scope of the present application.

[0032] In step S101 of the embodiment of the present invention, in an exemplary embodiment, the preset event includes a line break operation, a paragraph break operation, a page break operation, or prohibiting the reception of input operation instructions, or a combination of the above. It can be understood that the preset events of the present application include various forms, and the present application only lists some of them. Under the same idea, they are all included in the scope of the present application.

[0033] In an exemplary embodiment, in step S101, the number of characters input into the predetermined text area is counted in real time, and the number of characters in the text content can be obtained by using the API interface of the Java program (the length() API interface of String).

[0034] In an exemplary embodiment, in step S102, when it is monitored that the number of characters input in the predetermined area changes, the number of characters counted in real time is used as the current number of characters; wherein, monitoring whether the user enters new characters can utilize the listener provided by EditText, and when user input is detected, the counting of the number of characters is triggered.

[0035] In an embodiment of the present invention, in step S103, when the current number of characters is greater than the preset number of characters, a preset event is triggered, including: when the current number of characters is greater than the preset number of characters, the operation of receiving character input in the predetermined area is prohibited; a new editing area is created, the extra N characters are added to the new editing area, and the operation of receiving character input is resumed in the new editing area; wherein N is the difference between the current number of characters and the preset number of characters. Specifically, the above-mentioned resumption of receiving character input operation moves the cursor to the end of the added characters in the new editing area. When the new area is a line, paragraph or page, the cursor is moved to the new line, paragraph or page.

[0036] In an embodiment of the present invention, in step S103, when the predetermined area includes the current page and the preset event includes a page change operation, correspondingly, when the current number of characters is greater than the preset number of characters, a preset event is triggered, including: when the current number of characters is greater than the preset number of characters, prohibiting the reception of input character operations of the current page; creating a new page, adding the excess number of characters N to the new page, and resuming the reception of input character operations on the new page.

[0037] In an exemplary embodiment, the Android system uses EditText to control whether editing is possible. It is understandable that when the preset event includes a line break operation or a paragraph break operation, the corresponding example can be used for implementation, which will not be described in detail here. The embodiment of the present invention can set the number of characters of the specified page according to the user's specified page, so that when the specified page reaches the predetermined number of characters, the page will be automatically changed, avoiding manual operation by the user.

[0038] In an embodiment of the present invention, the text processing method further includes step S104: when a user triggers a character number limit instruction, the number of characters in the specified area set by the user is obtained and used as the preset number of characters. In an exemplary embodiment, the word document is parsed and opened, an input box pops up, the number of characters entered by the user is received, the user enters the number of characters, and the number of characters entered by the user is read and saved.

[0039] In an embodiment of the present invention, the text processing method further includes step S105: the real-time counting of the number of characters input in the predetermined area includes: real-time counting of the position of the currently input characters to determine whether it has reached the predetermined area; when reaching the predetermined area, real-time counting of the number of characters input in the text predetermined area. In an exemplary embodiment, when the user's predetermined area is a certain line, or a certain paragraph, or a certain page, or a certain paragraph of a certain page in the text, the system will count the position, and when reaching the position, the word count will be limited.

[0040] In an exemplary embodiment, the text processing method further comprises step S105: prompting the user of the current number of characters. In an exemplary embodiment, the current number of input characters can be displayed in real time through a window to remind the user.

[0041] In another exemplary embodiment, the text processing method further includes step S106: according to the preset number of characters and the current number of characters, the number of characters remaining to be input in the predetermined area is calculated, and the number of remaining characters is prompted to the user. In an exemplary embodiment, the number of currently input characters or the number of remaining characters can be displayed in real time through a window to remind the user.

[0042] like Figure 2 As shown, an embodiment of the present invention provides a text processing device, including a statistical module 100 and a trigger module 200.

[0043] The statistics module 100 is used to count the characters in a predetermined area in real time when an input operation is detected; when it is detected that the number of characters input in the predetermined area changes, the number of characters counted in real time is used as the current number of characters.

[0044] In the embodiment of the present invention, the predetermined area is the current line, the current paragraph, the current page, or the selected area received from the user in the predetermined text, or all of the above. It can be understood that the predetermined area of ​​the present application includes various forms, and the present application only lists some of them. Under the same idea, they are all included in the scope of the present application.

[0045] In an exemplary embodiment, the counting module 100 is used to count the number of characters input in the predetermined area of ​​the text in real time, and can use the API interface of the java program (the length() API interface of String) to obtain the number of characters in the text content. In an exemplary embodiment, the listener method provided by EditText can be used to monitor whether the user enters new content, and the number of characters counted will be triggered when the user enters content. In an exemplary embodiment, the listener provided by EditText can be used to monitor whether the user enters new content, and the number of characters counted will be triggered when the user input is detected.

[0046] The trigger module 200 is used to trigger a preset event when the current number of characters is greater than the preset number of characters. In an exemplary embodiment, the trigger module 200 is used to prohibit receiving character input operations in a predetermined area when the current number of characters is greater than the preset number of characters; create a new editing area, add the extra N characters to the new editing area, and resume receiving character input operations in the new editing area; wherein N is the difference between the current number of characters and the preset number of characters. The above-mentioned resumption of receiving character input operations specifically moves the cursor to the end of the added characters in the new editing area. When the new area is a line, paragraph or page, the cursor is moved to the new line, paragraph or page.

[0047] In an embodiment of the present invention, the preset events include a line break operation, a paragraph break operation, a page break operation, or prohibiting the reception of input operation instructions, or a combination of the above. It can be understood that the preset events of the present application include various forms, and the present application only lists some of them. Under the same idea, they are all included in the scope of the present application.

[0048] When the above-mentioned predetermined area includes the current page, and the preset event includes a page change operation, in an exemplary embodiment, the trigger module 200 is used to prohibit receiving input character operations of the current page when the current number of characters is greater than the preset number of characters; create a new page, add the extra number of characters N to the new page, and resume receiving input character operations on the new page. In an exemplary embodiment, the Android system uses EditText to control whether editing is possible. It can be understood that when the preset event includes a line break operation or a paragraph change operation, the corresponding examples can be used for implementation, which will not be described in detail here. The embodiment of the present invention can set the number of characters of the specified page according to the user's specified page, so that the page is automatically changed when the specified page reaches the predetermined number of characters, avoiding manual operation by the user.

[0049] In an exemplary embodiment, the device further includes: a setting module 400, which is used to obtain the number of characters in the predetermined area set by the user and use it as the preset number of characters when receiving a user-triggered character number limit instruction. In an exemplary embodiment, the word document is parsed and opened, an input box pops up, the number of characters entered by the user is received, the user enters the number of characters, and the number of characters entered by the user is read and saved.

[0050] In an exemplary embodiment, the device further includes a prompting module 300 for prompting the user the number of the current number of characters; and / or calculating the number of characters remaining to be input in the predetermined area according to the preset number of characters and the current number of characters, and prompting the user the number of remaining characters. In an exemplary embodiment, the number of characters currently input or the number of characters remaining can be displayed in real time through a window to remind the user.

[0051] In an exemplary embodiment, the statistics module 100 is also used to: count the position of the current input character in real time, determine whether it reaches the predetermined area; when reaching the predetermined area, count the number of characters input in the predetermined area of ​​the text in real time. In an exemplary embodiment, when the user's predetermined area is a certain line, a certain paragraph, a certain page, or a certain paragraph of a certain page in the text, the system will count the position, and when reaching the position, the word count will be limited.

[0052] like Figure 3 As shown, this embodiment illustrates the text processing process, taking the trigger event as a page change instruction as an example:

[0053] 1) Call the EditText control in the Android system to monitor the user's operations in the Word document;

[0054] 2) When the Word document enters edit mode, the EditText control edits the text;

[0055] 3) When the user performs programming operations, the listener is triggered to investigate the method of calculating the number of text characters;

[0056] 4) When the number of characters in the current text is greater than the preset number of characters, the method of creating a new page encapsulated by WPS can be called through the system API interface using Java code to automatically create a new page.

[0057] An embodiment of the present invention provides a device, which includes: a memory and a processor; wherein the memory is used to store a program for performing the above-mentioned text processing; and the processor is used to read the program for performing the above-mentioned text processing and execute the steps of the above-mentioned text processing method.

[0058] An embodiment of the present invention provides a readable storage medium, on which a text processing program is stored. When the text processing program is executed by a processor, the steps of the above-mentioned text processing method are implemented.

[0059] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

Claims

1. A text processing method, characterized in that: include: When an input operation is detected, the number of characters in the predetermined area is counted in real time, including: real-time counting of the position of the current input character to determine whether it has reached the predetermined area; when reaching the predetermined area, real-time counting of the number of characters input in the predetermined area of ​​the text; When it is detected that the number of characters inputted in the predetermined area changes, the number of characters counted in real time is used as the current number of characters; When the current number of characters is greater than the preset number of characters, a preset event is triggered, a new editing area is created, the extra N characters are added to the new editing area, and the operation of receiving input characters is resumed in the new editing area; wherein N is the difference between the current number of characters and the preset number of characters; The preset event includes at least one of the following: a line change operation, a paragraph change operation, a page change operation, and an instruction to prohibit receiving input operations; The triggering of a preset event when the current number of characters is greater than the preset number of characters includes: executing a line break operation, a paragraph break operation, a page break operation, or prohibiting the reception of character input in a predetermined area when the current number of characters is greater than the preset number of characters; In the case where the predetermined area includes the current page and the preset event includes a page change operation, the preset event is triggered when the current number of characters is greater than the preset number of characters, including: when the current number of characters is greater than the preset number of characters, prohibiting the operation of receiving input characters of the current page; creating a new page, adding the excess N characters to the new page, and resuming the operation of receiving input characters on the new page; wherein N is the difference between the current number of characters and the preset number of characters.

2. The method according to claim 1, characterized in that The predetermined area also includes at least one of the following: a current line, a current paragraph, and an area selected by a user.

3. The method according to claim 1, characterized in that The method previously includes: when receiving a user-triggered character number limitation instruction, obtaining the number of characters in the predetermined area set by the user and using it as the preset number of characters.

4. The method according to claim 1, wherein: The method further comprises: Prompt the user to the current character count; and / or The remaining number of characters that can be input in the predetermined area is calculated according to the preset number of characters and the current number of characters, and the user is prompted with the remaining number of characters.

5. A text processing device, characterized in that: include: The counting module is used to count the number of characters in the predetermined area in real time when an input operation is detected, including: counting the position of the current input character in real time to determine whether it has reached the predetermined area; when it has reached the predetermined area, counting the number of characters input in the predetermined area in real time; when it is detected that the number of characters input in the predetermined area has changed, using the number of characters counted in real time as the current number of characters; A trigger module, used to trigger a preset event when the current number of characters is greater than a preset number of characters, create a new editing area, add the extra N characters to the new editing area, and resume receiving input character operations in the new editing area; wherein N is the difference between the current number of characters and the preset number of characters; The preset event includes at least one of the following: a line change operation, a paragraph change operation, a page change operation, and an instruction to prohibit receiving input operations; The triggering of a preset event when the current number of characters is greater than the preset number of characters includes: executing a line break operation, a paragraph break operation, a page break operation, or prohibiting the reception of character input in a predetermined area when the current number of characters is greater than the preset number of characters; In the case where the predetermined area includes the current page and the preset event includes a page change operation, the preset event is triggered when the current number of characters is greater than the preset number of characters, including: when the current number of characters is greater than the preset number of characters, prohibiting the operation of receiving input characters of the current page; creating a new page, adding the excess N characters to the new page, and resuming the operation of receiving input characters on the new page; wherein N is the difference between the current number of characters and the preset number of characters.

6. The device according to claim 5, characterized in that The statistical module is also used to count the position of the current input character in real time to determine whether it has reached the predetermined area; if it has reached the predetermined area, the number of characters input in the predetermined area is counted in real time.

7. A device comprising: a memory and a processor; characterized in that: The memory is used to store a program for text processing; the processor is used to read the program for text processing and execute the steps of the text processing method according to any one of claims 1 to 4.

8. A readable storage medium, characterized in that: The readable storage medium stores a text processing program, and when the text processing program is executed by a processor, the steps of the text processing method according to any one of claims 1 to 4 are implemented.