WO2016131260A1 - Word processing method and apparatus - Google Patents

Word processing method and apparatus Download PDF

Info

Publication number
WO2016131260A1
WO2016131260A1 PCT/CN2015/090282 CN2015090282W WO2016131260A1 WO 2016131260 A1 WO2016131260 A1 WO 2016131260A1 CN 2015090282 W CN2015090282 W CN 2015090282W WO 2016131260 A1 WO2016131260 A1 WO 2016131260A1
Authority
WO
WIPO (PCT)
Prior art keywords
text information
module
analysis
text
extended
Prior art date
Application number
PCT/CN2015/090282
Other languages
French (fr)
Chinese (zh)
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 WO2016131260A1 publication Critical patent/WO2016131260A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Definitions

  • This paper relates to the field of word processing technology, especially a word processing method and device.
  • the text selected by the user may have multiple meanings or part of speech, and the query operation of the terminal device is difficult to obtain an accurate interpretation of the text. Therefore, the manner of querying the text in the related art is performed by the terminal device for the keyword selected by the user. Query, which leads to inaccurate query results.
  • the technical problem to be solved by the present invention is to provide a word processing method and apparatus for solving the problem of querying text in the related art.
  • the terminal device searches for keywords selected by the user, which leads to inaccurate query results.
  • a word processing method including:
  • the method before the step of performing semantic analysis on the first text information in the second text information, the method further includes:
  • the first text information is the same as the character type of the extended text information
  • the first text information is semantically analyzed in the second text information, and an analysis result of the first text information is obtained.
  • the step of performing semantic analysis on the first text information in the second text information includes:
  • the first text information is reselected, and an analysis result of the reselected first text information is obtained.
  • the reselected first text information includes:
  • the selected first text information and a portion of the extended text information are selected first text information and a portion of the extended text information.
  • the method further includes:
  • the analysis results are displayed on a graphical user interface GUI.
  • a word processing device includes an acquisition module and a semantic analysis module, wherein:
  • the obtaining module is configured to: obtain, according to a location of the selected first text information in the file, Second text information, wherein the second text information includes the first text information and extended text information adjacent to the first text information;
  • the semantic analysis module is configured to perform semantic analysis on the first text information in the second text information acquired by the obtaining module, and obtain an analysis result of the first text information.
  • the device further includes: a character analysis module and a determination module, where
  • the character analysis module is configured to compare the first text information and the second text information before the semantic analysis module performs semantic analysis on the first text information in the second text information
  • the first text information is subjected to character type analysis
  • the determining module is configured to: determine whether the first text information and the extended text information have the same character type;
  • the character analysis module is further configured to: when the determining module determines that the first text information is different from the character type of the extended text information, querying the interpretation of the first text information or prompting the first text information Perform the corresponding operations;
  • the semantic analysis module is configured to perform semantic analysis on the first text information in the second text information acquired by the obtaining module, and obtain an analysis result of the first text information: in the determining module When it is determined that the first text information is the same as the character type of the extended text information, the first text information is semantically analyzed in the second text information, and the analysis result of the first text information is obtained.
  • the device further includes a determining module, where
  • the determining module is configured to: determine, during the semantic analysis of the first text information in the second text information, whether the positioning of the selected first text information is accurate;
  • the semantic analysis module is further configured to: when the determining module determines that the location of the selected first text information is accurate, acquiring an analysis result of the first text information;
  • the semantic analysis module is further configured to: when the determining module determines that the location of the selected first text information is inaccurate, reselect the first text information, and acquire the first text information for reselection Analysis results.
  • the first text information that is reselected by the semantic analysis module includes:
  • the selected first text information and a portion of the extended text information are selected first text information and a portion of the extended text information.
  • the device further includes: a display module, where
  • the display module is configured to display the analysis result on the graphical user interface GUI after the semantic analysis module acquires the analysis result.
  • a computer program comprising program instructions that, when executed by a computer, cause the computer to perform any of the above-described word processing methods.
  • the text processing method and device provided by the technical solution of the present invention obtain the second text information to be analyzed by combining the first text information selected by the user with the specific location of the first text information in the file, the second text information including the above The first text information and the extended text information selected by the user, so as to perform semantic analysis on the first text information in the second text information to obtain an analysis result; the method provided by the present invention expands the query on the individual text information to The specific analysis carried out in the context can obtain the specific interpretation of the text, the part of speech, the components in the sentence and other characteristics, with more comprehensive and accurate analysis results; solve the way of querying text in related technologies, because the terminal equipment is selected for the user Keywords are queried, resulting in inaccurate query results.
  • FIG. 1 is a flowchart of a text processing method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another word processing method according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of still another text processing method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a word processing apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of another word processing apparatus according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a text processing method according to an embodiment of the present invention.
  • the text processing method provided in this embodiment is applicable to a text query in an electronic file, and the method can be executed by a word processing device.
  • the word processing device is usually implemented in hardware and software, and can usually be integrated in the terminal.
  • the terminal device is, for example, a personal computer (Personal Computer, PC for short) or a smart terminal.
  • the method in this embodiment may include:
  • the application scenario of the embodiment is, for example, the user reading an electronic file through a smart terminal, and the electronic file may be in a format such as Word, Excel, or PDF, and may be applied to a text message, an instant message, or the like by the user through the smart terminal.
  • the smart terminal may be, for example, a terminal having a touch screen, and the user selects the first text information in the electronic file by a touch operation, and the first text information is, for example, a phrase.
  • the user after selecting a phrase, the user usually directly specifies the manner of the query, such as searching a dictionary, searching for encyclopedic knowledge of the network query, and the like.
  • the first text information selected by the user is not directly queried.
  • the second text information to be analyzed may be obtained by combining the position of the first text information in the electronic file currently read by the user, that is, the second text information to be analyzed may be combined with the context content of the first text information.
  • the content adjacent to the first text information is defined as the extended text information in the embodiments of the present invention; in a specific implementation, the extended text information is added as a boundary, for example, by using the punctuation marks appearing in the file as a boundary.
  • the standard uses the left and right text of the first text information as the extended text information, and combines with the first text information to form the second text information to be analyzed.
  • S120 Perform semantic analysis on the first text information in the second text information, and obtain an analysis result of the first text information.
  • a phrase can be a verb or a name in different sentences, and can be a derogatory or derogatory term in different contexts, and a single appearing phrase can have multiple interpretations in either Chinese or English.
  • a phrase can be a verb or a name in different sentences, and can be a derogatory or derogatory term in different contexts, and a single appearing phrase can have multiple interpretations in either Chinese or English.
  • the meaning of the phrase in the file cannot be accurately determined. If it is necessary to obtain the meaning of the phrase in the file, the user needs to combine the context. Subjective judgment, or one step of the command prompt operation with the intelligent terminal, select a suitable explanation.
  • the object to be analyzed is not limited to the text content selected by the user, and the first text information selected by the user needs to be placed in a specific context in combination with the first text information selected by the user and the semantics of the context.
  • the analysis result suitable for the context can be obtained, and the analysis result includes, for example, the part of speech of the phrase, the explanation, and the components in the sentence, such as a subject, a predicate or an object.
  • the method provided by this embodiment can obtain a more comprehensive and accurate analysis of the first text information.
  • the text processing method provided by the embodiment obtains the second text information to be analyzed by using the first text information selected by the user and the specific location of the first text information in the file, where the second text information includes the user selection.
  • First text information and extended text information so that the first text information in the second text information is semantically analyzed to obtain an analysis result; the method provided in this embodiment expands the query of the individual text information into a language
  • the specific analysis carried out in the environment can obtain the specific interpretation of the text, the part of speech, the characteristics of the elements in the sentence, and have more comprehensive and accurate analysis results; solve the method of querying text in related technologies, because the terminal device is selected for the user. Keywords are queried, resulting in inaccurate query results.
  • the method provided in this embodiment may further perform an intelligent judgment, and further guide the user to perform a corresponding operation, that is, the method provided in this embodiment shown in FIG. 1 further includes: S130, in the graphic
  • the analysis result is displayed on the graphical user interface (GUI), and the user is instructed to perform corresponding operations on the analysis result; for example, if the analysis result is a place name, the user may be prompted whether to go to the place to perform the navigation operation. If the analysis result is a phone number, the user may be prompted whether the number needs to be dialed. If the analysis result is an idiom, the user may be prompted to obtain a specific explanation by querying the dictionary. In addition, the user may be instructed to perform copying to the clipboard or by searching. Engine search and other operations.
  • the content of some specific operations performed on the analysis result is taken as an example.
  • the present invention does not limit the operation content that is performed by the user after the analysis result is obtained, as long as it can be the first
  • the prompt operation of matching the text information can be applied to various embodiments of the present invention to improve the intelligence of the method and is convenient for the user to use.
  • FIG. 2 is a flowchart of another text processing method according to an embodiment of the present invention. This embodiment is further described based on the embodiment shown in FIG. 1 above.
  • the method provided in this embodiment may include:
  • step S113 is performed to query the interpretation of the first text information or prompt the user to perform corresponding operations on the first text information.
  • the first text information is the same as the character type of the extended text information, S120 is performed, the first text information is semantically analyzed in the second text information, and the analysis result of the first text information is obtained.
  • the analysis of the character type is performed before the first text information is analyzed. For example, if the selected first text information is different from the extended text information of the context in the language and character type, such as the selected The first text message is an English word, and the extended text message is Chinese. Then, the dictionary database can be directly queried to give a Chinese interpretation of the first text information, and the user can be guided to select a dictionary or webpage search to obtain a Chinese interpretation of the first text information; for example, the selected first text information is a number. Further, according to whether the extended text information of the judgment context is a feature number such as a phone number or a currency number, the subsequent smart terminal is prompted to prompt the user to perform the corresponding operation.
  • the extended text information of the judgment context is a feature number such as a phone number or a currency number
  • the method provided in this embodiment first introduces the analysis of the character type before performing the semantic analysis. Since the character type is more intuitive, the content and the workload of the execution judgment are relatively small, and the appropriate interpretation can be directly given after the compound judgment rule. Or guiding the user to perform the corresponding operation, further reducing the workload when performing the text query by the method provided by the embodiment, and improving the convenience of the text processing method.
  • the user when the user selects the first text information to be queried in the file, the user also selects as an example on the smart terminal with the touch screen, and the user clicks on the screen to select the first text information, because the touch screen sensing system
  • the problem, or the inaccurate user touch may cause the first text information recognized by the smart terminal not to be the text that the user wants to select, that is, the problem that the word selection may be inaccurate, so that the method in the related art is very It is difficult to query the interpretation of the text that the user desires to query, or the user needs to re-execute the selection operation to obtain the text of the desired query.
  • the query operation in the text requires the user to perform a complicated selection process, and the accuracy of the touch selection operation is not only It is a subjective choice problem of the user, and may be a recognition problem of touch sensing.
  • the present invention provides a solution to the above problem.
  • FIG. 3 it is a flowchart of still another text processing method according to an embodiment of the present invention.
  • the S120 in the embodiment may be further described as an example.
  • the S120 in the embodiment may include: S121, performing semantic analysis on the first text information in the second text information; S122, determining user selection Whether the positioning of the first text information is accurate; if it is accurate, S123 is performed, and if it is not accurate, S124 is performed.
  • the specific manner of placing the first text information in the context of the first text information for analysis is similar to the above embodiment, and the components of the first text information, such as a subject, a predicate, and an object, may be analyzed. Attributive, adverbial or complement, etc., can also analyze its part of speech, such as verbs, nouns or adjectives, etc. In the process of analysis, it can be combined with extended text information to judge the first text.
  • the first text information may be re-selected, and the first text information may be subjected to word breaking or supplementary context content.
  • the text that the user desires to select is a four-character idiom, but only the previous one is selected due to the clicking operation.
  • the first text information can be supplemented as a complete idiom.
  • the re-selected first text information acquired by the defined rule includes, for example, a portion of the first text information selected by the user; or a portion of the first text information and the partially extended text information selected by the user; or the first text information selected by the user and Part of the extended text information.
  • the method provided in this embodiment can intelligently determine the text of the user's interest for analysis and processing, and intelligently conduct the guided interaction, further simplifying the user operation and improving the user experience.
  • FIG. 4 is a schematic structural diagram of a word processing apparatus according to an embodiment of the present invention.
  • the word processing apparatus provided in this embodiment is suitable for the case of performing text query in an electronic file.
  • the word processing apparatus is usually implemented in hardware and software, and can be integrated into a processor of a terminal device, for example, the terminal device, for example. For PC or smart terminal, etc.
  • the word processing apparatus of this embodiment specifically includes: an obtaining module 11 and a semantic analysis module 12.
  • the obtaining module 11 is configured to: obtain second text information to be analyzed according to a position of the first text information selected by the user in the file, where the second text information includes the first text information and is adjacent to the first text information. Extended text information.
  • the semantic analysis module 12 is configured to: perform semantic analysis on the first text information in the second text information acquired by the obtaining module 11, and obtain an analysis result of the first text information.
  • the apparatus provided in this embodiment further includes: a display module 13 configured to: after the semantic analysis module 12 obtains the analysis result, display the analysis result on the GUI of the graphical user interface, and The user is shown to operate the analysis results accordingly.
  • a display module 13 configured to: after the semantic analysis module 12 obtains the analysis result, display the analysis result on the GUI of the graphical user interface, and The user is shown to operate the analysis results accordingly.
  • the word processing device provided by the embodiment of the present invention is used to execute the word processing method provided by the embodiment shown in FIG. 1 of the present invention, and has a corresponding function module, and the implementation principle and technical effect thereof are similar, and details are not described herein again.
  • FIG. 5 is a schematic structural diagram of another word processing apparatus according to an embodiment of the present invention.
  • the present embodiment is further described based on the embodiment shown in FIG. 4, and the apparatus provided in this embodiment further includes: a character analysis module 14 configured to: in the second text information, the semantic analysis module 12 Before the semantic analysis of the text information, comparing the first text information and the second text information, character type analysis is performed on the first text information; and the determining module 15 is configured to: determine whether the character type of the first text information and the extended text information are the same.
  • a character analysis module 14 configured to: in the second text information, the semantic analysis module 12 Before the semantic analysis of the text information, comparing the first text information and the second text information, character type analysis is performed on the first text information
  • the determining module 15 is configured to: determine whether the character type of the first text information and the extended text information are the same.
  • the character analysis module 14 is further configured to: when the determining module 15 determines that the character type of the first text information and the extended text information is different, querying the interpretation of the first text information or prompting the user to perform corresponding information on the first text information.
  • the semantic analysis module 12 is specifically configured to: when the determining module 15 determines that the first text information and the extended text information have the same character type, perform semantic analysis on the first text information in the second text information, and obtain the first Analysis of text information.
  • the determining module 15 is further configured to: determine, during the semantic analysis of the first text information in the second text information by the semantic analysis module 12, Whether the positioning of the selected first text information is accurate.
  • the semantic analysis module 12 is further configured to: when the determination result of the determination module 15 is accurate, obtain an analysis result of the first text information; in addition, the semantic analysis module 12 is further configured to: the determination result of the determination module 15 When it is inaccurate, the first text information is reselected, and the analysis result of the reselected first text information is obtained.
  • the first text information reselected by the semantic analysis module 12 in this embodiment includes, for example, a part of the first text information selected by the user; or part of the first text information and partial extended text information selected by the user; or The first text information and the partially expanded text information selected by the user.
  • the word processing apparatus provided by the embodiment of the present invention is used to execute the word processing method provided by the embodiment shown in FIG. 2 and FIG. 3 of the present invention, and has a corresponding function module, and the implementation principle and the technical effect thereof are similar, and details are not described herein again.
  • the embodiment of the invention also discloses a computer program, comprising program instructions, which when executed by a computer, enable the computer to execute any of the above-mentioned word processing methods.
  • the embodiment of the invention also discloses a carrier carrying the computer program.
  • the text processing method and device provided by the technical solution of the present invention obtain the second text information to be analyzed by combining the first text information selected by the user with the specific location of the first text information in the file, the second text information including the above The first text information and the extended text information selected by the user, so as to perform semantic analysis on the first text information in the second text information to obtain an analysis result; the method provided by the present invention expands the query on the individual text information to The specific analysis carried out in the context can obtain the specific interpretation of the text, the part of speech, the components in the sentence and other characteristics, with more comprehensive and accurate analysis results; solve the way of querying text in related technologies, because the terminal equipment is selected for the user Keywords are queried, resulting in inaccurate query results. Therefore, the present invention has strong industrial applicability.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Document Processing Apparatus (AREA)

