28.06.2013 Views

Papers in PDF format

Papers in PDF format

Papers in PDF format

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The applet is organised around two ma<strong>in</strong> displays which are constructed with components from the Java Abstract<br />

W<strong>in</strong>dow Toolkit: the <strong>in</strong>put display accepts user <strong>in</strong>put (sentences, category assignments and phrase structure rules) while<br />

the output display pr<strong>in</strong>ts tree representations of successful analyses generated by the user's grammar (the <strong>in</strong>put display is<br />

shown <strong>in</strong> the first two images; the output display <strong>in</strong> the third).<br />

Sentences chosen by users are separated <strong>in</strong>to tokens (words) next time they click on a button. The category <strong>in</strong>put fields<br />

are adjusted accord<strong>in</strong>gly, show<strong>in</strong>g one labeled field for each word token. When the user clicks on the Parse button, the<br />

<strong>in</strong>put <strong>format</strong> is verified before it is passed to a parser object as a object made up from objects<br />

consist<strong>in</strong>g of a syntactic category and the graphemic representation, and a object made up by objects.<br />

The parser object then runs its pars<strong>in</strong>g method. A left-corner algorithm implemented as a while-loop rather than rely<strong>in</strong>g<br />

directly on recursion is used. This type of algorithm makes it easy to handle left-recursive rules and keep track of choice<br />

po<strong>in</strong>ts (if one is found a copy of the current state are saved for each alternative which is then pursued <strong>in</strong> turn). As the<br />

parser proceeds, it constructs a bracketed str<strong>in</strong>g representation of the grammatical structure, and successful parses are<br />

saved to an array.<br />

If one or more analyses are found, the applet shifts to the output display. Tree representations of the sentence structure<br />

are pa<strong>in</strong>ted by send<strong>in</strong>g messages conta<strong>in</strong><strong>in</strong>g a s<strong>in</strong>gle str<strong>in</strong>g representation, the total number of successful analyses and<br />

the number of the current one to the display. The str<strong>in</strong>g is then parsed by a second top-down predictive parser, which<br />

generates a set of relative coord<strong>in</strong>ates for the nodes of the tree which are l<strong>in</strong>ked and labeled.<br />

The applet can be accessed at URL http://www.l<strong>in</strong>guistics.bangor.ac.uk/java/lt/L<strong>in</strong>gTutor.html.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!