CN114967994A - Text processing method and device and electronic equipment - Google Patents

Text processing method and device and electronic equipment Download PDF

Info

Publication number
CN114967994A
CN114967994A CN202110220954.3A CN202110220954A CN114967994A CN 114967994 A CN114967994 A CN 114967994A CN 202110220954 A CN202110220954 A CN 202110220954A CN 114967994 A CN114967994 A CN 114967994A
Authority
CN
China
Prior art keywords
interface
text
touch operation
displaying
conversion
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
CN202110220954.3A
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110220954.3A priority Critical patent/CN114967994A/en
Priority to PCT/CN2022/071644 priority patent/WO2022179329A1/en
Publication of CN114967994A publication Critical patent/CN114967994A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • 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

Abstract

The embodiment of the application discloses a text processing method and device and electronic equipment. The method comprises the following steps: a second interface is displayed on the first interface in a stacking mode, and the second interface comprises a second text obtained after the first text in the first interface is converted; if the touch operation acting on the screen is detected and the acting position of the touch operation is located in the second interface, removing the second interface from the touch position; and operating the first interface based on the touch operation. Therefore, the user can directly operate the first interface displaying the original text through the second interface displaying the conversion result by the mode, the problem that the first interface can be operated only after the second interface is closed is solved, and the user experience is further improved.

Description