Abstract

A word processing method and apparatus. The method comprises: according to the position of first text information selected by a user in a file, acquiring second text information to be analysed, wherein the second text information comprises the first text information and extended text information adjacent to the first text information (S110);and performing semantic analysis on the first text information in the second text information, and acquiring an analysis result of the first text information (S120).This method solves the problem in the related art that a query result is inaccurate due to the fact that a terminal device performs querying with regard to a keyword selected by a user in the method for querying a text.

Description

一种文字处理方法和装置Word processing method and device 技术领域Technical field
本文涉及文字处理技术领域,尤指一种文字处理方法和装置。This paper relates to the field of word processing technology, especially a word processing method and device.
背景技术Background technique
随着计算机的发展和普及,以及对节能和环保提出的更高要求,用户的阅读形式逐渐由纸质文件变化为电子文件,通常地,用户可以通过计算机或智能终端查看文件,并且在阅读文件的过程中可以对文件中的文本进行实时查询,具有比纸质文件更便捷的查询方式。目前,在查询电子文件中的文本内容时,通常由用户手动选择一些关键词作为查询的对象,终端设备的查询操作具体针对用户选择的关键词,例如可以是一个词组,英文单词或一组数字。With the development and popularization of computers, as well as higher demands on energy conservation and environmental protection, users' reading forms are gradually changed from paper documents to electronic files. Generally, users can view files through computers or smart terminals, and read documents. The process can query the text in the file in real time, which is more convenient than the paper file. At present, when querying the text content in the electronic file, the user usually manually selects some keywords as the object of the query, and the query operation of the terminal device is specifically targeted to the keyword selected by the user, for example, may be a phrase, an English word or a set of numbers. .
显然地,用户选择的文本可能存在多种词义或词性,终端设备的查询操作很难获取到该文本的准确解释,因此,相关技术中查询文本的方式,由于终端设备针对用户选择的关键词进行查询,而导致查询结果不准确的问题。Obviously, the text selected by the user may have multiple meanings or part of speech, and the query operation of the terminal device is difficult to obtain an accurate interpretation of the text. Therefore, the manner of querying the text in the related art is performed by the terminal device for the keyword selected by the user. Query, which leads to inaccurate query results.
发明内容Summary of the invention
本发明要解决的技术问题是提供了一种文字处理方法和装置,以解决相关技术中查询文本的方式,由于终端设备针对用户选择的关键词进行查询,而导致查询结果不准确的问题。The technical problem to be solved by the present invention is to provide a word processing method and apparatus for solving the problem of querying text in the related art. The terminal device searches for keywords selected by the user, which leads to inaccurate query results.
为了解决上述技术问题,采用如下技术方案:In order to solve the above technical problems, the following technical solutions are adopted:
一种文字处理方法,包括:A word processing method, including:
根据选择的第一文本信息在文件中的位置,获取第二文本信息,其中,所述第二文本信息包括所述第一文本信息和与所述第一文本信息相邻的扩充文本信息;Obtaining second text information according to a location of the selected first text information in the file, wherein the second text information includes the first text information and extended text information adjacent to the first text information;
在所述第二文本信息中对所述第一文本信息进行语义分析,并获取所述第一文本信息的分析结果。 Performing semantic analysis on the first text information in the second text information, and acquiring an analysis result of the first text information.
可选地,所述在所述第二文本信息中对所述第一文本信息进行语义分析的步骤之前,该方法还包括:Optionally, before the step of performing semantic analysis on the first text information in the second text information, the method further includes:
对比所述第一文本信息和所述第二文本信息,对所述第一文本信息进行字符类型分析;Comparing the first text information and the second text information, performing character type analysis on the first text information;
判断所述第一文本信息与所述扩充文本信息的字符类型是否相同;Determining whether the first text information and the extended text information have the same character type;
当所述第一文本信息与所述扩充文本信息的字符类型不同时,查询所述第一文本信息的解释或者提示对所述第一文本信息进行相应的操作;Querying an interpretation of the first text information or prompting a corresponding operation on the first text information when the first text information is different from the character type of the extended text information;
当所述第一文本信息与所述扩充文本信息的字符类型相同时,在所述第二文本信息中对所述第一文本信息进行语义分析,并获取所述第一文本信息的分析结果。When the first text information is the same as the character type of the extended text information, the first text information is semantically analyzed in the second text information, and an analysis result of the first text information is obtained.
可选地,所述在所述第二文本信息中对所述第一文本信息进行语义分析的步骤包括:Optionally, the step of performing semantic analysis on the first text information in the second text information includes:
在所述第二文本信息中对所述第一文本信息进行语义分析,并判断所选择的第一文本信息的定位是否准确;Performing semantic analysis on the first text information in the second text information, and determining whether the location of the selected first text information is accurate;
当判断出所选择的第一文本信息的定位准确时,获取所述第一文本信息的分析结果;Obtaining an analysis result of the first text information when it is determined that the location of the selected first text information is accurate;
当判断出所选择的第一文本信息的定位不准确时,对所述第一文本信息进行重新选择,并获取对重新选择的第一文本信息的分析结果。When it is determined that the positioning of the selected first text information is inaccurate, the first text information is reselected, and an analysis result of the reselected first text information is obtained.
可选地,所述重新选择的第一文本信息包括:Optionally, the reselected first text information includes:
选择的部分第一文本信息;或者,Part of the first textual information selected; or,
选择的部分第一文本信息和部分所述扩充文本信息;或者,a selected portion of the first text information and a portion of the extended text information; or,
选择的第一文本信息和部分所述扩充文本信息。The selected first text information and a portion of the extended text information.
可选地,所述获取所述第一文本信息的分析结果之后,该方法还包括:Optionally, after the obtaining the analysis result of the first text information, the method further includes:
在图形用户界面GUI上显示所述分析结果。The analysis results are displayed on a graphical user interface GUI.
一种文字处理装置,包括获取模块和语义分析模块,其中:A word processing device includes an acquisition module and a semantic analysis module, wherein:
所述获取模块设置成:根据选择的第一文本信息在文件中的位置,获取 第二文本信息,其中,所述第二文本信息包括所述第一文本信息和与所述第一文本信息相邻的扩充文本信息;The obtaining module is configured to: obtain, according to a location of the selected first text information in the file, Second text information, wherein the second text information includes the first text information and extended text information adjacent to the first text information;
所述语义分析模块设置成:在所述获取模块获取的第二文本信息中对所述第一文本信息进行语义分析,并获取所述第一文本信息的分析结果。The semantic analysis module is configured to perform semantic analysis on the first text information in the second text information acquired by the obtaining module, and obtain an analysis result of the first text information.
可选地,该装置还包括:字符分析模块和判断模块,其中,Optionally, the device further includes: a character analysis module and a determination module, where
所述字符分析模块设置成:在所述语义分析模块在第二文本信息中对所述第一文本信息进行语义分析之前,对比所述第一文本信息和所述第二文本信息,对所述第一文本信息进行字符类型分析;The character analysis module is configured to compare the first text information and the second text information before the semantic analysis module performs semantic analysis on the first text information in the second text information The first text information is subjected to character type analysis;
所述判断模块设置成:判断所述第一文本信息与所述扩充文本信息的字符类型是否相同;The determining module is configured to: determine whether the first text information and the extended text information have the same character type;
所述字符分析模块还设置成:在所述判断模块判断出第一文本信息与所述扩充文本信息的字符类型不同时,查询所述第一文本信息的解释或者提示对所述第一文本信息进行相应的操作;The character analysis module is further configured to: when the determining module determines that the first text information is different from the character type of the extended text information, querying the interpretation of the first text information or prompting the first text information Perform the corresponding operations;
所述语义分析模块设置成按照如下方式在所述获取模块获取的第二文本信息中对所述第一文本信息进行语义分析,并获取所述第一文本信息的分析结果:在所述判断模块判断出第一文本信息与所述扩充文本信息的字符类型相同时,在所述第二文本信息中对所述第一文本信息进行语义分析,并获取所述第一文本信息的分析结果。The semantic analysis module is configured to perform semantic analysis on the first text information in the second text information acquired by the obtaining module, and obtain an analysis result of the first text information: in the determining module When it is determined that the first text information is the same as the character type of the extended text information, the first text information is semantically analyzed in the second text information, and the analysis result of the first text information is obtained.
可选地,该装置还包括判断模块,其中,Optionally, the device further includes a determining module, where
所述判断模块设置成:在所述语义分析模块在第二文本信息中对所述第一文本信息进行语义分析的过程中,判断所选择的第一文本信息的定位是否准确;The determining module is configured to: determine, during the semantic analysis of the first text information in the second text information, whether the positioning of the selected first text information is accurate;
所述语义分析模块还设置成:在所述判断模块判断出所选择的第一文本信息的定位准确时,获取所述第一文本信息的分析结果;The semantic analysis module is further configured to: when the determining module determines that the location of the selected first text information is accurate, acquiring an analysis result of the first text information;
所述语义分析模块还设置成:在所述判断模块判断出所选择的第一文本信息的定位不准确时,对所述第一文本信息进行重新选择,并获取对重新选择的第一文本信息的分析结果。The semantic analysis module is further configured to: when the determining module determines that the location of the selected first text information is inaccurate, reselect the first text information, and acquire the first text information for reselection Analysis results.
可选地,所述语义分析模块重新选择的第一文本信息包括: Optionally, the first text information that is reselected by the semantic analysis module includes:
选择的部分第一文本信息;或者,Part of the first textual information selected; or,
选择的部分第一文本信息和部分所述扩充文本信息;或者,a selected portion of the first text information and a portion of the extended text information; or,
选择的第一文本信息和部分所述扩充文本信息。The selected first text information and a portion of the extended text information.
可选地,该装置还包括:显示模块,其中,Optionally, the device further includes: a display module, where
所述显示模块设置成:在所述语义分析模块获取所述分析结果之后,在图形用户界面GUI上显示所述分析结果。The display module is configured to display the analysis result on the graphical user interface GUI after the semantic analysis module acquires the analysis result.
一种计算机程序,包括程序指令,当该程序指令被计算机执行时,使得该计算机可执行上述任意的文字处理方法。A computer program comprising program instructions that, when executed by a computer, cause the computer to perform any of the above-described word processing methods.
一种载有所述的计算机程序的载体。A carrier carrying the computer program as described.
本发明技术方案提供的文字处理方法和装置,通过用户选择的第一文本信息结合该第一文本信息在文件中的具体位置中,获取待分析的第二文本信息,该第二文本信息包括上述用户选择的第一文本信息和扩充文本信息,从而在第二文本信息中对该的第一文本信息进行语义分析,以获取分析结果;本发明提供的方法将对单独文本信息的查询扩展为在语境中进行的具体分析,可以得到文本的具体解释、词性,在语句中的成分等特征,具有更全面和准确的分析结果;解决了相关技术中查询文本的方式,由于终端设备针对用户选择的关键词进行查询,而导致查询结果不准确的问题。The text processing method and device provided by the technical solution of the present invention obtain the second text information to be analyzed by combining the first text information selected by the user with the specific location of the first text information in the file, the second text information including the above The first text information and the extended text information selected by the user, so as to perform semantic analysis on the first text information in the second text information to obtain an analysis result; the method provided by the present invention expands the query on the individual text information to The specific analysis carried out in the context can obtain the specific interpretation of the text, the part of speech, the components in the sentence and other characteristics, with more comprehensive and accurate analysis results; solve the way of querying text in related technologies, because the terminal equipment is selected for the user Keywords are queried, resulting in inaccurate query results.
附图概述BRIEF abstract
附图用来提供对本发明技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本发明的技术方案,并不构成对本发明技术方案的限制。The drawings are used to provide a further understanding of the technical solutions of the present invention, and constitute a part of the specification, which together with the embodiments of the present application are used to explain the technical solutions of the present invention, and do not constitute a limitation of the technical solutions of the present invention.
图1为本发明实施例提供的一种文字处理方法的流程图;FIG. 1 is a flowchart of a text processing method according to an embodiment of the present invention;
图2为本发明实施例提供的另一种文字处理方法的流程图; 2 is a flowchart of another word processing method according to an embodiment of the present invention;
图3为本发明实施例提供的又一种文字处理方法的流程图;FIG. 3 is a flowchart of still another text processing method according to an embodiment of the present invention;
图4为本发明实施例提供的一种文字处理装置的结构示意图;4 is a schematic structural diagram of a word processing apparatus according to an embodiment of the present invention;
图5为本发明实施例提供的另一种文字处理装置的结构示意图。FIG. 5 is a schematic structural diagram of another word processing apparatus according to an embodiment of the present invention.
本发明的较佳实施方式Preferred embodiment of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps illustrated in the flowchart of the figures may be executed in a computer system such as a set of computer executable instructions. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
图1为本发明实施例提供的一种文字处理方法的流程图。本实施例提供的文字处理方法适用于在电子文件中进行文本查询的情况中,该方法可以由文字处理装置来执行,该文字处理装置通常以硬件和软件的方式来实现,通常可以集成在终端设备的处理器中,该终端设备例如为私人计算机(Personal Computer,简称为:PC)或智能终端等。如图1所示,本实施例的方法可以包括:FIG. 1 is a flowchart of a text processing method according to an embodiment of the present invention. The text processing method provided in this embodiment is applicable to a text query in an electronic file, and the method can be executed by a word processing device. The word processing device is usually implemented in hardware and software, and can usually be integrated in the terminal. In the processor of the device, the terminal device is, for example, a personal computer (Personal Computer, PC for short) or a smart terminal. As shown in FIG. 1, the method in this embodiment may include:
S110,根据用户选择的第一文本信息在电子文件中的位置,获取待分析的第二文本信息,该第二文本信息包括第一文本信息和与第一文本信息相邻的扩充文本信息。S110. Acquire second text information to be analyzed according to a location of the first text information selected by the user in the electronic file, where the second text information includes first text information and extended text information adjacent to the first text information.
本实施例的应用场景例如为:用户通过智能终端阅读电子文件,该电子文件例如可以是Word,Excel或PDF等格式的,再例如,还可以应用于用户通过智能终端对短信、即时消息等文字信息的处理中,该智能终端例如可以为具有触摸屏的终端,用户通过触摸操作选择了电子文件中的第一文本信息,该第一文本信息例如为一个词组。相关技术中用户在选择了词组后,通常直接指定查询的方式,比如查词典,搜索网络查询百科知识等。The application scenario of the embodiment is, for example, the user reading an electronic file through a smart terminal, and the electronic file may be in a format such as Word, Excel, or PDF, and may be applied to a text message, an instant message, or the like by the user through the smart terminal. In the processing of the information, the smart terminal may be, for example, a terminal having a touch screen, and the user selects the first text information in the electronic file by a touch operation, and the first text information is, for example, a phrase. In the related art, after selecting a phrase, the user usually directly specifies the manner of the query, such as searching a dictionary, searching for encyclopedic knowledge of the network query, and the like.
本实施例提供的方法中,并不直接对用户选择的第一文本信息进行查询, 而是根据该第一文本信息在用户当前阅读的电子文件中的位置向左右扩充,即可以结合第一文本信息的上下文内容获取待分析的第二文本信息,向左右扩充的内容可以为与该第一文本信息相邻的内容,本发明各实施例中将上述向左右扩充的内容定义为扩充文本信息;在具体实现中,例如以文件中的出现的标点符号为界限作为执行添加扩充文本信息的标准,将第一文本信息的左右文本作为扩充文本信息,并与该第一文本信息结合构成待分析的第二文本信息。In the method provided in this embodiment, the first text information selected by the user is not directly queried. The second text information to be analyzed may be obtained by combining the position of the first text information in the electronic file currently read by the user, that is, the second text information to be analyzed may be combined with the context content of the first text information. The content adjacent to the first text information is defined as the extended text information in the embodiments of the present invention; in a specific implementation, the extended text information is added as a boundary, for example, by using the punctuation marks appearing in the file as a boundary. The standard uses the left and right text of the first text information as the extended text information, and combines with the first text information to form the second text information to be analyzed.
S120,在第二文本信息中对第一文本信息进行语义分析,并获取该第一文本信息的分析结果。S120: Perform semantic analysis on the first text information in the second text information, and obtain an analysis result of the first text information.
通常的,一个词组在不同的句子中可以为动词或名称,在不同的语境中可以为褒义词或贬义词,并且无论是中文,还是英文,一个单独出现的词组可以有多种解释。例如采用相关技术的查询方式,虽然可以获取该词组的多种解释,但不能准确的判断该词组在文件中的意思,如果需要得到该词组在文件中的意思,还需要用户自身结合语境进行主观判断,或者进行一步的与智能终端进行命令提示操作,选择一个适合的解释。Usually, a phrase can be a verb or a name in different sentences, and can be a derogatory or derogatory term in different contexts, and a single appearing phrase can have multiple interpretations in either Chinese or English. For example, using the related art query method, although various explanations of the phrase can be obtained, the meaning of the phrase in the file cannot be accurately determined. If it is necessary to obtain the meaning of the phrase in the file, the user needs to combine the context. Subjective judgment, or one step of the command prompt operation with the intelligent terminal, select a suitable explanation.
在本实施例中,分析的对象并不局限于用户所选择的文本内容,同时需要结合用户选择的第一文本信息和上下文的语义,通过将用户选择的第一文本信息放置于具体的语境中进行分析,可以得到适合语境的分析结果,该分析结果例如包括:该词组的词性,解释,以及在语句的成分,比如作主语、谓语或宾语等。显然地,本实施例提供的方法可以得到对第一文本信息更全面和准确的分析。In this embodiment, the object to be analyzed is not limited to the text content selected by the user, and the first text information selected by the user needs to be placed in a specific context in combination with the first text information selected by the user and the semantics of the context. In the analysis, the analysis result suitable for the context can be obtained, and the analysis result includes, for example, the part of speech of the phrase, the explanation, and the components in the sentence, such as a subject, a predicate or an object. Obviously, the method provided by this embodiment can obtain a more comprehensive and accurate analysis of the first text information.
本实施例所提供的文本处理方法,通过用户选择的第一文本信息结合该第一文本信息在文件中的具体位置中,获取待分析的第二文本信息,该第二文本信息包括上述用户选择的第一文本信息和扩充文本信息,从而在第二文本信息中对该的第一文本信息进行语义分析,以获取分析结果;本实施例提供的方法将对单独文本信息的查询扩展为在语境中进行的具体分析,可以得到文本的具体解释、词性,在语句中的成分等特征,具有更全面和准确的分析结果;解决了相关技术中查询文本的方式,由于终端设备针对用户选择的关键词进行查询,而导致查询结果不准确的问题。 The text processing method provided by the embodiment obtains the second text information to be analyzed by using the first text information selected by the user and the specific location of the first text information in the file, where the second text information includes the user selection. First text information and extended text information, so that the first text information in the second text information is semantically analyzed to obtain an analysis result; the method provided in this embodiment expands the query of the individual text information into a language The specific analysis carried out in the environment can obtain the specific interpretation of the text, the part of speech, the characteristics of the elements in the sentence, and have more comprehensive and accurate analysis results; solve the method of querying text in related technologies, because the terminal device is selected for the user. Keywords are queried, resulting in inaccurate query results.
可选地,在得到上述分析结果后,本实施例提供的方法还可以进行智能判断,进一步引导用户执行相应地操作,即上述图1所示本实施例提供的方法还包括:S130,在图形用户界面(Graphical User Interface,简称为:GUI)上显示分析结果,并指示用户对该分析结果进行相应地操作;例如若分析结果为一地名,可以提示用户是否需要去该地方以执行导航操作,如果分析结果是一个电话号码,可以提示用户是否需要拨叫该号码,如果分析结果是个成语,可以提示用户是否通过查询词典获取具体解释,另外,还可以指示用户执行复制到剪贴板,或者通过搜索引擎搜索等操作。Optionally, after the foregoing analysis result is obtained, the method provided in this embodiment may further perform an intelligent judgment, and further guide the user to perform a corresponding operation, that is, the method provided in this embodiment shown in FIG. 1 further includes: S130, in the graphic The analysis result is displayed on the graphical user interface (GUI), and the user is instructed to perform corresponding operations on the analysis result; for example, if the analysis result is a place name, the user may be prompted whether to go to the place to perform the navigation operation. If the analysis result is a phone number, the user may be prompted whether the number needs to be dialed. If the analysis result is an idiom, the user may be prompted to obtain a specific explanation by querying the dictionary. In addition, the user may be instructed to perform copying to the clipboard or by searching. Engine search and other operations.
需要说明的是,本实施例以上述对分析结果做的一些具体操作的内容为例进行说明,本发明不限制在获取分析结果后,与用户交互执行的操作内容,只要是可以与该第一文本信息相匹配的提示操作,都可以应用与本发明各实施例中,以提高该方法的智能性,便于用户使用。It should be noted that, in this embodiment, the content of some specific operations performed on the analysis result is taken as an example. The present invention does not limit the operation content that is performed by the user after the analysis result is obtained, as long as it can be the first The prompt operation of matching the text information can be applied to various embodiments of the present invention to improve the intelligence of the method and is convenient for the user to use.
图2为本发明实施例提供的另一种文字处理方法的流程图。本实施例以在上述图1所示实施例基础上的进一步地描述,本实施例提供的方法在S120之前可以包括:FIG. 2 is a flowchart of another text processing method according to an embodiment of the present invention. This embodiment is further described based on the embodiment shown in FIG. 1 above. The method provided in this embodiment may include:
S111,对比第一文本信息和第二文本信息,对第一文本信息进行字符类型分析。S111. Perform character type analysis on the first text information by comparing the first text information with the second text information.
S112,判断第一文本信息与扩充文本信息的字符类型是否相同;若不相同,则执行S113,若相同,则执行S120。S112. Determine whether the character type of the first text information and the extended text information are the same. If not, execute S113. If they are the same, execute S120.
具体地,当第一文本信息与扩充文本信息的字符类型不同时,执行S113,查询该第一文本信息的解释或者提示用户对该第一文本信息进行相应的操作。Specifically, when the character type of the first text information is different from the extended text information, step S113 is performed to query the interpretation of the first text information or prompt the user to perform corresponding operations on the first text information.
当第一文本信息与扩充文本信息的字符类型相同时,执行S120,在第二文本信息中对第一文本信息进行语义分析,并获取第一文本信息的分析结果。When the first text information is the same as the character type of the extended text information, S120 is performed, the first text information is semantically analyzed in the second text information, and the analysis result of the first text information is obtained.
本实施例在对第一文本信息进行予以分析前,先执行字符类型的分析,举例来说,如果所选第一文本信息在语种、字符类型上不同于上下文的扩充文本信息,比如所选的第一文本信息是英文单词,而扩充文本信息是中文, 则可以直接查询词典数据库给出该第一文本信息的中文解释,也可以引导用户选择词典或网页搜索以获取对该第一文本信息的中文解释;再比如所选的第一文本信息是数字,则进一步根据判断上下文的扩充文本信息是否为电话号码、货币数字等特征数字,便于后续智能终端提示用户执行相应地操作。In this embodiment, the analysis of the character type is performed before the first text information is analyzed. For example, if the selected first text information is different from the extended text information of the context in the language and character type, such as the selected The first text message is an English word, and the extended text message is Chinese. Then, the dictionary database can be directly queried to give a Chinese interpretation of the first text information, and the user can be guided to select a dictionary or webpage search to obtain a Chinese interpretation of the first text information; for example, the selected first text information is a number. Further, according to whether the extended text information of the judgment context is a feature number such as a phone number or a currency number, the subsequent smart terminal is prompted to prompt the user to perform the corresponding operation.
本实施例提供的方法,在进行语义分析前,先引入字符类型的分析,由于字符类型更直观,执行判断的内容和工作量都比较少,在复合判断规则后可以直接给出合适的解释,或引导用户执行相应地操作,进一步地降低了通过本实施例提供的方法执行文本查询时的工作量,并且提高了文本处理方法的便捷性。The method provided in this embodiment first introduces the analysis of the character type before performing the semantic analysis. Since the character type is more intuitive, the content and the workload of the execution judgment are relatively small, and the appropriate interpretation can be directly given after the compound judgment rule. Or guiding the user to perform the corresponding operation, further reducing the workload when performing the text query by the method provided by the embodiment, and improving the convenience of the text processing method.
可选地,用户在对文件中选择待查询的第一文本信息时,同样以用户在具有触摸屏的智能终端上选择为例予以说明,用户点击屏幕选择第一文本信息,由于触摸屏的感应系统的问题,或者用户触摸不准确等问题,都有可能造成智能终端识别到的第一文本信息并非用户想选择的文本,即可能造成选词定位不准确的问题,这样,采用相关技术中的方式很难查询到用户所希望查询文本的解释,或者需要由用户重新执行选择操作,以获取所需查询的文本,在文本中进行查询操作需要用户执行复杂的选择过程,并且触摸选择操作的准确性不仅是用户主观的选择问题,有可能是触摸感应的识别问题。Optionally, when the user selects the first text information to be queried in the file, the user also selects as an example on the smart terminal with the touch screen, and the user clicks on the screen to select the first text information, because the touch screen sensing system The problem, or the inaccurate user touch, may cause the first text information recognized by the smart terminal not to be the text that the user wants to select, that is, the problem that the word selection may be inaccurate, so that the method in the related art is very It is difficult to query the interpretation of the text that the user desires to query, or the user needs to re-execute the selection operation to obtain the text of the desired query. The query operation in the text requires the user to perform a complicated selection process, and the accuracy of the touch selection operation is not only It is a subjective choice problem of the user, and may be a recognition problem of touch sensing.
针对上述问题,本实施例提供了一种解决方式,如图3所示,为本发明实施例提供的又一种文字处理方法的流程图。同样以在上述图1所示实施例的基础上为例予以示出,本实施例中的S120可以包括:S121,在第二文本信息中对第一文本信息进行语义分析;S122,判断用户选择的第一文本信息的定位是否准确;若准确,则执行S123,若不准确,执行S124。The present invention provides a solution to the above problem. As shown in FIG. 3, it is a flowchart of still another text processing method according to an embodiment of the present invention. The S120 in the embodiment may be further described as an example. The S120 in the embodiment may include: S121, performing semantic analysis on the first text information in the second text information; S122, determining user selection Whether the positioning of the first text information is accurate; if it is accurate, S123 is performed, and if it is not accurate, S124 is performed.
S123,获取第一文本信息的分析结果。S123. Acquire an analysis result of the first text information.
S124,对所述第一文本信息进行重新选择,并获取对重新选择的第一文本信息的分析结果。S124. Reselect the first text information, and obtain an analysis result of the reselected first text information.
在本实施例中,将第一文本信息放置于第一文本信息的语境中进行分析的具体方式与上述实施例类似,可以分析该第一文本信息的成分,比如作主语、谓语、宾语,定语、状语或补语等,还可以分析其词性,比如动词、名词或形容词等,在分析的过程中,可以同时结合扩充文本信息判断该第一文 本信息的定位是否准确,也就是所选择的文本是否为用户希望选择的文本,若判断出选择的第一文本信息明显不是一个完整的词组,或者其中包括了多余的连词、冠词的内容,可以对第一文本信息进行重新选择,具体可以对该第一文本信息进行断词或补充上下文的内容,例如,用户希望选择的文本是一个四字成语,但是由于点选操作只选择了前面的三个字,在执行S124时,可以将该第一文本信息补充为完整的成语。这样,用户在选择文本时,无论选择的是首字还是尾字,都可以正确的识别出用户希望选择的文本,并根据预定义的规则智能的修改为用户希望选择的正确文本;根据该预定义的规则获取的重新选择的第一文本信息例如包括:用户选择的部分第一文本信息;或者,用户选择的部分第一文本信息和部分扩充文本信息;或者,用户选择的第一文本信息和部分所述扩充文本信息。In this embodiment, the specific manner of placing the first text information in the context of the first text information for analysis is similar to the above embodiment, and the components of the first text information, such as a subject, a predicate, and an object, may be analyzed. Attributive, adverbial or complement, etc., can also analyze its part of speech, such as verbs, nouns or adjectives, etc. In the process of analysis, it can be combined with extended text information to judge the first text. Whether the location of the information is accurate, that is, whether the selected text is the text that the user wishes to select, and if it is determined that the selected first text information is obviously not a complete phrase, or includes redundant content of conjunctions and articles, The first text information may be re-selected, and the first text information may be subjected to word breaking or supplementary context content. For example, the text that the user desires to select is a four-character idiom, but only the previous one is selected due to the clicking operation. Three words, when S124 is executed, the first text information can be supplemented as a complete idiom. In this way, when the user selects the text, whether the first word or the last word is selected, the text that the user wishes to select can be correctly identified, and the modified text is intelligently modified according to the predefined rules to be the correct text that the user wishes to select; The re-selected first text information acquired by the defined rule includes, for example, a portion of the first text information selected by the user; or a portion of the first text information and the partially extended text information selected by the user; or the first text information selected by the user and Part of the extended text information.
本实施例提供的方法,可以智能的判断出用户感兴趣的文本进行分析处理,并且智能的进行引导交互,进一步地简化了用户操作,提升用户体验。The method provided in this embodiment can intelligently determine the text of the user's interest for analysis and processing, and intelligently conduct the guided interaction, further simplifying the user operation and improving the user experience.
需要说明的是,图3所示实施例中,无论执行S123,还是执行S124,都可以获取到用户需要选择的文本的分析结果,因此,在S123或S124之后,都可以执行S130,执行S130的具体方式与上述图1所示实施例相同,故在此不再赘述。It should be noted that, in the embodiment shown in FIG. 3, the analysis result of the text that the user needs to select may be obtained whether S123 or S124 is executed. Therefore, after S123 or S124, S130 may be performed to execute S130. The specific manner is the same as the embodiment shown in FIG. 1 above, and therefore no further details are provided herein.
图4为本发明实施例提供的一种文字处理装置的结构示意图。本实施例提供的文字处理装置适用于在电子文件中进行文本查询的情况中,该文字处理装置通常以硬件和软件的方式来实现,通常可以集成在终端设备的处理器中,该终端设备例如为PC或智能终端等。如图4所示,本实施例的文字处理装置具体包括:获取模块11和语义分析模块12。FIG. 4 is a schematic structural diagram of a word processing apparatus according to an embodiment of the present invention. The word processing apparatus provided in this embodiment is suitable for the case of performing text query in an electronic file. The word processing apparatus is usually implemented in hardware and software, and can be integrated into a processor of a terminal device, for example, the terminal device, for example. For PC or smart terminal, etc. As shown in FIG. 4, the word processing apparatus of this embodiment specifically includes: an obtaining module 11 and a semantic analysis module 12.
其中,获取模块11,设置成:根据用户选择的第一文本信息在文件中的位置,获取待分析的第二文本信息,该第二文本信息包括第一文本信息和与第一文本信息相邻的扩充文本信息。The obtaining module 11 is configured to: obtain second text information to be analyzed according to a position of the first text information selected by the user in the file, where the second text information includes the first text information and is adjacent to the first text information. Extended text information.
语义分析模块12,设置成:在获取模块11获取的第二文本信息中对第一文本信息进行语义分析,并获取第一文本信息的分析结果。The semantic analysis module 12 is configured to: perform semantic analysis on the first text information in the second text information acquired by the obtaining module 11, and obtain an analysis result of the first text information.
可选地,本实施例提供的装置还包括:显示模块13,设置成:在语义分析模块12获取分析结果之后,在图形用户界面GUI上显示分析结果,并指 示用户对分析结果进行相应地操作。Optionally, the apparatus provided in this embodiment further includes: a display module 13 configured to: after the semantic analysis module 12 obtains the analysis result, display the analysis result on the GUI of the graphical user interface, and The user is shown to operate the analysis results accordingly.
本发明实施例提供的文字处理装置用于执行本发明图1所示实施例提供的文字处理方法,具备相应的功能模块,其实现原理和技术效果类似,此处不再赘述。The word processing device provided by the embodiment of the present invention is used to execute the word processing method provided by the embodiment shown in FIG. 1 of the present invention, and has a corresponding function module, and the implementation principle and technical effect thereof are similar, and details are not described herein again.
图5为本发明实施例提供的另一种文字处理装置的结构示意图。本实施例为在上述图4所示实施例基础上的进一步地描述,本实施例提供的装置还包括:字符分析模块14,设置成:在语义分析模块12在第二文本信息中对第一文本信息进行语义分析之前,对比第一文本信息和第二文本信息,对第一文本信息进行字符类型分析;判断模块15,设置成:判断第一文本信息与扩充文本信息的字符类型是否相同。FIG. 5 is a schematic structural diagram of another word processing apparatus according to an embodiment of the present invention. The present embodiment is further described based on the embodiment shown in FIG. 4, and the apparatus provided in this embodiment further includes: a character analysis module 14 configured to: in the second text information, the semantic analysis module 12 Before the semantic analysis of the text information, comparing the first text information and the second text information, character type analysis is performed on the first text information; and the determining module 15 is configured to: determine whether the character type of the first text information and the extended text information are the same.
相应地,字符分析模块14,还设置成:在判断模块15判断出第一文本信息与扩充文本信息的字符类型不同时,查询第一文本信息的解释或者提示用户对第一文本信息进行相应的操作;语义分析模块12,具体设置成:在判断模块15判断出第一文本信息与扩充文本信息的字符类型相同时,在第二文本信息中对第一文本信息进行语义分析,并获取第一文本信息的分析结果。Correspondingly, the character analysis module 14 is further configured to: when the determining module 15 determines that the character type of the first text information and the extended text information is different, querying the interpretation of the first text information or prompting the user to perform corresponding information on the first text information. The semantic analysis module 12 is specifically configured to: when the determining module 15 determines that the first text information and the extended text information have the same character type, perform semantic analysis on the first text information in the second text information, and obtain the first Analysis of text information.
可选地,上述图5所示文字处理装置在具体实现中,判断模块15,还设置成:在语义分析模块12在第二文本信息中对第一文本信息进行语义分析的过程中,判断用户选择的第一文本信息的定位是否准确。相应地,语义分析模块12,还设置成:在判断模块15的判断结果为准确时,获取第一文本信息的分析结果;另外,语义分析模块12,还设置成:在判断模块15的判断结果为不准确时,对第一文本信息进行重新选择,并获取对重新选择的第一文本信息的分析结果。Optionally, in the specific implementation of the word processing apparatus shown in FIG. 5, the determining module 15 is further configured to: determine, during the semantic analysis of the first text information in the second text information by the semantic analysis module 12, Whether the positioning of the selected first text information is accurate. Correspondingly, the semantic analysis module 12 is further configured to: when the determination result of the determination module 15 is accurate, obtain an analysis result of the first text information; in addition, the semantic analysis module 12 is further configured to: the determination result of the determination module 15 When it is inaccurate, the first text information is reselected, and the analysis result of the reselected first text information is obtained.
需要说明的是,本实施例中的语义分析模块12重新选择的第一文本信息例如包括:用户选择的部分第一文本信息;或者,用户选择的部分第一文本信息和部分扩充文本信息;或者,用户选择的第一文本信息和部分扩充文本信息。It should be noted that the first text information reselected by the semantic analysis module 12 in this embodiment includes, for example, a part of the first text information selected by the user; or part of the first text information and partial extended text information selected by the user; or The first text information and the partially expanded text information selected by the user.
本发明实施例提供的文字处理装置用于执行本发明图2和图3所示实施例提供的文字处理方法,具备相应的功能模块,其实现原理和技术效果类似,此处不再赘述。 The word processing apparatus provided by the embodiment of the present invention is used to execute the word processing method provided by the embodiment shown in FIG. 2 and FIG. 3 of the present invention, and has a corresponding function module, and the implementation principle and the technical effect thereof are similar, and details are not described herein again.
本发明实施例还公开了一种计算机程序,包括程序指令,当该程序指令被计算机执行时,使得该计算机可执行上述任意的文字处理方法。The embodiment of the invention also discloses a computer program, comprising program instructions, which when executed by a computer, enable the computer to execute any of the above-mentioned word processing methods.
本发明实施例还公开了一种载有所述的计算机程序的载体。The embodiment of the invention also discloses a carrier carrying the computer program.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
虽然本发明所揭露的实施方式如上,但所述的内容仅为便于理解本发明而采用的实施方式,并非用以限定本发明。任何本发明所属领域内的技术人员,在不脱离本发明所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明的专利保护范围,仍须以所附的权利要求书所界定的范围为准。While the embodiments of the present invention have been described above, the described embodiments are merely for the purpose of understanding the invention and are not intended to limit the invention. Any modification and variation in the form and details of the embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention. The scope defined by the appended claims shall prevail.
工业实用性Industrial applicability
本发明技术方案提供的文字处理方法和装置,通过用户选择的第一文本信息结合该第一文本信息在文件中的具体位置中,获取待分析的第二文本信息,该第二文本信息包括上述用户选择的第一文本信息和扩充文本信息,从而在第二文本信息中对该的第一文本信息进行语义分析,以获取分析结果;本发明提供的方法将对单独文本信息的查询扩展为在语境中进行的具体分析,可以得到文本的具体解释、词性,在语句中的成分等特征,具有更全面和准确的分析结果;解决了相关技术中查询文本的方式,由于终端设备针对用户选择的关键词进行查询,而导致查询结果不准确的问题。因此本发明具有很强的工业实用性。 The text processing method and device provided by the technical solution of the present invention obtain the second text information to be analyzed by combining the first text information selected by the user with the specific location of the first text information in the file, the second text information including the above The first text information and the extended text information selected by the user, so as to perform semantic analysis on the first text information in the second text information to obtain an analysis result; the method provided by the present invention expands the query on the individual text information to The specific analysis carried out in the context can obtain the specific interpretation of the text, the part of speech, the components in the sentence and other characteristics, with more comprehensive and accurate analysis results; solve the way of querying text in related technologies, because the terminal equipment is selected for the user Keywords are queried, resulting in inaccurate query results. Therefore, the present invention has strong industrial applicability.

