Giter Club home page Giter Club logo

Comments (5)

Axiomatic-Mind avatar Axiomatic-Mind commented on September 15, 2024 1

Thanks! Embarrassingly, I was trying to get that information by calling format!(โ€œ{:?}โ€, foo) on the output of the parse_input function and using regular expressions to parse it. The lengths to which one will go!

from bnf.

shnewto avatar shnewto commented on September 15, 2024

Hey @Axiomatic-Mind ๐Ÿ‘‹ as to your first question, whether parse_input returns a list of parse trees or not is mostly up to your grammar, and things like grammars for programming languages usually shouldn't have ambiguous ways to interpret a sentence. But grammars for natural language can be full of ambiguities that can lead to multiple parse trees. My personal favorite example of the kind of sentence that would lead a parser like this to return multiple trees is "Time flies like an arrow". Where we're either talking about the concept of time moving quickly, or something more like a plot line from Doctor Who, i.e. "Time flies like an arrow. Fruit flies like a banana."

As to your second question, it's a great point! ParseTreeNode probably needs to be exposed!

from bnf.

shnewto avatar shnewto commented on September 15, 2024

Thanks so much for #106! I've published version 0.4.1 to crates.io now so you should be able to use your changes

from bnf.

CrockAgile avatar CrockAgile commented on September 15, 2024

Thanks for noticing this issue @Axiomatic-Mind ! totally just an oversight. And double thanks for opening a PR ๐Ÿ™Œ

from bnf.

Axiomatic-Mind avatar Axiomatic-Mind commented on September 15, 2024

My pleasure๐Ÿ‘

from bnf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.