CN117454855A - Text editing method, text editor, and computer-readable storage medium - Google Patents

Text editing method, text editor, and computer-readable storage medium Download PDF

Info

Publication number
CN117454855A
CN117454855A CN202311572513.5A CN202311572513A CN117454855A CN 117454855 A CN117454855 A CN 117454855A CN 202311572513 A CN202311572513 A CN 202311572513A CN 117454855 A CN117454855 A CN 117454855A
Authority
CN
China
Prior art keywords
text
editing
grammar
format
grammar rule
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.)
Pending
Application number
CN202311572513.5A
Other languages
Chinese (zh)
Inventor
罗文印
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Tatfook Network Tech Co Ltd
Original Assignee
Shenzhen Tatfook Network Tech Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Tatfook Network Tech Co Ltd filed Critical Shenzhen Tatfook Network Tech Co Ltd
Priority to CN202311572513.5A priority Critical patent/CN117454855A/en
Publication of CN117454855A publication Critical patent/CN117454855A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The application discloses a text editing method, a text editor and a computer readable storage medium, wherein the text editing method comprises the following steps: receiving a first text input by a user, wherein the first text is in a markup language format; acquiring a preset grammar rule, and converting the first text into a second text based on the grammar rule; outputting a second text which is in a rich text format; and receiving an editing instruction, and editing the second text based on the editing instruction. Based on the mode, the first text input by the user is converted into the second text, namely the markup language text is converted into the rich text, and the converted rich text is output, so that the user can directly edit the rich text without re-editing the markup language text, the editing function is enriched, the use experience of the user is improved, and the workload of searching or memorizing a large number of marks by the user can be reduced.

Description