Claims (12)

  1. 一种文字处理方法,包括:A word processing method, including:
    根据选择的第一文本信息在文件中的位置,获取第二文本信息,其中,所述第二文本信息包括所述第一文本信息和与所述第一文本信息相邻的扩充文本信息;Obtaining second text information according to a location of the selected first text information in the file, wherein the second text information includes the first text information and extended text information adjacent to the first text information;
    在所述第二文本信息中对所述第一文本信息进行语义分析,并获取所述第一文本信息的分析结果。Performing semantic analysis on the first text information in the second text information, and acquiring an analysis result of the first text information.
  2. 根据权利要求1所述的文字处理方法,其中,所述在所述第二文本信息中对所述第一文本信息进行语义分析的步骤之前,该方法还包括:The word processing method according to claim 1, wherein before the step of performing semantic analysis on the first text information in the second text information, the method further comprises:
    对比所述第一文本信息和所述第二文本信息,对所述第一文本信息进行字符类型分析;Comparing the first text information and the second text information, performing character type analysis on the first text information;
    判断所述第一文本信息与所述扩充文本信息的字符类型是否相同;Determining whether the first text information and the extended text information have the same character type;
    当所述第一文本信息与所述扩充文本信息的字符类型不同时,查询所述第一文本信息的解释或者提示对所述第一文本信息进行相应的操作;Querying an interpretation of the first text information or prompting a corresponding operation on the first text information when the first text information is different from the character type of the extended text information;
    当所述第一文本信息与所述扩充文本信息的字符类型相同时,在所述第二文本信息中对所述第一文本信息进行语义分析,并获取所述第一文本信息的分析结果。When the first text information is the same as the character type of the extended text information, the first text information is semantically analyzed in the second text information, and an analysis result of the first text information is obtained.
  3. 根据权利要求1所述的文字处理方法,其中,所述在所述第二文本信息中对所述第一文本信息进行语义分析的步骤包括:The word processing method according to claim 1, wherein the step of performing semantic analysis on the first text information in the second text information comprises:
    在所述第二文本信息中对所述第一文本信息进行语义分析,并判断所选择的第一文本信息的定位是否准确;Performing semantic analysis on the first text information in the second text information, and determining whether the location of the selected first text information is accurate;
    当判断出所选择的第一文本信息的定位准确时,获取所述第一文本信息的分析结果;Obtaining an analysis result of the first text information when it is determined that the location of the selected first text information is accurate;
    当判断出所选择的第一文本信息的定位不准确时,对所述第一文本信息进行重新选择,并获取对重新选择的第一文本信息的分析结果。When it is determined that the positioning of the selected first text information is inaccurate, the first text information is reselected, and an analysis result of the reselected first text information is obtained.
  4. 根据权利要求3所述的文字处理方法,其中,所述重新选择的第一文本信息包括: The word processing method according to claim 3, wherein said reselected first text information comprises:
    选择的部分第一文本信息;或者,Part of the first textual information selected; or,
    选择的部分第一文本信息和部分所述扩充文本信息;或者,a selected portion of the first text information and a portion of the extended text information; or,
    选择的第一文本信息和部分所述扩充文本信息。The selected first text information and a portion of the extended text information.
  5. 根据权利要求1~4中任一项所述的文字处理方法,其中,所述获取所述第一文本信息的分析结果之后,该方法还包括:The character processing method according to any one of claims 1 to 4, wherein after the obtaining the analysis result of the first text information, the method further comprises:
    在图形用户界面GUI上显示所述分析结果。The analysis results are displayed on a graphical user interface GUI.
  6. 一种文字处理装置,包括获取模块和语义分析模块,其中:A word processing device includes an acquisition module and a semantic analysis module, wherein:
    所述获取模块设置成:根据选择的第一文本信息在文件中的位置,获取第二文本信息,其中,所述第二文本信息包括所述第一文本信息和与所述第一文本信息相邻的扩充文本信息;The obtaining module is configured to: acquire second text information according to a location of the selected first text information in the file, where the second text information includes the first text information and the first text information Extended text information of the neighbor;
    所述语义分析模块设置成:在所述获取模块获取的第二文本信息中对所述第一文本信息进行语义分析,并获取所述第一文本信息的分析结果。The semantic analysis module is configured to perform semantic analysis on the first text information in the second text information acquired by the obtaining module, and obtain an analysis result of the first text information.
  7. 根据权利要求6所述的文字处理装置,该装置还包括:字符分析模块和判断模块,其中,The word processing device according to claim 6, further comprising: a character analysis module and a determination module, wherein
    所述字符分析模块设置成:在所述语义分析模块在第二文本信息中对所述第一文本信息进行语义分析之前,对比所述第一文本信息和所述第二文本信息,对所述第一文本信息进行字符类型分析;The character analysis module is configured to compare the first text information and the second text information before the semantic analysis module performs semantic analysis on the first text information in the second text information The first text information is subjected to character type analysis;
    所述判断模块设置成:判断所述第一文本信息与所述扩充文本信息的字符类型是否相同;The determining module is configured to: determine whether the first text information and the extended text information have the same character type;
    所述字符分析模块还设置成:在所述判断模块判断出第一文本信息与所述扩充文本信息的字符类型不同时,查询所述第一文本信息的解释或者提示对所述第一文本信息进行相应的操作;The character analysis module is further configured to: when the determining module determines that the first text information is different from the character type of the extended text information, querying the interpretation of the first text information or prompting the first text information Perform the corresponding operations;
    所述语义分析模块设置成按照如下方式在所述获取模块获取的第二文本信息中对所述第一文本信息进行语义分析,并获取所述第一文本信息的分析结果:在所述判断模块判断出第一文本信息与所述扩充文本信息的字符类型相同时,在所述第二文本信息中对所述第一文本信息进行语义分析,并获取所述第一文本信息的分析结果。The semantic analysis module is configured to perform semantic analysis on the first text information in the second text information acquired by the obtaining module, and obtain an analysis result of the first text information: in the determining module When it is determined that the first text information is the same as the character type of the extended text information, the first text information is semantically analyzed in the second text information, and the analysis result of the first text information is obtained.
  8. 根据权利要求6所述的文字处理装置,该装置还包括判断模块,其 中,A word processing device according to claim 6, further comprising a judging module in,
    所述判断模块设置成:在所述语义分析模块在第二文本信息中对所述第一文本信息进行语义分析的过程中,判断所选择的第一文本信息的定位是否准确;The determining module is configured to: determine, during the semantic analysis of the first text information in the second text information, whether the positioning of the selected first text information is accurate;
    所述语义分析模块还设置成:在所述判断模块判断出所选择的第一文本信息的定位准确时,获取所述第一文本信息的分析结果;The semantic analysis module is further configured to: when the determining module determines that the location of the selected first text information is accurate, acquiring an analysis result of the first text information;
    所述语义分析模块还设置成:在所述判断模块判断出所选择的第一文本信息的定位不准确时,对所述第一文本信息进行重新选择,并获取对重新选择的第一文本信息的分析结果。The semantic analysis module is further configured to: when the determining module determines that the location of the selected first text information is inaccurate, reselect the first text information, and acquire the first text information for reselection Analysis results.
  9. 根据权利要求8所述的文字处理装置,其中,所述语义分析模块重新选择的第一文本信息包括:The word processing apparatus according to claim 8, wherein the first text information reselected by the semantic analysis module comprises:
    选择的部分第一文本信息;或者,Part of the first textual information selected; or,
    选择的部分第一文本信息和部分所述扩充文本信息;或者,a selected portion of the first text information and a portion of the extended text information; or,
    选择的第一文本信息和部分所述扩充文本信息。The selected first text information and a portion of the extended text information.
  10. 根据权利要求6~9中任一项所述的文字处理装置,该装置还包括:显示模块,其中,The word processing device according to any one of claims 6 to 9, further comprising: a display module, wherein
    所述显示模块设置成:在所述语义分析模块获取所述分析结果之后,在图形用户界面GUI上显示所述分析结果。The display module is configured to display the analysis result on the graphical user interface GUI after the semantic analysis module acquires the analysis result.
  11. 一种计算机程序,包括程序指令,当该程序指令被计算机执行时,使得该计算机可执行如权利要求1-5中任一项所述的文字处理方法。A computer program comprising program instructions which, when executed by a computer, cause the computer to perform the word processing method of any of claims 1-5.
  12. 一种载有如权利要求11所述的计算机程序的载体。 A carrier carrying the computer program of claim 11.
