Showing posts with label diagram. Show all posts
Showing posts with label diagram. Show all posts

Sunday, February 26, 2012

Spotlight on Linguistic Tools: Syntax Tree Generator

A fellow linguist recently shared a link with me for another online tree-diagramming program--one that I think is definitely more user-friendly than the other online programs that I've tried out. It is the Syntax Tree Generator. The Help page states that the program works best with Google Chrome--I've tried it on Firefox, Safari, and Opera without any issues. If you are on Google Chrome when you go to the website, you'll see a screen that looks like this:

Initial screenshot of Syntax Tree Generator

The screen changes just a bit if you use other browsers (e.g., the sliders for font and spacing are boxes for numerical inputs), but the overall design is still the same. The text box at the top is where you put in the information that dictates what the tree will look like.

Text box for diagramming
The sentence in the above screenshot is what you see when you first go to the website. You can play with that sentence or put in your own new sentence entirely. I'm using my own sentence for the examples below.

The basics of this program is the use of bracketing to mark constituents and embedding. The mother node label is the first entry after the open bracket, and a space after that label will result in a branch to a daughter node. The cool thing about this online program is that the diagram on the page follows what you type in the text box in real time. In other words, as you make changes, the diagram changes along with what you type, and you can see if what you type is what you had intended for the diagram.

One of the first features that is handy is the ability to diagram with triangles, which is indicated by the asterisk (*) after the mother node; for instance, if I type in [S* The dog is sleeping], I get this diagram:

[S* The dog is sleeping]
If there are no brackets within the original set of brackets, there will be no daughter branches. If you take out the * after the mother node, the triangle will turn into a single branch:

[S The dog is sleeping]
Again, the program reads whatever comes directly after the opening bracket as the mother and anything following it as the daughter. Even though four words (with spaces) follow the mother node, there is only one branch because there is only one set of brackets.

By adding brackets, you can add more daughters to diagram; the following diagram is made with the input [S [NP* The dog] [Aux is] [VP sleeping]]:

[S [NP* The dog] [Aux is] [VP sleeping]]
Now the mother node S has three daughters because there are three sets of open and closed brackets inside the S brackets. Each of the daughters in this example have only one branch (or one triangle). Each daughter can be expanded by adding more sets of brackets within it. The following diagram is [S [NP [Det The] [N dog]] [Aux is] [VP sleeping]]:

[S [NP [Det The] [N dog]] [Aux is] [VP sleeping]]
The difference with this diagram is that the NP node has been expanded to have two daughters; that's because the NP brackets now have two sets of brackets--[Det The] and [N dog]--inside.

Nodes can also be "uni-branching", as in the following diagram:

[S [NP [Det The] [N dog]] [Aux is] [VP [V sleeping]]]
In this case, the VP node now has the daughter V, which then branches down into the text node sleeping.

By using the bracketing method, sentences can get more and more complex. Again, the wonderful thing about this is the real-time diagramming that follows the input in the text box. Whenever you have a diagram you want to use in a document, simply right-click the image and copy it. Then you can paste the image into any document you need.

Another nice thing is that you can download the app for offline use by going to the Wiki page and clicking on the download link. After downloading the .zip file and unzipping the file, you'll see the following in the downloaded folder:

Downloaded folder for offline use
Click (or double-click) on the index.html (which is highlighted in the image above), and an offline version of the webpage will open. It's routed through your computer files, so you have full usage of the program without needing internet access. You need all the other files in the folder in order for the program to work without being online, so you need to keep all those together.

Have fun diagramming!

Updated note: The designer of this app updated the look, so the screenshots are a bit dated. The new look is incredibly sleek and even more user-friendly. I highly encourage you to check out its new look: http://mshang.ca/syntree/.

Thursday, February 2, 2012

Spotlight on Linguistic Tools: Linguistics Online Playgrounds

Linguistics Online (or 'LiOn') is a website that was developed as an online supplement for linguistics students at Utrecht University. One of the components of the website is the Tool Playground; in the Tool Playground are two incredibly valuable resources for many linguistics students: the IPA Keyboard Playground and the Treebuilder Playground.

The IPA Keyboard Playground is exactly what it sounds like: another online IPA keyboard. The keyboard is organized in the consonant and vowel IPA charts but doesn't have all the diacritics and more obscure IPA symbols (like those for clicks). Since many students don't necessarily need the extra IPA symbols, this keyboard is more streamlined for ease of use.

LiOn IPA Keyboard Playground screenshot

When using the keyboard, you can (as with other online keyboards) simply type into the text box (which for this one is situated between the consonant and vowel charts, which helps to visually separate the two). When you need a symbol you can't type, you simply click on its button in the chart, and the IPA symbol will be inserted where the cursor is. When you've finished with what you'd like to type, you can then copy and paste the text directly into your document on your word processor of choice.

The layout of the IPA Keyboard Playground is accessible and visually appealing. The text box isn't as large as the text box for some of the other online IPA keyboards, but often when we're typing in IPA, we're typing one line or one utterance (or even one word) at a time, so you may not find that to be a downfall. If, however, you want to enter multiple lines of text in IPA at once, you won't be able to put in a line break in this keyboard. Remember that online keyboards are all about functionality--you may find that you like to use one online keyboard for one task while you prefer a different one for another task.

The Treebuilder Playground is also what it sounds like: an online tree diagramming (or tree building) program. This online system is not as intuitive or user-friendly as the downloadable TreeForm software; however, it may be more accessible to many students than the online phpSyntax program. When you go into the Treebuilder Playground, you'll see this:

