Linguist Forum

Specializations => Morphosyntax => Topic started by: Daniel on December 19, 2013, 12:29:33 AM

Title: Syntactic Trees in your posts! [instructions]
Post by: Daniel 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/
Title: Re: Syntactic Trees in your posts! [instructions]
Post by: lx on December 19, 2013, 04:29:42 AM
Now, that is a cool feature.
Title: Re: Syntactic Trees in your posts! [instructions]
Post by: Daniel 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.
Title: Re: Syntactic Trees in your posts! [instructions]
Post by: mplola on September 29, 2014, 10:51:31 AM
the most impressive feature i've seen!
Title: Re: Syntactic Trees in your posts! [instructions]
Post by: vahid on March 05, 2015, 10:10:54 AM
That's great!!
Title: Re: Syntactic Trees in your posts! [instructions]
Post by: Poemworld on June 23, 2017, 01:00:21 PM
Nice, but I don't think I'm there yet lol.
Title: Re: Syntactic Trees in your posts! [instructions]
Post by: binumal 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
Title: Re: Syntactic Trees in your posts! [instructions]
Post by: Daniel 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 `.
Title: Re: Syntactic Trees in your posts! [instructions]
Post by: Daniel 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!