Method and apparatus for presenting streaming input on rich text editor
By generating a document with format differences supported by the rich text editor and performing incremental update rendering, the problem that the rich text editor cannot directly render lightweight markup language streaming input is solved, improving rendering efficiency and user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2026-04-02
AI Technical Summary
Some rich text editors cannot directly render streaming input in lightweight markup language formats, resulting in poor rendering performance, page jitter, and a lack of compatibility with input content.
By acquiring both streaming and incremental input, a differential document in a format supported by a rich text editor is generated and rendered incrementally, avoiding full rendering operations.
It improves the rendering efficiency and page presentation of the rich text editor, reduces page jitter, and enhances compatibility with streaming input.
Smart Images

Figure CN2024121228_02042026_PF_FP_ABST
Abstract
Description
Method and apparatus for presenting streaming input on a rich text editor TECHNICAL FIELD
[0001] The present disclosure relates to the field of computer technology, and more particularly, to a method, apparatus, computing device, computer-readable storage medium and computer program product for presenting streaming input on a rich text editor. BACKGROUND
[0002] With the development of network technology, lightweight markup languages (e.g., Markdown) have been widely used due to their simple and intuitive, easy-to-learn and easy-to-use features. Lightweight markup languages allow people to write documents using easily readable and writable plain text formats, which are then converted into valid HyperText Markup Language (HTML) or other formats and rendered or presented.
[0003] At the same time, more and more people are using generative language models to obtain information or create. The generative language model accepts a user's query and provides an answer in the form of streaming output, which is often a string in the format of a lightweight markup language. The user device receives the streaming input from the generative language model and presents the streaming input on a rich text editor. However, some rich text editors may lack component support and be unable to directly render some lightweight markup language format streaming input, or require complex processing, which results in low rendering performance.
[0004] SUMMARY
[0005] Therefore, the present disclosure provides a technical solution for presenting streaming input on a rich text editor, which can improve the compatibility of the rich text editor in presenting the streaming input, and enable the rich text editor to present the streaming input in an incremental update manner, thereby improving the rendering efficiency and page presentation effect of the rich text editor.
[0006] According to a first aspect of the present disclosure, a method for presenting streaming input on a rich text editor is provided. The method comprises: obtaining a first streaming input and a second streaming input, the second streaming input including an increment relative to the first streaming input; generating a difference document in a format supported by the rich text editor based on the first streaming input and the second streaming input; and presenting the second streaming input on the rich text editor by rendering the difference document.
[0007] According to a second aspect of the present disclosure, there is provided an apparatus for presenting streaming input on a rich text editor. The apparatus comprises: a streaming input obtaining unit configured to obtain a first streaming input and a second streaming input, the second streaming input comprising an increment relative to the first streaming input; a diff document generating unit configured to generate a diff document in a format supported by the rich text editor based on the first streaming input and the second streaming input; and a presenting unit configured to present the second streaming input on the rich text editor by rendering the diff document.
[0008] According to a third aspect of the present disclosure, there is provided a computing device comprising: at least one processing unit; at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the computing device to perform the method as described in the first aspect of the present disclosure.
[0009] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer storage medium comprising machine executable instructions that, when executed by a device, cause the device to perform the method as described in the first aspect of the present disclosure.
[0010] According to a fifth aspect of the present disclosure, there is provided a computer program product comprising machine executable instructions that, when executed by a device, cause the device to perform the method as described in the first aspect of the present disclosure.
[0011] It is to be understood that the Summary is not intended to identify key or essential features of embodiments of the present disclosure, nor is it intended to be used to limit the scope of the present disclosure. Other features, details, and advantages of the present disclosure will become BRIEF DESCRIPTION OF DRAWINGS
[0012] The above and other objects, features and advantages of embodiments of the present disclosure will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, various embodiments of the present disclosure are illustrated by way of example and not limitation, in which:
[0013] FIG. 1 shows a schematic diagram of an environment in which embodiments of the present disclosure can be implemented;
[0014] FIG. 2 shows a schematic flowchart of a method for presenting streaming input on a rich text editor according to an embodiment of the present disclosure;
[0015] FIG. 3 shows a flowchart of a method for rendering streaming input by way of incremental update according to an embodiment of the present disclosure;
[0016] Figure 4 illustrates a schematic block diagram of an apparatus for presenting streaming input on a rich text editor, in accordance with an embodiment of the present disclosure; and
[0017] Figure 5 illustrates a block diagram of a device capable of implementing a number of embodiments of the present disclosure. DETAILED DESCRIPTION
[0018] The concepts of the present disclosure will now be described with reference to the various example embodiments illustrated in the drawings. It is to be understood that the description of these embodiments is merely intended to provide a more detailed understanding of the disclosure and further implementations of the disclosure, and is not intended to limit the scope of the disclosure in any way. It should be noted that similar or identical reference numerals can be used in the figures to indicate similar or identical elements, where practicable. Those skilled in the art will understand that alternative embodiments of the structures and / or methods illustrated herein can be employed without departing from the principles and concepts described herein.
[0019] In the context of the present disclosure, the term “comprising” and its various variants are to be understood to be open-ended terms that mean “including but not limited to”; the term “based on” is to be understood as “based at least in part on”; the term “one embodiment” is to be understood as “at least one embodiment”; the term “another embodiment” is to be understood as “at least one other embodiment”. Other terms that can appear but are not mentioned here are not to be interpreted or limited in a way that contradicts the concepts on which the embodiments of the present disclosure are based, unless explicitly stated.
[0020] As submitted above, a lightweight markup language such as Markdown allows people to write documents using a human-readable and easy-to-write plain text format, which can then be converted into valid HTML or other formats. The syntax of lightweight markup languages is simple and intuitive, easy to learn and use, so it has been widely used in many fields.
[0021] A rich text editor (RTE) is a tool that allows users to create and edit formatted text, commonly used in web pages, documents, and emails. Unlike plain text editors, rich text editors support various text formats, styles, and structures, such as bold, italic, underline, color, font change, paragraph alignment, etc. These editors usually support the WYSIWYG mode, allowing users to view the formatting effects in real time while editing. In addition, they are usually able to generate HTML code, which makes it easy to embed formatted content into web pages or applications.
[0022] However, some rich text editors cannot directly render strings in certain syntax formats (e.g., Markdown) and need to convert them into supported format content for rendering. In the application scenario of generating model output stream content, the rich text editor of the user device may not support the format of certain stream content, resulting in incorrect display of the content. On the other hand, since the stream output of the model needs to be constantly displayed on the screen, and since the output of the model is context-dependent, the rich text editor needs to perform full rendering, which has relatively low performance and may cause page jitter. Therefore, it is desirable to enhance the compatibility of the rich text editor for input content and to implement incremental update rendering to improve performance and user experience.
[0023] To address or mitigate the above problems and / or other potential problems, embodiments of the present disclosure propose a method for presenting stream content on a rich text editor. According to the method, a user device can obtain stream input (also referred to as existing content) and incremental input relative to the stream input, which can be obtained later. The stream input and the incremental input can be, for example, text in a certain markup language format, such as Markdown text, but in some implementations, the rich text editor may not support direct rendering of this markup language format. Then, the user device can convert the whole formed by the stream input and the incremental input into content in a format supported by the rich text editor, and compare it with the converted stream input to generate a difference document, which is also in a format supported by the rich text editor. Then, by rendering the difference document, the existing stream content and the incremental content are presented on the rich text editor. Based on such a way, the compatibility of the rich text editor in presenting stream input can be improved, while the rich text editor can present stream input in an incremental update manner, thereby improving the rendering efficiency of the rich text editor and the page presentation effect.
[0024] It should be noted that Markdown language will be taken as an example in this paper as the format of stream input received by the rich text editor, but it should be understood that other language formats are also possible. In addition, Delta language based on quilljs framework will be taken as the format supported by the rich text editor (i.e., capable of direct rendering) in this paper, but it should be understood that other formats are also possible.
[0025] To facilitate understanding of embodiments of the present disclosure, the following explanations of terms are provided:
[0026] Table 1: Explanation of Related Terms
[0027] The basic principles and implementations of the present disclosure are explained hereinafter with reference to the accompanying drawings. It should be understood that the exemplary embodiments are given only so that those skilled in the art can better understand and implement the embodiments of the present disclosure, and do not limit the scope of the present disclosure in any way.
[0028] FIG. 1 shows a schematic diagram of an environment 100 capable of implementing various embodiments of the present disclosure. As shown in FIG. 1, the environment 100 includes a user device 110 and a server 120, which can be operated by a user. Optionally, the user device 110 can be any computing device with display function, including but not limited to: a smartphone, a tablet computer, a portable computer, a smart television, an in-vehicle computer, a wearable device (e.g., a smart bracelet, a smart watch), etc. The user device 110 can be installed with a rich text editor 130, which can receive a document or input supporting various styles (font, font size, color) and elements (picture, table, link, etc.), and render and present to the user.
[0029] The server 120 can be a standalone physical network server, or a network server cluster or distributed system composed of multiple physical network servers, or a cloud network server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms. As shown, the server 120 includes a generative model 140, which in some implementations can be a trained language model and can generate data or content based on a prompt.
[0030] The user device 110 and the server 120 can be communicatively connected through a network. The network between the user device 110 and the server 120 can be a wired network or a wireless network, for example, it can be a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a cellular data communication network, etc. electronic network capable of realizing information exchange function.
[0031] As shown in FIG. 1, a user device 101 can communicate data, information, services with a server 120 via a network. In this example, a user can transmit a query to the server 120 via the user device 110, and expect the server 120 to provide content based on the query. Accordingly, upon receiving the query, the server 120 can use a generative model 140 to generate an answer, e.g., provide the query as a prompt to the generative model 140. In some implementations, the generative model 140 will generate the answer on the fly, e.g., word by word. The server 120 can send the on-the-fly answer to the user device 110. The user device 110 can render the on-the-fly answer on a rich text editor. Note that the environment 100 shown in FIG. 1 is merely exemplary, and embodiments of the present disclosure can be implemented in different environments, e.g., the on-the-fly input can not necessarily be provided by a generative model, but can be locally generated or in other ways.
[0032] In some implementations, the on-the-fly answer input to the user device 110 can be in Markdown format, but the rich text editor 130 does not support Markdown format, but supports other formats, e.g., Delta format. To this end, it is necessary to implement conversion from Markdown format to Delta format.
[0033] The following Table 2 and Table 3 give an example of a piece of Markdown document and the converted Delta text.
[0034] Table 2: Example of Markdown text
[0035] Table 3: Example of Delta document
[0036] In some embodiments, a Delta document (delta) can include one or more Delta objects, each having a key or index (zoneId), a type (zoneType), and change operations (ops), each of which can be an insert, retain, or delete. In this document, key and index can be used interchangeably. In some embodiments, a change operation can have an attribute (attribute) indicating the type of object involved in the operation or other information.
[0037] In the above example, for the delta object with key "0", which is of type "Z" (i.e., ZoneDelta), its change operations include, in sequence, insert:'*'; insert:'Headings h13\n'; insert:'*'; insert:'\n'. Note that the second occurrence of "insert:'\n'" has an attribute "aceTable" indicating that the inserted content is a table, and the attribute further includes the row object (with key flIhB2GF7c4FWkjvr2Hw) and the column object (with key lUJB7OAsHUI7o39e0) of the table.
[0038] For the table row object with key flIhB2GF7c4FWkjvr2Hw, which is of type "R" (i.e., RowDelta), its change operations include, in sequence, inserting three rows (with ids 'flihb2gf7c4fwkjvr2hwr0', 'flihb2gf7c4fwkjvr2hwr1', 'flihb2gf7c4fwkjvr2hwr2', respectively). For the table column object with key lUJB7OAsHUI7o39e0, which is of type "C" (i.e., ColDelta), its change operations include, in sequence, inserting two columns (with ids 'lujb7oashui7o39e0c0', 'lujb7oashui7o39e0c1', respectively).
[0039] Further, the delta document also includes cell objects of the table, each of which has a key that is a combination of the keys of its row and column. For example, the delta object with key xflihb2gf7c4fwkjvr2hwr0xlujb7oashui7o39e0c0, which is of type "Z", has a change operation of inserting the string 'Syntax\n'.
[0040] FIG. 2 illustrates a flow diagram of a method 200 for presenting streaming input on a rich text editor, according to some embodiments of the present disclosure. In some embodiments, the method 200 can be implemented by, for example, the user device 110 shown in FIG. 1. It should be understood that the method 200 can also include additional actions not shown and / or can omit actions shown, without limitation in this regard. For ease of explanation, the method 200 will be described with reference to FIG. 1.
[0041] As shown in FIG. 2, at block 210, the method 200 can include obtaining a first stream input and a second stream input, the second stream input including an increment relative to the first stream input. In some embodiments, the first stream input and the second stream input can be strings that are generated by the generative model 140 and streamed to the user device 110. For example, the user device 110 can first receive the first stream input, and then receive an increment relative to the first stream input, which, together with the first stream input already received, forms the second stream input. The user device 110 can buffer the first stream input, and combine the increment subsequently received with the buffered data to obtain the second stream input.
[0042] The rich text editor 130 of the user device 110 can render and present the first stream input before receiving the increment input. As an example, assume that the rich text editor 130 supports direct rendering of Delta format, but does not support Markdown format. If the streamed input received by the user device 110 is a string in Markdown format, a conversion from Markdown format to Delta format needs to be implemented. In some embodiments, the input in Markdown format can be first converted to an Abstract Syntax Tree, and then the Abstract Syntax Tree is converted to a document in Delta format. The conversion from the Abstract Syntax Tree to the document in Delta format can include conversions for the following Markdown formats: quote, code block, inline code, strike, italic, bold, heading, image, inline formula, paragraph formula, hyperlink, reference link, unordered list, ordered list, table, etc. Thus, the conversion as shown in Tables 2-3 can be implemented. The converted document in Delta format can be directly rendered.
[0043] It is noted that since the stream input can have strong context dependency, the conversion and rendering cannot be done separately for the increment. In order to render and present the second stream input based on the increment, the first stream input previously received and the increment need to be rendered and presented as a whole. As mentioned above, full rendering (i.e., clearing the rendered first stream input, and re-rendering the second stream input from zero) has the problem of low performance and page jitter.
[0044] At block 220, a diff document in a format supported by the rich text editor is generated based on the first streaming input and the second streaming input. The format supported by the rich text editor defines a document (e.g., DeltaSet) by describing changes, which can include at least one object (Delta), each object can include at least one change operation (ops), each change operation can include one of insert, retain, and delete. With the diff document, incremental update manner of rendering can be implemented, while avoiding full rendering.
[0045] In some embodiments, the user device 110 can obtain a first document (DeltaSet A) for the first streaming input and a second document (DeltaSet B) for the second streaming input, where the first and second documents have the format supported by the rich text editor 130. Then, the user device 110 can generate a diff document (DeltaSet C) based on the first and second documents. To this end, the user device 110 converts the first streaming input to a first abstract syntax tree, and converts the first abstract syntax tree to the first document. This action can be done in advance. For the second streaming input, the user device 110 can merge the first streaming input and the incremental input, resulting in the second streaming input, convert the second streaming input to a second abstract syntax tree, and convert the second abstract syntax tree to the second document. It should be understood that the first and second documents include respective Delta objects, each object has a corresponding index and type. As for the specific implementation of obtaining the diff document from the first and second documents, it will be explained in detail below with reference to FIG. 3.
[0046] At block 230, the second streaming input is presented on the rich text editor by rendering the diff document. In some embodiments, the diff document is applied to the rich text editor without the need to clear the first streaming input already presented on the rich text editor. Thereby, the operation of full update and rendering of a document object model (DOM) can be advantageously avoided, reducing performance impairment, and also not causing the feeling of jitter when the page is refreshed.
[0047] FIG. 3 illustrates a flow diagram of a method of rendering streaming input by way of incremental update, according to an embodiment of the present disclosure. In FIG. 3, the server 120 provides streaming input, i.e., incremental Markdown (MD) data 302 to the user device 110. The user device 110 merges the received incremental MD with the already received and cached MD to obtain the streaming input to be presented. Then, the user device 110 converts the merged content into an abstract syntax tree 304, and converts the abstract syntax tree 304 into a new document DeltaSet 305 in a format supported by the rich text editor, which includes a set of newly generated object Deltas. Next, a diff algorithm proposed by the present disclosure is used to generate a diff document (DeltaSet C) based on a comparison between the converted and cached MD document (DeltaSet A) and the new document DeltaSet 305 (DeltaSet B). The diff document can be initialized as an empty set.
[0048] In some embodiments, the new Delta objects 306 in DeltaSet B can be traversed to determine the Delta objects of DeltaSet C, the new Delta objects 306 are compared with the Delta data of the cached MD (i.e., DeltaSet A) 307 to generate the diff Deltas 308, and added to DeltaSet C. The generated DeltaSet C can be applied to the rich text editor for rendering 308.
[0049] Specifically, for each new Delta object of DeltaSet B, if the index (e.g., key) of the Delta object does not exist in DeltaSet A or the index exists in DeltaSet A but the type (e.g., ZoneType) is different, the Delta object is added to DeltaSet C. Otherwise, if the index of the Delta object exists in DeltaSet A and the type is the same, the difference between the Delta object and another Delta object in DeltaSet A corresponding to the index is calculated, and the difference is added to the diff document.
[0050] In some embodiments, the Delta objects can be serialized into two strings based on respective change operations in the two Delta objects, and the difference between the Delta objects is determined based on a comparison between the strings. The comparison result of the strings can include insertion, same, or deletion of the strings.
[0051] For example, the Delta objects in DeltaSet A can be named as DeltaX, and the Delta objects in DeltaSet B can be named as DeltaY. The two Delta objects can be serialized into corresponding strings first, and the difference between the two strings can be calculated. In some embodiments, the fast-diff algorithm can be used to calculate the difference between the two strings, and the output result can be INSERT, EQUAL or DELETE type. The serialization can be implemented based on the change operation in the Delta object, for example, the string in the insert operation is extracted and merged to obtain the serialized result.
[0052] Then, based on the comparison result of the two strings, the difference between DeltaX and DeltaY is determined. For the comparison result of INSERT type, the index area slice of the corresponding string of the Delta is added to DeltaSetC[key] as an insert operation. For the comparison result of EQUAL type, the index area slice of the corresponding string of the Delta is added to DeltaSetC[key] as a retain operation. For the DELETE type, the index area slice of the corresponding string of the Delta is added to DeltaSetC[key] as a delete operation.
[0053] It should be noted that when the string type of the Delta is EQUAL type, that is, there is a same string, it is further necessary to judge according to the attribute information whether it is the same content or there is a nesting. This is because similar tables, code blocks and the like correspond to a predefined string in the Delta object, for example, an empty string or “*”, and more information is stored in the corresponding attribute (atrribute), which contains the index value of its real delta content. Therefore, when encountering the EQUAL type, when the string is a table, a code block or the like, it is necessary to recursively call the difference algorithm as described above.
[0054] In some embodiments, if the result of the comparison includes the same string and the same string includes a predefined character, the attribute information of the change operation corresponding to the string in the two Delta objects is determined, for example, whether it is a table, a code block or other structure. If yes, the sub-objects in DeltaSet A and DeltaSet B are respectively determined based on the attribute information, the differences of the two sub-objects are further compared, and the differences are added to DeltaSet C. In some embodiments, the attribute information can include the index of the sub-object, and if the attribute information indicates that the Delta object is a table, it can also include the index of the row object (RowDelta) and the column object (ColDelta). In the process of calculating the differences of the two delta sub-objects, it can continue to recursively calculate the differences of more delta sub-objects.
[0055] The process of recursive call is described as follows with the diff process of mdA and mdB as an example.
[0056] Table 4: Markdown input example
[0057] In the first step, the Markdown input shown in Table 4 is converted into the corresponding Delta document as follows
[0058] Table 5: Delta document example
[0059] In the second step, the two Delta documents are compared. For the delta object with key 0, its type is the same, and its corresponding serialization is obtained as the corresponding string.
[0060] Table 6: Serialization result example
[0061] In the third step, the serialization string is traversed. Since '*Headings h' in strA is the same as that in strB, the first 11 characters are retain operation.
[0062] The fourth step is in strB, 12-15 strings are new, so it is an insert operation; since the 16th string of strA and strB is the same, and its delta's attributes contain the attribute aceTable, whose value is the table row delta and column delta index connected by spaces, so it is needed to split it by spaces, find its corresponding Delta object in DeltaSet B, and recursively operate the first to fourth steps, thereby obtaining the difference of the cell delta object.
[0063] Finally, an incremental difference document DeltaSet C is obtained, and the result is
[0064] Table 7: DeltaSet C example
[0065] FIG. 4 shows an apparatus 400 for presenting a streaming input on a rich text editor according to an embodiment of the present disclosure. As shown, the apparatus 400 includes a streaming input obtaining unit 410, a difference document generating unit 420, and a presenting unit 430. The streaming input obtaining unit 410 can be configured to obtain a first streaming input and a second streaming input, the second streaming input including an increment relative to the first streaming input. The difference document generating unit 420 can be configured to generate, based on the first streaming input and the second streaming input, a difference document in a format supported by the rich text editor. The presenting unit 430 can be configured to present the second streaming input on the rich text editor by rendering the difference document.
[0066] It should be noted that more actions or steps shown in FIGS. 1-3 can be implemented by the apparatus 400 shown in FIG. 4. For example, the apparatus 400 can include more modules or units to implement the actions or steps described above, or some units or modules shown in FIG. 4 can be further configured to implement the actions or steps described above. Here, no further elaboration is repeated.
[0067] FIG. 5 shows a schematic block diagram of an example device 500 that can be used to implement embodiments of the present disclosure. As shown, the device 500 includes a computing unit 501 that can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 502 or loaded from a storage unit 506 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0068] A plurality of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0069] The computing unit 501 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs various methods and processes described above, such as the method 300. For example, in some embodiments, the method 300 can be implemented as a computer software program, which is tangibly embodied in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded onto the RAM 503 and executed by the computing unit 501, one or more steps of the method 300 described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the method 300 by any other appropriate means, such as by means of firmware.
[0070] In some embodiments, the methods and processes described above can be implemented as a computer program product. The computer program product can include a computer readable storage medium having computer readable program instructions thereon for performing various aspects of the present disclosure.
[0071] Computer readable storage media can be tangible storage media which can retain and store instructions for use by an instruction execution device. Computer readable storage media can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer readable storage media include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
[0072] Computer readable program instructions described herein can be downloaded to respective computing / processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.
[0073] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including object oriented programming languages and procedural programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to configure the electronic circuitry in order to act in accord with the
[0074] These computer readable program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer readable program instructions can also be stored in a computer readable storage medium that can include non- transitory computer readable storage media that can direct a computer, a programmable data processing apparatus, and / or other devices to function in a particular manner, such that the computer readable storage medium having instructions for causing an apparatus to implement one or more functions / acts specified in the flowchart and / or block diagram block or blocks can be utilized.
[0075] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0076] The computer program product of the second aspect can include a computer readable storage medium. The computer readable storage medium can include instructions. The instructions can include one or both of: instructions for causing a computer to enable a user equipment device to receive a configuration message from a base station, the configuration message comprising an indication of a set of one or more parameters for a first type of hybrid automatic repeat request process, the first type of hybrid automatic repeat request process being associated with a first type of data; and instructions for causing a computer to enable a user equipment device to receive a configuration message from a base station, the configuration message comprising an indication of a set of one or more parameters for a first type of hybrid automatic repeat request process, the first type of hybrid automatic repeat request process being associated with a first type of data.
[0077] Embodiments of the present disclosure have been described above, with the understanding that these embodiments are exemplary only, and are not restrictive, and are not limited to the disclosed embodiments. Many modifications and changes to this disclosure would be apparent to those of ordinary skill in the art. The scope of the technology disclosed is not to be limited by the specific illustrative embodiments presented above, but only by the claims that follow. The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting.
Claims
1. A method for presenting streaming input on a rich text editor, comprising: obtaining a first streaming input and a second streaming input, the second streaming input comprising an increment relative to the first streaming input; generating a diff document in a format supported by the rich text editor based on the first streaming input and the second streaming input; and presenting the second streaming input on the rich text editor by rendering the diff document. the format supported by the rich text editor defines a document comprising at least one object, each object comprising at least one change operation, each change operation comprising one of an insertion, a preservation, and a deletion.
2. The method of claim 1, wherein, generating the diff document for rendering based on the first streaming input and the second streaming input comprises:
3. The method of claim 2, wherein, obtaining a first document for the first streaming input and a second document for the second streaming input, the first and second documents being in the format supported by the rich text editor; and generating the diff document based on the first and second documents.
4. The method of claim 3, wherein obtaining a first document for the first streaming input and a second document for the second streaming input comprises: converting the first streaming input into a first abstract syntax tree, and converting the first abstract syntax tree into the first document; and converting the second streaming input into a second abstract syntax tree, and converting the second abstract syntax tree into the second document. objects in the first and second documents have respective indices and types, and generating the diff document based on the first and second documents comprises: for each object in the second document, 5. The method of claim 3, wherein, if the object's index does not exist in the first document or the index exists in the first document but the types are different, adding the object to the diff document; and if the object's index exists in the first document and the types are the same, computing a difference between the object and another object in the first document corresponding to the index, and adding the difference to the diff document.
6. The method of claim 5, wherein the another object in the first document is a first object, the object in the second document is a second object, and computing a difference between the second object and the first object comprises: serializing the first and second objects into a first and second string, respectively, based on respective change operations in the first and second objects; determining a difference between the second object and the first object based on a comparison between the first and second strings, wherein a result of the comparison comprises an insertion, a same, or a deletion of a string.
7. The method of claim 6, further comprising: in response to a result of the comparison including a same string and the same string including a predefined character, determining first attribute information of a first change operation in the first object corresponding to the string and second attribute information of a second change operation in the second object corresponding to the string; determining a first sub-object in the first document and a second sub-object in the second document based on the first attribute information and the second attribute information, respectively; and adding a difference of the second sub-object compared to the first sub-object to the difference document.
8. The method of claim 7, wherein, The first attribute information and the second attribute information respectively indicate a type of the first sub-object and the second sub-object as a table.
9. The method of claim 8, wherein, The first attribute information and the second attribute information respectively include indices of the first sub-object and the second sub-object, and attribute information in the first sub-object and the second sub-object respectively include indices of row objects and column objects of a corresponding table.
10. The method of any one of claims 1 to 9, wherein, rendering the second stream input on the rich text editor by rendering the difference file includes: rendering the difference file in an incremental update manner without emptying the first stream input already rendered on the rich text editor.
11. The method of any one of claims 1-10, the first stream input and second stream input are generated by a generative model.
12. The method of any one of claims 1-11, wherein the rich text editor does not support direct rendering of a format of the first stream input and the second stream input.
13. An apparatus for rendering stream input on a rich text editor, the apparatus comprising: a stream input obtaining unit configured to obtain a first stream input and a second stream input, the second stream input including an increment relative to the first stream input; a difference document generating unit configured to generate a difference document in a format supported by the rich text editor based on the first stream input and the second stream input; and a rendering unit configured to render the second stream input on the rich text editor by rendering the difference document.
14. A computing device comprising: at least one processing unit; at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions when executed by the at least one processing unit causing the computing device to perform the method of any one of claims 1-12.
15. A non-transitory computer storage medium comprising machine executable instructions that, when executed by a device, cause the device to perform the method of any one of claims 1-12.
16. A computer program product comprising machine executable instructions that, when executed by a device, cause the device to perform the method of any one of claims 1-12.