Author Topic: Syntactic Trees in your posts! [instructions]  (Read 4455 times)

Offline Daniel

  • Administrator
  • Experienced Linguist
  • *****
  • Posts: 1731
  • Country: us
    • English
Syntactic Trees in your posts! [instructions]
« on: December 19, 2013, 12:29:33 AM »
One of the great benefits of the new forum is customization. By far the most useful for discussion of Syntax in particular will be the ability to include syntactic trees in directly in your posts!



Here's the code to do that:
Code: [Select]
[TREE][S [NP phpSyntaxTree][VP [V creates][NP nice syntax trees]]][/TREE]
More Info and test page (to check your tree syntax):
http://linguistforum.com/ext/phpsyntaxtree/
« Last Edit: December 19, 2013, 12:37:14 AM by djr33 »
Welcome to Linguist Forum! If you have any questions, please ask.

Offline lx

  • Global Moderator
  • Linguist
  • *****
  • Posts: 164
Re: Syntactic Trees in your posts! [instructions]
« Reply #1 on: December 19, 2013, 04:29:42 AM »
Now, that is a cool feature.

Offline Daniel

  • Administrator
  • Experienced Linguist
  • *****
  • Posts: 1731
  • Country: us
    • English
Re: Syntactic Trees in your posts! [instructions]
« Reply #2 on: January 24, 2014, 06:12:53 PM »
How to copy a tree from someone else's post:

If you want to copy a tree that someone else made (perhaps to modify or correct it), then you can do so by using the "Quote" feature. Just click on "Quote" above the post with the tree, then it will be automatically entered into your reply. Remove the other text except the TREE part and edit it as required.
Welcome to Linguist Forum! If you have any questions, please ask.

Offline mplola

  • Jr. Linguist
  • **
  • Posts: 10
  • Country: gr
    • Greek
Re: Syntactic Trees in your posts! [instructions]
« Reply #3 on: September 29, 2014, 10:51:31 AM »
the most impressive feature i've seen!

Offline vahid

  • New Linguist
  • *
  • Posts: 4
Re: Syntactic Trees in your posts! [instructions]
« Reply #4 on: March 05, 2015, 10:10:54 AM »
That's great!!

Offline Poemworld

  • Jr. Linguist
  • **
  • Posts: 11
Re: Syntactic Trees in your posts! [instructions]
« Reply #5 on: June 23, 2017, 01:00:21 PM »
Nice, but I don't think I'm there yet lol.

Offline binumal

  • Jr. Linguist
  • **
  • Posts: 40
Re: Syntactic Trees in your posts! [instructions]
« Reply #6 on: January 01, 2018, 03:06:33 PM »
[vP[DP] [v' v [VP V [DP]]]]

How to avoid this \  which comes in whenever one type V'? Please help
« Last Edit: January 01, 2018, 03:09:36 PM by binumal »

Offline Daniel

  • Administrator
  • Experienced Linguist
  • *****
  • Posts: 1731
  • Country: us
    • English
Re: Syntactic Trees in your posts! [instructions]
« Reply #7 on: January 06, 2018, 10:13:29 PM »
That's a good question. Unfortunately the linguistics notation conflicts with a programming issue: apostrophes are automatically "escaped" with slashes by the server in order to prevent any attacks with malicious code.

There is probably a way around this, but I've looked into it just briefly, and I think it would require modifying PHP Syntax Tree's code directly (rather than how I've integrated it), and I don't have the time to work that out at the moment (and I prefer to leave third-party plugins alone if possible). I may look into it again later-- it's a good question. Feel free to remind me if it keeps bugging you. If I get some time or want a project to take a break from other things, I might try it. It could be as simple as manually filtering out "\'" from the text that goes into the trees (very surface level, on the PHP Syntax Tree side of things), but the trick there would be finding the right line of code to do that, which is often the tricky part (finding, not fixing). This is actually a bug that should be fixed by PHP Syntax Tree in general (it's an unfortunate coincidence!). Could also try asking the developers about that if they are still working on the project.

Thanks for the feedback.

For now, I would say just go ahead with it as-is-- odd looking, but readable, not really ambiguous. Or you could use an alternative symbol like `.
« Last Edit: January 11, 2018, 08:56:40 PM by Daniel »
Welcome to Linguist Forum! If you have any questions, please ask.

Offline Daniel

  • Administrator
  • Experienced Linguist
  • *****
  • Posts: 1731
  • Country: us
    • English
Re: Syntactic Trees in your posts! [instructions]
« Reply #8 on: January 11, 2018, 08:55:11 PM »
Update/bug fix: I've now gone through the PHPSyntaxTree code and found where to fix this so it works with current server settings.

This change applies retroactively now so your tree above (for example) has v' displayed correctly, and it should work in the future.

Let me know if you find any more bugs!
Welcome to Linguist Forum! If you have any questions, please ask.