Grammar analysis method and device, equipment and storage medium

By obtaining the text to be identified in the dictionary pen and performing sentence-by-sampling processing based on punctuation marks, the problems of multiple sweeps and missing sweeps in grammatical analysis in the prior art are solved, and the accuracy and efficiency of grammatical analysis are improved.

CN119721017AActive Publication Date: 2025-03-28GUANGDONG XIAOTIANCAI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311270149.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-03-28
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

In the prior art, dictionary pens rely solely on punctuation marks for splitting during grammatical analysis, and multiple sweeps or missing sweeps of punctuation marks or words are prone to occur, which affects the accuracy of the grammatical analysis results.

Method used

By obtaining the text to be recognized, preliminary processing is performed according to the punctuation mark to obtain multiple clauses, and further processing is performed to determine the clause to be recognized with analysable grammatical content, and output its grammatical analysis results.

Benefits of technology

This solution can avoid multiple sweeps and missed sweeps of punctuation marks or words, improve the accuracy of grammatical analysis, and extract the text to be identified through image processing algorithms, improving the accuracy and speed of obtaining text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721017A_ABST
    Figure CN119721017A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a grammar analysis method and device, equipment and a storage medium, and relates to the technical field of intelligent learning, and the scheme comprises the steps of obtaining a to-be-recognized text; according to the punctuation marks included in the to-be-recognized text, the to-be-recognized text is processed to obtain a plurality of clauses of the to-be-recognized text, and the sentence end of each clause is provided with a first punctuation mark. And determining at least one to-be-identified clause from the plurality of clauses, wherein the at least one to-be-identified clause has analyzable grammatical content. And outputting a syntactic analysis result of the at least one to-be-recognized clause. The scheme is used for improving the accuracy of syntactic analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent learning technology, and in particular to a grammar analysis method, apparatus, device and storage medium. Background Art

[0002] The dictionary pen is a device that combines an electronic dictionary with a scanning function. Users can use the dictionary pen to scan the contents of a book, extract the text to be recognized based on the recognition technology in the dictionary pen, and perform grammatical analysis on the content of the text to be recognized. Usually, the dictionary pen will scan a paragraph of text in a book, so the extracted text to be recognized has multiple sentences. When the dictionary pen performs grammatical analysis on the content of the text to be recognized, it needs to split the text to be recognized into multiple sentences, and then perform grammatical analysis on each sentence.

[0003] In the prior art, the dictionary pen only splits the text according to the punctuation marks in the text to be recognized. However, this method may result in multiple scans or omissions of punctuation marks or words in the sentence. For example, when scanning the content in a book, the dictionary pen scans a question mark multiple times, which affects the accuracy of the dictionary pen's grammatical analysis of the sentence. Summary of the invention

[0004] The embodiments of the present application provide a syntax analysis method, apparatus, device and storage medium, which are used to improve the accuracy of syntax analysis.

[0005] In a first aspect, an embodiment of the present application provides a grammatical analysis method, comprising: obtaining a text to be recognized. According to the punctuation marks included in the text to be recognized, the text to be recognized is processed to obtain multiple sentences of the text to be recognized, each sentence having a first punctuation mark at the end of the sentence. At least one sentence to be recognized is determined from the multiple sentences, and at least one sentence to be recognized has grammatical content that can be analyzed. The grammatical analysis result of the at least one sentence to be recognized is output.

[0006] The embodiment of the present application provides a grammatical analysis method. After obtaining the text to be recognized, multiple sentences of the text to be recognized are first obtained according to the punctuation marks included in the text to be recognized, so that the text to be recognized can be preliminarily processed according to the punctuation marks. After obtaining multiple sentences, the multiple sentences are further processed to obtain at least one sentence to be recognized with analyzable grammatical content, so that the text to be recognized can be more accurately segmented, and then the sentence to be recognized with analyzable grammatical content is extracted from the multiple sentences, and the grammatical analysis result is output according to at least one sentence to be recognized. This solution can avoid the situation of multiple scanning or missing scanning of punctuation marks or words in the sentence that only performs preliminary splitting in the prior art, so the accuracy of grammatical analysis can be improved.

[0007] In a possible implementation of the present application, obtaining the text to be recognized includes: obtaining an image containing the text to be recognized. Recognizing the image according to an image processing algorithm to extract the text to be recognized from the image. By extracting the text to be recognized from the image, the accuracy and speed of obtaining the text to be recognized can be improved, which can save a lot of time and labor costs for users.

[0008] In a possible implementation of the present application, obtaining the text to be recognized includes: a user inputting the text to be recognized in an electronic device.

[0009] In a possible implementation of the present application, obtaining an image containing text to be recognized includes: using an image sensor in an electronic device to capture an image when a user uses the electronic device to scan an area to be recognized.

[0010] In a possible implementation of the present application, determining at least one sentence to be recognized from multiple sentences includes: taking a sentence with meaning from the multiple sentences as at least one sentence to be recognized, any sentence to be recognized has at least one word, and one or more words in the at least one word can be found in a preset word library. In this way, at least one sentence with meaning can be determined from multiple sentences, thereby avoiding the situation in the prior art where only preliminary splitting is performed, resulting in multiple scans or omissions of punctuation marks or words.

[0011] In a possible implementation of the present application, outputting the grammatical analysis result of at least one sentence to be identified includes: for any sentence to be identified, outputting the grammatical analysis result of the sentence to be identified according to whether the sentence pattern of the sentence to be identified is a simple sentence, wherein a simple sentence refers to a sentence in which sentence components are omitted, and sentence components include any of the following subjects, target verbs, and objects. In this way, the grammatical analysis can be performed separately on the sentence to be identified whose sentence pattern is a simple sentence and the sentence to be identified whose sentence pattern is not a simple sentence, so as to improve the efficiency of the grammatical analysis.

[0012] In a possible implementation of the present application, if the first database stores a sentence to be identified, the sentence pattern of the sentence to be identified is a simple sentence. In this way, it is possible to quickly determine whether the sentence pattern of the sentence to be identified is a simple sentence. In other words, if the first database does not store any sentence to be identified, the sentence pattern of any sentence to be identified is not a simple sentence.

