A syntax analysis method, device, apparatus and storage medium

By using punctuation marks for preliminary processing and further analysis in the dictionary pen, clauses with analyzable grammatical content are identified, thus solving the problem of inaccurate grammatical analysis in the dictionary pen and improving the accuracy of the analysis results.

CN119721017BActive Publication Date: 2025-12-16GUANGDONG XIAOTIANCAI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing dictionary pens produce inaccurate results during grammatical analysis due to overscanning or underscanning of punctuation marks or words.

Method used

By acquiring the text to be identified, preliminary processing is performed using punctuation marks to determine the sentences with analyzable grammatical content, and further processing is carried out to improve the accuracy of sentence segmentation, and the grammatical analysis results are output.

Benefits of technology

It improves the accuracy of grammatical analysis, avoids overscanning or underscanning of punctuation marks or words, and enhances the reliability of analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721017B_ABST
    Figure CN119721017B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a syntax analysis method, device and equipment and a storage medium, relating to the technical field of intelligent learning. The method comprises: obtaining a text to be recognized. The text to be recognized is processed according to punctuation marks included in the text to be recognized, to obtain a plurality of sentences of the text to be recognized, each of which has a first punctuation mark at the end. At least one sentence to be recognized is determined from the plurality of sentences, and the at least one sentence to be recognized has analyzable syntax content. A syntax analysis result of the at least one sentence to be recognized is output. The method is used to improve the accuracy of syntax analysis.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent learning, and in particular, to a grammar analysis method and device, equipment and a storage medium. BACKGROUND

[0002] A dictionary pen is a combination of an electronic dictionary and a device with scanning function. A user can scan the content on a book by using the dictionary pen, extract the to-be-recognized text according to the recognition technology in the dictionary pen, and perform grammar analysis on the content of the to-be-recognized text. In general, the dictionary pen scans a paragraph of text on a book, and thus the extracted to-be-recognized text has multiple sentences. When the dictionary pen performs grammar analysis on the content in the to-be-recognized text, the to-be-recognized text needs to be split into multiple sentences, and then grammar analysis is performed on each sentence.

[0003] In the prior art, the dictionary pen only splits according to the punctuation marks in the to-be-recognized text. However, this method may have multiple scanning or missed scanning of the punctuation marks or words in the sentence, which affects the accuracy of the grammar analysis result of the dictionary pen. SUMMARY

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

[0005] In a first aspect, the embodiments of the present application provide a grammar analysis method, which includes: obtaining to-be-recognized text. Processing the to-be-recognized text according to the punctuation marks included in the to-be-recognized text to obtain multiple sentences of the to-be-recognized text, and each sentence end has a first punctuation mark. Determining at least one to-be-recognized sentence from the multiple sentences, and the at least one to-be-recognized sentence has analyzable grammar content. Outputting the grammar analysis result of the at least one to-be-recognized sentence.

[0006] The embodiments of the present application provide a grammar analysis method. After obtaining the to-be-recognized text, the multiple sentences of the to-be-recognized text are obtained according to the punctuation marks included in the to-be-recognized text, so that the to-be-recognized text can be preliminarily processed according to the punctuation marks. After obtaining the multiple sentences, the multiple sentences are further processed to obtain at least one to-be-recognized sentence with analyzable grammar content, so that the to-be-recognized text can be more accurately split. Then, the to-be-recognized sentence with analyzable grammar content is extracted from the multiple sentences, and the grammar analysis result is output according to the at least one to-be-recognized sentence. This scheme can avoid the multiple scanning or missed scanning of the punctuation marks or words in the sentence in the prior art, and thus can improve the accuracy of grammar analysis.

[0007] In a possible implementation of the present application, the obtaining of the text to be recognized includes: obtaining an image containing the text to be recognized. The image is recognized according to an image processing algorithm, so as to extract the text to be recognized from the image. The accuracy and speed of obtaining the text to be recognized can be improved, and a lot of time and labor cost of the user can be saved.

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

[0009] In a possible implementation of the present application, the obtaining of the image containing the text to be recognized includes: collecting, by an image sensor in the electronic device, an image when the user scans a region to be recognized by using the electronic device.

[0010] In a possible implementation of the present application, the determining of the at least one sentence to be recognized from the multiple sentences includes: taking a meaningful sentence in the multiple sentences as the 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 meaningful sentence can be determined from the multiple sentences, so as to avoid the situation of missing scanning of punctuation marks or words caused by only preliminary splitting in the prior art.

[0011] In a possible implementation of the present application, the outputting of the syntax analysis result of the at least one sentence to be recognized includes: for any sentence to be recognized, outputting the syntax analysis result of the sentence to be recognized according to whether a sentence pattern of the sentence to be recognized is a simple sentence, the simple sentence refers to a sentence in which a sentence component is omitted, and the sentence component includes any one of a subject, a target verb and an object. In this way, the syntax analysis can be performed on the sentence to be recognized with the simple sentence pattern and the sentence to be recognized with the non-simple sentence pattern, so as to improve the efficiency of the syntax analysis.

