GithubHelp home page GithubHelp logo

int2str / jssyntaxtree Goto Github PK

View Code? Open in Web Editor NEW
80.0 80.0 17.0 199 KB

Dynamic JavaScript version of phpSyntaxTree - a tool to draw syntax trees from labelled bracket notation.

License: GNU General Public License v2.0

CSS 4.25% HTML 8.03% JavaScript 87.58% Dockerfile 0.15%

jssyntaxtree's People

Contributors

brendonirwan avatar int2str avatar mkeisenbach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

jssyntaxtree's Issues

Add local docker setup

Nice project! ๐Ÿ‘

I cant create a pull request, soI will let you my additions here.

  • Dockerfile
FROM nginx:1.19

COPY . /usr/share/nginx/html
  • add to Readme

Local Setup

You can run jsSyntaxTree also locally on docker:

  • install and run docker on your machine
  • build the image
docker build -t jssyntaxtree .
  • run the container and map the default nginx port to your machine
docker run -p 80:80 jssyntaxtree

all words on same level

Sometimes I would prefer an option that forced jssyntaxtree to put all words on the lowest level. At the moment, I have to cheat and then use a graphics program to correct the line, as in this example:
[sentence [main-clause [S I] [V admire] [O her reasoning]] [[[ but]]] [main-clause [S I] [V reject] [O her conclusions]]]
Thanks for your consideration!

Enable URL export

Allow for direct URL export of current sentence:

https://ironcreek.net/syntaxtree/?[S%20[NP%20jsSyntaxTree][VP%20[V%20creates][NP%20nice%20syntax%20trees%20-%3E1]]]

Direct link

Allow manual subscript on leaf nodes

[Filed on behalf of @brucetesar]
Manual subscript works well for non-leaf nodes. However, I couldn't get it to work for leaf nodes. For instance, if I have a trace as a leaf node, and I try to co-index it, I still get t_i in the result. Could you extend the pattern to leaf nodes?

Connector Height and Text Decorations

Thank you for the great work! I already suggested your website to my students in the syntax course. I was just wondering is there a way to change the connector height? Also, are you planning on adding text decorations like italic face.

Arrows cut off

Draw this tree, and watch the arrow as it vanishes in the middle.

[A_A [B_B lorem] [C_C [D_D ipsum] [E_E [F_F dolor] [G_G [H_H sit] [I_I [J_J amet] [K_K [L_L consectetur] [M_M [N_N adispicing] [O_O elit -> 1]]]]]]]]

Manual subscripts

In the old php version, it was possible to add manual subscripts to nodes using the underscore notation: "N_i" came out as N with subscript i. This feature doesn't work for me in the new js version. Has it not been implemented (yet)?

P.S. Thanks for maintaining this very useful tool.

Allow space in nonterminals

I would like to be able to insert spaces into nonterminals, for instance in the following diagram, where I needed to have a space between "main" and "clause":
[sentence [main-clause [S I] [V admire] [O her reasoning]] but [main-clause [S I] [V reject] [O her conclusions]]]
Of course entering an actual space does not work, and underscores are already taken, but unfortunately, all blank characters I enter will be converted to spaces (e.g. ALT+255 or anything from here). I think adding support for something that does not usually occur to be converted into a space would be a useful feature, say a double percent sign:
main%%clause
What do you think?

command-line node.js-compatible approach?

@int2str Great to discover your code. May I ask for a little guidance?

I wish to create syntax trees for Lushootseed, a Pacific Northwest indigenous language. See, for instance, this work in progress:

Mink and Tetyika

Does there exist, or can you help me create, a stand-alone javascript script which creates a syntax tree svg diagram from labeled bracket notation? With such a capability, I could - from the command line - experiment to find a suitable bracket notation for each line in the story, of which this is one example:

image

After rendering svg to a file, I could later include it as part of the annotation pop-in.

I'll be grateful for any advice you can give.

Subscripted terms changed behavior

Just saw version 1.10. The arrow feature looks cool! But, indicating subscripts with underscore now acts differently. If I enter [V t_j], I get an error message below the entry box, "Unexpected SUBSCRIPT_PREFIX at idx 3", and the desired subscript does not appear. After playing with it for a while, I found a workaround: [V [t_j]], with an additional pair of square brackets surrounding the subscripted term and its subscript, does what is desired. What seems to matter is that the subscripted term is the first term after a left square bracket: [V [t_j ]] works as expected, as does [V [t_j a]]. Perhaps something to do with how the input is tokenized?

SVG download gone?

First of all, thanks for the great work, which I have been using and recommending to my students for years!
In phpSyntaxtree there used to be an SVG download, which allowed me to change things in Inkscape when I was unhappy with the original layout (and which was easier to adapt for high-resolution publications). Do you plan to bring this back?

Minor typo in Tips

Hi there, thanks for making this! There is a minor typo in tip.js line 10: "The graph will updarte automatically...".

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.