WO2022135302A1 - 一种选择文本的方法、电子设备及计算机可读存储介质 - Google Patents

一种选择文本的方法、电子设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2022135302A1
WO2022135302A1 PCT/CN2021/139261 CN2021139261W WO2022135302A1 WO 2022135302 A1 WO2022135302 A1 WO 2022135302A1 CN 2021139261 W CN2021139261 W CN 2021139261W WO 2022135302 A1 WO2022135302 A1 WO 2022135302A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
participle
word
preset
target text
Prior art date
Application number
PCT/CN2021/139261
Other languages
English (en)
French (fr)
Inventor
缪丹
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022135302A1 publication Critical patent/WO2022135302A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • 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

Definitions

  • the present application relates to the field of electronic device interaction technologies, and in particular, to a method for selecting text, an electronic device, and a computer-readable storage medium.
  • operations on text are commonly used by users, and selecting text is a basic operation on text. For example, when a user reads the content of a web page, he finds interesting information and wants to copy and save it; or, when a user wants to send a message to a friend, he finds that the content of the message to be sent overlaps with the content of the previous message, and he wants to copy the existing message. The content is copied and used directly.
  • the above operations all require the user to select the target text in a targeted manner, and then perform copying or other operations on the target text.
  • Embodiments of the present application provide a method for selecting text, an electronic device, and a computer-readable storage medium, which can accurately predict the text content that the user actually wants to select based on the detected text content touched by the user, thereby improving the user's ability to select text. Accuracy, so as to improve the speed of user selection of text and improve user experience.
  • an embodiment of the present application provides a method for selecting text, which specifically includes: acquiring a first text corresponding to a touch operation; selecting a second text including the first text; and confirming the first text based on the second text The first participle corresponding to the starting point character in the middle; processing the first text based on the first participle to obtain target text; and displaying the target text.
  • the technical solution provided by the first aspect above can further determine the text that the user actually wants to select based on the detected starting point character of the text corresponding to the user's touch operation, thereby improving the accuracy of the text selected by the user.
  • This solution is particularly convenient for electronic devices that are prone to misoperation, such as electronic devices with smaller screens or smaller text fonts.
  • the processing of the first text based on the first segmented word to obtain the target text specifically includes: judging whether the first segmented word is a preset meaningful word; if is a preset meaningful word, then select the first participle to integrate with the first text to obtain the target text; if it is not a preset meaningful word, discard the first participle, and in the first text
  • the target text is obtained by removing the starting point character corresponding to the first participle.
  • the probability that the user actually wants to select is very high, and most of the user wants to select the entire word (when a word contains multiple characters), rather than select a part of the word . And if the starting point character corresponds to a meaningless word, there is a high probability of being misselected. Therefore, based on judging whether the starting point character is a preset meaningful word, the first text is processed to obtain the target text, which is more suitable for the user's habit of selecting text, and greatly improves the accuracy of the user's text selection.
  • the method further includes: confirming, based on the second text, a second participle corresponding to an end point character in the first text; Processing a text to obtain a target text specifically includes: processing the first text based on the first word segmentation and the second word segmentation to obtain the target text.
  • the first text is processed by simultaneously considering the word segmentation corresponding to the ending point character to further approximate the text content that the user actually wants to select.
  • the processing of the first text based on the first participle and the second participle to obtain the target text specifically includes: judging the first participle and the second participle respectively. Whether the second participle is a preset meaningful word; if the first participle and the second participle are preset meaningful words, select the first participle and the second participle, and combine them with The first text is integrated to obtain the target text; or if the first participle is not a preset meaningful word, and the second participle is a preset meaningful word, then in the first text Remove the starting point character corresponding to the first participle, and integrate with the second participle to obtain the target text; or if the first participle is a preset meaningful word, the second participle is not For preset meaningful words, the first text is integrated with the first participle, and the end point character corresponding to the second participle is removed to obtain the target text.
  • the preset meaningful words are words of a preset thesaurus, or words of a predetermined part of speech.
  • the preset meaningful words can be words in a thesaurus preset by the user, and the thesaurus can be updated dynamically.
  • the words in the thesaurus can include common words, network terms, popular words, self-created words, etc. There can also be different thesaurus for different languages.
  • the pre-specified part-of-speech words are entity words. Conversely, non-substantial words may belong to meaningless words.
  • the method further includes: operating a selection box corresponding to the target text to obtain the third text.
  • the user can also continue to operate the selection box of the target text to select more or less text, which is convenient for the user to adjust flexibly.
  • the method further includes: performing other operations on the target text.
  • the user can perform operations such as copying, cutting, etc. on the selected text.
  • the touch operation is a finger touch operation, or a touch operation of a stylus.
  • the touch operation in this solution is not limited to the user's finger touch, and the touch operation of the stylus is also applicable.
  • an embodiment of the present application provides a terminal device, where the terminal device can execute the first aspect or one or more of the text extraction methods in multiple possible implementation manners of the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the first aspect or various possibilities of the first aspect are implemented.
  • embodiments of the present application provide a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in an electronic device
  • the processor in the electronic device executes the first aspect or one or more of the text extraction methods in the multiple possible implementation manners of the first aspect.
  • the first text corresponding to the touch operation is obtained by detecting the user's touch operation, and the word segmentation corresponding to the start point character/end point character of the first text is obtained by limited expansion of the text range In this case, process the first text to obtain the target text. In this way, the present solution can further determine the text content that the user actually wants to select based on the text range roughly positioned by the user's touch operation, thereby improving the accuracy of the text selection by the user.
  • FIG. 1 is an exemplary schematic diagram of a user operation of an application interface according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of an electronic device 200 according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a text selection method according to an embodiment of the present application.
  • FIG. 4 is an exemplary schematic diagram of a text selection result of an application interface according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of another text selection method according to an embodiment of the present application.
  • FIG. 6 is an exemplary schematic diagram of a user operation of another application interface according to an embodiment of the present application.
  • FIG. 7 is an exemplary schematic diagram of a text selection result of another application interface according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of another electronic device 800 according to an embodiment of the present application.
  • At least one refers to one or more.
  • “Plural” means two or more.
  • the character “/” generally indicates that the associated objects are an “or” relationship.
  • “At least one (item) of the following” or its similar expression refers to any combination of these items, including any combination of single item (item) or plural item (item).
  • At least one (a) of a, b or c may represent: a, b, c, a and b, a and c, b and c, or a, b and c seven situations. where each of a, b, c can be an element itself, or a set containing one or more elements.
  • selecting text is a common operation for displaying text in electronic devices, for example, selecting a piece of text and then copying and pasting it.
  • a user can usually select a piece of related text at one time through a single-finger or multi-finger touch operation.
  • the user's finger touches there will inevitably be errors between the contact point of the finger aimed by the user and the actual touch point of the finger recognized by the electronic device, which will cause the text corresponding to the actual touch point recognized by the electronic device to be different from what the user really wants to select. Word.
  • the embodiment of the present invention provides a text selection method, which can further predict the text that the user really wants to select based on the text corresponding to the actual touch point recognized by the electronic device, intelligently improve the accuracy of text selection, and further improve the user Choose the speed and experience of text.
  • the electronic device involved in this embodiment of the present invention may be any terminal device with a touch screen, including but not limited to mobile phones, tablet computers, notebook computers, televisions, laptop computers, desktop computers, mobile phones, multimedia players, E-readers, smart in-vehicle devices, smart home appliances, artificial intelligence devices, wearable electronic devices (such as smart watches, etc.), IoT devices, virtual reality/augmented reality/mixed reality devices, etc.
  • FIG. 2 shows a schematic diagram of a hardware structure of an electronic device 200 provided by an embodiment of the present application.
  • the terminal device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a USB interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 251, and a wireless communication module 252 , audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, camera 293, display screen 294, and SIM card interface 295 and so on.
  • the sensor module 280 may include a touch sensor 280K, (of course, the terminal device 200 may also include other sensors, such as a gyroscope sensor, an acceleration sensor, a pressure sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a distance sensor, a magnetic sensor, an environmental sensor, etc. light sensor, air pressure sensor, or bone conduction sensor, etc., not shown in the figure).
  • sensors such as a gyroscope sensor, an acceleration sensor, a pressure sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a distance sensor, a magnetic sensor, an environmental sensor, etc. light sensor, air pressure sensor, or bone conduction sensor, etc., not shown in the figure).
  • the processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or Neural-network Processing Unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller may be the nerve center and command center of the terminal device 200 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 210 for storing instructions and data.
  • the memory in processor 210 is cache memory.
  • the memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
  • the processor 210 may execute the text selection method provided by the embodiment of the present invention, so as to accurately predict and locate the text that the user wants to select.
  • the processor 210 may include different devices. For example, when a CPU and an NPU (AI chip) are integrated, the CPU and NPU may cooperate to execute the text selection method provided by the embodiments of the present disclosure. Executed by NPU for faster processing efficiency.
  • Display screen 294 is used to display images, videos, and the like.
  • Display screen 294 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED organic light-emitting diode
  • AMOLED organic light-emitting diode
  • FLED flexible light-emitting diode
  • Miniled MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the terminal device 200 may include one or N display screens 294 , where N is a positive integer greater than one.
  • the display screen 294 may be used to display information entered by or provided to the user as well as various graphical user interfaces (GUIs). For example, display 294 may display photos, videos, web pages, or documents, and the like. Display screen 294 may display textual information.
  • GUIs graphical user interfaces
  • display 294 may display photos, videos, web pages, or documents, and the like.
  • Display screen 294 may display textual information.
  • the processor 210 detects a touch event of the user's finger (or a stylus, etc.) on the displayed text on the display screen 294, in response to the touch event, detects the text in the touch area corresponding to the touch event, and based on the detected The text in the touch area is predicted to obtain the selected target text, which is displayed on the display 294 .
  • the display screen 294 may be an integrated flexible display screen, or a spliced display screen composed of two rigid screens and a flexible screen located between the two rigid screens, etc. Do limit.
  • the terminal device 200 may control the display screen 294 to display corresponding text information, and display the target text selected by the user in response to the user's touch operation. For example, as shown in Figure 4 or Figure 7.
  • Camera 293 front camera or rear camera, or a camera that can be both a front camera and a rear camera is used to capture still images or video.
  • the camera 293 may include a photosensitive element such as a lens group and an image sensor, wherein the lens group includes a plurality of lenses (convex or concave) for collecting the light signal reflected by the object to be photographed, and transmitting the collected light signal to the image sensor .
  • the image sensor generates an original image of the object to be photographed according to the light signal.
  • Internal memory 221 may be used to store computer executable program code, which includes instructions.
  • the processor 210 executes various functional applications and data processing of the terminal device 200 by executing the instructions stored in the internal memory 221 .
  • the internal memory 221 may include a storage program area and a storage data area.
  • the program storage area may store operating system, codes of application programs (such as camera applications, browser applications, social applications, etc.), and the like.
  • the storage data area may store data created during the use of the terminal device 200 (such as images and videos captured by the camera application) and the like.
  • the internal memory 221 may also store one or more computer programs 1310 corresponding to the text selection method provided by the embodiment of the present disclosure.
  • the one or more computer programs 1304 are stored in the aforementioned memory 221 and configured to be executed by the one or more processors 210, and the one or more computer programs 1310 include instructions that may be used to perform the execution of FIG. 3 or each step in the corresponding embodiment of FIG. 5 .
  • the processor 210 can control the display screen to display the target text in the embodiment of FIG. 3 or FIG. 5 after detecting the user's touch operation on the text.
  • the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • non-volatile memory such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the code of the text selection method provided by the embodiment of the present disclosure may also be stored in an external memory.
  • the processor 210 may execute the code of the text selection method stored in the external memory through the external memory interface 220 .
  • the functions of the touch sensor 280K in the sensor module 280 are described below.
  • Touch sensor 280K also called “touch panel”.
  • the touch sensor 280K may be disposed on the display screen 294, and the touch sensor 280K and the display screen 294 form a touch screen, also called a "touch screen”.
  • the touch sensor 280K is used to detect touch operations on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to touch operations may be provided via display screen 294 .
  • the user may perform the touch operations shown in FIG. 1 and FIG. 6 on the touch screen, and the processor may acquire the touch area according to the touch operations.
  • the display screen 294 of the terminal device 200 displays a main interface, and the main interface includes icons of multiple applications (such as instant messaging applications, browser applications, etc.).
  • the display screen 294 displays an interface of an instant communication application, such as a login interface or a chat interface.
  • the wireless communication function of the terminal device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 251, the wireless communication module 252, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in terminal device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 251 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the terminal device 200 .
  • the mobile communication module 251 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 251 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 251 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 251 may be provided in the processor 210 .
  • At least part of the functional modules of the mobile communication module 251 may be provided in the same device as at least part of the modules of the processor 210 .
  • the mobile communication module 251 may also be used for information interaction with other terminal devices.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 270A, the receiver 270B, etc.), or displays images or videos through the display screen 294 .
  • the modem processor may be a stand-alone device.
  • the modulation and demodulation processor may be independent of the processor 210, and may be provided in the same device as the mobile communication module 251 or other functional modules.
  • the wireless communication module 252 can provide applications on the terminal device 200 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 252 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 252 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 .
  • the wireless communication module 252 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 .
  • the wireless communication module 252 is configured to transmit data between other terminal devices under the control of the processor 210.
  • the processor 210 executes the text selection method provided by the embodiment of the present disclosure
  • the processor can control the The wireless communication module 252 sends a service request to other terminal devices, and can also receive service results provided by other terminal devices based on the above-mentioned service request. For example, sending webpage access requests to other terminal devices, receiving webpage content provided by other terminal devices, or sending instant messages to other terminals, receiving instant messages sent by other terminals through the network, etc.
  • the terminal device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, an application processor, and the like. Such as music playback, recording, etc.
  • the terminal device 200 may include more or less components than those shown in FIG. 2 , which is not limited in this embodiment of the present disclosure.
  • the illustrated terminal device 200 is only an example, and the terminal device 200 may have more or fewer components than those shown in the figures, may combine two or more components, or may have a different configuration of components.
  • the various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • Embodiment 1 of the present invention provides a method 300 for text selection, which specifically includes:
  • the electronic device can detect the user's touch operation. When the user's touch operation is detected, the electronic device obtains the coordinates corresponding to the touch operation, and matches the text corresponding to the actual touch point, that is, the first text, according to the obtained coordinates.
  • the touch operation may be a touch operation by the user's finger, or may be a touch operation by the user through a stylus (or a stylus) or the like.
  • the coordinates corresponding to the touch operation may be the coordinates of the start point and the end point, or may be multiple coordinates or coordinate intervals from the start point to the end point. This embodiment of the present invention does not specifically limit this.
  • S304 Select a second text that includes more content than the first text.
  • the electronic device may select a continuous long text.
  • the long text includes not only the text content between the start point and the end point, but also the word segmentation corresponding to the start point symbol and the end point symbol.
  • the long text is the second text.
  • the starting point character is "le” and the ending point character is "lian”.
  • the second text may be "I went to see Avengers 5 with my friends today”.
  • the electronic device can process the content of the second text to obtain all the word segments corresponding to the second text. Then, find the participle corresponding to the starting point character and the ending point character in all the participles.
  • the electronic device may process the second text through a natural language processing (Natural Language Processing, NLP) module to obtain all the word segments corresponding to the second text.
  • NLP Natural Language Processing
  • word segmentation is the word unit that decomposes sentences and paragraphs into. Decomposing sentences and paragraphs into word units is the basic function of NLP. How to implement word segmentation through NLP is an existing technology in the AI field, which is not described in detail or specifically limited in this embodiment of the present invention.
  • the participle corresponding to the starting point character is a preset meaningful word, such as an entity word, the participle is selected. However, if the participle corresponding to the starting point character is a preset meaningless word, such as a non-substantial word, the starting point character is discarded. End point characters are handled in a similar manner.
  • the electronic device can determine whether it is a preset meaningful word or a meaningless word through a preset thesaurus.
  • the electronic device may have a preset thesaurus corresponding to meaningful words.
  • the electronic device may preset a thesaurus A. If the participle corresponds to a word in thesaurus A, it is considered to be a meaningful word, and the participle is selected; if it is not a word in thesaurus A, it is considered a meaningless word, and the participle is discarded.
  • the words contained in thesaurus A can be configured.
  • the thesaurus A may contain various entity words, such as nouns, verbs, pronouns, adjectives, and the like.
  • the words in the thesaurus A can also include Internet terms, popular self-created words, etc., and even an interface for adding words to the thesaurus A can be provided to the user.
  • the words in the thesaurus A can be updated in real time.
  • the entity word thesaurus can add new names of people, movies, songs, network terms, etc. in real time.
  • the electronic device may also preset a thesaurus B corresponding to meaningless words.
  • the electronic device can also determine that if the word segment is a word in thesaurus B, the word segment is discarded, otherwise the word segment is selected.
  • Thesaurus B may contain non-substantial words, such as auxiliary words, adverbs, prepositions, symbols, etc.
  • Thesaurus B may also contain some words other than non-substantial words, or words added by the user, and so on.
  • the electronic device can also select or discard the word segment by simply determining whether it is an entity word.
  • this method may not be as accurate as the preset thesaurus, and it is not easy to update in real time.
  • the electronic device may further judge the situation that the starting point character or the ending point character is a symbol, for example, if the starting point character is a symbol, it is discarded, and if the ending point character is a symbol, it is selected.
  • the first text is processed according to the word segmentation corresponding to the starting point character and the ending point character to obtain and display the target text.
  • the electronic device integrates the selected starting point word segment with the first text. For example, the starting point word segmentation is spliced with the first text and deduplicated.
  • the electronic device removes the starting point character, such as text or punctuation, from the first text.
  • End point characters are treated similarly as start point characters. If the word segment corresponding to the end point character is selected, the electronic device integrates the selected end point word segment with the first text. For example, the end point word segmentation is spliced with the first text and deduplicated. However, if the word segment corresponding to the starting point character is not selected, the electronic device removes the ending point character, such as text or punctuation, from the first text.
  • the target text is obtained.
  • the participle corresponding to the starting point character “le” is “le”, which is a meaningless word and is discarded.
  • the participle corresponding to the end point character “lian” is “Avengers 5", which is a meaningful participle, so it is selected.
  • the obtained target text is "Avengers 5", as shown in Figure 4.
  • Different electronic devices display selected text differently. After the target text is obtained, the target text is displayed in a display mode corresponding to the touch operation, such as highlighting or adding shadows.
  • if some characters in a piece of text can have multiple word segmentation methods, for example, “fu” can correspond to “revenge”, “Avengers”, “Avengers”, “Avengers 5",
  • NLP performs word segmentation, it can select a word segmentation for this text according to the situation of these word segmentations, for example, select "Avengers 5".
  • most users choose more words for a certain word, or the current hot word, or the newly added meaningful word, etc.
  • Electronic devices may choose a higher probability during word segmentation. the participle.
  • the user can also adjust the selection box corresponding to the target text to select more or less content. For example, drag the border of the dotted box shown in Figure 4 to select more or less content.
  • the user can also perform other common text operations based on the target text, such as copying/cutting the text.
  • the above-mentioned method of the embodiment of the present invention is not limited to the selection of Chinese texts, and can also be applied to texts in other languages.
  • the word segmentation sequence corresponding to the text “I Went to see the Avengers 5 with my friends today.” can be: “I” “went to” “the Avengers 5" "with” "my friends” "today” ".”.
  • the text corresponding to the touch operation actually detected by the electronic device is “Avengers 5 with my”. Since the participle corresponding to "Avengers" is "the Avengers 5", it is a preset meaningful word, and the participle corresponding to "my” is "my friends", which is also a preset meaningful word. Then, according to the method of the embodiment of the present invention, after processing the text corresponding to the detected touch operation, the obtained target text is "the Avengers 5 with my friends".
  • the electronic device after detecting the first text corresponding to the actual touch point, the electronic device actively obtains the second text with more content, so as to facilitate the selection of the first text corresponding to the start point and the end point of the first text.
  • the word segmentation determines whether it is a meaningful word segmentation, and adjusts the selected text based on the word segmentation of the starting point and the ending point to obtain the target text.
  • the text selection method can intelligently predict the text content that the user actually wants to select based on the coarsely positioned text of the touch operation actually detected by the electronic device, make up for the selection error caused by the touch operation, and improve the accuracy of the text selection by the user, thereby Improved the speed and user experience of user selection of text.
  • FIG. 5 shows Embodiment 2 of a specific implementation manner of the present invention.
  • the contents of the above-mentioned Embodiment 1 are all applicable to the Embodiment 2.
  • the touch area shown in FIG. 6 is the touch area corresponding to the two-finger touch operation actually detected by the electronic device.
  • the mobile phone After the mobile phone detects the two-finger touch operation of the finger, it respectively identifies the coordinates of the display screen corresponding to the touch positions of the two fingers, and determines the starting point and end point corresponding to the touch position according to the relative position relationship of the identified coordinates. The starting point and the ending point determine the text interval corresponding to the current two-finger touch operation.
  • the touch operation may not be limited to a two-finger touch operation, but may also be a multi-finger touch operation.
  • the electronic device can first identify the coordinates of the multiple touch points of the multi-finger touch, and then determine the starting point and the ending point according to the relative positional relationship of the multiple coordinates and the arrangement of the text, and then determine the starting point and the ending point according to the starting point and the ending point. Display the text area corresponding to the multi-finger touch.
  • the long text in addition to the text between the starting point character and the ending point character (the first text), also includes the text that takes one more line forward from the starting point character, and the one more line that starts from the ending point character. text. If there is no more line before the start-point character, the entire line where the start-point character is is taken. Or, if there is no more line after the end-point character, take the entire line where the end-point character is located.
  • the second text can be obtained by identifying specific punctuation marks around the start and end characters.
  • Specific punctuation marks can be commas, periods, semicolons, etc.
  • the second text includes, in addition to the first text, all text between the starting point and the previous punctuation mark, and all text between the ending point and the next punctuation mark.
  • the electronic device may also recognize the entire paragraph in which the start-point character and the end-point character are located as long text.
  • the electronic device can also dynamically adjust different long text acquisition methods according to the optimization of the algorithm.
  • the long text could read "In Schott's view, the purpose of the lockdown is to flatten the growth rate of the outbreak while developing a cure", or the long text could read, "The purpose of the lockdown is to allow the outbreak to grow The speed is flattening out.”
  • S506 Process the long text, obtain the word segmentation list and the character list according to the appearance order of the original text, and obtain their mapping relationship.
  • the electronic device can process this long text through NLP, and obtain all the word segmentation lists and character lists in order.
  • the content of the long text is "In Schott's view, the purpose of the blockade is to flatten the growth rate of the epidemic and develop treatment methods."
  • the word segmentation list corresponding to the long text is: “In” “Short” “seems” “,” “blockade” “” “purpose” “is” “to make” “epidemic”, “growth”, “speed” “tend to” “smooth” “,” “at the same time “R&D” "Treatment” "Method” ".”.
  • the electronic device may also record the character list corresponding to the long text, and record the mapping relationship between the character list and the word segmentation list. In this way, it is convenient to identify which character corresponds to which participle.
  • the character list corresponding to the above long text is: “zai”, “xiao”, “special”, “see”, “lai”, “seal”, “lock”, “de”, “mu”, “de”, “yes”, “make” “Epidemic”, “Sentiment”, “Increase”, “Long”, “Speed”, “Degree”, “Tendency”, “Yu”, “Flat”, “Slow”, “Same”, “Time”, “Research”, “Development”, “Treatment” and “Treatment” "”method””.
  • the character “feng” corresponds to the participle "blocking"
  • the first character “ ⁇ ” corresponds to the participle "de”
  • the second character “de” corresponds to the participle "purpose”, and so on.
  • the participle of the starting point and the ending point is a meaningful word, this participle is selected. And if it is a meaningless word, it is discarded.
  • the participle corresponding to the starting point character "de” is "de”, which is not a meaningful word and is discarded.
  • the participle corresponding to the end point "flat” is "flat”, which is a meaningful word, and is selected.
  • the determination method in S306 you can refer to the determination method in S306, for example, it can be defined by a preset thesaurus, or you can determine the part of speech of the word segmentation content (such as whether it is an entity word, etc. ) to determine, etc., which will not be repeated here.
  • all word segmentation sequences within the start point character and the end point character are selected.
  • the word segmentation sequences within the starting point and the ending point are: "purpose”, “yes”, “make”, “epidemic”, “growth”, “speed”, “trend”.
  • the above-obtained word segments are synthesized in the order of the original text to obtain the target text. If there is overlapping text, it will be deduplicated first and then synthesized.
  • the word segments selected by the touch operation this time are “purpose”, “yes”, “make”, “epidemic”, “growth”, “speed”, “trend” and “smooth”.
  • the synthesized target text is "The purpose is to flatten the growth rate of the epidemic", as shown in Figure 7.
  • the target text is displayed on the touch screen in a display mode corresponding to the selected operation.
  • Different electronic devices may have different display modes, and the display shown in FIG. 7 is for illustration only, and does not constitute any limitation.
  • the user can continue to adjust the text selection, such as dragging the border of the selection box of the target text to continue to select more text, or adjusting the selection box to select less text.
  • the above-mentioned method in the embodiment of the present invention is not limited to the selection of Chinese texts, and can be applied to texts in other languages.
  • the embodiment of the present application further provides an electronic device 800, as shown in FIG.
  • the electronic device 800 is an electronic device that can be used to implement the text selection methods shown in Embodiment 1 and Embodiment 2 above.
  • the display module 801 is used to display text information, such as various types of text information shown in Embodiment 1 and Embodiment 2.
  • the display module 801 can also present the text selected by the user in a specific manner after the user selects the text.
  • the detection module 802 can be used to detect a user's touch operation, for example, can detect a finger touch operation, including single-finger touch, two-finger touch or multi-finger touch, etc., and can also detect a touch operation such as a touch pen/stylus.
  • the detection module 802 can also continue to detect various operations of the user after the display module displays the target text, such as an operation of adjusting the selected text by the user, or an operation of copying/cutting the target text input by the user, etc. .
  • the processing module 803 may be configured to execute the method of S302-S308 in FIG. 3 or the text selection method of S402-S412 in FIG. 4 after the detection module 802 detects the user's touch operation.
  • the electronic device 800 may also include a storage module 804 .
  • the storage module 804 may be used to store computer programs and/or data.
  • the storage module 804 stores the preset thesaurus involved in Embodiment 1 and Embodiment 2, such as thesaurus A and thesaurus B.
  • the display module 801 may include the display screen 294 in the foregoing embodiment shown in FIG. 2 .
  • the detection module 802 may include the touch sensor 280K in the aforementioned embodiment shown in FIG. 2 .
  • the detection module 802 may also include a part of the processor 210 for cooperating to realize the detection of the touch operation.
  • the processing module 803 may include the processor 210 in the aforementioned embodiment shown in FIG. 2 .
  • the storage module 804 may include the internal memory 221 in the aforementioned embodiment shown in FIG. 2 .
  • each functional module in each embodiment of the present application may be integrated into one processor, or may exist physically alone, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules.
  • the term “when” may be interpreted to mean “if” or “after” or “in response to determining" or “in response to detecting" depending on the context.
  • the phrases “in determining" or “if detecting (the stated condition or event)” can be interpreted to mean “if determining" or “in response to determining" or “on detecting (the stated condition or event)” or “in response to the detection of (the stated condition or event)”.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.
  • the process can be completed by instructing the relevant hardware by a computer program, and the program can be stored in a computer-readable storage medium.
  • the program When the program is executed , which may include the processes of the foregoing method embodiments.
  • the aforementioned storage medium includes: ROM or random storage memory RAM, magnetic disk or optical disk and other mediums that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种选择文本的方法及装置,应用于人工智能(Artificial Intelligence,AI)领域中的智能交互领域。该方法包括:获取触摸操作对应的第一文本;选取包含第一文本的第二文本;基于第二文本,确认所述第一文本中起始点字符对应的第一分词;基于所述第一分词对所述第一文本进行处理,得到目标文本并显示。该技术方案可以基于触摸操作对应的文本,智能分析用户实际想选择的文本,提高用户选择文本的准确性和便利性。