PCT/CN2015/090282 2015-07-15 2015-09-22 Word processing method and apparatus WO2016131260A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510417413.4A CN106708797B (en) 2015-07-15 2015-07-15 Word processing method and device
CN201510417413.4 2015-07-15

Publications (1)

Publication Number Publication Date
WO2016131260A1 true WO2016131260A1 (en) 2016-08-25

Family

ID=56688667

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/090282 WO2016131260A1 (en) 2015-07-15 2015-09-22 Word processing method and apparatus

Country Status (2)

Country Link
CN (1) CN106708797B (en)
WO (1) WO2016131260A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109917988B (en) * 2017-12-13 2021-12-21 腾讯科技(深圳)有限公司 Selected content display method, device, terminal and computer readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1556480A (en) * 2003-12-30 2004-12-22 珠海金山软件股份有限公司 Electron dictionary semanteme analysis method
CN102446168A (en) * 2010-10-11 2012-05-09 英业达股份有限公司 Instant translation system and method thereof
CN103678287A (en) * 2013-11-30 2014-03-26 武汉传神信息技术有限公司 Method for unifying keyword translation
CN103870523A (en) * 2005-12-22 2014-06-18 清晰传媒广告有限公司 Analyzing content to determine context and serving relevant content based on the context
CN103970732A (en) * 2014-05-22 2014-08-06 北京百度网讯科技有限公司 Mining method and device of new word translation
CN104199965A (en) * 2014-09-22 2014-12-10 吴晨 Semantic information retrieval method
US20150006143A1 (en) * 2013-06-27 2015-01-01 Avaya Inc. Semantic translation model training
CN104280042A (en) * 2014-09-30 2015-01-14 深圳市微思客技术有限公司 Method and device for acquiring navigation information

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100568225C (en) * 2006-12-08 2009-12-09 富士通株式会社 The Words symbolization processing method and the system of numeral and special symbol string in the text
CN101295292B (en) * 2007-04-23 2016-07-20 北大方正集团有限公司 A kind of method based on maximum entropy model modeling and name Entity recognition and device
US8782069B2 (en) * 2009-06-11 2014-07-15 Chacha Search, Inc Method and system of providing a search tool
CN103218113A (en) * 2013-02-28 2013-07-24 魏新成 Method for selecting text character string by multi-click action of left mouse button
WO2015081512A1 (en) * 2013-12-04 2015-06-11 华为终端有限公司 Method and electronic device for scheduling app

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1556480A (en) * 2003-12-30 2004-12-22 珠海金山软件股份有限公司 Electron dictionary semanteme analysis method
CN103870523A (en) * 2005-12-22 2014-06-18 清晰传媒广告有限公司 Analyzing content to determine context and serving relevant content based on the context
CN102446168A (en) * 2010-10-11 2012-05-09 英业达股份有限公司 Instant translation system and method thereof
US20150006143A1 (en) * 2013-06-27 2015-01-01 Avaya Inc. Semantic translation model training
CN103678287A (en) * 2013-11-30 2014-03-26 武汉传神信息技术有限公司 Method for unifying keyword translation
CN103970732A (en) * 2014-05-22 2014-08-06 北京百度网讯科技有限公司 Mining method and device of new word translation
CN104199965A (en) * 2014-09-22 2014-12-10 吴晨 Semantic information retrieval method
CN104280042A (en) * 2014-09-30 2015-01-14 深圳市微思客技术有限公司 Method and device for acquiring navigation information