[0013] In a possible implementation of the present application, the grammatical analysis result of the sentence to be identified is output according to whether the sentence pattern of the sentence to be identified is a simple sentence, including: when the sentence pattern of the sentence to be identified is not a simple sentence, if it is detected that the sentence structure of the sentence to be identified is complete, the grammatical analysis content of the sentence to be identified is used as the grammatical analysis result of the sentence to be identified and output. If it is detected that the sentence structure of the sentence to be identified is incomplete, the grammatical analysis content of the sentence to be identified and the first information are used as the grammatical analysis result of the sentence to be identified and output, and the first information is used to prompt that the sentence structure of the sentence to be identified is incomplete. In this way, the sentence structure of the sentence to be identified whose sentence pattern is not a simple sentence can be further judged, and when it is detected that the sentence structure of the sentence to be identified is incomplete, the first information is also output, thereby improving the reliability of the grammatical analysis result.

[0014] In a possible implementation of the present application, determining whether the sentence structure of the sentence to be identified is complete includes: if the sentence to be identified contains a target verb, a subject and / or an object, then determining that the sentence structure of the sentence to be identified is complete. In this way, it is possible to quickly and effectively determine whether the sentence structure of the sentence to be identified is complete by simply detecting the sentence components in the sentence to be identified.

[0015] In a possible implementation of the present application, after determining at least one sentence to be identified from multiple sentences, the method further includes: if it is detected that any sentence to be identified contains a first content, then any sentence to be identified is processed, and any sentence to be identified after processing does not contain the first content, and the first content includes: text in other languages ​​different from the language corresponding to the analyzable grammatical content, and / or numbers. Outputting the grammatical analysis result of at least one sentence to be identified includes: outputting the grammatical analysis result of any sentence to be identified after processing and at least one sentence to be identified that does not contain the first content. In this way, the content related to the analyzable grammatical content in the sentence to be identified can be screened out to avoid the influence of the first content on the subsequent grammatical analysis, thereby improving the accuracy of the grammatical analysis.

[0016] In a second aspect, an embodiment of the present application provides a grammatical analysis device, which can implement the method in the first aspect or any possible implementation of the first aspect, and thus can also achieve the beneficial effects in the first aspect or any possible implementation of the first aspect. The grammatical analysis device can be an electronic device, or a device that supports an electronic device to implement the method in the first aspect or any possible implementation of the first aspect, such as a chip or control circuit used in an electronic device. The grammatical analysis device can implement the above method through software, hardware, or by executing corresponding software through hardware.

[0017] As an example, an embodiment of the present application provides a grammatical analysis device, which is an electronic device or a chip used in an electronic device, and the grammatical analysis device includes: an acquisition unit, used to acquire a text to be recognized. A processing unit, used to process the text to be recognized according to the punctuation marks included in the text to be recognized, so as to obtain multiple sentences of the text to be recognized, and each sentence has a first punctuation mark at the end of the sentence. A determination unit, used to determine at least one sentence to be recognized from the multiple sentences, and at least one sentence to be recognized has analyzable grammatical content. An output unit, used to output the grammatical analysis result of at least one sentence to be recognized.

[0018] In a possible implementation of the present application, the acquisition unit is further configured to acquire an image containing text to be recognized.

[0019] In a possible implementation of the present application, the syntax analysis device provided in the embodiment of the present application further includes: a recognition unit. The recognition unit is used to recognize the image according to the image processing algorithm to extract the text to be recognized from the image.

[0020] In a possible implementation of the present application, the determination unit is further configured to take a meaningful sentence from among the multiple sentences as at least one sentence to be identified.

[0021] In a possible implementation of the present application, the output unit is further configured to output a grammatical analysis result of any sentence to be identified according to whether the sentence pattern of the sentence to be identified is a simple sentence.

[0022] In a possible implementation of the present application, the output unit is also used to detect that the sentence structure of the sentence to be recognized is complete when the sentence pattern of the sentence to be recognized is not a simple sentence, and then output the grammatical analysis content of the sentence to be recognized as the grammatical analysis result of the sentence to be recognized.

[0023] In a possible implementation of the present application, the output unit is further configured to detect that the sentence structure of the sentence to be recognized is incomplete, and then output the grammatical analysis content of the sentence to be recognized and the first information as the grammatical analysis result of the sentence to be recognized.

[0024] In a possible implementation of the present application, the determination unit is further configured to detect that the sentence to be identified contains a target verb, a subject and / or an object, and then determine that the sentence structure of the sentence to be identified is complete.

[0025] In a possible implementation of the present application, the processing unit is further configured to detect that any sentence to be identified contains the first content, and then process any sentence to be identified, so that any sentence to be identified after processing does not contain the first content.

[0026] In a possible implementation of the present application, the output unit is further configured to output a grammatical analysis result of any processed sentence to be recognized and at least one sentence to be recognized that does not contain the first content.

[0027] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is run on a computer, the computer executes a grammatical analysis method described in any possible implementation of the first aspect to the first aspect.

[0028] In a fourth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute a grammatical analysis method described in the first aspect or various possible implementations of the first aspect.

[0029] In a fifth aspect, an embodiment of the present application provides a grammatical analysis device for implementing various methods in various possible designs of the first aspect or any aspect of the first aspect. The grammatical analysis device can be the above-mentioned electronic device, or a device including the above-mentioned electronic device, or a component (e.g., a chip) used in the electronic device.

[0030] The syntax analysis device described in the fifth aspect includes modules and units corresponding to the above method, which can be implemented by hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.

[0031] In a sixth aspect, an embodiment of the present application provides a grammatical analysis device, which includes: at least one processor and a communication interface. When the grammatical analysis device is running, the processor executes a computer-executable instruction or program stored in the grammatical analysis device to enable the grammatical analysis device to perform a method as described in any of the various possible designs of the first aspect or any aspect of the first aspect. For example, the grammatical analysis device can be an electronic device, or a component used in an electronic device.

[0032] It should be understood that the communication device described in the sixth aspect may also include: a bus and a memory, the memory being used to store code and data. Optionally, at least one processor communication interface and the memory are coupled to each other.

