Giter Site home page Giter Site logo

adambcomer / lin-tree-solver Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 2.0 7.62 MB

This tool automatically parses and builds linguistics syntax trees.

Home Page: https://lin-tree-solver.adambcomer.com/

License: Apache License 2.0

JavaScript 2.04% HTML 1.66% TypeScript 96.30%
linguistics react tree-viewer syntax-trees parse-trees

lin-tree-solver's Introduction

Linguistics Tree Solver

About:

This tool automatically builds linguistics syntax trees.

A major goal of this tool is to accept to a broad set of syntax rules. Nearly every textbook has different rules and standards.

I want others to be able to add/modify the rules to work for them.

I have included an annotated sentence and syntax rules from Syntax: A Generative Introduction, Third Edition, by Andrew Carnie.

Click around to view the sentence, the syntax rules, and parsed trees.

Tutorial:

1. Define Syntax Rules (One Time Step)

Work in progress.

2. Write and Annotate a Sentence

In the Sentence Editor, add your sentence in the text box at the top. The sentence will be automatically be split by word. Under each word will be all of the Parts of Speech from the Syntax Rules. By coloring these Parts of Speech, the solver will find trees that satisfy these constraints.

Note: You can select multiple Parts of Speech for a single word. At first, this may seem strange. How can a word be a Noun, Verb, and Adjective at the same time? But, what if we don't know what Part of Speech a word is? A word that has multiple Parts of Speech represents our uncertainty or lack of knowledge. The solver can use that uncertainty to work out all possible trees that satisfy the other constraints.

Once the sentence has been annotated to the best of a our ability, we can compute the trees that satisfy the syntax rules in conjunction with the annotations.

3. Build/Solve/Compute All Syntax Trees For a Sentence

In the Tree Viewer, you can view all of the parsed trees.

Technologies:

This project uses Web Workers to parse the trees. To get the best performance and support, use an up-to-date version of Chrome, Firefox, or Safari.

FAQ:

Why are a few the syntax rules slightly different from the textbook?

The textbook has some rules that don't work well with parsers and were modified to work as the author intended. For example, the X-Bar rule in the textbook N'โ†’N' (PP). This rule can be satisfied by an infinite chain of N's. Intuitively, we know that the shortest possible tree is the desired result, but the computer doesn't know that when it searches for every possible tree. I modified some of the rules to work with the parser to give the desired parsed trees rather then make the exact rules work.

Can I save a picture of the parsed trees?

Yes. In the Tree Viewer, there is a Image button in the top right. Clicking this button will generate an image based on the viewer window and automatically download it.

How do I share my Sentence/Syntax Rules with a friend?

Currently, there are no sharing mechanisms. This feature is under active development. I'm considering several strategies to make this feature work seamlessly.

Is this project open source?

Yes. You can view the code at my Github Repository. I'm happy to merge pull requests that build on the project.

To-Do:

  • Embeddable iframes
  • Improve rendering for larger trees
  • Label structural relationships between all of the nodes in a tree

Done:

  • Saving of Sentences/Syntax Rules/Trees
  • Sharing of Sentences/Syntax Rules/Trees
  • Tooling to catch common syntax rule errors

Resources:

lin-tree-solver's People

Contributors

adambcomer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lin-tree-solver's Issues

Cheating Warning Message for Students

It has come to my attention that students have been submitting trees for homework assignments with this tool and claiming the work as their own. To discourage this type of behaviour, warning messages will be added to the Web App.

If your are a linguistics professor or TA and have an idea you would like to share, this issue will be left open for suggestions.

Add nested CPs in VPs for X-bar Theory Trees

Nesting CPs within VPs is currently not possible for any of the X-bar Theory rule sets. The modifications to the base rules should only need to touch the VPs and V_bars. These changes should be minimal but will require extensive testing to verify that only correct trees are produced.

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.