Also Published As

Publication number Publication date
CN106708797A (en) 2017-05-24
CN106708797B (en) 2021-03-16

Similar Documents

Publication Publication Date Title
US11449767B2 (en) Method of building a sorting model, and application method and apparatus based on the model
US11567981B2 (en) Model-based semantic text searching
JP4664076B2 (en) Blinking annotation callouts to highlight cross-language search results
RU2643467C1 (en) Comparison of layout similar documents
US11481417B2 (en) Generation and utilization of vector indexes for data processing systems and methods
US20180039696A1 (en) Knowledge graph entity reconciler
US20120297294A1 (en) Network search for writing assistance
WO2015135455A1 (en) Natural language question answering method and apparatus
JP2018077858A (en) System and method for conversation-based information search
US11853689B1 (en) Computer-implemented presentation of synonyms based on syntactic dependency
US20140019462A1 (en) Contextual query adjustments using natural action input
JP2003223437A (en) Method of displaying candidate for correct word, method of checking spelling, computer device, and program
JP2015511746A5 (en)
CN111753064B (en) Man-machine interaction method and device
US20140372402A1 (en) Enhanced Searching at an Electronic Device
WO2022135474A1 (en) Information recommendation method and apparatus, and electronic device
US20210133264A1 (en) Data Processing Systems and Methods
US10621252B2 (en) Method for searching in a database
US20220365956A1 (en) Method and apparatus for generating patent summary information, and electronic device and medium
KR20200136636A (en) Morphology-Based AI Chatbot and Method How to determine the degree of sentence
US10963641B2 (en) Multi-lingual tokenization of documents and associated queries
WO2016131260A1 (en) Word processing method and apparatus
US20190018827A1 (en) Electronic content insertion systems and methods
JP2004295301A (en) Document retrieval device
WO2022104297A1 (en) Multimodal input-based data selection and command execution

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: 15882399

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: 15882399

Country of ref document: EP

Kind code of ref document: A1