Grammar Writing: Week 2: Difference between revisions

From English Grammar
Jump to navigation Jump to search
No edit summary
No edit summary
Line 16: Line 16:


<span style="color: blue>Task 2</span>
<span style="color: blue>Task 2</span>
Add subtypes to "bot".
Add subtypes to "bot".
In DesktopTrale, right-click on the "bot" node in the TypeHierarchy tree navigation on lefthand side.
In DesktopTrale, right-click on the "bot" node in the TypeHierarchy tree navigation on lefthand side.



Revision as of 11:43, 23 October 2017

A Grammar for Cars

Types of cars


Defining a Car Type Hierarchy

Types of cars

Task 1

Load an empty signature. 

In DesktopTrale, click on: Type Hierarchy -> Load TRALE Signature -> select the "signature" file in the directory grammars/dd-00-empty-signature

Task 2

Add subtypes to "bot".

In DesktopTrale, right-click on the "bot" node in the TypeHierarchy tree navigation on lefthand side.



The Grammar dt-01-FirstWords

You received a grammar with the name above. When you open the grammar, you will see that it just contains one type in the type hierarchy, namely the type bot. This is the most general type in all of grammars All other types that we define are its subtypes. The only purpose of bot is to allow us to define our own more specific subtypes that do some real work for us.

The goal of the first grammar is to write lexical entries for the two words lilly and smokes. All this grammar will then do is to recognize the two strings lilly and smokes and tell us that they represent words.

Before, we can write lexical entries or add anything else to a grammar, we first need to define the type hierarchy! We will do this together.

Task 1
Add the type word as a subtype of bot.

Now we have a first type in the grammar that we can do something useful with.

Task 2
Add the two words lilly and smokes!

Here, you can check what your grammar can do at this point: it recognises lilly and smokes and says that they are words. No more and no less!


If everything went well, then you have just successfully written your first grammar. Congratulations!

The Grammar dt-02-FirstFeature

Task 1
Add the types word and syntax as subtypes of bot.
Task 2
# Add the types noun and verb as subtypes of syntax.
# To the type word, add the feature SYNTAX of type syntax.
 Task 3
 Add the two words lilly and smokes. Give them the SYNTAX value that is appropriate for them.














Navigation:

 Main Page   Week 2    Week 3    Week 4    Week 5    Week 6    Week 7   Week 8