[0033] In a seventh aspect, an embodiment of the present application provides a chip, the chip comprising a processor and a communication interface, the communication interface and the processor are coupled, the processor is used to run a computer program or instruction to implement a syntax analysis method described in the first aspect or various possible implementations of the first aspect. The communication interface is used to communicate with other modules outside the chip. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic diagram of the internal structure of an electronic device provided in an embodiment of the present application;

[0035] Figure 2 A flowchart of a syntax analysis method provided in an embodiment of the present application;

[0036] Figure 3 A schematic diagram of a grammatical analysis result provided in an embodiment of the present application;

[0037] Figure 4 A schematic diagram of the structure of a grammar analysis device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0039] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0040] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0041] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0042] The dictionary pen is a device that combines an electronic dictionary with a scanning function. Users can use the dictionary pen to scan the contents of a book, extract the text to be recognized based on the recognition technology in the dictionary pen, and perform grammatical analysis on the content of the text to be recognized. Usually, the dictionary pen will scan a paragraph of text in a book, so the extracted text to be recognized has multiple sentences. When the dictionary pen performs grammatical analysis on the content of the text to be recognized, it needs to split the text to be recognized into multiple sentences, and then perform grammatical analysis on each sentence.

[0043] In the prior art, the dictionary pen only splits the text according to the punctuation marks in the text to be recognized. However, this method may result in multiple scans or omissions of punctuation marks or words in the sentence. For example, when scanning the content in a book, the dictionary pen scans a question mark multiple times, which affects the accuracy of the dictionary pen's grammatical analysis of the sentence.

[0044] Therefore, the embodiments of the present application provide a syntax analysis method, apparatus, device and storage medium, which are used to improve the accuracy of syntax analysis.

[0045] A grammatical analysis method provided in an embodiment of the present application can be performed by an electronic device, which can be a mobile phone, a dictionary pen or other device with a grammatical analysis function. Optionally, the electronic device in the embodiment of the present application can also have an image sensor, which is used to scan text and transmit the perceived image to the central processing unit of the electronic device, such as a CPU. So that the CPU applies an image processing algorithm to identify and extract the text to be identified (such as English text) from the image.

[0046] Optional, such as Figure 1 As shown, Figure 1 The electronic device 100 provided in the embodiment of the present application is a schematic diagram of the structure of the electronic device 100, the electronic device 100 includes: a processor 101, a communication line 102, at least one communication interface ( Figure 1 The communication interface 103 is used as an example for explanation).

[0047] The processor 101 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0048] The communication link 102 may include a pathway to transmit information between the above-mentioned components.

[0049] The communication interface 103 is used to exchange information with other devices, for example, using any transceiver-like device to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Networks (WLAN), etc.

[0050] Optionally, the electronic device may further include a memory 104 .

[0051] The memory 104 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 104 may exist independently and be connected to the processor 101 through the communication line 102. The memory 104 may also be integrated with the processor 101.

[0052] The memory 104 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 101. The processor 101 is used to execute the computer-executable instructions stored in the memory 104, thereby implementing a syntax analysis method provided in the following embodiment of the present application.

[0053] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.

[0054] In a specific implementation, as an embodiment, the processor 101 may include one or more CPUs, such as Figure 1 CPU0 and CPU1 in.

[0055] In a specific implementation, as an embodiment, the electronic device may include multiple processors, such as Figure 1 1 and 105. Each of these processors may be a single-core (Single-CPU) processor or a multi-core (Multi-CPU) processor. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0056] Optionally, the electronic device 100 may further include a scanning device 106 .

[0057] The scanning device 106 is used by the electronic device to obtain the text to be recognized. For example, the scanning device 106 can scan the text in a preset area (such as on a book) and extract the text in the preset area to obtain the text to be recognized.

[0058] In a specific implementation, the scanning device 106 may include an image sensor and a processing device. The image sensor is used to scan text in a preset area, and the processing device may be used to extract the text in the preset area to obtain text to be recognized.

[0059] Optionally, the electronic device may further include a display device 107 .

[0060] The display device 107 is used by the electronic device to output display information, such as the grammatical analysis result and / or the first information in the embodiment of the present application.

[0061] Optionally, the electronic device may further include a sound emitting device 108 .

[0062] The sound generating device 108 is used by the electronic device to output sound information, such as the grammatical analysis result and / or the first information in the embodiment of the present application.

[0063] In the embodiments of the present application, the specific structure of the execution subject of a syntax analysis method is not particularly limited in the embodiments of the present application, as long as it can communicate according to a syntax analysis method of the embodiments of the present application by running a program that records the code of the syntax analysis method of the embodiments of the present application. For example, the execution subject of a syntax analysis method provided in the embodiments of the present application can be a functional module in an electronic device that can call and execute a program, or a syntax analysis device applied to an electronic device, such as a chip. This application does not limit this.

[0064] It should be explained that the electronic device applied to the grammar analysis method provided in the embodiment of the present application may be a dictionary pen, or other devices, such as a computer with an external scanning device, a smart device with a camera function, etc. For example, the grammar analysis method may be applied to a dictionary pen or a mobile phone, and the content of the book may be recognized by the dictionary pen or the mobile phone, and then the multiple sentences in the extracted text to be recognized may be split.

[0065] This embodiment is described below by taking a syntax analysis method applied to a dictionary pen as an example.

[0066] The embodiments of the present application are explained assuming that the text to be recognized is English text.

[0067] like Figure 2 As shown, Figure 2 A flowchart of a syntax analysis method provided in an embodiment of the present application is shown, and the method includes:

[0068] Step 210: The dictionary pen obtains the text to be recognized.

[0069] It is understandable that the dictionary pen has a text scanning function.

[0070] Exemplarily, the dictionary pen can scan the content of a preset area through the scanning device of the dictionary pen, and extract the content of the preset area to obtain the text to be recognized. For example, the preset area can be a book, and the content of the preset area can be a paragraph in the book.

[0071] For example, the text to be recognized contains multiple sentences, and the multiple sentences can have different lengths. For example, the text to be recognized is: What a nice day! A rich woman is so proud of a valuable antique vase that she decides to have her bedroom painted the same colour as the vase. Several painters try to mix the colour right. However, none comes close enough to satisfy the woman! ! A painter comes. He confident that he cann mix the proper colour. Congratulations!