Description

一种选择文本的方法、电子设备及计算机可读存储介质
本申请要求在2020年12月26日提交中国国家知识产权局、申请号为202011570649.9的中国专利申请的优先权,发明名称为“一种选择文本的方法、电子设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子设备交互技术领域,特别涉及一种选择文本的方法、电子设备及计算机可读存储介质。
背景技术
目前,对文本的操作是用户常用的操作,而选择文本是对文本进行操作的基础操作。例如,用户阅读网页内容时,发现感兴趣的信息,想复制保存下来;或者,用户想给好友发送消息时,发现需要发送的消息内容与之前已有的消息内容部分重叠,想将已有的内容复制过来直接使用。上述这些操作都需要用户先针对性选择目标文本,再对目标文本进行复制或其他操作。
但由于用户手指接触触摸屏时,用户目测的手指接触点和电子设备实际检测到的触摸点有不可避免的人为偏差,尤其是屏幕较小或文本字体较小时,这会使得用户很难选取理想的文本,降低了用户选择文本的准确度和操作体验。
发明内容
本申请实施例提供了一种选择文本的方法、电子设备及计算机可读存储介质,能基于检测到的用户触摸的文本内容,准确预测用户实际想要选取的文本内容,提高了用户选择文本的准确度,从而提升用户选择文本的速度,提高用户体验。
第一方面,本申请实施例提供了一种选择文本的方法,具体包括:获取触摸操作对应的第一文本;选取包含第一文本的第二文本;基于第二文本,确认所述第一文本中起始点字符对应的第一分词;基于所述第一分词对所述第一文本进行处理,得到目标文本;显示所述目标文本。
上述第一方面提供的技术方案,可以基于检测到的用户触摸操作对应的文本的起始点字符来进一步判断用户实际想要选择的文本,提升用户选择文本的准确性。该方案对于容易引起误操作的电子设备,例如屏幕较小或文本字体较小的电子设备,尤为便捷。
在一种可能的实现方式中,所述基于所述第一分词对所述第一文本进行处理,得到目标文本,具体包括:判断所述第一分词是否是预设的有意义的词;如果是预设的有意义的词,则选取所述第一分词与第一文本进行整合,得到目标文本;如果不是预设的有意义的词,则舍弃所述第一分词,在第一文本中去除所述第一分词对应的所述起始点字符,得到目标文本。
起始点字符对应的分词如果是有意义的词,那么用户实际想选取的概率是很大的,而且用户多半是想整个词都选择(一个词包含多个字符时),而不是选择词的一部分。而如果起始点字符对应的是无意义的词,那么被误选的概率很大。因此,基于对起始点字符是否是预设的有意义的词进行判断,来对第一文本进行处理,得到目标文本,更贴合用户选择 文本的习惯,大大提升了用户选择文本的准确性。
在一种可能的实现方式中,所述方法还包括:基于所述第二文本,确认所述第一文本中结束点字符对应的第二分词;所述基于所述第一分词对所述第一文本进行处理,得到目标文本,具体包括:基于所述第一分词和所述第二分词,对所述第一文本进行处理,得到目标文本。
除了考虑第一文本的起始点字符对应的分词的情况,还同步考虑结束点字符对应的分词的情况来对第一文本进行处理,进一步贴近用户实际想选择的文本内容。
在一种可能的实现方式中,所述基于所述第一分词和所述第二分词,对所述第一文本进行处理,得到目标文本,具体包括:分别判断所述第一分词和所述第二分词是否是预设的有意义的词;如果所述第一分词和所述第二分词是预设的有意义的词,则选取所述第一分词和所述第二分词,并与所述第一文本进行整合,得到目标文本;或如果所述第一分词不是预设的有意义的词,所述第二分词是预设的有意义的词,则在所述第一文本中去除所述第一分词对应的所述起始点字符,并与所述第二分词进行整合,得到目标文本;或如果所述第一分词是预设的有意义的词,所述第二分词不是预设的有意义的词,则将所述第一文本与所述第一分词进行整合,并去除所述第二分词对应的所述结束点字符,得到目标文本。
同步考虑起始点字符和结束点字符对应的分词是否是有意义的词,来对第一文本进行处理,提高用户实际想选择文本的准确性。
在一种可能的实现方式中,所述预设的有意义的词是预置的词库的词,或者预先规定的词性的词。预设的有意义的词可以是用户预设的词库中的词,词库可以动态更新。词库中的词可以包含通用词,还可以包含网络用语、热门词、自造词等。针对不同的语言还可以有不同的词库。
在一种可能的实现方式中,所述预先规定的词性的词是实体词。而相反,非实体词可能属于无意义的词。
在一种可能的实现方式中,所述目标文本包含的所有的实体词都是完整的。这样就不会出现,一个实体词被选择了一部分,而另一部分没有被选择的情况。
在一种可能的实现方式中,在所述显示目标文本后,所述方法还包括:对所述目标文本对应的选择框进行操作,得到第三文本。用户还可以继续对目标文本的选择框进行操作,以选择更多或更少的文字,方便用户灵活调整。
在一种可能的实现方式中,在所述显示目标文本后,所述方法还包括:对所述目标文本进行其他操作。例如,用户可以对选择的文本进行复制、剪切等操作。
在一种可能的实现方式中,所述触摸操作是手指触摸操作,或触控笔的触摸操作。本方案的触摸操作不限于用户的手指触摸,触控笔的触摸操作也同样适用。
第二方面,本申请实施例提供了一种终端设备,该终端设备可以执行上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的文本提取方法。
第三方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的文本提取方法。
第四方面,本申请实施例提供了一种计算机程序产品,包括计算机可读代码,或者承 载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述第一方面或者第一方面的多种可能的实现方式中的一种或几种的文本提取方法。
在本发明公开的各个实施例的方案中,通过检测用户的触摸操作,获取触摸操作对应的第一文本,并通过有限扩大文本范围来获取第一文本的起始点字符/结束点字符对应的分词情况,处理第一文本得到目标文本。这样,本方案可以基于用户触摸操作粗定位的文本范围,进一步判断用户实际想要选择的文本内容,提升了用户选择文本的准确性。
附图说明
图1为本申请实施例的一种应用界面的用户操作示例性示意图;
图2为本申请实施例的一种电子设备200的结构示意图;
图3为本申请实施例的一种文本选择方法的方法示意图;
图4为本申请实施例的一种应用界面的文本选择结果的示例性示意图;
图5为本申请实施例的另一种文本选择方法的方法示意图;
图6为本申请实施例的另一种应用界面的用户操作示例性示意图;
图7为本申请实施例的另一种应用界面的文本选择结果的示例性示意图;
图8为本申请实施例的另一电子设备800的结构示意图。
具体实施方式
应理解,本申请实施例中“至少一个”是指一个或者多个。“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系。例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的三种情况。其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一(项)个”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b或c中的至少一项(个),可以表示:a,b,c,a和b,a和c,b和c,或a、b和c七种情况。其中a、b、c中的每一个本身可以是元素,也可以是包含一个或多个元素的集合。
在本申请中,“示例的”、“在一些实施例中”、“在另一些实施例中”等用于表示作例子、例证或说明。本申请中被描述为“示例”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用示例的一词旨在以具体方式呈现概念。
需要指出的是,本申请实施例中涉及的“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。
选择文本的操作是电子设备中针对显示文本的常见操作,例如选择一段文字,然后复制,粘贴。对具有触摸屏的电子设备,用户通常可以通过单指或多指触摸操作来一次性选择一段相关的文字。但由于用户手指触摸时,用户瞄准的手指接触点和电子设备识别到的手指的实际触摸点不可避免存在误差,会导致电子设备识别到的实际触摸点对应的文字不同于用户真实想要选择的文字。
如图1所示,用户与好友1的聊天中说到“我今天和朋友一起去看了复仇者联盟5”。在这段文字中,用户想选择“复仇者联盟5”。由于电子设备识别到的实际触摸点相关的文 字为“了复仇者联”,不同于“复仇者联盟5”。通常用户需要放弃之前的选择而重新选择,或者,用户调整之前触摸操作触发的选择框,以调整选择的文字为想要选择的文字。这些都需要用户更多的额外操作,甚至反复操作,才能使得用户选择到想要选择的文本。
本发明实施例提供了一种文本选择的方法,可以基于电子设备识别到的实际触摸点对应的文字,来进一步预测用户真实想要选择的文字,智能提高文本选择的准确性,从而进一步提高用户选择文本的速度和体验。
示例性的,本发明实施例涉及的电子设备可以是具有触摸屏的任意终端设备,包括而不限于手机、平板电脑、笔记本电脑、电视机、膝上计算机、台式计算机、移动电话、多媒体播放器、电子阅读器、智能车载设备、智能家电、人工智能设备、可穿戴电子设备(如智能手表等)、物联网设备、虚拟现实/增强现实/混合现实设备等。
图2示出了本申请实施例提供的一种电子设备200的硬件结构示意图。终端设备200可以包括处理器210,外部存储器接口220,内部存储器221,USB接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块251,无线通信模块252,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及SIM卡接口295等。其中传感器模块280可以包括触摸传感器280K,(当然,终端设备200还可以包括其它传感器,比如陀螺仪传感器、加速度传感器、压力传感器、接近光传感器、指纹传感器、温度传感器、距离传感器、磁传感器、环境光传感器、气压传感器、或骨传导传感器等,图中未示出)。
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是终端设备200的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。
处理器210可以运行本发明实施例提供的文本选择方法,以便于准确预测和定位用户想选择的文本。处理器210可以包括不同的器件,比如集成CPU和NPU(AI芯片)时,CPU和NPU可以配合执行本公开实施例提供的文本选择方法,比如文本选择方法中部分算法由CPU执行,另一部分算法由NPU执行,以得到较快的处理效率。
显示屏294用于显示图像,视频等。显示屏294包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic  light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,终端设备200可以包括1个或N个显示屏294,N为大于1的正整数。显示屏294可用于显示由用户输入的信息或提供给用户的信息以及各种图形用户界面(graphical user interface,GUI)。例如,显示器294可以显示照片、视频、网页、或者文件等。显示屏294可以显示文本信息。当处理器210检测到用户的手指(或触控笔等)在显示屏294上针对显示的文字的触摸事件后,响应于该触摸事件,检测触摸事件对应的触摸区域的文字,并基于检测的触摸区域的文字进行预测,得到选择的目标文本,在显示器294上显示。
在本公开实施例中,显示屏294可以是一个一体的柔性显示屏,也可以采用两个刚性屏以及位于两个刚性屏之间的一个柔性屏组成的拼接显示屏等,本发明实施例不做限定。
当处理器210运行本公开实施例提供的文本选择方法后,终端设备200可以控制显示屏294显示相应的文本信息,以及响应用户的触摸操作后,显示用户选择的目标文本。例如图4或图7所示。
摄像头293(前置摄像头或者后置摄像头,或者一个摄像头既可作为前置摄像头,也可作为后置摄像头)用于捕获静态图像或视频。通常,摄像头293可以包括感光元件比如镜头组和图像传感器,其中,镜头组包括多个透镜(凸透镜或凹透镜),用于采集待拍摄物体反射的光信号,并将采集的光信号传递给图像传感器。图像传感器根据所述光信号生成待拍摄物体的原始图像。
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行终端设备200的各种功能应用以及数据处理。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,应用程序(比如相机应用,浏览器应用,社交应用等)的代码等。存储数据区可存储终端设备200使用过程中所创建的数据(比如相机应用采集的图像、视频等)等。
内部存储器221还可以存储本公开实施例提供的文本选择方法对应的一个或多个计算机程序1310。该一个或多个计算机程序1304被存储在上述存储器221中并被配置为被该一个或多个处理器210执行,该一个或多个计算机程序1310包括指令,上述指令可以用于执行如图3或图5相应实施例中的各个步骤。当内部存储器221中存储的文本选择方法的代码被处理器210运行时,处理器210可以在检测到用户针对文本的触摸操作后,控制显示屏显示图3或图5实施例中的目标文本。
此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
当然,本公开实施例提供的文本选择方法的代码还可以存储在外部存储器中。这种情况下,处理器210可以通过外部存储器接口220运行存储在外部存储器中的文本选择方法的代码。
下面介绍传感器模块280中的触摸传感器280K的功能。
触摸传感器280K,也称“触控面板”。触摸传感器280K可以设置于显示屏294,由触摸传感器280K与显示屏294组成触摸屏,也称“触控屏”。触摸传感器280K用于检测作用 于其上或附近的触控操作。触摸传感器可以将检测到的触控操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏294提供与触控操作相关的视觉输出。在本公开实施例中,用户可以在触摸屏上执行图1和图6所示的触摸操作,处理器依据这些触摸操作可以获取到触摸区域。
示例性的,终端设备200的显示屏294显示主界面,主界面中包括多个应用(比如即时通信应用、浏览器应用等)的图标。用户通过触摸传感器280K点击主界面中即时通信应用的图标,触发处理器210启动即时通信应用。显示屏294显示即使通信应用的界面,例如登录界面或者聊天界面等。
终端设备200的无线通信功能可以通过天线1,天线2,移动通信模块251,无线通信模块252,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。终端设备200中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块251可以提供应用在终端设备200上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块251可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块251可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块251还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块251的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块251的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。在本公开实施例中,移动通信模块251还可以用于与其它终端设备进行信息交互。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器270A,受话器270B等)输出声音信号,或通过显示屏294显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器210,与移动通信模块251或其他功能模块设置在同一个器件中。
无线通信模块252可以提供应用在终端设备200上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块252可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块252经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块252还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。本公开实施例中,无线通信模块252,用于在处理器210的控制下与其他终端设备之间传输数据,比如,处理器210运行本公开实施例提供的文本选取方法时,处理器可以控制无线通信模块252向其 他终端设备发送服务请求,还可以接收其他终端设备基于上述服务请求提供的服务结果。例如,向其他终端设备发送网页访问请求,接收其他终端设备提供的网页内容,或向其他终端发送即时消息,接收其他终端通过网络发送过来的即时消息等。
另外,终端设备200可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
应理解,在实际应用中,终端设备200可以包括比图2所示的更多或更少的部件,本公开实施例不作限定。图示终端设备200仅是一个范例,并且终端设备200可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
以下将结合附图,对本申请实施例提供的文本选择方法做具体介绍。
如图3所示,本发明实施例1提供了一种文本选择的方法300,具体包括:
S302,获取触摸操作对应的第一文本。
电子设备可以检测用户的触摸操作。当检测到用户的触摸操作时,电子设备会获取触摸操作对应的坐标,并根据获取到的坐标,匹配与实际触摸点对应的文本,即第一文本。该触摸操作可以是用户手指的触摸操作,也可以是用户通过触控笔(或叫手写笔)等作用的触摸操作。触摸操作对应的坐标可以是起始点坐标和结束点坐标,也可以是从起始点到结束点之间的多个坐标或者坐标区间。本发明实施例对此不做具体限定。
以图1中对应的文本选取为例,在“我今天和朋友一起去看了复仇者联盟5”中,用户想选择“复仇者联盟5”,而电子设备识别到的实际触摸点的坐标对应的相关文本为“了复仇者联”。即第一文本为“了复仇者联”。
S304,选取包含第一文本外的更多内容的第二文本。
一种可选的实现方式中,在检测到文本选择的触摸操作后,电子设备可以选取一段连续的长文本。该长文本不仅包含起始点和结束点之间的文本内容,还包含了起始点符号和结束点符号对应的分词。该长文本为第二文本。
在上面的实例中,起始点字符为“了”,结束点字符为“联”。第二文本可以是“我今天和朋友一起去看了复仇者联盟5”。
S306,基于第二文本,查找第一文本中起始点和结束点字符对应的分词。
电子设备获取第二文本后,可以对第二文本的内容进行处理,得到第二文本对应的所有分词。然后在所有的分词中查找起始点字符和结束点字符对应的分词。
在一种可实现方式中,电子设备可以通过自然语言处理(Natural Language Processing,NLP)模块来处理第二文本,得到第二文本对应的所有分词。其中,分词是将句子、段落分解成的字词单位。将句子、段落分解成字词单位是NLP的基础功能。如何通过NLP实现分词是AI领域的现有技术,本发明实施例对此不做详细说明和具体限定。
上述实例中,第二文本“我今天和朋友一起去看了复仇者联盟5”对应的分词分别为“我”、“今天”、“和”、“朋友”、“一起”、“去”、“看”、“了”、“复仇者联盟5”。
如果起始点字符对应的分词,是预设的有意义的词,如实体词,则选取该分词。而如果起始点字符对应的分词是预设的无意义的词,例如非实体词,则舍弃该起始点字符。结 束点字符也根据类似的方法进行处理。
电子设备可以通过预置的词库来判定是否是预设的有意义的词或者无意义的词。具体的,电子设备可以有预先设置的有意义的词对应的词库。例如,电子设备可以预置一个词库A。如果分词对应的是词库A中的词,则认为是有意义的词,进而选取该分词,而如果不是词库A中的词,则认为是无意义的词,进而舍弃该分词。
词库A包含的词可以配置。例如词库A中可以包含各实体词,如名词、动词、代词、形容词等。词库A中的词也可以包含网络用语、热门自造词等,甚至可以提供向词库A中添加词的接口给用户。词库A中的词可以实时更新,例如实体词词库可以实时添加新的人名、电影名、歌曲名、网络用语等。
可选的,电子设备还可以预置一个词库B,对应无意义的词。电子设备也可以判断如果分词是词库B中的词,则舍弃该分词,否则选取该分词。词库B中可以包含非实体词,如助词、副词、介词、符号等。词库B也可以包含一些非实体词外的词,或者用户添加的词,等。
在一种可实现的方式中,电子设备也可以通过简单判定分词是否是实体词来选取或舍弃。不过该方式可能没有预置词库判断准,也不好实时更新。
可选的,电子设备也可以对起始点字符或结束点字符是符号的情况有进一步的判断,例如如果是起始点字符是符号,则舍弃,而如果是结束点字符是符号,则选取。
S308,根据起始点字符和结束点字符对应的分词对第一文本进行处理,得到目标文本并显示。
如果选取了起始点字符对应的分词,电子设备将选取的起始点分词与第一文本进行整合。如将起始点分词与第一文本进行拼接并去重。
而如果没有选取起始点字符对应的分词,电子设备将起始点字符,如文字或标点符号,从第一文本中去除。
结束点字符也像起始点字符一样做类似的处理。如果选取了结束点字符对应的分词,电子设备将选取的结束点分词与第一文本进行整合。如将结束点分词与第一文本进行拼接并去重。而如果没有选取起始点字符对应的分词,电子设备将结束点字符,如文字或标点符号,从第一文本中去除。
将第一文本的起始点字符和结束点字符进行上述处理后,得到目标文本。
图1实例中,起始点字符“了”对应的分词是“了”,属于无意义的词,则舍弃。而结束点字符“联”对应的分词是“复仇者联盟5”,属于有意义的分词,则选取。整合后,得到的目标文本为“复仇者联盟5”,如图4所示。
不同的电子设备显示选择文本的方式不同。得到目标文本后,目标文本以触摸操作对应的显示方式显示,例如高亮、或加阴影等凸显出来,图4只是简单的示例,具体显示方式本发明实施例不做具体限定。
在一种可选的实现方式中,如果一段文本中,某些字符可以有多种分词方式,例如“复”可以对应“复仇”“复仇者”“复仇者联盟”“复仇者联盟5”,NLP在分词时,可根据这些分词的情况选择一个作为本段文本的分词,例如选择“复仇者联盟5”。例如某一分词相对其他分词来说,是多数用户选择更多的词,或是当前的热词,或是最新加入的有意义的词, 等,电子设备在在分词时可能会更大概率选择该分词。
可选的,在显示目标文本后,用户还可以对目标文本对应的选择框进行调整,以选择更多或更少的内容。例如,对图4所示的虚线框的边框进行拖动,以选择更多或更少的内容。
在显示目标文本后,用户还可以基于目标文本进行其他常用的文本操作,例如复制/剪切文本等。
本发明实施例的上述方法不限于中文文本的选择,也可适用于其他语言的文本。例如文本“I went to see the Avengers 5 with my friends today.”对应的分词序列可以为:“I”“went to”“the Avengers 5”“with”“my friends”“today”“.”。检测到用户的触摸操作,电子设备实际检测的触摸操作对应的文本为“Avengers 5 with my”。由于“Avengers”对应的分词为“the Avengers 5”,是预设的有意义的词,“my”对应的分词为“my friends”,也是预设的有意义的词。那么根据本发明实施例的方法,基于检测到触摸操作对应的文本处理后,得到的目标文本为“the Avengers 5 with my friends”。
本发明实施例提供的文本选择方法,在检测到实际触摸点对应的第一文本后,电子设备通过主动获取更多内容的第二文本,以便于对第一文本的起始点和结束点对应的分词进行判断是否是有意义的分词,并基于起始点和结束点的分词的情况来调整选择的文本,得到目标文本。该文本选择方法能基于电子设备实际检测到的触摸操作粗定位的文本,来智能预测用户实际想选择的文本内容,弥补了触摸操作带来的选择误差,提高了用户选择文本的准确性,从而提高了用户选择文本的速度和用户体验。
基于上述实施例1,图5示出了本发明具体实现方式的实施例2。上述实施例1中的内容均适用于实施例2。
下述以双指触摸选择文本为例。
S502,检测双指触摸操作对应的文本区间。
图6中所示的触摸区域为电子设备实际检测到的双指触摸操作对应的触摸区域。手机在检测到手指的双指触摸操作后,分别识别两个手指的触摸位置对应的显示屏的坐标,根据识别到的坐标的相对位置关系,判断触摸位置对应的起始点和结束点,并根据起始点和结束点确定出本次双指触摸操作对应的文本区间。
可以理解的是,该触摸操作也可以不限于双指触摸操作,还可以是多指触摸操作。电子设备可以先分别识别出多指触摸的多个触摸点的坐标,然后根据多个坐标的相对位置关系以及文本的排布方式,确定出起始点和结束点,进而根据起始点和结束点确定出多指触摸对应的文本区间。
S504,提取包含上述触摸操作对应的文本外的足够的长文本。
长文本可以有多种获取方法,本发明实施例不限定具体获取长文本的方法。
例如,长文本除了包含起始点字符和结束点字符之间的文本(第一文本),还包括从起始点字符开始向前多取一行的文本,以及从结束点字符开始向后多取一行的文本。如果起始点字符前面没有更多一行,则取起始点字符所在的整行。或者,如果结束点字符后面没有更多一行,则取结束点字符所在的整行。
或者,第二文本可以通过识别起始点字符和结束点字符附近的特定的标点符号来获取。 特定的标点符号可以是逗号、句号、分号等。例如,第二文本除了包含第一文本,还包括起始点到前一个标点符号之间的所有文本,以及结束点往后一个标点符号之间的所有文本。
或者,电子设备也可以通过识别起始点字符和结束点字符所在的整个段落作为长文本。
电子设备也可以根据算法的优化而动态调整不同的长文本获取的方法。
图6所示的示例中,长文本可以为“在肖特看来,封锁的目的是使疫情增长速度趋于平缓,同时研发治疗方法”,或者长文本可以为“封锁的目的是使疫情增长速度趋于平缓”。
S506,处理长文本,按照原文出现顺序获得分词列表与字符列表,并获得他们的映射关系。
电子设备可以通过NLP来处理该长文本,按顺序获取所有的分词列表和字符列表。
图6所示的示例中,以长文本内容为“在肖特看来,封锁的目的是使疫情增长速度趋于平缓,同时研发治疗方法。”为例,该长文本对应的分词列表为:“在”“肖特”“看来”“,”“封锁”“的”“目的”“是”“使”“疫情”“增长”“速度”“趋于”“平缓”“,”“同时”“研发”“治疗”“方法”“。”。
可选的,电子装置也可以记录该长文本对应的字符列表,并记录字符列表和分词列表的映射关系。这样可以方便标识具体是哪个字符对应到哪个分词。
例如,上述长文本对应的字符列表为:“在”“肖”“特”“看”“来”“,”“封”“锁”“的”“目”“的”“是”“使”“疫”“情”“增”“长”“速”“度”“趋”“于”“平”“缓”“,”“同”“时”“研”“发”“治”“疗”“方”“法”“。”。
上述分词列表和字符列表中,字符“封”对应分词“封锁”,第一个字符“的”对应分词“的”,第二个字符“的”对应分词“目的”,等。
S508,查找起始点与结束点字符对应的分词。
起始点和结束点的分词如果是有意义的词,则选取该分词。而如果是无意义的词,则舍弃。
图6所示的示例中,起始点字符“的”对应的分词是“的”,不属于有意义的词,则舍弃。结束点“平”对应的分词是“平缓”,属于有意义的词,则选取。怎么判定分词是否是有意义的词,还是无意义的词,可以参考S306中的判定方法,例如可以通过预置的词库来定义,也可以通过判定分词内容的词性(例如是否是实体词等)来判定,等,此处不再赘述。
S510,选取起始点与结束点以内的分词序列。
在对起始点字符对应的分词和结束点字符对应的分词进行判断后,选取起始点字符与结束点字符以内的所有分词序列。例如如图5所示的示例中,起始点与结束点以内的分词序列为:“目的”“是”“使”“疫情”“增长”“速度”“趋于”。
S512,将选取的分词按原文显示序列合成,得到目标文本,并在触摸屏上以与选中操作对应的显示方式显示。
将上述得到的分词按原文顺序合成,得到目标文本。如有重合文本,则先去重后合成。
图6所示的示例中,本次触摸操作选择的分词分别为“目的”“是”“使”“疫情”“增长”“速度”“趋于”“平缓”。合成后的目标文本为“目的是使疫情增长速度趋于平缓”,如图7所示。
目标文本在触摸屏上以与选中操作对应的显示方式显示。不同的电子设备可能会有不 同的显示方式,图7所示的显示只是示意,并不构成任何限定。
可选的,在显示的目标文本的基础上,用户还可以继续对文本选择进行调整操作,如拖动目标文本的选择框的边框继续选择更多的文本,或者调整选择框选择更少的文本。
本发明实施例的上述方法也不限于中文文本的选择,可适用于其他语言的文本。
基于上述实施例1和实施例2的相同的构思,本申请实施例还提供了一种电子设备800,如图8所示,包括显示模块801、检测模块802、处理模块803和存储模块804。
电子设备800是可用于实现上述实施例1和实施例2所示的文本选择方法的电子设备。
显示模块801,用于显示文本信息,例如实施例1和实施例2所示的各类文本信息。显示模块801还能在用户选择文本后,以特定的方式呈现用户选择的文本。
检测模块802可用于检测用户的触摸操作,例如可以检测手指的触摸操作,包括单指触摸、双指触摸或多指触摸等,也可以检测例如触摸笔/手写笔的触摸操作等。可选的,检测模块802还可以在显示模块显示目标文本后,继续检测用户的各种操作,例如用户调整选择的文本的操作,或者用户输入的对目标文本进行复制/剪切的操作,等。
处理模块803可用于在检测模块802检测到用户的触摸操作后,执行图3中S302-S308的方法,或图4中S402-S412的文本选择方法。
电子设备800还可以包括存储模块804。存储模块804可用于存储计算机程序和/或数据。存储模块804存储实施例1和实施例2中涉及的预置的词库,例如词库A和词库B。
具体的,在本申请实施例中,显示模块801可以包含前述图2所示实施例中的显示屏294。检测模块802可以包含前述图2所示实施例中的触摸传感器280K。或者,检测模块802还可以包含处理器210的一部分,用于配合实现触摸操作的检测。处理模块803可以包含前述图2所示实施例中的处理器210。存储模块804可以包含前述图2所示实施例中的内部存储器221。
关于电子设备800实现文本选择的具体执行过程,可参见上方法实施例1和实施例2中的详细描述,此处不再赘述。本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
上述实施例中所用,根据上下文,术语“当…时”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算 机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘)等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (12)

  1. 一种文本选择方法,其特征在于,所述方法包括:
    获取触摸操作对应的第一文本;
    选取包含第一文本的第二文本;
    基于第二文本,确认所述第一文本中起始点字符对应的第一分词;
    基于所述第一分词对所述第一文本进行处理,得到目标文本;
    显示所述目标文本。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述第一分词对所述第一文本进行处理,得到目标文本,具体包括:
    判断所述第一分词是否是预设的有意义的词;
    如果所述第一分词是预设的有意义的词,则选取所述第一分词与第一文本进行整合,得到目标文本;或者
    如果所述第一分词不是预设的有意义的词,则舍弃所述第一分词,在第一文本中去除所述第一分词对应的所述起始点字符,得到目标文本。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    基于所述第二文本,确认所述第一文本中结束点字符对应的第二分词;
    所述基于所述第一分词对所述第一文本进行处理,得到目标文本,具体包括:
    基于所述第一分词和所述第二分词,对所述第一文本进行处理,得到目标文本。
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述第一分词和所述第二分词,对所述第一文本进行处理,得到目标文本,具体包括:
    分别判断所述第一分词和所述第二分词是否是预设的有意义的词;
    如果所述第一分词和所述第二分词是预设的有意义的词,则选取所述第一分词和所述第二分词,并与所述第一文本进行整合,得到目标文本;或
    如果所述第一分词不是预设的有意义的词,所述第二分词是预设的有意义的词,则在所述第一文本中去除所述第一分词对应的所述起始点字符,并与所述第二分词进行整合,得到目标文本;或
    如果所述第一分词是预设的有意义的词,所述第二分词不是预设的有意义的词,则将所述第一文本与所述第一分词进行整合,并去除所述第二分词对应的所述结束点字符,得到目标文本。
  5. 根据权利要求2-4任一项所述的方法,其特征在于,所述预设的有意义的词是预置的词库的词,或者预先规定的词性的词。
  6. 根据权利要求5所述的方法,其特征在于,所述预先规定的词性的词是实体词。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述目标文本包含的所有的实体词都是完整的。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,在所述显示目标文本后,所述方法还包括:
    对所述目标文本对应的选择框进行操作,得到第三文本。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,在所述显示目标文本后,所述方法还包括:
    对所述目标文本进行其他操作。
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述触摸操作是手指触摸操作,或触控笔的触摸操作。
  11. 一种电子设备,其特征在于,包括处理器,用于存储处理器可执行指令的存储器,以及用于显示文本并接收用户触摸操作的触摸屏,所述处理器调用所述可执行指令时以使得终端实现如权1-10任意一项所述的文本选择方法。
  12. 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1-10中任意一项所述的方法。
