Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tolerance should apply to previous unit #2

Open
dvc94ch opened this issue Jan 21, 2018 · 3 comments
Open

tolerance should apply to previous unit #2

dvc94ch opened this issue Jan 21, 2018 · 3 comments
Labels
antlr-port Issues only applicable to our attempt to port to antlr

Comments

@dvc94ch
Copy link
Collaborator

dvc94ch commented Jan 21, 2018

the grammar should be:

range : unit tolerance?
unit : voltage | current | power | resistance | capacitance | inductance | frequency

@kasbah
Copy link
Member

kasbah commented Jan 21, 2018

I think we have a bit of a conflict here between our "NLP" use cases (search, BOM creation) and our circuit HDL use cases. For the HDLs we want the clearest description but for search we want to extract as much info as possible.

For search I definitely want to parse 10uF 0603 10% as a 10% tolerance on capacitance. What to do for HDLs, I am not sure. The best thing for those cases maybe to lint and format the user input to be less ambiguous.

Are you thinking of use cases where you specify multiple tolerances on different units? What cases are you thinking of exactly?

@dvc94ch
Copy link
Collaborator Author

dvc94ch commented Jan 21, 2018

Maybe there isn't a use case. I think it makes it more readable and makes sense though.

Do you have any real world "NLP" examples where it is actually specified like that? And is a parsing framework the right tool for NLP processing? Wouldn't a NLP framework be more suited? (I'm not familiar with NLP concepts or terminology)

@kasbah
Copy link
Member

kasbah commented Jan 21, 2018

Sure, I agree with you, but for search we don't care about that. For other applications it would be fairly easy to make a formatting function:

> format('0603 10% 1u capacitor for decoupling') 
'capacitor 1uF 10% 0603'

I have seen the specs rattled off in any old order all over the place really. Here is a capacitor description from Farnell: SMD Multilayer Ceramic Capacitor, 1210 [3225 Metric], 0.47 µF, 200 V, ± 10%, X7R, MC Series .

I think the existing implementation is a good proof of concept that a formal grammar approach can work well for this very limited subset of "natural language". I have been looking a bit at the implementation of Duckling and while they don't use a grammar DSL the "rules" they use seem very grammar-like. This is my first foray into this kind of parsing as well though.

@kasbah kasbah added the antlr-port Issues only applicable to our attempt to port to antlr label Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
antlr-port Issues only applicable to our attempt to port to antlr
Projects
None yet
Development

No branches or pull requests

2 participants