TRALE: Lists and Subcategorization
Now, we’ll explore how lists are declared and used in TRALE, particularly for subcategorization in sentence parsing.
Table of Contents
Open Table of Contents
1. Declaration of Lists
In TRALE, lists are a recursive data structure that can be empty or contain elements. Here’s how you declare lists:
list sub [e_list, ne_list].
ne_list intro [hd:bot, tl:list].
Explanation:
list
: The base type for lists, which has two subtypes:e_list
(empty list) andne_list
(non-empty list).ne_list
has two features:hd
: The head of the list (the first item).tl
: The tail of the list (the rest of the list after the head).
This recursive structure allows for lists of arbitrary length.
2. List Usage
Lists are represented with square brackets ([]
). They can contain one or more elements, and the vertical bar (|
) operator is used to separate the head from the tail of the list.
Examples:
- Empty list:
[]
- Single element list:
[X]
- List with multiple elements:
[X1, X2, X3]
- Head and tail structure:
[Head|Rest]
Example of List Nesting
[X1|[X2|[X3, X4|[X5, X6|Rest]]]]
Here, X1
is the head, and the rest of the list (Rest
) contains other nested elements.
3. Subcategorization Lists (SubCat Lists)
Lists are particularly useful for subcategorization in syntactic rules. Subcategorization lists (subcat
) specify what arguments a verb can take, such as objects or subjects.
For example:
- A transitive verb (like notice) requires one object.
- A ditransitive verb (like give) requires two objects.
Subcategorization Example
bot sub [cat, agr, person, sem].
cat sub [agreeable, s].
agreeable sub [np, verbal] intro [agr:agr, sem:sem].
np intro [sem:n_sem].
verbal sub [v, vp, s] intro [sem:v_sem, subcat:list].
agr intro [person:person, case:case].
sem sub [v_sem, n_sem].
v_sem sub [notice, give].
n_sem sub [book, pronoun].
list sub [e_list, ne_list].
ne_list intro [hd:bot, tl:list].
person sub [first, second, third].
case sub [subjective, objective].
Key Points
agreeable
is a type that can be annp
(noun phrase) or averbal
(verbal category).verbal
types include verbs (v
), verb phrases (vp
), and sentences (s
).subcat
is a feature ofverbal
, represented as a list of arguments (objects, subjects) that the verb takes.
Example of Pronoun and Verb Definitions
i ---> (np, sem:pronoun, agr:(person:first, case:subjective)).
you ---> (np, sem:pronoun, agr:(person:second, case:subjective)).
he ---> (np, sem:pronoun, agr:(person:third, case:subjective)).
books ---> (np, sem:book).
notice ---> (v, sem:notice, agr:person:first,
subcat: [
(Obj, np, agr:case:objective),
(Subj, np, agr:case:subjective)]).
notices ---> (v, sem:notice, agr:person:third,
subcat: [
(Obj, np, agr:case:objective),
(Subj, np, agr:case:subjective)]).
give ---> (v, sem:give, agr:person:first,
subcat: [
(Obj1, np, agr:case:objective),
(Obj2, np, agr:case:objective),
(Subj, np, agr:case:subjective)]).
gives ---> (v, sem:give, agr:person:third,
subcat: [
(Obj1, np, agr:case:objective),
(Obj2, np, agr:case:objective),
(Subj, np, agr:case:subjective)]).
Explanation:
- Each verb is defined with a specific
subcat
list that includes the objects (Obj
,Obj1
,Obj2
) and the subject (Subj
) it requires. - The subcategorization list specifies the syntactic arguments of the verb. For instance:
- notice takes one object and a subject.
- give takes two objects and a subject.
4. Rules for Verb Phrases and Sentences
Rules are applied to combine these subcategorization lists and generate valid sentences.
Verb Phrase Rule (vp
)
vp rule
(vp, sem:Sem, agr:Agr, subcat:(Rest, [_|_])) ===>
cat> (verbal, sem:Sem, agr:Agr, subcat: [Obj|Rest]),
cat> Obj.
Explanation:
- This rule defines how a verb phrase is constructed. It expects a
verbal
category (e.g., a verb) followed by its object (Obj
). - The subcat list is processed recursively, where the object is consumed, and the rest of the list (
Rest
) remains for further processing.
Sentence Rule (s
)
s rule
(s, sem:Sem, agr:Agr, subcat:([], Rest)) ===>
cat> (Subj, agr:Agr),
cat> (vp, sem:Sem, agr:Agr, subcat: [Subj|Rest]).
Explanation:
- This rule generates a complete sentence (
s
) by combining a subject (Subj
) with a verb phrase (vp
). - It expects an empty subcat list for the verb phrase (i.e., all objects have been consumed) and adds the subject to the subcat list to form a full sentence.
5. Key Notes
-
Subcat List Order: The objects in the subcat list should be listed before the subject. This is because, in SVO (Subject-Verb-Object) languages, the verb phrase is built first, and the objects are consumed before the subject.
-
List Notation: The notation
[_|_]
is used to indicate that there should be at least one element in the list.
Full Grammar
bot sub [cat, agr, person, sem].
cat sub [agreeable, s].
agreeable sub [np, verbal] intro [agr:agr, sem:sem].
np intro [sem:n_sem].
verbal sub [v, vp, s] intro [sem:v_sem, subcat:list].
agr intro [person:person, case:case].
sem sub [v_sem, n_sem].
v_sem sub [notice, give].
n_sem sub [book, pronoun].
list sub [e_list, ne_list].
ne_list intro [hd:bot, tl:list].
person sub [first, second, third].
case sub [subjective, objective].
i ---> (np, sem:pronoun, agr:(person:first, case:subjective)).
you ---> (np, sem:pronoun, agr:(person:second, case:subjective)).
he ---> (np, sem:pronoun, agr:(person:third, case:subjective)).
she ---> (np, sem:pronoun, agr:(person:third, case:subjective)).
me ---> (np, sem:pronoun, agr:(person:first, case:objective)).
you ---> (np, sem:pronoun, agr:(person:second, case:objective)).
him ---> (np, sem:pronoun, agr:(person:third, case:objective)).
her ---> (np, sem:pronoun, agr:(person:third, case:objective)).
books ---> (np, sem:book).
notice ---> (v, sem:notice, agr:person:first,
subcat: [
(Obj, np, agr:case:objective),
(Subj, np, agr:case:subjective)]).
notices ---> (v, sem:notice, agr:person:third,
subcat: [
(Obj, np, agr:case:objective),
(Subj, np, agr:case:subjective)]).
give ---> (v, sem:give, agr:person:first,
subcat: [
(Obj1, np, agr:case:objective),
(Obj2, np, agr:case:objective),
(Subj, np, agr:case:subjective)]).
gives ---> (v, sem:give, agr:person:third,
subcat: [
(Obj1, np, agr:case:objective),
(Obj2, np, agr:case:objective),
(Subj, np, agr:case:subjective)]).
vp rule
(vp, sem:Sem, agr:Agr, subcat:(Rest, [_|_])) ===>
cat> (verbal, sem:Sem, agr:Agr, subcat:[Obj|Rest]),
cat> Obj.
s rule
(s, sem:Sem, agr:Agr, subcat:([], Rest)) ===>
cat> (Subj, agr:Agr),
cat> (vp, sem:Sem, agr:Agr, subcat:[Subj|Rest]).
By following these steps and examples, you can define recursive lists and use them for subcategorization in syntactic structures in TRALE. This allows for more precise and flexible parsing of complex sentence structures in natural language processing tasks.