PCT/CN2021/139261 2020-12-26 2021-12-17 一种选择文本的方法、电子设备及计算机可读存储介质 WO2022135302A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011570649.9 2020-12-26
CN202011570649.9A CN114757180A (zh) 2020-12-26 2020-12-26 一种选择文本的方法、电子设备及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2022135302A1 true WO2022135302A1 (zh) 2022-06-30

Family

ID=82157365

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/139261 WO2022135302A1 (zh) 2020-12-26 2021-12-17 一种选择文本的方法、电子设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN114757180A (zh)
WO (1) WO2022135302A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100231529A1 (en) * 2009-03-12 2010-09-16 Nokia Corporation Method and apparatus for selecting text information
CN102937864A (zh) * 2012-10-31 2013-02-20 百度在线网络技术(北京)有限公司 一种用于在触摸终端上确定所选文本的方法与设备
CN104750661A (zh) * 2013-12-30 2015-07-01 腾讯科技(深圳)有限公司 一种对文本进行选定词句的方法和装置
CN110032324A (zh) * 2018-01-11 2019-07-19 华为终端有限公司 一种文本选中方法及终端
CN111026319A (zh) * 2019-12-26 2020-04-17 腾讯科技(深圳)有限公司 一种智能文本处理方法、装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100231529A1 (en) * 2009-03-12 2010-09-16 Nokia Corporation Method and apparatus for selecting text information
CN102937864A (zh) * 2012-10-31 2013-02-20 百度在线网络技术(北京)有限公司 一种用于在触摸终端上确定所选文本的方法与设备
CN104750661A (zh) * 2013-12-30 2015-07-01 腾讯科技(深圳)有限公司 一种对文本进行选定词句的方法和装置
CN110032324A (zh) * 2018-01-11 2019-07-19 华为终端有限公司 一种文本选中方法及终端
CN111026319A (zh) * 2019-12-26 2020-04-17 腾讯科技(深圳)有限公司 一种智能文本处理方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN114757180A (zh) 2022-07-15