[0012] In a possible implementation of the present application, the sentence to be recognized is stored in the first database, and the sentence pattern of the sentence to be recognized is a simple sentence. In this way, whether the sentence pattern of the sentence to be recognized is a simple sentence can be quickly determined. In other words, if no sentence to be recognized is stored in the first database, the sentence pattern of any sentence to be recognized is not a simple sentence.

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

[0014] In a possible implementation manner of the present application, the determination of the complete sentence structure of the to-be-identified sentence includes: if it is detected that the to-be-identified sentence has a target verb, and a subject and / or an object, it is determined that the sentence structure of the to-be-identified sentence is complete. In this way, whether the sentence structure of the to-be-identified sentence is complete can be quickly and effectively determined through a simple way of detecting the sentence components in the to-be-identified sentence.

[0015] In a possible implementation manner of the present application, after the at least one to-be-identified sentence is determined from the plurality of sentences, the method further includes: if it is detected that any to-be-identified sentence contains first content, processing any to-be-identified sentence, and the processed any to-be-identified sentence does not contain the first content, and the first content includes: characters of other languages than the language corresponding to the analyzable syntax content, and / or numbers. The syntax analysis result of the at least one to-be-identified sentence is output, including: outputting the syntax analysis result of the processed any to-be-identified sentence and the to-be-identified sentence which does not contain the first content among the at least one to-be-identified sentence. In this way, the content related to the analyzable syntax content in the to-be-identified sentence can be screened out, and the subsequent syntax analysis is avoided due to the first content, thereby improving the accuracy of the syntax analysis.

[0016] In a possible implementation manner of the present application, the syntax analysis result of the to-be-identified sentence is output according to whether the sentence pattern of the to-be-identified sentence is a simple sentence, including: in the case that the sentence pattern of the to-be-identified sentence is not a simple sentence, if it is detected that the sentence structure of the to-be-identified sentence is complete, the syntax analysis content of the to-be-identified sentence is taken as the syntax analysis result of the to-be-identified sentence and is output. If it is detected that the sentence structure of the to-be-identified sentence is not complete, the syntax analysis content of the to-be-identified sentence and the first information are taken as the syntax analysis result of the to-be-identified sentence and are output, and the first information is used to prompt that the sentence structure of the to-be-identified sentence is not complete. In this way, the sentence structure of the to-be-identified sentence which is not a simple sentence can be further judged, and in the case that it is detected that the sentence structure of the to-be-identified sentence is not complete, the first information is also output, thereby improving the reliability of the syntax analysis result.

[0017] As an example, the embodiment of the present application provides a syntax analysis device, which is an electronic device or a chip applied to the electronic device, and the syntax analysis device comprises: an acquisition unit configured to acquire a text to be recognized; a processing unit configured to process the text to be recognized according to punctuation included in the text to be recognized, so as to obtain a plurality of sentences of the text to be recognized, and each of the sentences has a first punctuation at a tail of the sentence; a determination unit configured to determine at least one to-be-recognized sentence from the plurality of sentences, and the at least one to-be-recognized sentence has analyzable syntax content; and an output unit configured to output a syntax analysis result of the at least one to-be-recognized sentence.

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

[0019] In a possible implementation of the present application, the syntax analysis device provided by the embodiment of the present application further comprises an identification unit, which is configured to identify the image according to an image processing algorithm, so as 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 determine a meaningful sentence in the plurality of sentences as the at least one to-be-recognized sentence.

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

[0022] In a possible implementation of the present application, the output unit is further configured to, in a case where the sentence pattern of the to-be-recognized sentence is not the simple sentence, detect that a sentence structure of the to-be-recognized sentence is complete, and output syntax analysis content of the to-be-recognized sentence as the syntax analysis result of the to-be-recognized sentence.

[0023] In a possible implementation of the present application, the output unit is further configured to, in a case where the sentence pattern of the to-be-recognized sentence is not the simple sentence, detect that a sentence structure of the to-be-recognized sentence is not complete, and output the syntax analysis content of the to-be-recognized sentence and first information as the syntax analysis result of the to-be-recognized sentence.

[0024] In a possible implementation of the present application, the determination unit is further configured to, in a case where the to-be-recognized sentence has a target verb and a subject and / or an object, detect that the sentence structure of the to-be-recognized sentence is complete.

[0025] In a possible implementation of the present application, the processing unit is further configured to, in a case where any to-be-recognized sentence contains first content, process the any to-be-recognized sentence, and the any to-be-recognized sentence after the processing does not contain the first content.

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

[0027] In a third aspect, the embodiments of the present application provide a computer readable storage medium, which stores a computer program or instructions, and when the computer program or instructions run on a computer, the computer is caused to perform the syntax analysis method described in any one of the possible implementation manners of the first aspect.

[0028] In a fourth aspect, the embodiments of the present application provide a computer program product including instructions, and when the instructions run on a computer, the computer is caused to perform the syntax analysis method described in the first aspect or the possible implementation manners of the first aspect.