[0072] It needs to be explained that when the scanning pen extracts the text to be recognized, there may be cases where the dictionary pen scans too much or misses something, for example, an extra "!" is scanned in the above text to be recognized.

[0073] It should be explained that the text to be recognized obtained by the dictionary pen can be a printed text or a handwritten text, and the embodiment of the present application does not limit this.

[0074] The text to be recognized in the present application can be the content obtained by the dictionary pen scanning and recognizing the text by itself. Of course, the text to be recognized can also be the content scanned and recognized by other electronic devices and sent to the dictionary pen, or the text to be recognized in the present application can also be the text downloaded by the dictionary pen from a web page. The embodiments of the present application do not limit this.

[0075] Step 220: The dictionary pen processes the text to be recognized according to the punctuation marks included in the text to be recognized, so as to obtain a plurality of sentences of the text to be recognized.

[0076] It needs to be explained that punctuation marks are symbols that assist written language and are used to indicate pauses, tone, or the nature of words, etc.

[0077] Exemplarily, punctuation marks may include a period (".."), a question mark ("?"), an exclamation mark ("!"), a comma (","), a colon (":"), a semicolon (";"), a character ("-"), a hyphen ("--"), a dash ("——"), brackets (such as parentheses "()", brackets "[]", braces "{}"), quotation marks (such as double quotes """" or single quotes "'"), abbreviations, and a possessive symbol ("'s"), etc.

[0078] Each sentence has a first punctuation mark at the end. It is understandable that the first punctuation mark is used to indicate the end of a sentence and distinguish it from the next sentence, such as a period at the end of a sentence.

[0079] Exemplarily, when the text to be recognized is English text, the first punctuation marks include: a period ("."), a question mark ("?"), and an exclamation mark ("!").

[0080] It is understandable that when the dictionary pen detects other punctuation marks (such as “,”) in the text to be recognized, it does not perform sentence splitting on the text to be recognized.

[0081] As an example, when the dictionary pen processes the text to be recognized, each time the first punctuation mark in the text to be recognized is detected, the text to be recognized is split into sentences with the first punctuation mark as the splitting point and as the end of the previous sentence; correspondingly, when other punctuation marks except the first punctuation mark in the text to be recognized are detected, the sentence is not split with the punctuation mark as the splitting point. For example, the text to be recognized is: What a nice day! A rich woman is so proud of a valuable antique vase that she decides to have her bedroom painted the same colour as the vase. Several painters try to mix the colour right. However, none comes close enough to satisfy the woman! ! A painter comes. He confident that he cann mix the proper colour. Congratulations! The dictionary pen splits the text to be recognized into sentences according to the punctuation marks included in the text to be recognized, with the first punctuation mark in the text to be recognized as the splitting point and as the end of the sentence, and obtains the following multiple sentences:

[0082] Sentence 1: What a nice day!

[0083] Clause 2: A rich woman is so proud of a valuable antique vase that shedecides to have her bedroom painted the same color as the vase.

[0084] Clause 3:Several painters try to mix the color right.

[0085] Clause 4: However, none comes close enough to satisfy the woman!

[0086] Clause 5:!

[0087] Clause 6:A painter comes.

[0088] Clause 7: He confident that he can mix the proper colour.

[0089] Clause 8: Congratulations!

[0090] It is understandable that when the dictionary pen scans the text to be recognized, it may scan punctuation marks more than once (such as sentence 5) or miss them (such as sentence 7).

[0091] Step 230: The dictionary pen determines at least one sentence to be recognized from the multiple sentences.

[0092] Among them, at least one sentence to be identified has analyzable grammatical content.

[0093] Exemplarily, the sentence to be identified having analyzable grammatical content may be that the sentence to be identified is a meaningful sentence; or the sentence to be identified has a main sentence component; or the sentence to be identified has a tense (general present tense, general future tense), etc. For example, the main sentence component may be any one or more of a subject, a predicate, or a target verb.

[0094] For example, the dictionary pen can determine that the sentence to be recognized is a meaningful sentence by detecting that the words in the sentence to be recognized can be found in a preset word library or in the cloud. Regarding how the dictionary pen determines that the sentence to be recognized is a meaningful sentence, please refer to the following embodiment, which will not be repeated here.

[0095] For example, if the sentence components of clause 6 include a subject and a target verb, then clause 6 can be used as a clause to be identified.

[0096] For another example, if “A”, “painter” and “comes” in sentence 6 can be found in the preset vocabulary, then sentence 6 can be used as a sentence to be recognized.

[0097] As an example, the dictionary pen can determine that sentences 1 to 4 and sentences 6 to 8 are to-be-recognized sentences from the above sentences 1 to 6. It can be understood that the content of sentence 5 is "!", which has no analyzable grammatical content.

[0098] Step 240: The dictionary pen outputs a grammatical analysis result of at least one sentence to be recognized.

[0099] Exemplarily, the grammatical analysis results of the clause to be identified may include: grammatical analysis of the clause to be identified, grammatical analysis of each word in the clause to be identified, and key vocabulary, etc. Among them, the grammatical analysis of the clause to be identified includes: sentence components (such as subject, linking verb, location, object, clause, etc.), sentence type (special question, general question, declarative sentence, etc.), sentence tense (general present tense, general future tense, present continuous tense, etc.), sentence voice (active sentence, passive sentence). The grammatical analysis results of each word can be the meaning, antonym, synonym, etc. of the word.

[0100] For example, Figure 3 The grammatical analysis of the above-mentioned clause 3 is shown as follows: First, the dictionary pen determines the sentence components in clause 3, for example: "Several painters" is the subject, "try to" is the predicate, and "to mix the colour right" is the object. Second, the dictionary pen determines that the sentence type of clause 3 is a declarative sentence, the tense is the present tense, and the voice is active. Third, the dictionary pen performs a grammatical structure analysis on clause 3, for example: "Several" is an adjective and is the attributive of "painters"; "painters" is a plural noun; "try" is a verb; "to mix the colour right" is the infinitive of the verb as the object of clause 3. Fourth, the dictionary pen lists the key words in clause 3, for example, the key words are "Several", "try", and "mix".

[0101] It needs to be explained that Figure 3 This is an example description of the grammatical analysis results in the embodiments of the present application, and is not intended to be limiting.

[0102] Exemplarily, the dictionary pen can output the grammatical analysis result of at least one sentence to be recognized through the display device (such as a display screen) of the dictionary pen, and the grammatical analysis result is display information. Exemplarily, the dictionary pen can also output the grammatical analysis result of at least one sentence to be recognized through the sound device (such as a speaker) of the dictionary pen, and the grammatical analysis result is sound information.

[0103] Optionally, the dictionary pen can also output the grammatical analysis result of at least one sentence to be recognized through the display screen or speaker of an external device. The external device can be a mobile phone, a computer or an e-book, and the embodiment of the present application does not impose specific restrictions on this. Optionally, the dictionary pen and the external device can be connected by wired communication such as a data cable, or by wireless communication such as Bluetooth, Wi-Fi, etc.

[0104] The embodiment of the present application provides a grammatical analysis method. After obtaining the text to be recognized, multiple sentences of the text to be recognized are first obtained according to the punctuation marks included in the text to be recognized, so that the text to be recognized can be preliminarily processed according to the punctuation marks. After obtaining multiple sentences, the multiple sentences are further processed to obtain at least one sentence to be recognized with analyzable grammatical content, so that the text to be recognized can be more accurately segmented, and then the sentence to be recognized with analyzable grammatical content is extracted from the multiple sentences, and the grammatical analysis result is output according to at least one sentence to be recognized. This solution can avoid the situation of multiple scanning or missing scanning of punctuation marks or words in the sentence that only performs preliminary splitting in the prior art, so the accuracy of grammatical analysis can be improved.

[0105] As a possible implementation method, after the above step 210, the method provided in the embodiment of the present application further includes: the dictionary pen outputs second information of at least one unrecognizable sentence among the multiple sentences.

[0106] Among them, the unrecognizable clause does not have analyzable grammatical content. For example, the above "clause 5:!" is an unrecognizable clause.

[0107] The second information is used to reflect the sentence that does not have analyzable grammatical content.

[0108] For example, when the above-mentioned "Sentence 5:!" is an unrecognizable sentence, the dictionary pen outputs the second information of "Sentence 5:!", and the second information can be used to prompt that "Sentence 5:!" does not have analyzable grammatical content.

[0109] Optionally, the second information is also used to indicate the reason why the unrecognizable sentence does not have analyzable grammatical content. For example, the dictionary pen obtains "Sentence 5:!" when processing the text to be recognized because of multiple scans when acquiring the text to be recognized.

[0110] As a possible implementation method, the method provided in the embodiment of the present application also includes: when each of the multiple sentences is an unrecognizable sentence, the dictionary pen outputs third information.

[0111] The third information is used to reflect that each sentence in the text to be recognized does not have analyzable grammatical content.

[0112] Optionally, the third information is also used to indicate the reason why each sentence in the text to be recognized does not have analyzable grammatical content. Exemplarily, the preset area does not support scanning (for example, the preset area is not smooth, etc.). Exemplarily, whether the scanning device of the dictionary pen fails, resulting in serious over-scanning and missed scanning of the content of the text to be recognized.

[0113] In a possible embodiment of the present application, the above step 210 includes the following steps: the dictionary pen acquires an image containing the text to be recognized, and the dictionary pen recognizes the image according to an image processing algorithm to extract the text to be recognized from the image.

[0114] Exemplarily, the dictionary pen has a scanning device, and the scanning device may include an image sensor and a processing device. For example, the content collected by the image sensor is sent to the processing device in the scanning device. Of course, exemplary, the scanning device in the dictionary pen may also include an image sensor, and the image sensor sends the collected content to other processors in the dictionary pen. The embodiments of the present application are not limited to this.

[0115] As an example, in response to the user's operation, the dictionary pen scans the content of the preset area through the image sensor, and sends the collected image to the processing device or other processor in the scanning device. The processing device or other processor extracts the text to be recognized from the image according to the image processing algorithm. By extracting the text to be recognized from the image, the accuracy and speed of obtaining the text to be recognized can be improved, which can save a lot of time and labor costs for users.

[0116] Exemplarily, the image processing algorithm may be an OCR (optical character recognition) algorithm. As to how the dictionary pen extracts the text to be recognized, reference may be made to the prior art, which will not be described in detail here.

[0117] As a possible implementation method, the above step 210 includes the following method: the dictionary pen detects that the user inputs the text to be recognized, and obtains the text to be recognized.

[0118] For example, the user can input the text to be recognized by voice through the microphone of the dictionary pen. Alternatively, for example, the user can also input the text to be recognized through a device (such as a Bluetooth keyboard, mobile phone, computer, etc.) that is connected to the dictionary pen, and the device sends the text to be recognized to the dictionary pen.

[0119] In a possible embodiment of the present application, the above step 230 includes the following method: the dictionary pen takes a sentence with meaning from a plurality of sentences as at least one sentence to be recognized.

[0120] Among them, any sentence to be recognized has at least one word, and one or more words in the at least one word can be found in a preset word library.

[0121] Exemplarily, the preset word library can be a word library of the dictionary pen itself. The dictionary pen searches for words in the preset word library itself to determine the meaningful sentences in the multiple clauses. It should be explained that the dictionary pen can update the preset word library in the dictionary pen when it is connected to the Internet.

[0122] Exemplarily, the preset word library can also be a word library stored in the cloud and accessible to the dictionary pen. When the dictionary pen is connected to the Internet, it searches for words in the preset word library in the cloud to determine the meaningful sentences in the multiple clauses.

[0123] Exemplarily, the preset word library may include dictionary libraries of dictionaries of various publishing houses.

[0124] As an example, when the dictionary pen determines whether "Sentence 6: A painter comes." is a meaningful sentence, it detects that sentence 6 has at least one word (A, painter, comes), and these words can be found in the preset vocabulary, then it is determined that sentence 6 has meaning.

[0125] As another example, when the dictionary pen determines whether "Sentence 5:!" is a meaningful sentence, if it detects that sentence 5 does not contain English words, it determines that sentence 5 is meaningless. In this way, the dictionary pen can determine the meaningful sentences to be recognized when there are multiple scans or omissions of punctuation marks when scanning the text to be recognized.

[0126] As another example, when the dictionary pen determines whether "Sentence 7: He confident that he cann mix the proper colour." is a meaningful sentence, it detects that there is at least one word in sentence 7, and other words except "cann" can be found in the preset vocabulary, then it is determined that sentence 7 is meaningful.

[0127] It should be explained that, when the dictionary pen determines that "Sentence 7: He confident that he cann mix theproper colour." is meaningful, it can correct the word "cann" according to the content of 7 before outputting the grammatical analysis result of sentence 7 to obtain the corrected sentence 7 "He confident that he can mix theproper colour.". As for how the dictionary pen corrects words, reference can be made to the prior art, which will not be elaborated here.

[0128] Through the above method, the dictionary pen can determine at least one meaningful sentence from multiple sentences, thereby avoiding the situation in the prior art where only preliminary splitting is performed and punctuation marks or words are scanned multiple times or missed.

[0129] In a possible embodiment of the present application, the above step 240 includes the following steps: the dictionary pen outputs the grammatical analysis result of any sentence to be recognized according to whether the sentence pattern of the sentence to be recognized is a simple sentence.

[0130] Among them, a simple sentence refers to a sentence in which sentence components are omitted. Sentence components include any of the following: subject, target verb, and object. Target verbs include predicate verbs and linking verbs.

[0131] It can be understood that a simple sentence may be a sentence in which a subject is omitted, a sentence in which a target verb is omitted, or a sentence in which an object is omitted.

[0132] For example, sentences such as "Enjoy your meal.", "Congratulations!", "Bless you!", etc. can be simple sentences with the subject omitted. For another example, sentences such as "He sings.", "You read.", "He sleeps.", "Clause 6: A painter comes.", etc. can be simple sentences with the object omitted. For another example, sentences such as "Maybe.", "Yes.", "Certainly.", "Clause 1: What a nice day!", etc. can be simple sentences with the target verb omitted.

[0133] It is understandable that before the dictionary pen outputs the grammatical analysis result of the sentence to be recognized, it also determines whether the sentence to be recognized is a simple sentence according to the sentence pattern of the sentence to be recognized. In other words, the dictionary pen can output the grammatical analysis result of the sentence to be recognized that is a simple sentence, and can also output the grammatical analysis result of the sentence to be recognized that is not a simple sentence. In this way, the grammatical analysis can be performed separately on the sentence to be recognized that is a simple sentence and the sentence to be recognized that is not a simple sentence, so as to improve the efficiency of the grammatical analysis.

[0134] In a possible embodiment of the present application, the first database stores sentences to be recognized, and the sentence pattern of the sentences to be recognized is a simple sentence.

[0135] The first database is used to store various types of simple sentences. For example, the first database stores simple sentences with omitted subjects, simple sentences with omitted target verbs, or simple sentences with omitted objects.

[0136] As an example, the first database may be stored in the dictionary pen. When the dictionary pen determines whether the sentence to be recognized is a simple sentence, it may search the first database in the dictionary pen.

[0137] As another example, the first database may be stored in the cloud. When the dictionary pen determines whether the sentence to be identified is a simple sentence when connected to the network, it may search the first database in the cloud.

[0138] It is understandable that the content of the simple sentences in the first database can be updated according to the needs of the user.

[0139] In this way, it is possible to quickly determine whether the sentence pattern of the sentence to be identified is a simple sentence. In other words, if any sentence to be identified is not stored in the first database, the sentence pattern of any sentence to be identified is not a simple sentence.

[0140] As an example, if there are non-simple sentences in the sentences contained in the first database, for example, if "I love the rose." is stored in the first database, the sentence in the first database is removed, and the updated first database does not contain "I love the rose.".

[0141] As another example, when a new simple sentence is detected and the first database does not contain the new simple sentence, for example, the new simple sentence is "Congratulations!", the simple sentence is added to the first database, and the updated first database contains "Congratulations!".

[0142] As another example, when it is detected that the simple sentence "Enjoys your meal." in the first database is incorrect, the simple sentence is modified to "Enjoy your meal.", and the updated first database includes the simple sentence "Enjoy your meal.".

[0143] Exemplarily, when the first database is stored in the cloud, the dictionary pen can obtain the updated first database through networking.

[0144] For example, when the first database is stored in the dictionary pen, the dictionary pen can obtain the updated first database through networking, and then store the updated first database independently in the dictionary pen. Alternatively, the dictionary pen can also merge the updated first database with the original first database, or replace the original first database with the updated first database.

[0145] As an example, in the above-mentioned clauses 1 to 4, and clauses 6 to 8, the first database stores “What a nice day!” and “Congratulations!”, and then clauses 1 and 8 are determined to be simple sentences.

[0146] As a possible implementation manner, the method provided in the embodiment of the present application also includes: if a sentence to be recognized is not stored in the first database, the dictionary pen determines that the sentence to be recognized is not a simple sentence.

[0147] For example, if the first database does not store the above-mentioned clauses 2 to 4, and clauses 6 to 7, the dictionary pen determines that the above-mentioned clauses 2 to 4, and clauses 6 to 7 are not simple sentences.

[0148] In a possible embodiment of the present application, the dictionary pen determines that the sentence structure of the sentence to be recognized is complete, including: the dictionary pen detects that the sentence to be recognized contains a target verb, a subject and / or an object, and then determines that the sentence structure of the sentence to be recognized is complete.

[0149] For example, the sentence structure in English generally includes: "subject + predicate + object", "subject + linking verb + predicate", "subject + intransitive verb".

[0150] It can be understood that when the sentence structure is "subject + predicate + object", the sentence contains a subject, a target verb and an object. When the sentence structure is "subject + copula + predicate", the sentence contains a subject and a target verb. When the sentence structure is "subject + intransitive verb", the sentence contains a subject and a target verb. In this way, it is possible to quickly and effectively determine whether the sentence structure of the sentence to be identified is complete by simply detecting the sentence components in the sentence to be identified.

[0151] For example, in clauses 2 to 4, and clauses 6 to 7 of the non-simple sentence above, the dictionary pen detects that "Clause 7: He confident that he cann mix the proper colour." does not contain the target verb, and determines that the sentence structure of clause 7 is incomplete.

[0152] In a possible embodiment of the present application, the dictionary pen outputs the grammatical analysis result of the sentence to be recognized according to whether the sentence pattern of the sentence to be recognized is a simple sentence, including: when the sentence pattern of the sentence to be recognized is not a simple sentence, the dictionary pen detects that the sentence structure of the sentence to be recognized is complete, and then outputs the grammatical analysis content of the sentence to be recognized as the grammatical analysis result of the sentence to be recognized. If the dictionary pen detects that the sentence structure of the sentence to be recognized is incomplete, then outputs the grammatical analysis content of the sentence to be recognized and the first information as the grammatical analysis result of the sentence to be recognized.

[0153] The first information is used to indicate that the sentence structure of the sentence to be identified is incomplete.

[0154] Exemplarily, the first information may reflect that the sentence structure of the clause to be identified may be incomplete, or may reflect the missing sentence components in the sentence structure of the clause to be identified, such as the incomplete sentence structure of clause 7 above, and the target verb (copula) "is" is missing in the sentence structure.

[0155] Exemplarily, the dictionary pen can output the first information through a display screen of the dictionary pen, and the first information is text information. Exemplarily, the dictionary pen can also output the first information through a speaker of the dictionary pen, and the first information is voice information. Exemplarily, the dictionary pen can also output the first information through a display screen or a speaker of a device external to the dictionary pen. In this way, the sentence structure of the to-be-recognized sentence pattern that is not a simple sentence can be further judged, and when it is detected that the sentence structure of the to-be-recognized sentence is incomplete, the first information is further output, thereby improving the reliability of the grammatical analysis result.

[0156] It is understandable that the dictionary pen can output a grammatical analysis result of a clause to be recognized with a complete sentence structure, or can output a grammatical analysis result of a clause to be recognized with an incomplete sentence structure.

[0157] It is understandable that when the dictionary pen detects that the sentence structure of the sentence to be recognized is complete, the sentence to be recognized is not a simple sentence.

[0158] Optionally, when the dictionary pen outputs the grammatical analysis results of a clause to be identified with an incomplete sentence structure, the dictionary pen may output the first information before outputting the grammatical analysis content, or may output the first information after outputting the grammatical analysis content, or may output the grammatical analysis content and the first information at the same time.

[0159] In a possible embodiment of the present application, after the above step 230, the method provided in the embodiment of the present application further includes: if the dictionary pen detects that any sentence to be recognized contains the first content, then any sentence to be recognized is processed, and any sentence to be recognized after processing does not contain the first content. Correspondingly, the above step 240 includes the following manner: the dictionary pen outputs the grammatical analysis results of any sentence to be recognized after processing and at least one sentence to be recognized that does not contain the first content.

[0160] The first content includes: text in a language other than the language corresponding to the analyzable grammatical content, and / or numbers.

[0161] For example, when the language corresponding to the analyzable grammatical content is English, the text in other languages ​​different from the sentence to be recognized may be Chinese, Japanese, etc.

[0162] For example, the numbers may be Arabic numerals, Roman numerals, etc.

[0163] Exemplarily, the dictionary pen processes the sentences to be recognized by deleting the first content in any sentence to be recognized or making the first content in the sentence to be recognized invisible. It is understandable that the processed sentences to be recognized contain text in the language corresponding to the analyzable grammatical content.

[0164] For example, the sentence to be recognized is: "I believe 1 believe the world will have a promising future." The dictionary pen detects that "1" and "believe" contained in the sentence to be recognized are the first content, so the sentence to be recognized is processed, and the processed sentence to be recognized is: "I believe the world will have a promising future.".

[0165] As an example, when the dictionary pen detects that any of at least one sentence to be recognized contains the first content, it can process these sentences to be recognized that contain the first content, so that these processed sentences to be recognized do not contain the first content. Then, the dictionary pen can output the grammatical analysis results of these processed sentences to be recognized. Of course, the dictionary pen can also output the grammatical analysis results of at least one sentence to be recognized that does not contain the first content. In this way, the dictionary pen can filter out the content related to the analyzable grammatical content in the sentence to be recognized, avoid the influence of the first content on the subsequent grammatical analysis, and thus improve the accuracy of the grammatical analysis.

[0166] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the interaction between various network elements. It can be understood that in order to realize the above functions, each device, such as an electronic device, includes a structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed in this document, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or in a computer software-driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0167] The embodiment of the present application can divide the functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0168] Combined with the above Figures 1 to 3, the method of the embodiment of the present application is explained, and the electronic device for executing the above method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the grammar analysis device provided by the embodiment of the present application can execute the steps executed by the electronic device in the above grammar analysis method.

[0169] In the case of integrated units, Figure 4 The grammatical analysis device involved in the above embodiment is shown. The grammatical analysis device can be an electronic device or a device applied in an electronic device, such as a chip or a processing circuit. The grammatical analysis device can include: an acquisition unit 410, a processing unit 420, a determination unit 430 and an output unit 440.

[0170] In an optional implementation, the syntax analysis device may further include a storage unit for storing program codes and data of the syntax analysis device.

[0171] In one example, the grammatical analysis device is an electronic device, or a chip used in an electronic device. Among them, the acquisition unit 410 is used to acquire the text to be recognized. The processing unit 420 is used to process the text to be recognized according to the punctuation marks included in the text to be recognized, so as to obtain multiple sentences of the text to be recognized, and each sentence has a first punctuation mark at the end of the sentence. The determination unit 430 is used to determine at least one sentence to be recognized from the multiple sentences, and at least one sentence to be recognized has analyzable grammatical content. The output unit 440 is used to output the grammatical analysis result of at least one sentence to be recognized.

[0172] In a possible implementation of the present application, the acquisition unit 410 is further configured to acquire an image containing text to be recognized.

[0173] In a possible implementation of the present application, the syntax analysis device provided in the embodiment of the present application further includes: a recognition unit. The recognition unit is used to recognize the image according to the image processing algorithm to extract the text to be recognized from the image.

[0174] In a possible implementation of the present application, the determination unit 430 is further configured to take a meaningful sentence from the multiple sentences as at least one sentence to be identified.

[0175] In a possible implementation of the present application, the output unit 440 is further configured to output a grammatical analysis result of any sentence to be identified according to whether the sentence pattern of the sentence to be identified is a simple sentence.

[0176] In a possible implementation of the present application, the output unit 440 is also used to detect that the sentence structure of the sentence to be recognized is complete when the sentence pattern of the sentence to be recognized is not a simple sentence, and then output the grammatical analysis content of the sentence to be recognized as the grammatical analysis result of the sentence to be recognized.

[0177] In a possible implementation of the present application, the output unit 440 is further configured to detect that the sentence structure of the sentence to be recognized is incomplete, and then output the grammatical analysis content of the sentence to be recognized and the first information as the grammatical analysis result of the sentence to be recognized.

[0178] In a possible implementation of the present application, the determination unit 430 is further configured to detect that the sentence to be identified contains a target verb, a subject and / or an object, and then determine that the sentence structure of the sentence to be identified is complete.

[0179] In a possible implementation of the present application, the processing unit 420 is further configured to detect that any sentence to be identified contains the first content, and then process any sentence to be identified, and any sentence to be identified after processing does not contain the first content.

[0180] In a possible implementation of the present application, the output unit 440 is further configured to output a grammatical analysis result of any processed sentence to be recognized and at least one sentence to be recognized that does not contain the first content.

[0181] The processing unit 430 may be a processor or a controller, such as a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present application. The processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The storage module may be a memory.

[0182] The memory is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor. The processor is used to execute the computer-executable instructions stored in the memory, thereby realizing a syntax analysis method provided in the following embodiment of the present application.

[0183] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.

[0184] In one aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed, the following is implemented: Figure 2 Functions performed by the electronic device 100.

[0185] In one aspect, a computer program product is provided, wherein the computer program product includes instructions, and when the instructions are executed, the following are implemented: Figure 2 Functions performed by the electronic device 100.

[0186] On the one hand, an embodiment of the present application provides a chip, which is applied to an electronic device 100, and the chip includes at least one processor, which is used to run instructions to implement the following Figure 2 Functions performed by the electronic device 100.

[0187] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by 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 programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD).

[0188] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in a claim. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0189] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A syntax analysis method, characterized in that: include: Get the text to be recognized; Processing the text to be recognized according to the punctuation marks included in the text to be recognized to obtain a plurality of sentences of the text to be recognized, each of the sentences having a first punctuation mark at the end; Determining at least one sentence to be identified from the plurality of sentences, wherein at least one sentence to be identified has analyzable grammatical content; Outputting a grammatical analysis result of at least one of the sentences to be recognized.

2. The method according to claim 1, characterized in that The step of obtaining the text to be recognized includes: Acquire an image containing the text to be recognized; The image is recognized according to an image processing algorithm to extract the text to be recognized from the image.

3. The method according to claim 1, characterized in that The step of determining at least one sentence to be identified from the plurality of sentences comprises: A sentence with meaning among the plurality of the clauses is taken as at least one of the clauses to be recognized, any of the clauses to be recognized has at least one word, and one or more of the at least one word can be found in a preset word library.

4. The method according to claim 1, characterized in that: The outputting of the grammatical analysis result of at least one of the sentences to be identified comprises: For any of the sentences to be identified, the grammatical analysis result of the sentence to be identified is output according to whether the sentence pattern of the sentence to be identified is a simple sentence. The simple sentence refers to a sentence with omitted sentence components, and the sentence components include any of the following subjects, target verbs and objects.

5. The method according to claim 4, characterized in that The sentence to be recognized is stored in the first database, and the sentence pattern of the sentence to be recognized is the simple sentence.

6. The method according to claim 4 or 5, characterized in that: The step of outputting the grammatical analysis result of the sentence to be identified according to whether the sentence pattern of the sentence to be identified is a simple sentence comprises: In the case that the sentence pattern of the clause to be identified is not the simple sentence, if it is detected that the sentence structure of the clause to be identified is complete, the grammatical analysis content of the clause to be identified is used as the grammatical analysis result of the clause to be identified and outputted; If it is detected that the sentence structure of the sentence to be recognized is incomplete, the grammatical analysis content of the sentence to be recognized and the first information are output as the grammatical analysis result of the sentence to be recognized, and the first information is used to prompt that the sentence structure of the sentence to be recognized is incomplete.

7. The method according to claim 6, characterized in that Determining that the sentence structure of the sentence to be identified is complete includes: If it is detected that the sentence to be recognized contains the target verb, the subject and / or the object, it is determined that the sentence structure of the sentence to be recognized is complete.

8. The method according to any one of claims 1 to 5, characterized in that: After determining at least one sentence to be identified from the plurality of sentences, the method further includes: If it is detected that any of the sentences to be identified contains a first content, any of the sentences to be identified is processed, and any of the sentences to be identified after processing does not contain the first content, and the first content includes: text in a language other than the language corresponding to the analyzable grammatical content, and / or numbers; The outputting of the grammatical analysis result of at least one of the sentences to be identified comprises: Outputting the processed grammatical analysis results of any of the to-be-recognized sentences and at least one of the to-be-recognized sentences that does not contain the first content.

9. A grammar analysis device, characterized in that: include: An acquisition unit, used for acquiring the text to be recognized; A processing unit, configured to process the text to be recognized according to the punctuation marks included in the text to be recognized, so as to obtain a plurality of sentences of the text to be recognized, each of which has a first punctuation mark at the end of the sentence; A determination unit, configured to determine at least one sentence to be identified from the plurality of sentences, wherein at least one sentence to be identified has analyzable grammatical content; An output unit is used to output a grammatical analysis result of at least one of the sentences to be recognized.

10. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 8 when executing the computer program.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and system for generating audio and video subtitles

    CN105704538A

  • Method and device for generating information

    CN110807311A

  • Text query method and device

    CN111597324A

  • Text sentiment recognition method and device, storage medium and computer equipment

    CN111931481A

  • Method for segmentation of text

    US6810375B1