allofphysicsgraph / proofofconcept

Physics Derivation Graph: mathematical connections among equations
https://derivationmap.net/
Other
20 stars 6 forks source link

Python function for determining whether valid latex expression is ambiguous #62

Open bhpayne opened 4 years ago

bhpayne commented 4 years ago

def is_expression_ambiguous(expr_latex: str) -> bool: """ >>> is_expression_ambiguous("1/2\pi ") True >>> is_expression_ambiguous("\sin x / y") True >>> is_expression_ambiguous("\sin x + 2") True """

bhpayne commented 4 years ago

This issue relies on having an Abstract Syntax Tree (AST) for the expression