LiOn Treebuilder Playground
The program automatically starts you with a top node of S; however, if you want to diagram something else--like a morpheme tree, for example--then you simply need to click on the box with the "E" (if you look closely, you'll see it actually says "Edit"). In edit mode, you can change the text for the top node. Every time you edit a node, you have to click on the green checkmark that appears next to the editing text box. Otherwise, it won't save any changes you made.

To add nodes below the top node, click on the "L+" or "+R" in the box. For the first node you add, it doesn't matter which of those you click. When you go to add a second daughter node, though, you need to decide if you want it to the left or right of the first one. As you add nodes, a tree will begin to form in the area above the top node box:

LiOn Treebuilder Playground: Building a diagram
As you can see in the screenshot above, the building space retains all the node boxes that you add--you can continue modifying the tree by adding more or taking away any existing nodes. When you add new nodes, make sure you are adding to the mother node--the trees in this program are built top-down. Once you've finished your tree, right-click on the tree diagram above all your nodes, and click on "Save image as..." to download the image to your computer. You can then insert that image into your document, like so:

LiOn Treebuilder Playground: Diagram
Again, this is more intuitive for many people than the system utilized by phpSyntax (with embedding through bracketing), but if you're able to download software, I still highly recommend using TreeForm. The LiOn Treebuilder Playground is a very handy tool to utilize, though, when you don't have the ability to download software (like when you're using a computer in the library).

The Tool Playground area of LiOn has many more useful tools that you may want to explore--it also has exercises for learning linguistic concepts, which is a nice feature for anyone learning more about linguistic analysis.

Wednesday, August 25, 2010

Spotlight on Linguistic Tools: phpSyntaxTree

If you ever find yourself in need of diagramming a sentence in a typed document, you may have noticed that not too many word processing programs have user-friendly ways of drawing and inserting trees. One way to work around that issue is to use the free online phpSyntaxTree program, which draws trees based on bracket notations. A few advantages to phpSyntaxTree are that the program is free, online (i.e., you don't have to download anything to use it), and provides an easy-to-work with picture file as its end product.

When you go to the web page, you will see something like this:


The text box on the website comes pre-programmed with this sentence already in bracket notation: [S [NP phpSyntaxTree][VP [V creates][NP nice syntax trees]]]. If you hit the "draw" button directly below the text box, you will go to a new screen that looks like this:


Once the tree is drawn, you can play with the settings across the top (e.g., take out the color, take out subscripts). When the tree looks like what you want, you can simply put your mouse over the diagram and click on it; it will download a copy of that diagram as a picture file (.PNG) to your computer, and you can then insert it into whatever document you're working on.

Once you've got the process down, it flows pretty nicely, and you can create diagrams of any kind (i.e., with any labels) to put into the text box on the website. The problem is that not all students are familiar or comfortable with using bracket notations.

For this program, the basic concept is what appears on the left inside the brackets is inserted in the mother node and what appears on the right is the daughter node. A space between the entries is interpreted as a branch or triangle. For instance, if you put [N dog] into the text box and hit the draw button, you will see a tree like this:


If you put [NP the dog] into the program, you will get a tree like this:

The first space after whatever entry you put at the left will be interpreted by the program as the separation between what is put on top (the mother node) and what is put on bottom (the daughter node). If more than one word appears in the daughter node, a triangle is used instead of a single branch (unless you turn off the triangle notation, in which case a single branch is inserted with several words below it).

Putting this concept to work in layers, you can put notations like [S [NP [Det the] [N dog]] [VP [V sleeps] [PP [Prep on] [NP [Det the] [N porch]]]]] and get results like this:


The program keeps track of your open and closed brackets; if the numbers are not equal, the program will not allow a tree to be drawn. If you break down the sentence in its bracket notation and compare it to its tree, you will see that the basic concept of "left side = mother node" is followed throughout: [NP [Det the] [N dog]] tells the program that NP should appear in the mother node, the mother node has two daughters (Det and N), and that those daughter nodes in turn have daughter nodes (the and dog).

Let's look at that sentence a little more closely. If you type [S the dog sleeps on the porch], you'll get a tree like this:


If you want to break that single node into two, you need to put words that go together in brackets: [S [the dog] [sleeps on the porch]]. Now you're telling the program to have two branches under S (branch 1: the dog; branch 2: sleeps on the porch). But if you hit "draw" right now, you'll be left with this:


Why did that happen? Because the program doesn't distinguish between words and labels unless you put them in their appropriate places. So the program read [the dog] as the is the mother node and its daughter is dog. The same applies to the other set of brackets. You can fix this by inserting labels for both of these: [S [NP the dog] [VP sleeps on the porch]].



From there, you can continue breaking it down until you get the tree with a complete break down. Just remember that what is on the left is inserted into the mother node, a space after that entry indicates a branch/triangle, and more than one branch from a single mother node is indicated by sets of brackets. For instance, [NP [Det] [Adj] [N]] will look like this:


Separating the entries into brackets told the program "don't interpret this as a single unit but rather as three separate daughter nodes."

Once you get the hang of using bracket notation, getting the tree structure you want becomes easier. I encourage you to play with the program to see what different structures look like in their bracket form and compare that form to its tree form. Playing with the program is the best way to learn it.

Next week I will showcase another way to get tree diagrams in typed form to insert into documents. In the meantime, I hope you will have some diagramming fun with phpSyntaxTree.