Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7586361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:24:35+00:00 2026-05-30T19:24:35+00:00

The input is either: (1) a bracketed representation of a tree with labeled internal

  • 0

The input is either:

(1) a bracketed representation of a tree with labeled internal nodes such as:

(S (N John) (VP (V hit) (NP (D the) (N ball))))

with output:

enter image description here

(Whether the lines are dashed and whether the caption is present are not significant.)

Or the input could be:

(2) a bracketing on words without labels e.g.:

((John) ((hit) ((the) (ball))))

with output same as above (no internal labels this time, just the tree structure).

Another component of the input is whether the tree is labeled as in (1) or unlabeled as in (2).


My question: What is the best way (fastest development time) to render these trees in the browser in javascript? Everything should happen on the client side.

I’m imagining a simple interface with just a textbox (and a radio button specifying whether it is a labeled tree or not), that, when changed, triggers a tree to render (if the input does not have any syntax errors).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T19:24:36+00:00Added an answer on May 30, 2026 at 7:24 pm

    Actually there is server side library to convert bracketed representation into tree, phpsyntaxtree.
    You can reimplement them using javascript graphic library like jsdraw2d or roll you on javascript using HTML5 canvas.

    10 Best Javascript Drawing and Canvas Libraries

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I send keyboard input messages to either the currently selected window or
I have a function whose input argument can either be an element or a
How can we check if the input number is either positive or negative in
I have an array of input strings that contains either email addresses or account
I have 2 input boxes that are not disabled. When either gets focus no
Here's a piece of code to take a string (either NSString or NSAttributedString) input
Input : {5, 13, 6, 5, 13, 7, 8, 6, 5} Output : {5,
I need to validate input: valid variants are either number or empty string. What
I currently have two input fields which toggle the value value to either true
Let's say the sound input is either an embedded mp3 file or the microphone.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.