Unlock instant, AI-driven research and patent intelligence for your innovation.

Parsing Methods for Context-Free Grammars

A parsing method and context technology, applied in the parsing field of context-free grammars, can solve the problems of large search space and long time, and achieve the effect of reducing search space, improving efficiency, and saving parsing time.

Active Publication Date: 2017-05-10
上海尚往网络科技有限公司
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0017] In the above system process, the parsing process needs to search and match all possible grammar rules and nested sub-rules, and the search space is large, so it takes a long time, especially for a system consisting of tens of thousands of rules Complex grammar takes longer; at the same time, the current grammar analysis needs to traverse and match all possible jumps after each state. For the case of a large number of jumps, such as in natural language Thousands of possible quantifiers can be connected after the numerals, and the time overhead is considerable

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Parsing Methods for Context-Free Grammars
  • Parsing Methods for Context-Free Grammars
  • Parsing Methods for Context-Free Grammars

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0038] In order to have a more specific understanding of the technical content, characteristics and effects of the present invention, now in conjunction with the illustrated embodiment, the details are as follows:

[0039] The analysis method of the context-free grammar of the present invention introduces three methods to improve the analysis efficiency in the analysis algorithm of the current context-free grammar, namely, the index hash of the first word of the rule, the query hash of the first word of the state jump and the analysis result of the rule The reuse of these three methods can be used at the same time to maximize the efficiency of parsing, or only any one of them can be used, or any two of them can be used. Below are detailed descriptions of the three methods.

[0040]First of all, the present invention introduces rule prefix hash into the current parsing algorithm of context-free grammar. Since there is only one grammatical rule that can finally match an input s...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for resolving a context-free grammar. In the conventional algorithm for resolving the context-free grammar, three methods, including rule first word index hash, state skipping first word inquiry hash and reusing of a resolving result of the same position and the same rule are introduced, and can be applied to a resolving process in any combination form. According to the resolving method, the resolving time of the context-free grammar can be reduced, and the resolving efficiency is increased. Due to the adoption of the rule first word index hush and reusing of a local resolving result, search of all nested sub-rules is avoided, and the search space is reduced; and meanwhile, the state skipping first word inquiry hash is adopted, so that a matched rule can be searched in a system by a small number of skips, even by one skip, and the resolving efficiency is increased greatly.

Description

technical field [0001] The invention relates to a method for parsing a context-free grammar. Background technique [0002] Context-free grammar (Content Free Grammar, CFG) is a formal grammar, which is defined as: For a grammar G[S], if each rule in the grammar rule set P is of the form A→α, A∈V N , α∈{V N ∪V T ) * , then the grammar G is a context-free grammar. According to the definition of context-free grammar, when applying the rule A → α in the derivation, A can always be replaced by the symbol string α without considering the context of the non-terminal symbol A. Therefore, the context-free grammar has strong enough expressive power and can It is used to define most computer programming languages ​​(C, XML, etc.), and is widely used in the field of natural language processing to describe the syntax and semantics of natural languages. [0003] Although context-free grammar has a wider description ability than another formal grammar regular language, its application...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/45G06F17/27
Inventor 翟鲁峰燕鹏举
Owner 上海尚往网络科技有限公司