Text processing method and device and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a text processing method and apparatus, and an electronic device.
Background
With the increasing amount of information displayed in electronic devices, some information needs to be converted to be easily recognized by users. For example, some text may need to be translated before it can be recognized by the user. However, in the related information conversion method, after the text in the original interface is converted and the conversion result is displayed, the original interface needs to be continuously operated after the conversion result is closed, which causes inconvenience to the user.
Disclosure of Invention
In view of the foregoing problems, the present application provides a text processing method, a text processing apparatus, and an electronic device to improve the foregoing problems.
In a first aspect, the present application provides a text processing method applied to an electronic device, where the method includes: a second interface is displayed on the first interface in a stacking mode, and the second interface comprises a second text obtained after the first text in the first interface is converted; if the touch operation acting on the screen is detected, and the acting position of the touch operation is located in the second interface, removing the second interface from the touch position; and operating the first interface based on the touch operation.
In a second aspect, the present application provides a text processing apparatus, which is operable on an electronic device, and includes: the interface display unit is used for displaying a second interface in a stacking manner on the first interface, wherein the second interface comprises a second text obtained by converting the first text in the first interface; the interface closing unit is used for removing the second interface from the touch position if the touch operation acting on the screen is detected and the acting position of the touch operation is positioned in the second interface; and the interface control unit is used for operating the first interface based on the touch operation.
In a third aspect, the present application provides an electronic device comprising a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the methods described above.
In a fourth aspect, the present application provides a computer readable storage medium having program code stored therein, wherein the program code when executed by a processor performs the method described above.
According to the text processing method and device and the electronic equipment, after a first text in a first interface is converted to obtain a corresponding second text, the second text is displayed in a second interface stacked on the first interface, if touch operation acting on a screen is detected, and the acting position of the touch operation is located in the second interface, the second interface is removed from the touch position, and the first interface is operated based on the touch operation. Therefore, after the second interface comprising the conversion result is displayed, if the touch operation is performed on the second interface, the second interface can be directly closed, and the first interface displaying the original text can be directly operated based on the touch operation, so that a user can directly operate the first interface displaying the original text through the second interface displaying the conversion result, the problem that the first interface can be operated only after the closing operation must be performed on the second interface is solved, and the user experience is further improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram illustrating an application scenario of a text processing method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating a text processing method according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a first interface and a second interface in a text processing method according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating a tool bar displayed in a floating manner in a text processing method according to an embodiment of the present application;
FIG. 5 is a diagram illustrating another tool bar displayed in a floating manner in a text processing method according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a selector in an embodiment of the present application;
fig. 7 is a schematic diagram illustrating a reduced toolbar of a floating display in a text processing method according to an embodiment of the present application;
fig. 8 is a schematic diagram illustrating a floating toolbar called in a text processing method according to an embodiment of the present application;
FIG. 9 is a diagram illustrating a status bar in an embodiment of the present application;
FIG. 10 is a diagram illustrating text transition state identification in a status bar in an embodiment of the present application;
FIG. 11 is a schematic diagram of another status bar in an embodiment of the present application;
FIG. 12 is a flow chart illustrating another method of text processing as set forth in an embodiment of the present application;
fig. 13 is a schematic diagram illustrating an effect of a touch operation applied to a second interface in the embodiment of the present application;
FIG. 14 is a diagram showing a plurality of areas divided on a screen in an embodiment of the present application;
FIG. 15 is a diagram showing a third text displayed in the embodiment of the present application;
FIG. 16 is a schematic diagram illustrating a reduction of the second interface in an embodiment of the present application;
fig. 17 is a block diagram showing a structure of a text processing apparatus according to another embodiment of the present application;
fig. 18 is a block diagram showing a structure of a text processing apparatus according to still another embodiment of the present application;
fig. 19 is a block diagram showing a configuration of an electronic device of the present application for executing a text processing method according to an embodiment of the present application;
fig. 20 is a storage unit for storing or carrying program code for implementing a text processing method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the increasing functions that can be realized by electronic equipment, information in the electronic equipment is also increasing, and some information in the electronic equipment may need to be converted to some extent before being recognized by a user. For example, there may be text recorded by foreign language in the electronic device, and in order to facilitate the user to recognize the semantic meaning of the text, the electronic device may need to be operated to convert the text recorded by the foreign language into the native language.
However, after studying the related conversion method, the inventor finds that, in the related information conversion method, after converting the text in the original interface and displaying the conversion result, the original interface needs to be operated continuously after the conversion result is closed, which causes inconvenience to the user.
Therefore, the inventor proposes a text processing method, a text processing device, and an electronic device that can improve the above problem in the present application, where after a first text in a first interface is converted to obtain a corresponding second text, the second text is displayed in a second interface layered on the first interface, and if a touch operation acting on a screen is detected and an acting position of the touch operation is located within the second interface, the second interface is removed from the touch position, and the first interface is operated based on the touch operation. Therefore, after the second interface comprising the conversion result is displayed, if the touch operation is performed on the second interface, the second interface can be directly closed, and the first interface displaying the original text can be directly operated based on the touch operation, so that a user can directly operate the first interface displaying the original text through the second interface displaying the conversion result, the problem that the first interface can be operated only after the closing operation must be performed on the second interface is solved, and the user experience is further improved.
It should be noted that the text processing method provided in the embodiment of the present application may be executed in an electronic device such as a mobile phone and a tablet computer, or may be executed by the electronic device and a server in a coordinated manner. The server may be a single physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, cloud computing, cloud storage, CDN (Content Delivery Network), and an artificial intelligence platform.
In the case that the text processing method provided in the embodiment of the present application is completed by the electronic device and the server in a coordinated manner, as shown in fig. 1, a second interface is displayed on the first interface in a stacked manner, where the second interface includes a second text obtained by converting the first text in the first interface; if the touch operation acting on the screen is detected, and the acting position of the touch operation is located in the second interface, removing the second interface from the touch position; the steps of operating the first interface based on the touch operation and the like may be performed by the client 110 in the electronic device, and the other steps of converting the first text into the second text may be performed by the client 110 in the electronic device or may be performed by the server 120.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, a text processing method provided in the embodiment of the present application is applied to an electronic device, and the method includes:
s110: and displaying a second interface on the first interface in a stacking manner, wherein the second interface comprises a second text obtained by converting the first text in the first interface.
The first interface may be an interface currently displayed in the foreground, and the text displayed in the first interface is original text which can be understood as text before conversion. Correspondingly, the second interface is an interface for displaying the converted text. Optionally, the second interface may be a web page (e.g., an html page), an application interface (e.g., an Activity interface), or a picture.
The first text may be all texts currently visible in the first interface, and the second text is a text obtained by converting the first text. Illustratively, as shown in fig. 3, a first interface 11 is shown in fig. 3, and a second text after converting the first text in the first interface 11 is displayed in a second interface 12 stacked on the first interface 11 in the right image. The arrangement format of the converted second text is the same as the arrangement format of the corresponding first text.
Optionally, the electronic device may convert the text in the first interface after entering the first conversion mode, and in this embodiment, the electronic device may be triggered to enter the first text conversion mode for converting the text in the first interface in a plurality of ways.
As one approach, entering the first text conversion mode may be triggered by hovering the display toolbar. In this manner, before displaying the second interface on the first interface in a stack, the method may further include: displaying a toolbar in a suspension mode at a designated position, wherein the toolbar comprises a first trigger mark; and if the touch operation acting on the first trigger mark is detected, entering a first text conversion mode.
Illustratively, as shown in fig. 4, in the toolbar 13 of the floating display shown in fig. 4, a first trigger 14 is displayed. If in the state shown in fig. 4, it is detected that there is a touch operation on the first trigger 14, the first text conversion mode may be entered. If the name of the first trigger 14 is "full screen translation", all texts in the first interface may be converted in the first text conversion mode entered, and the conversion in the mode shown in fig. 4 may be understood as translation of texts. Wherein the display of the toolbar 13 may be cancelled synchronously after entering the first text conversion mode, so as not to interfere with subsequent viewing by the user.
It should be noted that the toolbar shown in fig. 4 may include more triggers besides the first trigger shown in fig. 4. Optionally, the text conversion method may further include a second trigger, a third trigger, and a fourth trigger, where the second trigger may trigger to enter a second conversion mode, and a selector may be displayed in the second conversion mode, and a user may select a part of text from the first interface through the selector to convert the text.
The third trigger is an identifier for marking the current interface. Marking the current interface can be understood as storing the current interface separately, so that the current interface can be directly called to be displayed without triggering the application program to which the current interface belongs to start first. For example, the current interface may be a friend detail interface corresponding to the application a, and then a general process of starting the friend detail interface is to click an icon of the application a on a desktop to trigger the application a to start, display the friend list interface after the application a starts, and then select from the friend list interface to trigger the friend detail interface. If the current friend detail interface is marked through the third trigger mark in the toolbar, the friend detail interface can be directly called from the outside of the application program A to be displayed, the friend list interface does not need to be triggered and displayed, and then the operation path for calling the designated interface can be shortened. The fourth trigger may be an identifier for calling the corresponding application program to start. Under the condition that a fourth trigger mark is arranged in the toolbar in floating display, the other application program can be started without exiting from the current interface to the desktop, and the other application program can be triggered to be started by directly operating the fourth trigger mark.
Illustratively, as shown in fig. 5, where the identifier 15 named "free translation" is a second trigger, the entry into the second transition mode may be triggered by triggering the identifier 15 named "free translation". As shown in fig. 6, in the second conversion mode, the selector 18 may be displayed, and the selector 18 may be moved in response to a drag operation by the user, for example, may be dragged from a position shown in the left image in fig. 6 to a position shown in the right image. Referring to fig. 5 again, the identifier 16 named "new note" is a third trigger identifier, and by triggering the identifier 16 named "new note", the current interface can be stored separately to achieve the aforementioned effect of fast callout. And the identifier 17 named "navigation" is a fourth trigger. If a touch operation on the identifier 17 named "navigation" is detected, the start of the navigation application can be directly invoked.
Optionally, if the touch operation acting on the toolbar is not detected within the specified time period, the toolbar may be hidden or reduced. For example, as shown in fig. 7, if no touch operation acting on the toolbar is detected within a specified time period, the toolbar may be reduced to the state shown in fig. 7, the reduced toolbar may be displayed as a bar 17 in fig. 7, and the bar 17 may be located at a boundary of the display screen. After the toolbar is reduced to the bar 17, the user may bring up the toolbar again in floating display by dragging the bar 17 a specified distance in the direction indicated by the dotted arrow in fig. 8, and after the toolbar is brought up, the bar 17 may cancel the display.
Alternatively, if a touch operation acting on an area other than the toolbar is detected, the toolbar may be narrowed down to the state of the bar 17 shown in fig. 7.
Alternatively, the display and cancellation of the display of the selector may be controlled through the shortcut interface of the electronic device itself. Optionally, the shortcut interface may be triggered to be displayed by performing a sliding operation from the top of the display screen towards the bottom of the screen, and the management control of the selector may be displayed in the shortcut interface. If the selector is not yet displayed, if a touch operation on the management control is detected, the call-out selector may be triggered, and if the selector is already called out, if a touch operation on the management control is detected, the display of the selector may be cancelled.
Still further, as yet another alternative, the display selector may also be triggered by way of voice control. In this way, after the voice assistant of the electronic device is started, if the specified voice content is acquired, the call-out selector may be triggered. Alternatively, the specified speech content may be a text conversion, or may be a text translation, or the like. Alternatively, the specified voice content may be set by the user according to the user's own habits. In this manner, the selector may be controlled to cancel the display in the manner previously described, or may continue to be caused to cancel the display by the voice assistant.
In addition, in this embodiment, in order to facilitate reminding of the current conversion state and facilitating the user to perform more operations after entering the first conversion mode, a status bar may be displayed after entering the first conversion mode. Optionally, if a touch operation acting on the first trigger is detected, displaying a status bar in the first state, where the status bar in the first state includes a text conversion status identifier, a text conversion selection control, and a control for exiting the first text conversion mode. Wherein the text conversion state identification is used for representing whether text is currently converted. The text conversion selection control can be used for selecting an original language of the text to be converted and a conversion target language.
Illustratively, as shown in FIG. 9, a status bar 20 is displayed in a first state. Included in the status bar 20 of the first state are a text transition status identifier 21, a text transition selection control 22, and a control 23 for exiting the first text transition mode. For example, if the text in the first interface is currently being translated, the text conversion state identifier 21 may be displayed as a style shown in the left image in fig. 10, and if the translation is currently completed, the text conversion state identifier 21 may be displayed as a style shown in the right image in fig. 10.
It should be noted that, for the foregoing indication that more controls or identifiers are displayed in the status bar in the first state, the status bar in the first state occupies a certain area, and the more the area occupied by the status bar, the greater the influence on the reading experience of the user is. As an improvement, if there is no operation on the status bar within a specified duration, the status bar is switched to be in a second state, and the status bar in the second state includes the text conversion status identifier. Illustratively, as shown in FIG. 11, only the text transition state indicia 21 is displayed in the status bar 20 in the second state, and the text transition selection control and the control for exiting the first text transition mode may no longer be displayed. After the status bar is in the second state, the status bar may be switched to be in the first state in response to a clicking operation on the status bar.
S120: and if the touch operation acting on the screen is detected and the acting position of the touch operation is positioned in the second interface, removing the second interface from the touch position.
It should be noted that, in the embodiment of the present application, the second interface is removed from the touch position, so that the touch operation can be directly performed on the first interface. In the embodiment of the present application, there are various ways to remove the second interface from the touch position. Optionally, the second interface may be directly triggered to be canceled from being displayed, and moreover, the size of the second interface may be reduced, so that the reduced second interface is not overlapped with the touch position any more, and the second interface is removed from the touch position.
S130: and operating the first interface based on the touch operation.
The touch operation may be of various types. For example, a pressing operation or a sliding operation. Then operating the first interface based on the touch operation may be understood as performing the touch operation on the first interface.
It should be noted that, in the embodiment of the present application, there are many ways for the text to be processed to be converted. As one way, the conversion includes at least one of the following processing ways: performing language translation on the text; switching the font style of the text; and switching font sizes of the text. The language translation may include translating a text of any one language into a text of another language, for example, translating an english text into a chinese text, or translating a chinese text into an english text. Switching the font style of text may be understood as switching the font of the text itself. For example, the text of the song style may be switched to the text of the regular style, and for example, the text of the regular style may be switched to the text of the simplified style.
In the text processing method provided in this embodiment, after a first text in a first interface is converted to obtain a corresponding second text, the second text is displayed in a second interface stacked on the first interface, and if a touch operation applied to a screen is detected and an application position of the touch operation is located in the second interface, the second interface is removed from the touch position, and the first interface is operated based on the touch operation. Therefore, after the second interface comprising the conversion result is displayed, if the touch operation is performed on the second interface, the second interface can be directly closed, and the first interface displaying the original text can be directly operated based on the touch operation, so that a user can directly operate the first interface displaying the original text through the second interface displaying the conversion result, the problem that the first interface can be operated only after the closing operation must be performed on the second interface is solved, and the user experience is further improved.
Referring to fig. 12, a text processing method provided in the embodiment of the present application is applied to an electronic device, and the method includes:
s210: and displaying a second interface on the first interface in a stacking manner, wherein the second interface comprises a second text obtained by converting the first text in the first interface.
S220: and if the touch operation acting on the screen is detected and the acting position of the touch operation is positioned in the second interface, canceling to display the second interface.
S230: and operating the first interface based on the touch operation.
S240: and converting the third text in the first interface after the sliding operation is executed to obtain a fourth text.
The third text may be understood as the text currently displayed in the first interface after the sliding operation is performed in the first interface. Illustratively, as shown in fig. 13, a first text is displayed in the first interface 11 in the left image of fig. 13, and a second interface 12 for displaying a second text converted from the first text in the left image of fig. 13 is displayed in the middle image of fig. 13. In this case, if there is a slide operation in the direction shown in the middle image of fig. 13 (the direction indicated by the dotted arrow), the second interface 12 is canceled from being displayed as shown in the right image of fig. 13, and the slide operation in the direction indicated by the dotted arrow is synchronously performed on the first interface, so that the text currently displayed in the first interface is updated. For example, the text in the area 22 in the first interface in the left image of fig. 13 moves to the position in the first interface in the right image of fig. 13 as the sliding operation is performed, and then new content is displayed in the first interface, so that the text in the first interface is updated. Then in this case the text and the new content in the area 22 constitute the third text in the first interface. The new content may be plain text or text displayed in a picture.
It should be noted that the conversion manner shown in this embodiment is to translate a text, and the conversion manner in this embodiment may be other conversion manners besides translation, for example, the conversion manner may also include switching a font style of the text and switching a font size of the text.
In case that there are multiple conversion modes, the electronic device may determine the conversion mode to be used at the time according to the operation mode of the user. Optionally, the electronic device may determine the corresponding conversion mode according to the area where the touch operation of the user is located.
Optionally, the electronic device may divide the screen into a plurality of regions, and the plurality of regions have different conversion modes respectively corresponding to the plurality of regions. After the touch operation is detected, the position of the touch operation may be compared with the positions of the plurality of areas, and an area whose corresponding position matches the action position of the touch operation is used as a target area, and a conversion manner corresponding to the target area is determined as a conversion manner corresponding to the current touch operation.
Illustratively, as shown in fig. 14, the screen may be divided into an area a, an area b, and an area c, and the area a corresponds to the first conversion manner, the area b corresponds to the second conversion manner, and the area c corresponds to the third conversion manner. Then, when the second interface is in the display state, and when a touch operation acting on the area a is detected, so that the text in the first interface is updated, the text currently displayed in the first interface may be converted based on the first conversion manner corresponding to the area a. Similarly, when the second interface is in the display state, and when a touch operation acting on the area b is detected, so that the text in the first interface is updated, the text currently displayed in the first interface may be converted based on the second conversion manner corresponding to the area b. Similarly, when the second interface is in the display state, and when a touch operation acting on the area c is detected, so that the text in the first interface is updated, the text currently displayed in the first interface may be converted based on the third conversion manner corresponding to the area c.
As one way, the electronic device may obtain the text and the arrangement format of the text in the current interface (e.g., the first interface) by capturing a screen of the current interface and then by means of OCR (Optical Character Recognition), so that even if there is a picture in the current interface, the text included in the picture may still be obtained.
S250: and displaying a second interface on the first interface in a stacking mode, and displaying the fourth text in the second interface.
It is understood that the second interface may be caused to be displayed in response to the touch operation of the user in the foregoing step, and then the second interface may be restored on the first interface after the fourth text is obtained to facilitate displaying the fourth text. Illustratively, as shown in fig. 15, the left image of fig. 15 shows the third text in the first interface 11, and after the third text is converted into the corresponding fourth text, the third text can be displayed in the second interface 12 shown in the right image of fig. 15.
It should be noted that in translating this conversion manner, texts with different lengths may be required for description of the same sentence meaning. A situation may occur that a text obtained after translation is longer than an original text, and a display space occupied by the translated text is also larger than a display space occupied by the original text, and further, if the text displayed in the second interface is fixed in a font size, the converted text may not be completely displayed, and in order to improve the problem, as a way to display the second interface on the first interface in a stacked manner and display the fourth text in the second interface, the method includes: acquiring the size of the third interface; converting the font size of the fourth text based on the size to obtain a fourth text after font conversion; and displaying a second interface on the first interface in a stacking manner, and displaying the font-converted fourth text in the second interface.
As a manner, if there are many texts currently required to be translated in the first interface, if the text after font conversion (for example, the fourth text described above) cannot be completely displayed in the second interface even after font conversion is subsequently performed on the converted text (for example, the fourth text), the text after font conversion (for example, the fourth text after font conversion) may be displayed in pages in the second interface. In the case that the text in the second interface has paginated display, the touch operation triggering the switching of the pagination and the touch operation triggering the removal of the second interface from the touch position can be distinguished, so that the electronic device supports both the pagination of the content in the second interface and the operation of the first interface through the touch operation directly acting on the second interface.
Optionally, the touch operation for triggering to switch the paging may be a single-finger sliding operation, and correspondingly, the touch operation for triggering to remove the second interface from the touch position may be a multi-finger sliding operation. Optionally, the touch operation triggering the page switching may be a multi-finger sliding operation, and the touch operation triggering the removal of the second interface from the touch position may be a single-finger sliding operation.
Furthermore, as another way to remove the second interface from the touch position, in addition to the way to directly cancel the display of the second interface, in this embodiment of the application, the removing of the second interface from the touch position may include: and reducing the size of the second interface so that the second interface is removed from the touch position.
It should be noted that, in the process of reducing the size of the second interface, the display area occupied by the second interface may be correspondingly reduced, so that the positions of the second interface and the touch operation acting on the screen may be staggered, and the touch operation acting on the screen may directly act on the first interface originally below the second interface.
For example, as shown in fig. 16, if there is a touch operation with an action position within the second interface 12, the second interface 12 may be reduced from the pattern shown in the left image of fig. 16 to the pattern shown in the right image of fig. 16. It can be seen that in the right image of fig. 16, the second interface 12 is completely offset from the touch position, so that the touch operation applied to the screen can be directly applied to the first interface 11.
Correspondingly, in this way of reducing the second interface, the process of displaying the fourth text subsequently may also correspond to the foregoing way. Optionally, the touch operation includes a sliding operation, and after the operation is performed on the first interface based on the touch operation, the method further includes: converting the third text in the first interface after the sliding operation is executed to obtain a fourth text; and restoring the size of the second interface to the state before the reduction, and displaying the fourth text in the second interface. For example, in the process of displaying the fourth text, the reduced second interface may be restored to the style shown in the left image of fig. 16, and the fourth text may be displayed in the second interface. It is understood that the second text originally displayed in the second interface is deleted when the fourth text is displayed in the second interface.
It can be appreciated that each of the aforementioned manners of removing the second interface from the touch location may have its own benefits. For example, in the manner of directly canceling the display of the second interface, the interference caused when the user views the first interface can be avoided to the greatest extent, but every time the converted text corresponding to the updated text in the first interface needs to be displayed, the display of the second interface needs to be repeatedly restored, which has a certain influence on the visual experience of the user. However, in this way of reducing the size of the second interface, because the reduced second interface still occupies a certain display area, it may actually interfere with the user viewing the content in the first interface, but in this way of reducing the second interface, the user may be visually experienced better without performing repeated operations of canceling and displaying the second interface.
Based on the foregoing, the electronic device can also flexibly determine which way to remove the second interface from the touch position according to the current actual situation.
It should be noted that the electronic device may determine the manner for removing the second interface from the touch position according to the density of the text in the first interface. The density represents the arrangement density of the texts in the interface, the higher the density is, the more dense the text arrangement in the interface is, and correspondingly, the lower the density is, the more loose the text arrangement in the interface is. As one approach, the electronic device may compare the number of currently displayed texts in the first interface with the area of the first interface to obtain the density.
Optionally, if the density of the text acquired by the electronic device in the first interface is greater than the density threshold, it is determined that the second interface is removed from the touch position by canceling displaying the second interface, and correspondingly, if the density of the text acquired by the electronic device in the first interface is not greater than the density threshold, it is determined that the second interface is removed from the touch position by reducing the size of the second interface.
It should be noted that, in the process of updating the content in the first interface, all the content in the first interface may not be updated, but only part of the content may be updated. Referring again to fig. 13, the updated content (e.g., the third text) in the first interface is shown in the right image of fig. 13, and the content (e.g., the first text) before the update is shown in the left image of fig. 13, wherein the content included in the area 22 in fig. 13 is repeated compared to the content before the update. It can be understood that, when the user views the content, the user may pay more attention to the content that has not appeared than before, and in order to avoid repeated conversion, after updating the content in the first interface, the updated content is acquired and converted to obtain the fourth text, where the content that has not appeared than the content that has not appeared before the update. Therefore, by the mode, excessive invalid conversion operation is avoided, and resource waste is reduced.
As a manner, in the process of converting the content of the first interface, prompt information may be displayed to prompt that a conversion operation is currently performed, a trigger control is displayed in a suspended manner in the interface after the conversion is completed, and if a touch operation acting on the trigger control is detected, the converted text is triggered to be displayed.
According to the text processing method provided by the embodiment, after the second interface including the conversion result is displayed, if the touch operation is performed on the second interface, the second interface is directly closed, and the first interface displaying the original text is directly operated based on the touch operation, so that a user can directly operate the first interface displaying the original text through the second interface displaying the conversion result, the problem that the first interface can be operated only after the closing operation must be performed on the second interface is solved, and the user experience is further improved. Moreover, in this embodiment, if the screen is subjected to the sliding operation, after the sliding operation is finished, the third text in the first interface is directly converted, and the fourth text obtained after the conversion is displayed through the third interface, so that the electronic device can automatically trigger the text conversion according to the change of the content in the first interface, and the convenience of the conversion is improved.
Referring to fig. 17, a text processing apparatus 300 according to an embodiment of the present application is executed on an electronic device, where the apparatus 300 includes:
the interface display unit 310 is configured to display a second interface in a stacked manner on the first interface, where the second interface includes a second text obtained by converting the first text in the first interface.
The interface closing unit 320 is configured to remove the second interface from the touch position if a touch operation acting on the screen is detected and an acting position of the touch operation is located in the second interface.
An interface control unit 330, configured to operate the first interface based on the touch operation.
As shown in fig. 18, the apparatus 300 further includes: a text conversion unit 340 and a toolbar management unit 350.
The text conversion unit 340 is configured to convert the third text in the first interface after the sliding operation is performed, so as to obtain a fourth text; an interface display unit 310, configured to display a second interface on the first interface in a stacked manner, and display the fourth text in the second interface.
Optionally, the text conversion unit 340 is specifically configured to obtain a size of the third interface; converting the font size of the fourth text based on the size to obtain a fourth text after font conversion; correspondingly, the interface display unit 310 is configured to display a second interface on the first interface in a stacked manner, and display the font-converted fourth text in the second interface.
The toolbar management unit 350 is configured to display a toolbar in a floating manner at a specified position, where the toolbar includes a first trigger; and if the touch operation acting on the first trigger mark is detected, entering a first text conversion mode.
Optionally, the toolbar management unit 350 is specifically configured to display a status bar in the first state if a touch operation that is applied to the first trigger identifier is detected, where the status bar in the first state includes a text conversion status identifier, a text conversion selection control, and a control for exiting the first text conversion mode.
Optionally, the toolbar management unit 350 is specifically configured to switch the status bar to be in the second state if there is no operation on the status bar within a specified duration, where the status bar in the second state includes the text conversion status identifier.
As one way, the conversion includes at least one of the following processing ways: performing language translation on the text; switching the font style of the text; and switching font sizes of the text.
In the text processing apparatus provided in this embodiment, after a first text in a first interface is converted to obtain a corresponding second text, the second text is displayed in a second interface stacked on the first interface, and if a touch operation on a screen is detected and an action position of the touch operation is located in the second interface, the second interface is removed from the touch position, and the first interface is operated based on the touch operation. Therefore, after the second interface comprising the conversion result is displayed, if the touch operation is performed on the second interface, the second interface can be directly closed, and the first interface displaying the original text can be directly operated based on the touch operation, so that a user can directly operate the first interface displaying the original text through the second interface displaying the conversion result, the problem that the first interface can be operated only after the closing operation must be performed on the second interface is solved, and the user experience is further improved.
It should be noted that the device embodiment and the method embodiment in the present application correspond to each other, and specific principles in the device embodiment may refer to the contents in the method embodiment, which is not described herein again.
An electronic device provided by the present application will be described below with reference to fig. 19.
Referring to fig. 19, based on the text processing method and apparatus, another electronic device 200 capable of executing the text processing method is further provided in the embodiment of the present application. The electronic device 200 includes one or more processors 102 (only one shown), memory 104, and network module 106 coupled to each other. The memory 104 stores programs that can execute the content of the foregoing embodiments, and the processor 102 can execute the programs stored in the memory 104.
Processor 102 may include one or more cores for processing data, among other things. The processor 102 interfaces with various components throughout the electronic device 200 using various interfaces and circuitry to perform various functions of the electronic device 200 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 104 and invoking data stored in the memory 104. Alternatively, the processor 102 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 102 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 102, but may be implemented by a communication chip.
The Memory 104 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 104 may be used to store instructions, programs, code sets, or instruction sets. The memory 104 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.
The network module 106 is configured to receive and transmit electromagnetic waves, and implement interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, for example, an audio playing device. The network module 106 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The network module 106 may communicate with various networks, such as the internet, an intranet, a wireless network, or with other devices via a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. For example, the network module 106 may interact with a base station.
Referring to fig. 20, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 1100 has stored therein program code that can be called by a processor to perform the method described in the above-described method embodiments.
The computer-readable storage medium 1100 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 1100 includes a non-volatile computer-readable storage medium. The computer readable storage medium 1100 has storage space for program code 1110 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 1110 may be compressed, for example, in a suitable form.
To sum up, according to the text processing method and apparatus and the electronic device provided by the application, after a first text in a first interface is converted to obtain a corresponding second text, the second text is displayed in a second interface stacked on the first interface, and if a touch operation acting on a screen is detected, and an acting position of the touch operation is located in the second interface, the second interface is removed from the touch position, and the first interface is operated based on the touch operation. Therefore, after the second interface comprising the conversion result is displayed, if the touch operation is performed on the second interface, the second interface can be directly closed, and the first interface displaying the original text can be directly operated based on the touch operation, so that a user can directly operate the first interface displaying the original text through the second interface displaying the conversion result, the problem that the first interface can be operated only after the closing operation must be performed on the second interface is solved, and the user experience is further improved.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical feature diagrams may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (12)