Similar Documents

Publication Publication Date Title
US20230074004A1 (en) Method and apparatus for providing lock-screen
US11073983B2 (en) Display method and apparatus
WO2019062910A1 (zh) 一种复制和粘贴的方法、数据处理装置和用户设备
US20130050143A1 (en) Method of providing of user interface in portable terminal and apparatus thereof
US20170336938A1 (en) Method and apparatus for controlling content using graphical object
US10222900B2 (en) Method and apparatus for differentiating between grip touch events and touch input events on a multiple display device
US9075828B2 (en) Electronic device and method of controlling the same
US20190324634A1 (en) Display and Processing Methods and Related Apparatus
EP2869181A1 (en) Method for executing functions in response to touch input and electronic device implementing the same
CN105190520A (zh) 用于使能触摸的设备的悬停手势
KR20140045060A (ko) 이동 단말기 및 이동 단말기의 제어 방법
WO2019236204A1 (en) Device, method, and graphical user interface for managing authentication credentials for user accounts
AU2012302448A1 (en) Method of providing a user interface in portable terminal and apparatus thereof
US11481357B2 (en) Album display method, electronic device, and storage medium
US20220236837A1 (en) View Display Method and Electronic Device
US20150128073A1 (en) Method for sharing contents and electronic device thereof
WO2021169954A1 (zh) 搜索方法及电子设备
CN110865734B (zh) 目标对象显示方法、装置、电子设备和计算机可读介质
WO2015000430A1 (zh) 智能选词的方法和装置
WO2022218192A1 (zh) 文件处理方法及装置
WO2022068721A1 (zh) 截屏方法、装置及电子设备
CN109471841B (zh) 一种文件分类方法和装置
WO2020181505A1 (zh) 一种输入法候选内容的推荐方法及电子设备
WO2021197260A1 (zh) 便签创建方法及电子设备
KR102203131B1 (ko) 파일 관리 방법 및 그 전자 장치

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21909298

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21909298

Country of ref document: EP

Kind code of ref document: A1