Questions tagged [earley-parser]

A type of parser that can parse all context-free languages, mainly used in computational linguistics.

26 questions
6
votes
1 answer

Using integers/dates as terminals in NLTK parser

I'm trying to use the Earley parser in NLTK to parse sentences such as: If date is before 12/21/2010 then serial = 10 To do this, I'm trying to write a CFG but the problem is I would need to have a general format of dates and integers as terminals,…
FahimH
  • 151
  • 1
  • 7
6
votes
1 answer

Does the Marpa parser library support error recovery?

I know Perl's "Marpa" Earley parser has very good error reporting. But I can't find in its documentation or via Googling whether it has error recovery. For instance, most C/C++ compilers have error recovery, which they use to report multiple syntax…
hippietrail
  • 15,848
  • 18
  • 99
  • 158
5
votes
2 answers

Earley recognizer to Earley parser

I managed to create Earley recognizer, everything works fine. I have all proper sets of situation. But I only can use it to decide if word is accepted by grammar. How to make it to parse? I need some article or explanation, it seems that I need to…
dfens
  • 5,413
  • 4
  • 35
  • 50
3
votes
1 answer

(E)BNF How to match until next non-terminal rule?

I'm trying to write a grammar for content in the RIS format with nearley Example of file: TY - JOUR KW - foo KW - bar ER - A *.ris file always starts with the tag TY and ends with the tag ER. In between there can be many other tags like KW…
customcommander
  • 17,580
  • 5
  • 58
  • 84
3
votes
1 answer

How can I write an unambiguous nearley grammar for boolean search operators

The Context I am climbing the Nearley learning curve and trying to write a grammar for a search query parser. The Goal I would like to write grammar that is able to parse a querystring that contains boolean operators (e.g. AND, OR, NOT). Lets use…
slifty
  • 13,062
  • 13
  • 71
  • 109
3
votes
1 answer

Practical Earley Parsing (Aycock & Horspool 2002): How to add back pointers?

I've already coded an Earley parser with back pointers but it doesn't handle nullable grammars very well. I've also implemented Aycock & Horspool 2002's solution which is to make PREDICT skip over the nonterminal token if it is nullable.…
user2108462
  • 855
  • 7
  • 23
2
votes
0 answers

How does a chart for an ambigous sentence look for an Earley Parser

I've got a pretty basic question concerning the Earley parser: In case of syntactic ambiguity ( S -> NP VP(V NP(NP PP)) vs. S -> NP VP(VP((V NP) PP) ), are both parses stored in one chart or in two? the grammar im talking about is the following: S…
bngschmnd
  • 111
  • 1
  • 10
2
votes
1 answer

Which Eiffel compilers use Earley parsing

I stumbled upon this post http://compilers.iecc.com/comparch/article/02-04-096 that says there are two Eiffel compilers using Earley parsing. The post is quite old. I wonder if anyone here knows which Eiffel compilers use Earley parsers and if they…
Wickoo
  • 6,745
  • 5
  • 32
  • 45
2
votes
1 answer

Earley Parser Recursion

Does the Earley parser have expected problems with simple cycles? I've made my own implementation, but it's pretty similar to this one, which is very readable and about 150 lines total (and I, of course, didn't write it):…
en_Knight
  • 5,301
  • 2
  • 26
  • 46
1
vote
1 answer

Using the Earley library to parse with features and unification

The Earley parsing library is great for writing linguistic parsers in Haskell. CFGs can be specified in an intuitive way, and there is excellent support for backtracking and ambiguity. A simple example: {-# LANGUAGE OverloadedStrings #-} import…
SEC
  • 799
  • 4
  • 16
1
vote
0 answers

Earley algorithm gone wrong

I am trying to implement Earley's algorithm for parsing a grammar, however I must have done something wrong because after the first entry in the chart it doesn't go through the rest of the input string. My test grammar is the following: S -> aXbX |…
al21
  • 39
  • 5
1
vote
0 answers

Performant way to lex INDENT and DEDENT to pass to Earley?

Continuing from this GitHub issue: I need to match on indent or dedent, and I'm using Earley. Earley has no built-in support for indentation, but I'd like to be able to use indentation instead of braces in my language. Example input: func foo(a: A,…
Aly
  • 847
  • 1
  • 6
  • 30
1
vote
1 answer

how to identify the next possible node from grammar using tokenStream?

I am creating a textarea which have intellisense like most of the IDEs. My approach is to use earley parser algorithm. I am using the early-parser-js library. Below is the grammer: S -> NP VP VP -> VP PP | V NP | V PP -> P NP NP -> Det N | N | Pn |…
1
vote
0 answers

Natural language processing. POS tagging and syntax analysis

I am currently working hard on implementing my own library for English language processing. The real challenge is to go through all abundance of theoretical material and get the quantum of understading how to put it all on rails of production. I…
Mikezar
  • 76
  • 5
1
vote
0 answers

Making CFG and EarleyParser flexible to get same pattern if out of vocabulary word found

I have made a CFG grammar and verifying my grammar using EarleyParser algorithm. I wanted to ask how to allow a rule even if something is out of vocabulary from production rules. Let me give a rough example. S1 START I had a burger END START In the…
Hammad Hassan
  • 1,192
  • 17
  • 29
1
2