1. A text processing method applied to an electronic device, the method comprising:
a second interface is displayed on the first interface in a stacking mode, and the second interface comprises a second text obtained after the first text in the first interface is converted;
if the touch operation acting on the screen is detected, and the acting position of the touch operation is located in the second interface, removing the second interface from the touch position;
and operating the first interface based on the touch operation.
2. The method of claim 1, wherein removing the second interface from the touch location comprises:
and canceling the display of the second interface.
3. The method of claim 2, wherein the touch operation comprises a slide operation, and wherein operating the first interface based on the touch operation further comprises:
converting the third text in the first interface after the sliding operation is executed to obtain a fourth text;
and displaying a second interface on the first interface in a stacking mode, and displaying the fourth text in the second interface.
4. The method of claim 3, wherein displaying a second interface on top of the first interface and displaying the fourth text in the second interface comprises:
acquiring the size of the third interface;
converting the font size of the fourth text based on the size to obtain a fourth text after font conversion;
and displaying a second interface on the first interface in a stacking manner, and displaying the font-converted fourth text in the second interface.
5. The method of claim 1, wherein removing the second interface from the touch location comprises:
and reducing the size of the second interface so that the second interface is removed from the touch position.
6. The method of claim 5, wherein the touch operation comprises a slide operation, and wherein operating the first interface based on the touch operation further comprises:
converting the third text in the first interface after the sliding operation is executed to obtain a fourth text;
and restoring the size of the second interface to the state before the reduction, and displaying the fourth text in the second interface.
7. The method of any of claims 1-6, further comprising, prior to displaying the second interface on the first interface in a stack:
displaying a toolbar in a suspension mode at a designated position, wherein the toolbar comprises a first trigger mark;
and if the touch operation acting on the first trigger mark is detected, entering a first text conversion mode.
8. The method of claim 7, further comprising:
and if the touch operation acting on the first trigger mark is detected, displaying a status bar in a first state, wherein the status bar in the first state comprises a text conversion status mark, a text conversion selection control and a control for exiting the first text conversion mode.
9. The method of claim 8, wherein displaying the status bar in the first state if the touch operation acting on the first trigger is detected further comprises:
and if the operation on the status bar does not exist within the specified duration, switching the status bar to be in a second state, wherein the status bar in the second state comprises the text conversion status identifier.
10. A text processing apparatus, operable with an electronic device, the apparatus comprising:
the interface display unit is used for displaying a second interface in a stacking manner on the first interface, and the second interface comprises a second text obtained by converting the first text in the first interface;
the interface closing unit is used for removing the second interface from the touch position if the touch operation acting on the screen is detected and the acting position of the touch operation is positioned in the second interface;
and the interface control unit is used for operating the first interface based on the touch operation.
11. An electronic device comprising a processor and a memory;
one or more programs are stored in the memory and configured to be executed by the processor to implement the method of any of claims 1-9.
12. A computer-readable storage medium, having a program code stored therein, wherein the program code when executed by a processor performs the method of any of claims 1-9.
CN202110220954.3A 2021-02-26 2021-02-26 Text processing method and device and electronic equipment Pending CN114967994A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110220954.3A CN114967994A (en) 2021-02-26 2021-02-26 Text processing method and device and electronic equipment
PCT/CN2022/071644 WO2022179329A1 (en) 2021-02-26 2022-01-12 Text processing method and apparatus, and electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110220954.3A CN114967994A (en) 2021-02-26 2021-02-26 Text processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114967994A true CN114967994A (en) 2022-08-30