[0029] In a fifth aspect, the embodiments of the present application provide a syntax analysis apparatus for implementing the methods in the first aspect or any one of the possible implementation manners of the first aspect. The syntax analysis apparatus can be the electronic device, or a device including the electronic device, or a component (for example, a chip) applied to the electronic device.

[0030] The syntax analysis apparatus described in the fifth aspect includes modules or units corresponding to the above-mentioned methods, and the modules or units 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-mentioned functions.

[0031] In a sixth aspect, the embodiments of the present application provide a syntax analysis apparatus, which includes at least one processor and a communication interface. When the syntax analysis apparatus runs, the processor executes computer program or instructions stored in the syntax analysis apparatus, so that the syntax analysis apparatus performs any one of the methods in the first aspect or any one of the possible implementation manners of the first aspect. For example, the syntax analysis apparatus can be an electronic device, or a component applied to the electronic device.

[0032] It should be understood that the communication apparatus described in the sixth aspect can further include a bus and a memory for storing codes and data. Optionally, the at least one processor, the communication interface and the memory are coupled to each other.

[0033] In a seventh aspect, the embodiments of the present application provide a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is configured to run a computer program or instructions to implement the syntax analysis method described in the first aspect or the possible implementation manners of the first aspect. The communication interface is configured to communicate with other modules outside the chip. BRIEF DESCRIPTION OF DRAWINGS

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

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

[0036] Figure 3 A syntax analysis result schematic diagram provided by an embodiment of the present application;

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

[0038] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

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

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

[0041] It should be further understood that the term “and / or” used in the present application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0042] A dictionary pen is a combination of an electronic dictionary and a device with a scanning function. A user can scan the content on a book by using the dictionary pen, extract the to-be-recognized text according to the recognition technology in the dictionary pen, and perform syntax analysis on the content of the to-be-recognized text. In general, the dictionary pen scans a paragraph of text on a book, and therefore the extracted to-be-recognized text has multiple sentences. When the dictionary pen performs syntax analysis on the content in the to-be-recognized text, the to-be-recognized text needs to be split into multiple sentences, and then syntax analysis is performed on each sentence.

[0043] In the prior art, the dictionary pen only splits according to the punctuation marks in the text to be recognized. However, such a method may have the problem of multiple scanning or missing scanning of punctuation marks or words in a sentence. For example, the dictionary pen scans a question mark in a book multiple times, which affects the accuracy of the grammar analysis result of the dictionary pen.

[0044] Therefore, the embodiment of the present application provides a grammar analysis method, device, equipment and storage medium, which is used to improve the accuracy of grammar analysis.

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

[0046] Optionally, as shown in Figure 1 , the electronic device 100 provided by the embodiment of the present application includes a processor 101, a communication line 102, at least one communication interface (for example, a communication interface 103 is exemplified in the embodiment) and a storage 105. Figure 1 Figure 1 The processor 101 can be a general central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs of the present application.

[0047] The communication line 102 can include a path for transmitting information between the above-mentioned components.

[0048] The communication interface 103 is used for information interaction with other devices, for example, using any transceiver device, which is used for communication with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN) and the like.

[0049] Optionally, the electronic device can also include a storage 105.

[0050]

[0051] ​​The memory 104 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or it may be an electrically erasable programmable read-only memory (EEPROM), a compact disc-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. The memory 104 may exist independently and be connected to the processor 101 via communication line 102. The memory 104 may also be integrated with the processor 101.

[0052] The memory 104 stores computer execution instructions for implementing the scheme of this application, and its execution is controlled by the processor 101. The processor 101 executes the computer execution instructions stored in the memory 104, thereby implementing a syntax analysis method provided in the following embodiments of this application.

[0053] Optionally, the computer execution instructions in the embodiments of this application may also be referred to as application code, and the embodiments of this application do not specifically limit this.

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

[0055] In a specific implementation, as one example, an electronic device may include multiple processors, for example... Figure 1 Processors 101 and 105 are included. Each of these processors may be a single-core (Single-CPU) processor or a multi-core (Multi-CPU) processor. A processor here may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).

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

[0057] The scanning device 106 is used by the electronic device to acquire 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 have an image sensor and a processing device. The image sensor is used to scan the text in a preset area, and the processing device is used to extract the text in the preset area to obtain the text to be recognized.

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

[0060] The display device 107 is used by the electronic device to output display information, such as the syntax analysis results and / or first information in the embodiments of this application.

[0061] Optionally, the electronic device may also include a sound-generating device 108.

[0062] The sound-generating device 108 is used for electronic devices to output sound information, such as the grammar analysis results and / or first information in the embodiments of this application.

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

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

[0065] This embodiment will be described below using a syntax analysis method applied to a dictionary pen as an example.

[0066] This application's embodiments are explained using English text as the text to be identified.

[0067] like Figure 2 As shown, Figure 2 This illustration shows a flowchart of a syntax analysis method provided in an embodiment of this application. The method includes:

[0068] Step 210, the dictionary pen acquires the text to be recognized.

[0069] It can be understood that the dictionary pen has a text scanning function.

[0070] For example, the dictionary pen can scan the content of a preset area through the scanning device of the dictionary pen, 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 on 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 can mix the proper colour. Congratulations!

[0072] It needs to be explained that when the scanning pen extracts the text to be recognized, there can be a case of multiple scanning and missing scanning of the dictionary pen, such as the above-mentioned text to be recognized, which has an extra "!".

[0073] It needs to be explained that the text to be recognized acquired by the dictionary pen can be printed text or handwritten text, and the embodiments of the present application do not limit this.

[0074] The text to be recognized in the present application can be the content scanned and recognized by the dictionary pen 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 downloaded from a webpage by the dictionary pen. 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 included in the text to be recognized, to obtain multiple sentences of the text to be recognized.

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

[0077] Exemplarily, the punctuation marks can include a period ("."), a question mark ("?"), an exclamation mark ("!"), a comma (","), a colon (":"), a semicolon (";"), a dash ("-"), a hyphen ("-"), a dash ("—"), a parenthesis (such as a small parenthesis "()", a middle bracket "[]", a big bracket "{}"), a quotation mark (such as a double quotation mark " or a single quotation mark '), an abbreviation, and an apostrophe ("'s"), etc.

[0078] In the above, each of the sub-sentences has a first punctuation mark at the end of the sub-sentence. It can be understood that the first punctuation mark is used to indicate the end of a sub-sentence and distinguish from the next sub-sentence, such as a period at the end of a sentence.

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

[0080] It can be understood that when the pen detects other punctuation marks (such as ",") in the text to be recognized, the pen does not perform the sentence splitting on the text to be recognized.

[0081] As an example, the dictionary pen, when processing the to-be-recognized text, detects a first punctuation symbol in the to-be-recognized text, and splits the to-be-recognized text into sentences at the first punctuation symbol as a split point and as the end of a previous sentence. Correspondingly, when detecting other punctuation symbols in the to-be-recognized text, the dictionary pen does not split the to-be-recognized text into sentences at the punctuation symbols. For example, the to-be-recognized text 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 can mix the proper colour. Congratulations! The dictionary pen splits the to-be-recognized text into the following sentences according to the punctuation symbols included in the to-be-recognized text, and splits the to-be-recognized text into sentences at the first punctuation symbol in the to-be-recognized text as a split point and as the end of a previous sentence.

[0082] Sentence 1: What a nice day!

[0083] Sentence 2: 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.

[0084] Sentence 3: Several painters try to mix the colour right.

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

[0086] Sentence 5:!

[0087] Sentence 6: A painter comes.

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

[0089] Sentence 8: Congratulations!

[0090] It can be understood that, when scanning the to-be-recognized text, the dictionary pen can have multiple scanning (such as sentence 5) or missing scanning (such as sentence 7) of punctuation marks.

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

[0092] The at least one to-be-recognized sentence has analyzable grammatical content.

[0093] For example, the to-be-recognized sentence has analyzable grammatical content can be that the to-be-recognized sentence is a meaningful sentence; or the to-be-recognized sentence has main sentence components; or the to-be-recognized sentence has a tense (present tense, future tense). For example, the main sentence components can be any one or more of a subject, a predicate, or a target verb.

[0094] For example, the dictionary pen can determine that the to-be-recognized sentence is a meaningful sentence by detecting that a word in the to-be-recognized sentence can be found in a preset word library or in the cloud. How the dictionary pen determines that the to-be-recognized sentence is a meaningful sentence can be referred to the following embodiments, which will not be described here.

[0095] For example, sentence 6 has a subject and a target verb, so sentence 6 can be a to-be-recognized sentence.

[0096] For another example, “A”, “painter” and “comes” in sentence 6 can be found in a preset word library, so sentence 6 can be a to-be-recognized sentence.

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

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

[0099] For example, the syntax analysis result of the to-be-identified sentence can include: syntax analysis of the to-be-identified sentence, syntax analysis of each word in the to-be-identified sentence, and key words, etc. The syntax analysis of the to-be-identified sentence includes: sentence components (such as subject, linking verb, located, object, clause, etc.), sentence type (interrogative sentence, declarative sentence, etc.), sentence tense (general present tense, general future tense, present progressive tense, etc.), sentence voice (active sentence, passive sentence). The syntax analysis result of each word can be the meaning of the word, antonyms, synonyms, etc.

[0100] For example, as shown in the syntax analysis of the above sentence 3: first, the dictionary pen judges the sentence components in sentence 3, such as "Several painters" as the subject, "try to" as the predicate, and "to mix the color right" as the object. Second, the dictionary pen judges that the sentence type of sentence 3 is a declarative sentence, the tense is general present tense, and the voice is active. Third, the dictionary pen analyzes the syntax structure of sentence 3, such as "Several" is an adjective and is the attributive of "painters"; "painters" is a plural noun; "try" is a verb; "to mix the color right" is a verb infinitive as the object of sentence 3. Fourth, the dictionary pen lists the key words in sentence 3, such as the key words are "Several", "try", and "mix". Figure 3

[0101] It should be explained that, Figure 3 The above is an example description of the syntax analysis result in the embodiments of the present application, and is not limited.

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

[0103] Optionally, the dictionary pen can also output the syntax analysis result of at least one to-be-identified sentence through the display screen or the speaker of an external device. The external device can be a mobile phone, a computer, or an electronic book, and the embodiments of the present application do not make specific limitations. Optionally, the dictionary pen and the external device can be connected in a wired communication manner through a data line, or can be connected in a wireless communication manner through Bluetooth, Wi-Fi, etc.

[0104] ​The embodiment of the present application provides a syntax analysis method, after obtaining the to-be-recognized text, multiple sentences of the to-be-recognized text are obtained according to punctuation included in the to-be-recognized text, so that the to-be-recognized text can be preliminarily processed according to the punctuation. After the multiple sentences are obtained, the multiple sentences are further processed to obtain at least one to-be-recognized sentence with analyzable syntax content, so that the to-be-recognized text can be more accurately divided into sentences, then the to-be-recognized sentence with analyzable syntax content is extracted from the multiple sentences, and a syntax analysis result is output according to the at least one to-be-recognized sentence, which can avoid the multiple scanning or missing scanning of punctuation or words in a sentence in the prior art, and therefore the accuracy of syntax analysis can be improved.

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

[0106] The unrecognizable sentence does not have analyzable syntax content. For example, the "sentence 5:!" is an unrecognizable sentence.

[0107] The second information is used to reflect the sentence without analyzable syntax content.

[0108] For example, in the case that the "sentence 5:!" is an unrecognizable sentence, the dictionary pen outputs the second information of the "sentence 5:!", which can be used to prompt that the "sentence 5:!" does not have analyzable syntax content.

[0109] Optionally, the second information is also used to prompt the reason why the unrecognizable sentence does not have analyzable syntax content. For example, the dictionary pen obtains the "sentence 5:!" when processing the to-be-recognized text due to the multiple scanning when obtaining the to-be-recognized text.

[0110] As a possible implementation manner, the method provided by the embodiment of the present application further includes: when each sentence in 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 to-be-recognized text does not have analyzable syntax content.

[0112] Optionally, the third information is also used to prompt the reason why each sentence in the to-be-recognized text does not have analyzable syntax content. For example, a preset area does not support scanning (for example, the preset area is not smooth, etc.). For example, whether the scanning device of the dictionary pen is malfunctioning, resulting in a serious multiple scanning or missing scanning of the content of the to-be-recognized text.

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

[0114] For example, the dictionary pen has a scanning device, which can include an image sensor and a processing device. For example, the image sensor sends the acquired content to the processing device in the scanning device. Of course, for example, the scanning device in the dictionary pen can also include an image sensor, which sends the acquired content to other processors in the dictionary pen. The embodiments of the present application do not limit this.

[0115] For example, the dictionary pen scans the content of the preset area through the image sensor in response to the operation of the user, and sends the acquired image to the processing device or other processors in the scanning device. The processing device or other processors extract the text to be recognized from the image according to an image processing algorithm. Extracting the text to be recognized from the image can improve the accuracy and speed of acquiring the text to be recognized, and can save a lot of time and labor cost for the user.

[0116] For example, the image processing algorithm can be an OCR (optical character recognition) algorithm. For how the dictionary pen extracts the text to be recognized, please refer to the prior art, which will not be described here.

[0117] For example, the dictionary pen detects that the user inputs the text to be recognized, and acquires the text to be recognized.

[0118] For example, the user can input the text to be recognized through the microphone of the dictionary pen. Or, for example, the user can also input the text to be recognized through a device (such as a Bluetooth keyboard, a mobile phone, a computer, etc.) in communication connection with the dictionary pen, and the device sends the text to be recognized to the dictionary pen.

[0119] In a possible implementation of the present application, the step 230 comprises the following manner: the dictionary pen takes the sentences with meaning in the multiple sentences as the at least one recognized sentence.

[0120] Any of the recognized sentences has at least one word, and one or more words in the at least one word can be found in the preset word library.

[0121] For example, the preset word library can be the word library possessed by the dictionary pen itself. The dictionary pen finds the words in the preset word library possessed by itself to determine the sentences with meaning in the multiple sentences. It should be explained that the dictionary pen can update the preset word library in the dictionary pen when networking.

[0122] For example, the preset dictionary can also be a cloud-stored dictionary accessible to the dictionary pen. When connected to the internet, the dictionary pen identifies meaningful sentences within multiple clauses by searching for words in the preset dictionary in the cloud.

[0123] For example, the preset thesaurus can contain dictionaries from various publishers.

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

[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 any English words, it determines that sentence 5 is meaningless. In this way, the dictionary pen can identify meaningful sentences even when there are multiple scans or missed scans of punctuation marks during the scanning of 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, if it detects that sentence 7 contains at least one word and that the other words besides "cann" can be found in the preset dictionary, then sentence 7 is determined to be meaningful.

[0127] It should be explained that, when the dictionary pen determines that clause 7: "He confident that he can't mix the proper colour." is meaningful, it can correct the word "cann" based on the content of clause 7 before outputting the grammatical analysis result, thus obtaining the corrected clause 7: "He confident that he can mix the proper colour." How the dictionary pen corrects words can be found in existing technologies, which will not be elaborated here.

[0128] In this way, the dictionary pen can identify at least one meaningful sentence from multiple clauses, thereby avoiding the situation of multiple scanning or omission of punctuation marks or words caused by only performing preliminary segmentation in the existing technology.

[0129] In a possible implementation of the present application, the step 240 comprises the following step: the dictionary pen outputs the syntax analysis result of the to-be-identified sentence according to whether the sentence pattern of the to-be-identified sentence is a simple sentence.

[0130] The simple sentence refers to a sentence with omitted sentence components. The sentence components include any of the following: subject, target verb, and object. The target verb includes a predicate verb and a copula.

[0131] It can be understood that the simple sentence can be a sentence with omitted subject, or a sentence with omitted target verb, or a sentence with omitted object.

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

[0133] It can be understood that the dictionary pen further determines whether the to-be-identified sentence is a simple sentence according to the sentence pattern of the to-be-identified sentence before outputting the syntax analysis result of the to-be-identified sentence. In other words, the dictionary pen can output the syntax analysis result of the to-be-identified sentence that is a simple sentence, or output the syntax analysis result of the to-be-identified sentence that is not a simple sentence. In this way, the to-be-identified sentence with simple sentence pattern and the to-be-identified sentence with non-simple sentence pattern can be analyzed separately, so as to improve the efficiency of syntax analysis.

[0134] In a possible implementation of the present application, the to-be-identified sentence is stored in the first database, and the sentence pattern of the to-be-identified sentence 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 subject, simple sentences with omitted target verb, or simple sentences with omitted object.

[0136] As an example, the first database can be stored in the dictionary pen. When determining whether the to-be-identified sentence is a simple sentence, the dictionary pen can search in the first database in the dictionary pen.

[0137] As another example, the first database can be stored in the cloud. When determining whether the to-be-identified sentence is a simple sentence in a networked manner, the dictionary pen can search in the first database in the cloud.

[0138] It can be understood that the content of the simple sentence in the first database can be updated according to the requirement of the user.

[0139] In this way, it can be quickly determined whether the sentence type of the to-be-identified sentence is a simple sentence. In other words, if the first database does not store any to-be-identified sentence, the sentence type of the to-be-identified sentence is not a simple sentence.

[0140] As an example, if the first database contains a non-simple sentence, for example, the first database stores "I love the rose.", the first database removes the sentence, and the updated first database does not contain "I love the rose.".

[0141] As another example, if 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, if 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 contains the simple sentence "Enjoy your meal.".

[0143] For example, if the first database is stored in the cloud, the dictionary pen can obtain the updated first database through networking.

[0144] For example, if 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 sentence 1 to sentence 4, and sentence 6 to sentence 8, the first database stores "What a nice day!" and "Congratulations!", and it is determined that sentence 1 and sentence 8 are simple sentences.

[0146] As a possible implementation, the method provided by the embodiment of the present application further includes: if the first database does not store a certain to-be-identified sentence, the dictionary pen determines that the to-be-identified sentence is not a simple sentence.

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

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

[0149] For example, the sentence structure in English generally includes: "subject + predicate + object", "subject + copula + predicate", and "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, the completeness of the sentence structure of the to-be-recognized sentence can be quickly and effectively determined by a simple way of detecting the sentence components in the to-be-recognized sentence.

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

[0152] In a possible embodiment of the present application, the dictionary pen outputs the grammar analysis result of the to-be-recognized sentence according to whether the sentence pattern of the to-be-recognized sentence is a simple sentence, comprising: in the case that the sentence pattern of the to-be-recognized sentence is not a simple sentence, the dictionary pen detects that the sentence structure of the to-be-recognized sentence is complete, and then outputs the grammar analysis content of the to-be-recognized sentence as the grammar analysis result of the to-be-recognized sentence. The dictionary pen detects that the sentence structure of the to-be-recognized sentence is not complete, and then outputs the grammar analysis content of the to-be-recognized sentence and the first information as the grammar analysis result of the to-be-recognized sentence.

[0153] The first information is used to prompt that the sentence structure of the to-be-recognized sentence is not complete.

[0154] For example, the first information can reflect that the sentence structure of the to-be-recognized sentence can not be complete, or can reflect the missing sentence components in the sentence structure of the to-be-recognized sentence, such as the above-mentioned incomplete sentence structure of the sentence 7, and the missing target verb (copula) "is".

[0155] The exemplary dictionary pen can output the first information through a display screen of the dictionary pen, and the first information is text information. The exemplary dictionary pen can also output the first information through a loudspeaker of the dictionary pen, and the first information is voice information. The exemplary dictionary pen can also output the first information through a display screen or a loudspeaker of an external device of the dictionary pen. In this way, the sentence structure of the to-be-recognized sentence can be further determined, and the first information can be output when the sentence structure of the to-be-recognized sentence is incomplete, so as to improve the reliability of the grammar analysis result.

[0156] It can be understood that the dictionary pen can output the grammar analysis result of the to-be-recognized sentence with complete sentence structure, or output the grammar analysis result of the to-be-recognized sentence with incomplete sentence structure.

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

[0158] Optionally, when the dictionary pen outputs the grammar analysis result of the to-be-recognized sentence with incomplete sentence structure, the dictionary pen can output the first information before outputting the grammar analysis content, or output the first information after outputting the grammar analysis content, or output the grammar analysis content and the first information at the same time.

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

[0160] The first content includes: text of a language different from the language corresponding to the analyzable grammar content, and / or a number.

[0161] For example, when the language corresponding to the analyzable grammar content is English, the text of the language different from the to-be-recognized sentence can be Chinese, Japanese, etc.

[0162] For example, the number can be an Arabic number, a Roman number, etc.

[0163] For example, the dictionary pen can process the to-be-recognized sentence by deleting the first content in any to-be-recognized sentence, or make the first content in the to-be-recognized sentence invisible. It can be understood that the processed to-be-recognized sentence contains text of the language corresponding to the analyzable grammar content.

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

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

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

[0167] The embodiments of the present application can divide the functional units according to the above method examples. 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 integrated unit can be realized in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical functional division. When actually implemented, there can be another division manner.

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

[0169] In the case of using the integrated unit, Figure 4 The syntax analysis device involved in the above embodiments can be an electronic device or a device applied in the electronic device, such as a chip or a processing circuit. The syntax 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 can further include a storage unit for storing program codes and data of the syntax analysis device.

[0171] In an example, the syntax analysis device is an electronic device or a chip applied in the electronic device. The acquisition unit 410 is configured to acquire a text to be recognized. The processing unit 420 is configured to process the text to be recognized according to punctuation marks included in the text to be recognized, to obtain a plurality of sentences of the text to be recognized, and each of the sentences has a first punctuation mark at a tail of the sentence. The determination unit 430 is configured to determine at least one to-be-recognized sentence from the plurality of sentences, and the at least one to-be-recognized sentence has analyzable syntax content. The output unit 440 is configured to output a syntax analysis result of the at least one to-be-recognized sentence.

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

[0173] In a possible implementation of the present application, the syntax analysis device provided by the embodiments of the present application further includes an identification unit. The identification unit is configured to identify the image according to an 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 determine a meaningful sentence in the plurality of sentences as the at least one to-be-recognized sentence.

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

[0176] In a possible implementation of the present application, the output unit 440 is further configured to, in the case that the sentence pattern of the to-be-identified sentence is not a simple sentence, if it is detected that the sentence structure of the to-be-identified sentence is complete, output the syntax analysis content of the to-be-identified sentence as the syntax analysis result of the to-be-identified sentence.

[0177] In a possible implementation of the present application, the output unit 440 is further configured to, in the case that the sentence pattern of the to-be-identified sentence is not a simple sentence, if it is detected that the sentence structure of the to-be-identified sentence is complete, output the syntax analysis content of the to-be-identified sentence as the syntax analysis result of the to-be-identified sentence.

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

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

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

[0181] The processing unit 430 can be a processor or a controller, for example, 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, transistor logic device, hardware component, or any combination thereof. The processing unit can implement or execute the various exemplary logical blocks, modules, and circuits described in connection with the disclosure. The processor can also be a combination of implementing computing functions, 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 can be a memory.

[0182] The memory is configured to store computer-executable instructions for implementing the scheme of the present application, and the processor is configured to execute the computer-executable instructions stored in the memory, thereby implementing the syntax analysis method provided in the following embodiments of the present application.

[0183] Optionally, the computer-executable instructions in the embodiments of the present application can also be referred to as application program codes, which are not specifically limited in the embodiments of the present application.

[0184] In one aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores instructions. When the instructions are executed, the functions performed by the electronic device 100 in the foregoing embodiments are implemented. Figure 2 In one aspect, a computer-readable storage medium is provided, and the computer-readable storage medium stores instructions. When the instructions are executed, the functions performed by the electronic device 100 in the foregoing embodiments are implemented.

[0185] In an aspect, a computer program product including instructions is provided, which when executed by a computer, implement the functions as described in the above embodiments. Figure 2 In an aspect, a computer program product including instructions is provided, which when executed by a computer, implement the functions as described in the above embodiments.

[0186] In an aspect, the embodiments of the present application provide a chip, which is applied to the electronic device 100, and the chip includes at least one processor, which is configured to execute instructions to implement the functions as described in the above embodiments. Figure 2 In an aspect, a computer program product including instructions is provided, which when executed by a computer, implement the functions as described in the above embodiments.

[0187] In the above embodiments, the whole or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, the whole or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer programs or instructions are loaded and executed on a computer, the whole or part of the processes or functions described in the embodiments of the present application are performed. The computer can be a general purpose computer, a special purpose computer, a computer network, a network device, a user equipment or other programmable apparatus. The computer programs or instructions can 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 programs or instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired or wireless manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center and the like integrated with one or more available media. The available media can be a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape; an optical medium, such as a digital video disc (digital video disc, DVD); and a semiconductor medium, such as a solid state disk (solid state drive, SSD).

[0188] Although the present application is described in conjunction with the embodiments herein, other variations and modifications of the disclosed embodiments are possible, as will be understood by those of ordinary skill in the art upon reading the description of the disclosed embodiments. In the claims, the term comprising does not exclude other components or steps, and the terms singular or unplural do not exclude the plural. A single processor or other unit can implement several functions listed in the claims. Measures described in mutually different dependent claims can be combined and produce good results.

[0189] Although the present application has been described in connection with certain specific features and embodiments thereof, it is to be understood that it is intended to cover all modifications and variations of this application which are within the scope of the appended claims and their equivalents. Accordingly, the description and drawings are to be regarded as illustrative in nature and not as restrictive. It is intended that all such modifications and variations are included within the scope of the present application as defined by the following claims and their equivalents.

Claims

1. A syntax analysis method, characterized in that, include: Obtain the text to be recognized; Based on the punctuation marks included in the text to be identified, the text to be identified is processed to obtain multiple clauses of the text to be identified, and each clause has a first punctuation mark at the end; the first punctuation mark is used to indicate the end of a clause and to distinguish it from the next clause; From the plurality of said clauses, at least one clause to be identified is determined, wherein at least one said clause to be identified has analyzable grammatical content; The step of determining at least one sentence to be identified from a plurality of sentences, wherein at least one sentence to be identified has analyzable grammatical content, includes: any sentence to be identified having at least one word, and one or more of the words can be found in a preset thesaurus; Output the grammatical analysis result of at least one of the sentences to be identified.

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

3. The method according to claim 1, characterized in that, The output of at least one of the syntax analysis results of the sentence to be identified includes: For any of the sentences to be identified, before outputting the grammatical analysis results of the sentences to be identified, it is also determined whether the sentences to be identified are simple sentences based on the sentence structure of the sentences to be identified; the simple sentence refers to a sentence that omits any sentence component, and the sentence components include: subject, target verb and object.

4. The method according to claim 3, characterized in that, If the sentence to be identified is stored in the first database, then the sentence type of the sentence to be identified is the simple sentence.

5. The method according to claim 3 or 4, characterized in that, Before outputting the grammatical analysis results of the sentence to be identified, the process also determines whether the sentence to be identified is a simple sentence based on its sentence structure, including: If the sentence structure of the sentence to be identified is not a simple sentence, and the sentence structure of the sentence to be identified is detected to be complete, then 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 the sentence structure of the sentence to be identified is detected to be 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. The first information is used to indicate that the sentence structure of the sentence to be identified is incomplete.

6. The method according to claim 5, characterized in that, Determining that the sentence structure of the clause to be identified is complete includes: If the target verb, as well as the subject and / or object, are detected in the sentence to be identified, then the sentence structure of the sentence to be identified is determined to be complete.

7. The method according to any one of claims 1 to 4, characterized in that, After determining at least one sentence to be identified from the plurality of sentences, the method further includes: If any of the sentences to be identified is detected to contain the first content, then any of the sentences to be identified is processed, and the processed sentences to be identified do not contain the first content. The first content includes: characters of other languages ​​that are different from the language corresponding to the analyzable grammatical content, and / or, numbers; The output of at least one of the syntax analysis results of the sentence to be identified includes: Output the grammatical analysis results of any of the sentences to be identified after processing, as well as at least one sentence to be identified that does not contain the first content.

8. A syntax analysis device, characterized in that, include: The acquisition unit is used to acquire the text to be recognized; The processing unit is configured to process the text to be identified according to the punctuation marks included in the text to be identified, so as to obtain multiple clauses of the text to be identified, each clause having a first punctuation mark at the end; the first punctuation mark is used to indicate the end of a clause and to distinguish it from the next clause; A determining unit is configured to determine at least one sentence to be identified from a plurality of said sentences, wherein the at least one sentence to be identified has analyzable grammatical content; The step of determining at least one sentence to be identified from a plurality of sentences, wherein at least one sentence to be identified has analyzable grammatical content, includes: any sentence to be identified having at least one word, and one or more of the words can be found in a preset thesaurus; The output unit is used to output the syntax analysis result of at least one of the sentences to be identified.

9. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for generating audio and video subtitles

    CN105704538A

  • Method and device for generating information

    CN110807311A