Before we start writing general network traversal programs, we need to consider how we are going to represent transition networks as Pop11 data structures. If we ignore abbreviations for now, we will need to know the following about a network:
- What its initial nodes are. - What its final nodes are. - What its arcs are.
Thus, we will represent a network as a list structure with three components, for the initial nodes, the final nodes and the transitions (arcs). These components will be represented by lists in a format that is easy to remember and to type. So here are some example networks:
Code:english1.p
vars swahili_1; [[Initial 1] [Final 5] [From 1 to 2 by subj] [From 2 to 3 by tense] [From 3 to 4 by obj] [From 4 to 5 by stem]] -> swahili_1; vars english_1; [ [Initial 1] [Final 9] [From 1 to 3 by NP] [From 1 to 2 by DET] [From 2 to 3 by N] [From 3 to 4 by BV] [From 4 to 5 by ADV] [From 4 to 5 by #] [From 5 to 6 by DET] [From 5 to 7 by DET] [From 5 to 8 by #] [From 6 to 6 by MOD] [From 6 to 7 by ADJ] [From 7 to 9 by N] [From 8 to 8 by MOD] [From 8 to 9 by ADJ] [From 9 to 4 by CNJ] [From 9 to 1 by CNJ]] -> english_1;
Code:finite.p and here are the basic procedures for accessing the components of a network:
define initial_nodes(n) -> s; n --> [== [Initial ??s] ==] enddefine;
define final_nodes(n) -> s; n --> [== [Final ??s] ==] enddefine;
define transitions(n) -> t; n --> [= = ??t] enddefine;
For abbreviations, we will introduce a global variable ABBREVIATIONS whose value will be a list of lists such as the following:
vars abbreviations;
[ [NP abbreviates kim sandy lee] [DET abbreviates a the her] [N abbreviates consumer man woman] [BV abbreviates is was] [CNJ abbreviates and or] [ADJ abbreviates happy stupid] [MOD abbreviates very] [ADV abbreviates often always sometimes] ] -> abbreviations;
Send us a comment.