Family

ID=82974127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110220954.3A Pending CN114967994A (en) 2021-02-26 2021-02-26 Text processing method and device and electronic equipment

Country Status (2)

Country Link
CN (1) CN114967994A (en)
WO (1) WO2022179329A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110119234A (en) * 2019-04-08 2019-08-13 广州视源电子科技股份有限公司 A kind of operating method, storage medium and the relevant device of intelligent interaction plate
WO2019233212A1 (en) * 2018-06-07 2019-12-12 Oppo广东移动通信有限公司 Text identification method and device, mobile terminal, and storage medium
CN110781688A (en) * 2019-09-20 2020-02-11 华为技术有限公司 Method and electronic device for machine translation

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080172219A1 (en) * 2007-01-17 2008-07-17 Novell, Inc. Foreign language translator in a document editor
CN104636326A (en) * 2014-12-30 2015-05-20 小米科技有限责任公司 Text message translation method and device
CN111401323A (en) * 2020-04-20 2020-07-10 Oppo广东移动通信有限公司 Character translation method, device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019233212A1 (en) * 2018-06-07 2019-12-12 Oppo广东移动通信有限公司 Text identification method and device, mobile terminal, and storage medium
CN110119234A (en) * 2019-04-08 2019-08-13 广州视源电子科技股份有限公司 A kind of operating method, storage medium and the relevant device of intelligent interaction plate
CN110781688A (en) * 2019-09-20 2020-02-11 华为技术有限公司 Method and electronic device for machine translation
CN112183121A (en) * 2019-09-20 2021-01-05 华为技术有限公司 Method and electronic device for machine translation