Text editing method, text editor, and computer-readable storage medium
Technical Field
The present application relates to the field of text editing technology, and in particular, to a text editing method, a text editor, and a computer readable storage medium.
Background
The rich text format is a document format and the rich text editor provides rich document editing functions for the user, such as Microsoft Word (Microsoft document) editor. Users write content and typeset in real time, corresponding functions are usually realized by selecting a control in a toolbar of a visual interface by using a mouse, edited documents are sent to other platforms or devices, and incompatible phenomena can occur.
The mark language is a computer text code which adopts plain text format editing to realize text typesetting and data processing details, and is widely used for writing formatted text. For example, a sentence of text is marked with "×" indicating that the sentence of text is displayed in bold. The markup language can realize typesetting function of the document by using only a small amount of markup, is simple and efficient, and can be shared or read among different platforms or devices. However, the editing and previewing of the markup language editor generally require different interfaces, if the typesetting in the previewing interface is wrong, the editing interface needs to be edited again, and the editing function variety is less.
Disclosure of Invention
In order to solve the above-described problems, the present application provides a text editing method, a text editor, and a computer-readable storage medium.
In order to solve the above technical problems, the present application provides a first technical solution, and provides a text editing method, where the text editing method includes: receiving a first text input by a user, wherein the first text is in a markup language format; acquiring a preset grammar rule, and converting the first text into a second text based on the grammar rule; outputting the second text, wherein the second text is in a rich text format; and receiving an editing instruction, and editing the second text based on the editing instruction.
Wherein the step of converting the first text into a second text based on the grammar rules comprises: parsing the first text based on the grammar rules to convert the first text to intermediate format text; the intermediate format text is further converted to the second text based on the grammar rules.
Wherein the parsing the first text based on the grammar rules to convert the first text into intermediate format text includes: identifying a plurality of text elements of the first text; converting a plurality of text elements into a corresponding plurality of substrings based on the grammar rules; and obtaining the intermediate format text based on the plurality of sub-character strings.
Wherein the step of editing the second text based on the editing instruction includes: editing the second text based on the editing instruction to obtain a third text, wherein the third text is in the rich text format; and converting the third text into fourth text based on the grammar rule, wherein the fourth text is in the markup language format.
Wherein the step of converting the third text into a fourth text based on the grammar rules comprises: converting the third text into intermediate format text based on the grammar rules, wherein the intermediate format text comprises a plurality of sub-character strings; converting the plurality of substrings into a corresponding plurality of text elements based further on the grammar rules; and splicing the plurality of text elements to obtain the fourth text.
The step of obtaining the preset grammar rule comprises the following steps: acquiring a first grammar rule, wherein the first grammar rule comprises conversion rules of the first text and the intermediate format text; a second grammar rule is obtained, wherein the second grammar rule comprises conversion rules of the intermediate format text and the second text, and the grammar rule comprises the first grammar rule and the second grammar rule.
The text editing method further comprises the following steps: receiving a plug-in creation instruction, and creating a first plug-in, wherein the first plug-in is used for editing the second text; and receiving an instruction of installing the plug-in, and acquiring and installing a second plug-in, wherein the second plug-in is used for editing the second text.
In order to solve the technical problems, another technical scheme provided by the application is as follows: there is provided a text editor comprising a processor and a memory coupled to the processor, wherein program data and preset grammar rules are stored in the memory, the processor retrieving the program data stored in the memory to perform the text editing method as described above.
Wherein the processor comprises: the input and output module is used for receiving the first text input by the user and outputting the second text; the parsing and converting module is used for obtaining preset grammar rules and converting the first text into the second text based on the grammar rules; the grammar module is used for customizing grammar rules; and the editing module is used for receiving an editing instruction and editing the first text or the second text based on the editing instruction.
In order to solve the technical problems, another technical scheme provided by the application is as follows: there is provided a computer readable storage medium storing a computer program for implementing a text editing method as described above when being executed by a processor.
The application provides a text editing method, which comprises the following steps: receiving a first text input by a user, wherein the first text is in a markup language format; acquiring a preset grammar rule, and converting the first text into a second text based on the grammar rule; outputting a second text which is in a rich text format; and receiving an editing instruction, and editing the second text based on the editing instruction. Based on the mode, the first text input by the user is converted into the second text, namely the markup language text is converted into the rich text, and the converted rich text is output, so that the user can directly edit the rich text without re-editing the markup language text, the editing function is enriched, the use experience of the user is improved, and the workload of searching or memorizing a large number of marks by the user can be reduced. In addition, the rich text edited by the user can be converted into corresponding markup language text, and the markup language text is sent to other platforms or devices, so that incompatibility can be reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a flow chart of an embodiment of a text editing method provided herein;
FIG. 2 is a flow chart of another embodiment of a text editing method provided herein;
FIG. 3 is a flow chart of yet another embodiment of a text editing method provided herein;
FIG. 4 is a flow chart of yet another embodiment of a text editing method provided herein;
FIG. 5 is a schematic diagram of a framework of an embodiment of a text editor provided herein;
fig. 6 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present application.
Detailed Description
In order that the above objects, features and advantages of the invention will be readily understood, a more particular description of the invention will be rendered by reference to the appended drawings. It is to be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "first," "second," and the like in this disclosure are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the invention. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The rich text editor has rich editing functions, but may be incompatible in different platforms or devices. The mark language editor can realize typesetting function of the document only by using a small amount of marks, is simple and efficient, and can share or read among different platforms or devices, but the editing and previewing of the mark language editor usually need different interfaces, if the typesetting is wrong in the previewing interface, the editing interface needs to be edited again, and the editing function is less in variety.
Based on the problems, the text editing method is provided, and the user can directly edit the rich text by converting the markup language text input by the user into the rich text without re-editing the markup language text, so that the editing function is enriched, the use experience of the user is improved, and the workload of searching or memorizing a large number of marks by the user can be reduced. In addition, the rich text edited by the user can be converted into corresponding markup language text, and the markup language text is sent to other platforms or devices, so that incompatibility can be reduced.
The technical solutions in the embodiments of the present application are clearly and completely described below with reference to the drawings in the embodiments of the present application. Referring to fig. 1, fig. 1 is a flowchart of an embodiment of a text editing method provided in the present application. The text editing method of the embodiment is applied to a text editor, and the text editor can be applied to a user side such as a computer, a tablet or a mobile phone. The text editing method of the present embodiment includes the steps of:
s101: a first text input by a user is received, the first text being in a markup language format.
The first text is text input by a user in a markup language format. The first text input by the user is received, and the first text can be text content input by the user in real time or a text file in a markup language format.
S102: and acquiring a preset grammar rule, and converting the first text into the second text based on the grammar rule.
The preset grammar rules comprise a first text and a conversion rule between the first text.
The first text is converted to a second text based on grammar rules, the second text being in a rich text format. That is, in the present embodiment, the markup language text is converted into rich text based on grammar rules.
S103: and outputting a second text, wherein the second text is in a rich text format.
Wherein the second text in rich text format is output. It will be appreciated that as the user inputs the first text in real time, the text editor outputs the converted first text in real time, i.e. outputs the second text in real time. When a user inputs a text file in a markup language format, the text editor outputs the text file in a rich text format.
The visual interface of the text editor comprises a first window and a second window, wherein the first window is used for receiving a first text used for input, the second window is used for outputting a second text, and the first window and the second window can facilitate the comparison of a user to view the text content, so that the editing efficiency of the user is improved.
S104: and receiving an editing instruction, and editing the second text based on the editing instruction.
The editing instruction is an editing instruction input by a user, and the user can input the editing instruction through external equipment. For example, the user may input an edit instruction through a keyboard and a mouse.
Editing the second text based on the editing instruction. For example, the editing instruction is to modify the font of the second text into "regular script", and then modify the font of the second text from the original font into "regular script".
For example, a sentence of text is marked with "×" indicating that the sentence of text is displayed in bold. The first text input by the user is "× detailed description", and the second text output is bold-faced display of "detailed description". The user inputs an editing instruction of 'underline operation', and the text editor performs 'underline operation' on the second text, and the final second text is bold display and underline display of 'detailed description'.
Accordingly, the present embodiment provides a text editing method, including: receiving a first text input by a user, wherein the first text is in a markup language format; acquiring a preset grammar rule, and converting the first text into a second text based on the grammar rule; outputting a second text which is in a rich text format; and receiving an editing instruction, and editing the second text based on the editing instruction. Based on the mode, the first text input by the user is converted into the second text, namely the markup language text is converted into the rich text, and the converted rich text is output, so that the user can directly edit the rich text without re-editing the markup language text, the editing function is enriched, the use experience of the user is improved, and the workload of searching or memorizing a large number of marks by the user can be reduced.
Referring to fig. 2, fig. 2 is a flowchart of another embodiment of a text editing method provided in the present application.
The text editing method of the present embodiment includes the steps of:
s201: a first text input by a user is received, the first text being in a markup language format.
The step is the same as step S101, and will not be described here again.
Specifically, the first text includes a plurality of text elements including a marking element for marking the content element and a content element.
For example, the first text is "# Hello World", "#" is a markup element, and "Hello World" is a content element.
S202: and acquiring a preset grammar rule, and analyzing the first text based on the grammar rule to convert the first text into the intermediate format text.
Wherein the intermediate format text is used to represent the format and content of the first text or the second text.
The preset grammar rules comprise a first grammar rule and a second grammar rule. Optionally, the step of obtaining the preset grammar rule includes: acquiring a first grammar rule, wherein the first grammar rule comprises a conversion rule of a first text and a middle format text; a second grammar rule is obtained, the second grammar rule including conversion rules for intermediate format text and second text.
The intermediate format text includes text format and text content. Further, the first grammar rules include conversion rules between the markup elements and the text formats, and conversion rules between the content elements and the text content.
Taking the first text as "# Hello World" as an example, the text format corresponding to the marking element "#" is "title", and the text content corresponding to the content element "Hello World" is "Hello World".
The intermediate format text may be string text. For example, the intermediate format text may be JSON (JavaScript Object Notation ) string text.
The intermediate format text is exemplified as JSON string text. Taking the first text as "# Hello World" as an example, the JSON string text comprises a text format string and a text content string, and the text format string corresponding to the marking element "#" is: "type": "head"; the text content string corresponding to the content element "Hello World" is: "text": "Hello World".
It is understood that JSON string text includes, but is not limited to, text format strings and text content strings as described above.
Optionally, in this embodiment, the user may customize the first grammar rule that accords with the custom of the user, that is, the user may customize the correspondence between the markup language and the text format, so that the use experience of the user may be improved, and the editing efficiency of the user may also be improved.
S203: the intermediate format text is converted to a second text based on grammar rules.
Wherein the intermediate format text is converted to a second text based on a second grammar rule. Wherein the second grammar rules include conversion rules for intermediate format text and second text.
The first text includes a plurality of text segments. Taking the intermediate format text as a character string text for example, the intermediate format text comprises a plurality of sub-character strings, and the plurality of sub-character strings are in one-to-one correspondence with a plurality of text fragments. Each text segment includes a plurality of text elements including a markup element and a content element, and each sub-string includes a text format corresponding to the markup element and text content corresponding to the content element.
And sequentially converting the multiple sub-character strings into a rich text format based on the multiple sub-character strings of the intermediate format text to obtain a second text.
S204: and outputting a second text, wherein the second text is in a rich text format.
The step is the same as step S103, and will not be described here again.
S205: and receiving an editing instruction, and editing the second text based on the editing instruction.
The step is the same as step S104, and will not be described here again.
S206: and receiving a plug-in creation instruction, creating a first plug-in, wherein the first plug-in is used for editing the second text.
The plug-in creation instruction is a plug-in creation instruction input by a user, and the first plug-in is created based on the plug-in creation instruction input by the user. The first plug-in is used to edit the second text, and the first plug-in may be used to provide new editing functions or to improve existing editing functions.
S207: and receiving an instruction of installing the plug-in, acquiring and installing a second plug-in, wherein the second plug-in is used for editing a second text.
The plug-in installation instruction is an plug-in installation instruction input by a user, and the second plug-in is acquired and installed based on the plug-in installation instruction input by the user. The second plug-in is used to edit the second text, and the second plug-in may be used to provide new editing functions or to improve existing editing functions.
Thus, by the method of the present embodiment, the conversion of the first text into the second text, i.e., the conversion of the markup language text into the rich text, is achieved by converting the first text into the intermediate format text and converting the intermediate format text into the second text. The intermediate format text can be a character string text, the character string text can better store text information, the text information is easy to analyze and generate, and the editing efficiency can be improved by using the character string text. In addition, by creating or installing the plug-in, the plug-in is used for providing new editing functions or improving the existing editing functions, the editing functions can be enriched, and the use experience of a user is improved.
Referring to fig. 3, fig. 3 is a flowchart of another embodiment of a text editing method provided in the present application. This embodiment is a specific implementation manner of the step of converting the first text into the second text based on the grammar rule in fig. 1. In this embodiment, description will be given taking an intermediate format text as an example of a character string text.
The text editing method of the present embodiment includes the steps of:
s301: a plurality of text elements of the first text are identified.
Wherein the first text includes a plurality of text segments, and a plurality of text elements of the plurality of text segments are identified. The text elements include a markup element and a content element, and a plurality of markup elements and content elements identifying the first text.
S302: based on the grammar rules, the plurality of text elements are converted into a corresponding plurality of substrings.
The grammar rules comprise first grammar rules, and the first grammar rules comprise conversion rules of the first text and the intermediate format text. Specifically, the first grammar rules include a conversion rule between the markup element and the text format, and a conversion rule between the content element and the text content. Based on the first grammar rule, the plurality of text elements are converted into corresponding text formats or text content.
The first text comprises a plurality of text fragments, each text fragment comprises a plurality of text elements, and the text elements are converted into corresponding text formats or text contents based on a first grammar rule to obtain a sub-character string corresponding to the text fragment. And converting the text elements of the first text to obtain a plurality of substrings.
S303: based on the plurality of substrings, intermediate format text is obtained.
And combining the plurality of sub-strings to obtain the intermediate format text.
S304: the intermediate format text is converted to a second text based on grammar rules.
The step is the same as step S203, and will not be described here again.
Therefore, by the method of the embodiment, the plurality of text elements are converted into the corresponding plurality of sub-strings by identifying the plurality of text elements of the first text, so as to obtain the intermediate format text, and the intermediate format text is converted into the second text, thereby realizing the conversion of the first text into the second text, namely the conversion of the markup language text into the rich text.
Referring to fig. 4, fig. 4 is a flowchart illustrating a text editing method according to another embodiment of the present application. The embodiment is a specific implementation of the editing step of the second text based on the editing instruction in fig. 1.
S401: and editing the second text based on the editing instruction to obtain a third text, wherein the third text is in a rich text format.
The editing instruction is an editing instruction input by a user. And editing the second text based on the editing instruction to obtain a third text, wherein the third text is the edited second text. Wherein the third text is in a rich text format.
S402: the third text is converted into a string text, the string text comprising a plurality of substrings.
Wherein the third text is converted to a string text based on the second grammar rule. The third text comprises a plurality of text fragments, and the character string text comprises a plurality of substrings which are in one-to-one correspondence with the plurality of text fragments of the third text.
The second grammar rule comprises a conversion rule of intermediate format text and rich text, and the rich text is converted into the intermediate format text, namely, the third text is converted into character string text based on the second grammar rule.
S403: based on the grammar rules, the plurality of substrings are converted into a corresponding plurality of text elements.
Wherein the string text is converted to a fourth text based on the first grammar rule. The first grammar rule includes a conversion rule of markup language text and intermediate format text, and based on the first grammar rule, the intermediate format text is converted into markup language text, i.e., character string text is converted into fourth text.
Wherein the substring includes text content and a text format corresponding to the text content.
Wherein the first grammar rules include conversion rules between the markup elements and the text formats, and conversion rules between the content elements and the text content. Converting the text format into the corresponding marking element, and converting the text content into the corresponding content element to obtain the text element corresponding to the sub-character string.
S404: and splicing the text elements to obtain a fourth text, wherein the fourth text is in a markup language format.
And splicing the text elements of the sub-strings to obtain text fragments corresponding to the sub-strings. And splicing a plurality of text fragments corresponding to the plurality of sub-strings to obtain a fourth text.
Wherein the fourth text is in a markup language format.
In this embodiment, the second text is edited based on the editing instruction to obtain a third text, and the third text is converted into a fourth text, that is, the first text is modified according to the edited second text to obtain the fourth text, where the fourth text is in a markup language format. The text editing method can mutually convert the markup language text and the rich text, so that a user can select to edit the markup language text or the rich text according to own editing habit, the editing function can be enriched, and the use experience of the user is improved.
Referring to fig. 5, fig. 5 is a schematic diagram of a frame of an embodiment of a text editor provided in the present application. As shown in fig. 5, the text editor 100 includes a processor 10 and a memory 20 coupled to the processor 10. The memory 20 is used for storing a computer program, and the processor 10 is used for executing the computer program to implement the text editing method.
The processor 10 includes an input and output module 101, a parsing and conversion module 102, a grammar module 103, and an editing module 104. The input and output module 101 is configured to receive a first text input by a user and output a second text; the parsing and converting module 102 is configured to obtain a preset grammar rule, and convert the first text into the second text or convert the second text into the first text based on the grammar rule; grammar module 103 is used for customizing grammar rules; the editing module 104 is configured to receive an editing instruction, and edit the first text or the second text based on the editing instruction.
Wherein the first text may be markup language text and the second text may be rich text. The text editor can edit the markup language text or the rich text, and a user can directly edit the rich text without re-editing the markup language text, so that the editing function is enriched, the use experience of the user is improved, and the workload of searching or memorizing a large number of marks by the user can be reduced. In addition, the rich text edited by the user can be converted into corresponding markup language text, the markup language text is sent to other platforms or devices, sharing or reading is carried out among different platforms or devices, and the phenomenon of incompatibility can be reduced.
The visual interface of the text editor comprises a first window and a second window, the first window is used for receiving a first text used for input, the second window is used for outputting a second text, and the first window and the second window can facilitate the comparison of a user to view text contents and improve the editing efficiency of the user.
The processor 10 may also be referred to as a CPU (Central Processing Unit ). The processor 10 may be an electronic chip with signal processing capabilities. Processor 10 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 20 may be a memory stick, TF card, or the like, and may store all information in the text editor 100, including input raw data, computer programs, intermediate running results, and final running results, all stored in the memory 20. It stores and retrieves information based on the location specified by the processor 10. With the memory 20, the text editor 100 has a memory function to ensure proper operation. The memory 20 of the text editor 100 may be classified into a main memory (memory) and an auxiliary memory (external memory) according to the purpose, and may be classified into an external memory and an internal memory. The external memory is usually a magnetic medium, an optical disk, or the like, and can store information for a long period of time. The memory refers to a storage component on the motherboard for storing data and programs currently being executed, but is only used for temporarily storing programs and data, and the data is lost when the power supply is turned off or the power is turned off.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an embodiment of a computer readable storage medium provided in the present application. As shown in fig. 6, the computer-readable storage medium 110 stores therein a computer program 111 capable of implementing all the methods described above.
The units integrated with the functional units in the embodiments of the present application may be stored in the computer-readable storage medium 110 if implemented in the form of software functional units and sold or used as independent products. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or all or part of the technical solution, or in a software product, and the computer readable storage medium 110 includes several instructions in a computer program 111 to enable a computer device (which may be a personal computer, a system server, or a network device, etc.), a text editor (such as MP3, MP4, etc., also mobile terminals such as a mobile phone, a tablet computer, a wearable device, etc., also a desktop computer, etc.), or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-readable storage media 110 (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flowchart and/or block of the flowchart illustrations and/or block diagrams, and combinations of flowcharts and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable storage medium 110. These computer-readable storage media 110 may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the computer program 111, which is executed by the processor of the computer or other programmable data processing apparatus, produces means for implementing the functions specified in the flowchart block or blocks and/or block diagram block or blocks.
These computer-readable storage media 110 may also be stored in a memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the computer program 111 stored in the computer-readable storage media 110 produces an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer-readable storage media 110 may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the computer program 111, which executes on the computer or other programmable apparatus, provides steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Any process or method descriptions in flow diagrams or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiments of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order from that shown or discussed, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present application.
Logic and/or steps represented in the flow diagrams or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any medium for use by or in connection with an instruction execution system, apparatus, or device (which can be a personal computer, server, network device, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions).
The foregoing is only the embodiments of the present application, and not the patent scope of the present application is limited by the foregoing description, but all equivalent structures or equivalent processes using the contents of the present application and the accompanying drawings, or directly or indirectly applied to other related technical fields, which are included in the patent protection scope of the present application.

Claims (10)

1. A text editing method, characterized in that the text editing method comprises:
receiving a first text input by a user, wherein the first text is in a markup language format;
acquiring a preset grammar rule, and converting the first text into a second text based on the grammar rule;
outputting the second text, wherein the second text is in a rich text format;
and receiving an editing instruction, and editing the second text based on the editing instruction.
2. The text editing method of claim 1, wherein the step of converting the first text into the second text based on the grammar rule comprises:
parsing the first text based on the grammar rules to convert the first text to intermediate format text;
the intermediate format text is further converted to the second text based on the grammar rules.
3. The text editing method of claim 2, wherein the parsing the first text based on the grammar rule to convert the first text into intermediate format text comprises:
identifying a plurality of text elements of the first text;
converting a plurality of text elements into a corresponding plurality of substrings based on the grammar rules;
and obtaining the intermediate format text based on the plurality of sub-character strings.
4. The text editing method according to claim 1, wherein the step of editing the second text based on the editing instruction includes:
editing the second text based on the editing instruction to obtain a third text, wherein the third text is in the rich text format;
and converting the third text into fourth text based on the grammar rule, wherein the fourth text is in the markup language format.
5. The text editing method of claim 4, wherein the step of converting the third text into a fourth text based on the grammar rule comprises:
converting the third text into intermediate format text based on the grammar rules, wherein the intermediate format text comprises a plurality of sub-character strings;
converting the plurality of substrings into a corresponding plurality of text elements based further on the grammar rules;
and splicing the plurality of text elements to obtain the fourth text.
6. The text editing method of any of claims 1 to 5, wherein the step of obtaining a preset grammar rule comprises:
acquiring a first grammar rule, wherein the first grammar rule comprises conversion rules of the first text and the intermediate format text;
a second grammar rule is obtained, wherein the second grammar rule comprises conversion rules of the intermediate format text and the second text, and the grammar rule comprises the first grammar rule and the second grammar rule.
7. The text editing method according to claim 1, characterized in that the text editing method further comprises:
receiving a plug-in creation instruction, and creating a first plug-in, wherein the first plug-in is used for editing the second text;
and receiving an instruction of installing the plug-in, and acquiring and installing a second plug-in, wherein the second plug-in is used for editing the second text.
8. A text editor comprising a processor and a memory coupled to the processor, wherein program data and pre-set grammar rules are stored in the memory, and wherein the processor invokes the program data stored in the memory to perform the text editing method of any one of claims 1-7.
9. The text editor of claim 8 wherein the processor comprises:
the input and output module is used for receiving the first text input by the user and outputting the second text;
the parsing and converting module is used for obtaining preset grammar rules and converting the first text into the second text based on the grammar rules;
the grammar module is used for customizing grammar rules;
and the editing module is used for receiving an editing instruction and editing the second text based on the editing instruction.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program for implementing the text editing method according to any of claims 1-7 when being executed by a processor.
CN202311572513.5A 2023-11-21 2023-11-21 Text editing method, text editor, and computer-readable storage medium Pending CN117454855A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311572513.5A CN117454855A (en) 2023-11-21 2023-11-21 Text editing method, text editor, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311572513.5A CN117454855A (en) 2023-11-21 2023-11-21 Text editing method, text editor, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN117454855A true CN117454855A (en) 2024-01-26

Family

ID=89587521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311572513.5A Pending CN117454855A (en) 2023-11-21 2023-11-21 Text editing method, text editor, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN117454855A (en)

Similar Documents

Publication Publication Date Title
US9400775B2 (en) Document data entry suggestions
EP2291010A1 (en) Structure processing method and apparatus for layout file
CN101271463B (en) Structure processing method and system of layout file
US20220374617A1 (en) Document translation method and apparatus, storage medium, and electronic device
CN113515928B (en) Electronic text generation method, device, equipment and medium
CN106326194A (en) Directory generation method and apparatus applied to file format conversion scene
CN109933751B (en) Image-text drawing method and device, computer-readable storage medium and computer equipment
CN113609820A (en) Method, device and equipment for generating word file based on extensible markup language file
CN102915228A (en) Menu toolbar integration system and method
CN110390063A (en) A kind of data analysis method, device, medium and electronic equipment
CN110309457A (en) Web data processing method, device, computer equipment and storage medium
CN102103586B (en) Multi-language bidirectionally mixed-arranged caption edition system
CN111240962B (en) Test method, test device, computer equipment and computer storage medium
CN111142871B (en) Front-end page development system, method, equipment and medium
CN112433995A (en) File format conversion method, system, computer equipment and storage medium
CN109614592B (en) Text processing method and device, storage medium and electronic equipment
CN110297965B (en) Courseware page display and page set construction method, device, equipment and medium
CN111143749A (en) Webpage display method, device, equipment and storage medium
CN117454855A (en) Text editing method, text editor, and computer-readable storage medium
CN115756692A (en) Method for automatically combining and displaying pages based on style attributes and related equipment thereof
CN102104741B (en) Method and device for arranging multi-language captions
CN104731787A (en) Method, device and terminal capable of realizing page layout
WO2018063837A1 (en) Video generation of project revision history
CN115248881A (en) Webpage input information rendering method and device, electronic equipment and storage medium
CN102104742B (en) Multi-language caption mixing arrangement method and device

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