Elimination of left recursion from context-free grammars
First Claim
Patent Images
1. A method for transforming a first set of rule expressions forming a first grammar to a second set of rule expressions forming a second grammar for use as a language model in a language processing system, the method comprising:
- identifying at least one left-recursive category of the first grammar; and
applying a left-corner transform to substantially only the left-recursive category rule expressions of the first grammar in forming the second grammar.
2 Assignments
0 Petitions
Accused Products
Abstract
A method for transforming a first set of rule expressions forming a first grammar to a second set of rule expressions forming a second grammar includes identifying at least one left-recursive category of the first grammar; and applying a left-corner transform to substantially only the left-recursive rule expressions of the first grammar in forming the second grammar.
-
Citations
16 Claims
-
1. A method for transforming a first set of rule expressions forming a first grammar to a second set of rule expressions forming a second grammar for use as a language model in a language processing system, the method comprising:
-
identifying at least one left-recursive category of the first grammar; and
applying a left-corner transform to substantially only the left-recursive category rule expressions of the first grammar in forming the second grammar. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
reducing the number of rule expressions in the first grammar having a left-recursive category on a left-hand side of an rule expression.
-
-
3. The method of claim 2 wherein the step of reducing the number of rule expressions in the first grammar having the left-recursive category on the left-hand side of the rule expression comprises:
replacing a set of rule expressions of the form,
-
4. The method of claim 3 wherein the step of reducing the number of rule expressions in the first grammar having the left-recursive category on the left-hand side of the rule expression is performed before the step of identifying at least one left-recursive category of the first grammar.
-
5. The method of claim 3 wherein the step of reducing the number of rule expressions in the first grammar having the left-recursive category on the left-hand side of the rule expression is performed after the step of identifying at least one left-recursive category of the first grammar.
-
6. The method of claim 3 wherein the step of reducing the number of rule expressions in the first grammar having the left-recursive category on the left-hand side of the rule expression further comprises:
replacing a set of rule expressions of the form,
-
7. The method of claim 6 and further comprising:
-
deleting any rule expression of the form, A→
B, from the first grammar, where A occurs only once on the left-hand side within the set of rule expressions in the first grammar and B is a single word or category of the first grammar; and
replacing the category A with B for each occurrence of A in the first grammar.
-
-
8. The method of claim 6 and further comprising:
transforming the second grammar to eliminate rule expressions of the form A→
ε
, where A is a category and ε
is an empty string.
-
9. The method of claim 8 and, after transforming the second grammar to eliminate rule expressions of the form A→
- ε
, further comprising;deleting any rule expression of the form A→
B from the second grammar, where A occurs only once on the left-hand side within the set of rule expressions in the second grammar and B is a single word or category of the second grammar; and
replacing the category A with B for each occurrence of A in the second grammar.
- ε
-
10. The method of claim 1 and further comprising:
transforming the second grammar to eliminate rule expressions of the form Aε
ε
, where A is a category and ε
is an empty string.
-
11. The method of claim 2 wherein reducing the number of rule expressions in the first grammar having the left-recursive category on the left-hand side of the rule expression comprises:
replacing a set of rule expressions of the form,
-
12. The method of claim 2 wherein an original grammar is cyclic, and the method further comprises:
transforming the original grammar to be the first grammar, where the first grammar is noncyclic.
-
13. A method for transforming a first set of rule expressions forming a first grammar to a second set of rule expressions forming a second grammar for use as a language model in a language processing system, the method comprising:
replacing a set of rule expressions of the form,
-
14. A computer readable medium including instructions readable by a computer which, when implemented, build a language model for use in a language processing system by transforming a first set of expressions forming a first context-free grammar to a second set of expressions forming a second context-free grammar, the instructions comprising:
-
identifying at least one left-recursive category of the first grammar; and
applying a left-corner transformation to substantially only the left-recursive category expressions of the first grammar in forming the second grammar. - View Dependent Claims (15)
reducing a number of expressions in the first grammar having a left-recursive category on a left-hand side of an expression.
-
-
16. A computer readable medium including instructions readable by a computer which, when implemented, build a language model for use in a language processing system by transforming a first set of expressions forming a first grammar to a second set of expressions forming a second grammar, the method comprising:
replacing a set of expressions of the form,
Specification