Also Published As

Publication number Publication date
WO2022179329A1 (en) 2022-09-01
WO2022179329A8 (en) 2023-11-02
WO2022179329A9 (en) 2022-10-20

Similar Documents

Publication Publication Date Title
US11467855B2 (en) Application preloading method and device, storage medium and terminal
CN111858522A (en) File sharing method and device, terminal and storage medium
CN108363792B (en) Link generation method and device of application page, storage medium and electronic equipment
CN108595445A (en) Interpretation method, device and terminal
CN107678823A (en) Control method, device and the storage medium and mobile terminal of mobile terminal application
WO2022052832A1 (en) Interface display method and apparatus for application program, device and medium
CN111767108A (en) Application program label generation method, application interface display method and device
CN107765966A (en) Event triggering method, device, intelligent terminal and storage medium based on picture
CN112527434A (en) Page display method, terminal, server, system and electronic equipment
CN104281560B (en) Display method, device and terminal of memory text information
CN111324398A (en) Recent content processing method, device, terminal and storage medium
CN111931708A (en) Form generation method and device
CN112163432A (en) Translation method, translation device and electronic equipment
CN112068947A (en) Application program entering method and device, terminal equipment and computer readable medium
CN112840305B (en) Font switching method and related product
CN114967994A (en) Text processing method and device and electronic equipment
CN110286826A (en) Show processing method, device, equipment and the storage medium of content
CN112101023B (en) Text processing method and device and electronic equipment
CN113989559A (en) Method, device and equipment for determining probability threshold of classification model and storage medium
CN106657316A (en) Message withdrawing method and device
CN114690996A (en) Content display method and device and electronic equipment
WO2022179330A1 (en) Text processing method and apparatus, and electronic device and storage medium
CN114741315B (en) Use case updating method and device, electronic equipment and storage medium
CN113778488B (en) Page updating method and device, computer equipment and storage medium
CN110928474B (en) Junk file cleaning method and device, storage medium and terminal

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