Grammar Writing: Week 2: Difference between revisions

From English Grammar
Jump to navigation Jump to search
No edit summary
Line 67: Line 67:
   Add the two words lilly and smokes. Give them the SYNTAX value that is appropriate for them.
   Add the two words lilly and smokes. Give them the SYNTAX value that is appropriate for them.


= The Grammar '''dt-03-POSFeatures''' =
So far, your grammar treats all nouns alike. It says about every one of them that it is [SYNTAX ''noun'']. But not all nouns behave alike. For instance, some can function as subjects, but not all of them can, as you can see below:
<span style="color: blue>Task 1</span>
Add the types ''word'' and ''syntax'' as subtypes of bot.
<span style="color: blue>Task 2</span>
# Add the types noun and verb as subtypes of syntax.
# To the type word, add the feature SYNTAX of type syntax.
  <span style="color: blue>Task 3</span>
  Add the two words lilly and smokes. Give them the SYNTAX value that is appropriate for them.





Revision as of 13:07, 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. The type "bot" should appear. (You can center the visualization by right-clicking on the panel.)

Task 2

Add subtypes to "bot".

In DesktopTrale, expand and right-click the "bot" node in the TypeHierarchy tree navigation on lefthand side. Add appropriate subtypes. Note that only lower case letters and the underscore (_) are allowed as valid characters.

Task 3

Add features to the type car for fuel consumption and acceleration.

In DesktopTrale, add appropriate types for extent and speed as shown in the visualization. Add features, by clicking on "Edit TH". The focused type should be car(!).

Click on +feature, and select type extent. Name the feature fuel_consumption.

Click on +feature, and select type speed. Name the feature acceleration.

Click on the "Type Hierarchy" node in the "Your Grammar" tab. Your visualization should look like the one above.


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.


The Grammar dt-03-POSFeatures

So far, your grammar treats all nouns alike. It says about every one of them that it is [SYNTAX noun]. But not all nouns behave alike. For instance, some can function as subjects, but not all of them can, as you can see below:


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