Stephen McConnel
Alpha test version 0.97a9 of October 30, 1995
Contents:
PC-PATR uses a left corner chart parser with these characteristics:
mail address telephone
--------------------------------------------------------------
Stephen McConnel (972)708-7361 (office)
Academic Computing Department (972)708-7363 (fax)
Summer Institute of Linguistics
7500 W. Camp Wisdom Road electronic mail address
Dallas, TX 75236 -------------------------
U.S.A. steve@acadcomp.sil.org
or steve.mcconnel@sil.org
LHS ---> RHS_1 RHS_2 . . .LHS (the symbol to the left of the arrow) is a nonterminal symbol for the type of phrase that is being described. To the right of the arrow is an ordered list of the constituents of the phrase. These constituents are either nonterminal symbols, appearing on the left hand side of some rule in the grammar, or terminal symbols, representing basic classes of elements from the lexicon. These basic classes usually correspond to what are commonly called parts of speech. In PATR-II the terminal and nonterminal symbols are both referred to as categories.
Rule S -> NP VP (SubCl)
Rule NP -> {(Det) (AdjP) N (PrepP)} / PR
Rule Det -> DT / PR
Rule VP -> VerbalP (NP / AdjP) (AdvP)
Rule VerbalP -> V
Rule VerbalP -> AuxP V
Rule AuxP -> AUX (AuxP_1)
Rule PrepP -> PP NP
Rule AdjP -> (AV) AJ (AdjP_1)
Rule AdvP -> {AV / PrepP} (AdvP_1)
Rule SubCl -> CJ S
Consider the PC-PATR style context-free phrase structure grammar in figure 1 It has ten nonterminal symbols (S, NP, Det, VP, VerbalP, AuxP, PrepP, AdjP, AdvP, and SubCl), and nine terminal symbols (N, PR, DT, V, AUX, PP, AV, AJ, and CJ). This grammar describes a small subset of English sentences. Several aspects of this grammar are worth mentioning.
S
__________|__________
NP VP
___|____ _________|__________
Det N VerbalP NP AdvP
| man | | |
DT V PR PrepP
the sees us _____|______
PP NP
with ____|_____
Det N
| telescope
DT
a
A significant amount of grammar development can be done just with context-free phrase structure rules such as these. For example, parsing the sentence "the man sees us with a telescope" with this simple grammar produces a parse tree like that shown in figure 3. Parsing the similar sentence "we see the man with a telescope" produces two different parses as shown in figure 4, correctly showing the ambiguity between whether we used a telescope to see the man, or the man had a telescope when we saw him.
S
__________|__________
NP VP
| _____________|_____________
PR VerbalP NP AdvP
we | ___|____ |
V Det N PrepP
see | man _____|______
DT PP NP
the with ____|_____
Det N
| telescope
DT
a
S
_______|________
NP VP
| ________|________
PR VerbalP NP
we | _________|__________
V Det N PrepP
see | man _____|______
DT PP NP
the with ____|_____
Det N
| telescope
DT
a
A fundamental problem with context-free phrase structure grammars is
that they tend to grossly overgenerate. For example, the sample
grammar would incorrectly recognize the sentence "*he see the man with
a telescope", assigning it tree structures similar to those shown in
figure 4. With only the simple categories used by
context-free phrase structure rules, a very large number of rules are
required to accurately handle even a small subset of a language's
grammar. This is the primary motivation behind feature structures, the
basic enhancement of PATR-II
over context-free phrase structure
grammars. (Gazdar and Mellish (1989, pages 142-147) discuss
why context-free phrase structure grammars are inadequate to model some
human languages. The PATR-II
formalism (unification of feature
structures added to the context-free phrase structure rules) is shown
to be adequate for those cases.)
(1) [ lex: telescope cat: N ]where lex and cat are attribute names, and telescope and N are the values for those attributes. Note that the feature structure is enclosed in brackets, with an open bracket marking the beginning of a feature structure and a matching close bracket marking its end. Each feature occurs on a separate line, with the name coming first, followed by a colon and then its value. Feature names and (simple) values are single words consisting of alphanumeric characters.
Feature structures can have either simple values, such as the example above, or complex values, such as this (example 2):
(2)
[ lex: telescope
cat: N
gloss: `telescope
head: [ agr: [ 3sg: + ]
number: SG
pos: N
proper: -
verbal: - ]
root_pos: N ]
where the value of the head
feature is another feature
structure, that also contains an embedded feature structure. Feature
structures can be arbitrarily nested in this manner.
Portions of a feature structure can be referred to using the path notation. A path is a sequence of one or more feature names enclosed in angled brackets ( <> ). For instance, example 3-5 would all be valid feature paths based on the feature structure of example 2
(3) <head>
(4) <head number>
(5) <head agr 3sg>Paths are used in feature templates and feature constraints, described below.
Different features within a feature structure can share values. This is not the same thing as two features having identical values. In example 6 below, the <head agr> and <subj head agr> features have identical values, but in example 7 they share the same value:
(6)
[ cat: S
pred: [ cat: VP
head: [ agr: [ 3sg: + ]
finite: +
pos: V
tense: PAST
vform: ED ] ]
subj: [ cat: NP
head: [ agr: [ 3sg: + ]
case: NOM
number: SG
pos: N
proper: -
verbal: - ] ] ]
(7)
[ cat: S
pred: [ cat: VP
head: [ agr: $1[ 3sg: + ]
finite: +
pos: V
tense: PAST
vform: ED ] ]
subj: [ cat: NP
head: [ agr: $1
case: NOM
number: SG
pos: N
proper: -
verbal: - ] ] ]
(Example 8 not used, same as example 7.)
Shared values are indicated by the coindexing markers $1, $2, and so on.
Note that upper and lower case letters used in feature names and values are distinctive. For example, NUMBER is not the same as Number or number. (This is also true of the symbols used in the context-free phrase structure rules.)
Consider the following feature structures:
(9)
[ agreement: [ number: singular
person: first ] ]
(10) [ agreement: [ number: singular ] case: nominative ] ]
(11)
[ agreement: [ number: singular
person: third ] ]
(12)
[ agreement: [ number: singular
person: first ]
case: nominative ] ]
(13)
[ agreement: [ number: singular
person: third ]
case: nominative ] ]
Feature 10 can unify with either feature
9 (producing feature 12)
or feature 11 (producing feature 13).
However, feature 9 cannot unify with
feature 11
due to the conflict in the values of their <agreement person> features.
(14)
Rule S -> NP VP (SubCl)
<NP head agr> = <VP head agr>
<NP head case> = NOM
<S subj> = <NP>
<S head> = <VP head>
(15)
Rule NP -> {(Det) (AJ) N (PrepP)} / PR
<Det head number> = <N head number>
<NP head> = <N head>
<NP head> = <PR head>
Rule 14
has two feature constraints that limit the
co-occurrence of NP and VP, and two feature constraints that build the
feature structures for S. This highlights the dual purpose of feature
constraints in PC-PATR: limiting the co-occurrence of phrase
structure elements and constructing the feature structure for the
element defined by a rule. The first constraint states that the NP
and VP <head agr> features must unify successfully,
and also modifies both of those features if they do unify. The second
constraint states that NP's <head case> feature must
either be equal to NOM or else be undefined. In the latter case, it
is set equal to NOM. The last two constraints create a new feature
structure for S from the feature structures for NP and VP.
Rule 15 illustrates another important point about feature constraints. Constraints are applied only if they involve the phrase structure constituents actually found for the rule.
Rule S -> NP VP (SubCl)
<NP head agr> = <VP head agr>
<NP head case> = NOM
<S subj> = <NP>
<S pred> = <VP>
Rule NP -> {(Det) (AdjP) N (PrepP)} / PR
<Det head number> = <N head number>
<NP head> = <N head>
<NP head> = <PR head>
Rule Det -> DT / PR
<PR head case> = GEN
<Det head> = <DT head>
<Det head> = <PR head>
Rule VP -> VerbalP (NP / AdjP) (AdvP)
<NP head case> = ACC
<NP head verbal> = -
<VP head> = <VerbalP head>
Rule VerbalP -> V
<V head finite> = +
<VerbalP head> = <V head>
Rule VerbalP -> AuxP V
<V head finite> = -
<VerbalP head> = <AuxP head>
Rule AuxP -> AUX (AuxP_1)
<AuxP head> = <AUX head>
Rule PrepP -> PP NP
<NP head case> = ACC
<PrepP head> = <PP head>
Rule AdjP -> (AV) AJ (AdjP_1)
Rule AdvP -> {AV / PrepP} (AdvP_1)
Rule SubCl -> CJ S
1:
S
__________|__________
NP VP
___|____ _________|__________
Det N VerbalP NP AdvP
| man | | |
DT V PR PrepP
the saw us _____|______
PP NP
with ____|_____
Det N
| telescope
DT
a
[ cat: S
pred: [ cat: VP
head: [ agr: $1[ 3sg: + ]
finite:+
pos: V
tense: PAST
vform: ED ] ]
subj: [ cat: NP
head: [ agr: $1
case: NOM
number:SG
pos: N
proper:-
verbal:- ] ] ]
1 parse found
Figure 5 shows the grammar of figure 1 augmented with a number of feature constraints. With this grammar (and a suitable lexicon), the parse output shown in figure 3 would include the sentence feature structure, as shown in figure 6. Note that the <subj head agr> and <pred head agr> features share a common value as a result of the feature constraint unifications associated with the rule S --> NP VP (SubCl).
PC-PATR allows disjunctive feature constraints with its phrase structure rules. Consider rules 16 and 17 below. These two rules have the same phrase structure rule part. They can therefore be collapsed into the single rule 18, which has a disjunction in its unification constraints.
(16)
Rule CP -> NP C' ; for wh questions with NP fronted
<NP type wh> = +
<C' moved A-bar> = <NP>
<CP type wh> = <NP type wh>
<CP type> = <C' type>
<CP moved A-bar> = none
<CP type root> = + ; root clauses
<CP type q> = +
<CP type fin> = +
<CP moved A> = none
<CP moved head> = none
(17)
Rule CP -> NP C' ; for wh questions with NP fronted
<NP type wh> = +
<C' moved A-bar> = <NP>
<CP type wh> = <NP type wh>
<CP type> = <C' type>
<CP moved A-bar> = none
<CP type root> = - ; non-root clauses
(18)
Rule CP -> NP C' ; for wh questions with NP fronted
<NP type wh> = +
<C' moved A-bar> = <NP>
<CP type wh> = <NP type wh>
<CP type> = <C' type>
<CP moved A-bar> = none
{
<CP type root> = + ; root clauses
<CP type q> = +
<CP type fin> = +
<CP moved A> = none
<CP moved head> = none
/
<CP type root> = - ; non-root clauses
}
Not only does PC-PATR allow disjunctive unification constraints, but it also allows disjunctive phrase structure rules. Consider rule 19; it is very similar to rule 18. These two rules can be further combined to form rule 20, which has disjunctions in both its phrase structure rule and its unification constraints.
(19)
Rule CP -> PP C' ; for wh questions with PP fronted
<PP type wh> = +
<C' moved A-bar> = <PP>
<CP type wh> = <PP type wh>
<CP type> = <C' type>
<CP moved A-bar> = none
{
<CP type root> = + ; root clauses
<CP type q> = +
<CP type fin> = +
<CP moved A> = none
<CP moved head> = none
/
<CP type root> = - ; non-root clauses
}
(20)
; for wh questions with NP or PP fronted
Rule CP -> { NP / PP } C'
<NP type wh> = +
<C' moved A-bar> = <NP>
<CP type wh> = <NP type wh>
<PP type wh> = +
<C' moved A-bar> = <PP>
<CP type wh> = <PP type wh>
<CP type> = <C' type>
<CP moved A-bar> = none
{
<CP type root> = + ; root clauses
<CP type q> = +
<CP type fin> = +
<CP moved A> = none
<CP moved head> = none
/
<CP type root> = - ; non-root clauses
}
Since the open brace ({) introduces disjunctions both in the phrase structure rule and in the unification constraints, care must be taken to avoid confusing PC-PATR when it is loading the grammar file. The end of the phrase structure rule, and the beginning of the unification constraints, is signaled either by the first constraint beginning with an open angle bracket (<) or by a colon (:). If the first constraint is part of a disjunction, then the phrase structure rule must end with a colon. Otherwise, PC-PATR will treat the unification constraint as part of the phrase structure rule, and will shortly complain about syntax errors in the grammar file.
Perhaps it should be noted that disjunctions in phrase structure rules or unifications are expanded when the grammar file is read. They serve only as a convenience for the person writing the rules.
Note that these keywords are not case sensitive: RULE is the same as rule, and both are the same as Rule.
The optional rule identifier consists of one or more words enclosed in braces. Its current utility is only as a special form of comment describing the intent of the rule. (Eventually it may be used as a tag for interactively adding and removing rules.) The only limits on the rule identifier are that it not contain the comment character and that it all appears on the same line in the grammar file.
The terminal and nonterminal symbols in the rule have the following characteristics:
Rule X -> X_1 CJ X_2
<X cat> = <X_1 cat>
<X cat> = <X_2 cat>
<X arg1> = <X_1 arg1>
<X arg1> = <X_2 arg1>
The symbol X can be useful for capturing generalities. Care must be
taken, since it can be replaced by anything.
The symbols on the right hand side of a phrase structure rule may be marked or grouped in various ways:
Rule S -> NP {TVP / IV}
Rule S -> NP TVP / IV
A rule can be followed by zero or more feature constraints that refer to symbols used in the rule. A feature constraint has these parts, in the order listed:
A feature constraint that refers only to symbols on the right hand side of the rule constrains their co-occurrence. In the following rule and constraint, the values of the agr features for the NP and VP nodes of the parse tree must unify:
Rule S -> NP VP
<NP agr> = <VP agr>
If a feature constraint refers to a symbol on the right hand side of
the rule, and has an atomic value on its right hand side, then the
designated feature must not have a different value. In the following
rule and constraint, the head case
feature for the NP node of
the parse tree must either be originally undefined or equal to NOM:
Rule S -> NP VP
<NP head case> = NOM
(After unification succeeds, the head case
feature for the NP
node of the parse tree will be equal to NOM.)
A feature constraint that refers to the symbol on the left hand side of the rule passes information up the parse tree. In the following rule and constraint, the value of the tense feature is passed from the VP node up to the S node:
Rule S -> NP VP
<S tense> = <VP tense>
The characters (){}[]<>=: cannot be used in template names since they are used for special purposes in the grammar file. The characters /_ can be freely used in template names. The character \ should not be used as the first character of a template name because that is how fields are marked in the lexicon file.
The abbreviations defined by templates are usually used in the feature field of entries in the lexicon file. For example, the lexical entry for the irregular plural form feet may have the abbreviation pl in its features field. The grammar file would define this abbreviation with a template like this:
Let pl be [number: PL]The path notation may also be used:
Let pl be <number> = PLMore complicated feature structures may be defined in templates. For example,
Let 3sg be [tense: PRES
agr: 3SG
finite: +
vform: S]
which is equivalent to:
Let 3sg be [<tense> = PRES
<agr> = 3SG
<finite> = +
<vform> = S]
In the following example, the abbreviation irreg
is defined using
another abbreviation:
Let irreg be <reg> = -
pl
The abbreviation pl
must be defined previously in the grammar
file or an error will result. A subsequent template could also use the
abbreviation irreg
in its definition. In this way, an
inheritance hierarchy features may be constructed.
Feature templates permit disjunctive definitions. For example, the lexical entry for the word deer may specify the feature abbreviation sg-pl. The grammar file would define this as a disjunction of feature structures reflecting the fact that the word can be either singular or plural:
Let sg/pl be {[number:SG]
[number:PL]}
This has the effect of creating two entries for deer, one with
singular number and another with plural. Note that there is no limit
to the number of disjunct structures listed between the braces. Also,
there is no slash (/) between the elements of the disjunction as
there is between the elements of a disjunction in the rules.
A shorter version of the above template using the path notation looks
like this:
Let sg/pl be <number> = {SG PL}
Abbreviations can also be used in disjunctions, provided that they
have previously been defined:
Let sg be <number> = SG
Let pl be <number> = PL
Let sg/pl be {[sg] [pl]}
Note the square brackets around the abbreviations sg
and pl
without square brackets they would be interpreted as simple values
instead.
Feature templates can assign default atomic feature values, indicated by prefixing an exclamation point (!). A default value can be overridden by an explicit feature assignment. This template says that all members of category N have singular number as a default value:
Let N be <number> = !SGThe effect of this template is to make all nouns singular unless they are explicitly marked as plural. For example, regular nouns such as book do not need any feature in their lexical entries to signal that they are singular; but an irregular noun such as feet would have a feature abbreviation such as pl in its lexical entry. This would be defined in the grammar as [number: PL], and would override the default value for the feature number specified by the template above. If the N template above used SG instead of !SG, then the word feet would fail to parse, since its number feature would have an internal conflict between SG and PL.
PC-PATR recognizes the following parameters:
Parameter Start symbol is Sdeclares that the parse goal of the grammar is the nonterminal category S. The default start symbol is the left hand symbol of the first phrase structure rule in the grammar file.
Parameter Restrictor is <cat> <head form>declares that the cat and head form features should be used to screen rules before adding them to the parse chart. The default is not to use any features for such filtering. This filtering, named restriction in Shieber (1985), is performed in addition to the normal top-down filtering based on categories alone. (Restriction is not yet implemented. Should it be instead of normal filtering rather than in addition to?)
Parameter Attribute order is cat lex sense head
first rest agreement
declares that the cat
attribute should be the first one shown
in any output from PC-PATR
and that the other attributes should
be shown in the relative order shown, with the agreement
attribute shown last among those listed, but ahead of any attributes
that are not listed above. Attributes that are not listed are ordered
according to their character code sort order. If the attribute order
is not specified, then the category feature cat
is shown first,
with all other attributes sorted according to their character codes.
Parameter Category feature is Categdeclares that Categ is the name of the category attribute. The default name for this attribute is cat
Parameter Lexical feature is Lexdeclares that Lex is the name of the lexical attribute. The default name for this attribute is lex
Parameter Gloss feature is Glossdeclares that Gloss is the name of the gloss attribute. The default name for this attribute is gloss.
Consider the information shown in figure 7
; lexicon entry
\w stormed
\c V
\f Transitive AgentlessPassive
<head trans pred> = storm
;
definitions from the grammar file
Let Transitive be
<subcat first cat> = NP
<subcat rest first cat> = NP
<subcat rest rest> = end
<head trans arg1> = <subcat first head trans>
<head trans arg2> = <subcat rest first head trans>.
Define AgentlessPassive as
<out cat> = <in cat>
<out subcat> = <in subcat rest>
<out lex> = <in lex> ; added for PC-PATR
<out head> = <in head>
<out head form> => passiveparticiple.
[ lex: stormed
cat: V
head: [ trans: [ arg1: $1 [ ]
arg2: $2 [ ]
pred: storm ] ]
subcat: [ first: [ cat: NP
head: [ trans: $1 ] ]
rest: [ first: [ cat: NP
head: [ trans: $2 ] ]
rest: end ] ] ]
[ lex: stormed
cat: V
head: [ trans: [ arg1: [ ]
arg2: $1 [ ]
pred: storm ]
form: passiveparticiple ]
subcat: [ first: [ cat: NP
head: [ trans: $1 ] ]
rest: end ] ]
When the lexicon entry is loaded, it is initially assigned the feature
structure shown in figure 8, which is the
unification of the information given in the various fields of the
lexicon entry. Since one of the the labels stored in the \f
(feature) field is actually the name of a lexical rule, after the
complete feature structure has been built, the named lexical rule is
applied. After the rule has been applied, the feature structure has
been changed to the one shown in figure 9
Note that
all of the information in the output feature structure is from the
input feature structure, but not all of the input feature information
is found in the the output feature structure.
Using a lexical rule in conjunction with the PC-Kimmo morphological
parser within PC-PATR
is illustrated in
figures 10-12
Define MapKimmoFeatures as
<out cat> = <in head pos>
<out head> = <in head>
<out gloss> = <in root>
<out root_pos> = <in root_pos>
[ cat: Word
clitic: []
drvstem: []
head: [ agr: [ 3sg: + ]
finite: +
pos: V
tense: PRES
vform: S ]
root: `sleep
root_pos: V ]
[ cat: V
gloss: `sleep
head: [ agr: [ 3sg: + ]
finite: +
pos: V
tense: PRES
vform: S ]
lex: sleeps
root_pos: V ]
Figure 10
shows the lexical rule for mapping from
the top-level feature structure produced by the morphological parser to
the bottom-level feature structure used by the sentence parser. Note
that this rule must be named MapKimmoFeatures (unorthodox
capitalization and all).
Figure 11
shows the feature structure
created by the PC-Kimmo parser. After the lexical rule shown in
figure 10
has been applied (and after some
additional automatic processing), the feature structure shown in
figure 10
is passed to the PC-PATR
parser.
Note that the feature structure passed to the PC-PATR parser always has both a lex feature and a gloss feature, even if the MapKimmoFeatures lexical rule does not create them. The default value for the lex feature is the original word from the sentence being parsed. The default value for the gloss feature is the concatenation of the glosses of the individual morphemes in the word.
In contrast to the lex and gloss features which are provided automatically by default, the cat feature must be provided by the MapKimmoFeatures lexical rule. There is no way to provide this feature automatically, and it is required for the phrase structure rule portion of PC-PATR.
Each word loaded from the lexicon file is assigned certain features based on the fields described above.
For example, consider these entries for the words fox and foxes.
\w fox
\c N
\g canine
\f <number> = singular
\w foxes
\c N
\g canine+PL
\f <number> = plural
When these entries are used by the grammar, they are represented by these
feature structures:
[ cat: N
gloss: canine
lex: foxes
number: singular ]
[ cat: N
gloss: canine+PL
lex: foxes
number: plural ]
The lexicon entries can be simplified by defining feature templates in
the grammar file. Consider the following templates:
Let PL be <number> = plural Let N be <number> = !singularWith these two templates, defining an abbreviation for "plural" and defining a default feature for category N (noun), the lexicon entries can be rewritten as follows:
\w fox
\c N
\g canine
\f
\w foxes
\c N
\g canine+PL
\f PL
Note that the feature (\f) field of the first entry could be
omitted altogether since it is now empty.
When using the PC-Kimmo morphological parser, PC-PATR requires a special lexical rule in the (sentence level) grammar file. This rule is named MapKimmoFeatures and is used automatically to map from the features produced by the word parse to the features needed by the sentence parse. For example, consider the following definition:
Define MapKimmoFeatures as
<out cat> = <in head pos>
<out lex> = <in lex>
<out head> = <in head>
This lexical rule uses the <head pos> feature produced by the
PC-Kimmo parser as the <cat> feature for the PC-PATR
parser, and passes the <lex> and <head> features from the morphological parser to the sentence parser unchanged.
set GO32TMP=c:/tempReplace c:/temp with a suitable directory on your system for storing temporary files. Note that the slashes in this command are forward (/) slashes, not backslashes (\).
The sources have been successfully compiled on a SparcStation 1+ using both GNU gcc 2.5.7 and the standard cc compiler that comes with SunOS 4.1.3_U1.
For MS-DOS or Windows, you can give a full path starting with the disk letter and a colon (for example, a:); a path starting with \ which indicates a directory at the top level of the current disk; a path starting with .. which indicates the directory above the current one; and so on. Directories are separated by the \ character.
For the Macintosh, you can give a full path starting with the name of your hard disk, a path starting with : which means the current folder, or one starting :: which means the folder containing the current one (and so on).
For Unix, you can give a full path starting with a / (for example, /usr/pcpatr); a path starting with .. which indicates the directory above the current one; and so on. Directories are separated by the / character.
This command behaves the same as parse except that input comes from a file rather than the keyboard, and output may go to a file rather than the screen. When finished, a statistical report of successful parses is displayed on the screen.
The default filetype extension for load analysis is .ana, and the default filename is ample.ana. l a is a synonym for load analysis.
The default filetype extension for load grammar is .grm, and the default filename is grammar.grm. l gis a synonym for load grammar.
The default filetype extension for load kimmo grammar is .grm, and the default filename is grammar.grm. l k g is a synonym for load kimmo grammar.
The default filetype extension for load kimmo lexicon is .lex, and the default filename is lexicon.lex. l k l is a synonym for load kimmo lexicon.
The default filetype extension for load kimmo mapping is .map, and the default filename is feat.map. l k m is a synonym for load kimmo mapping.
The default filetype extension for load kimmo rules is .rul, and the default filename is rules.rul. l k r is a synonym for load kimmo rules.
The default filetype extension for load lexicon is .lex, and the default filename is lexicon.lex. l l is a synonym for load lexicon.
If a filename is given on the same line as the log command, then that file is used for the log file. Any previously existing file with the same name will be overwritten. If no filename is provided, then the file pcpatr.log in the current directory is used for the log file.
Use close to stop recording in a log file. If a log command is given when a log file is already open, then the earlier log file is closed before the new log file is opened.
Both the grammar and the lexicon must be loaded before using this command.
Be careful with this option. Setting failures to on can cause the PC-PATR to go into an infinite loop for certain recursive grammars and certain input sentences. (We may try to do something to detect this type of behavior, at least partially.)
This should not be required in the final version of PC-PATR.
Sentence
|
Declarative
_____|_____
NP VP
| ___|____
N V COMP
cows eat |
NP
|
N
grass
set tree flat turns on the parse tree display, displaying the
result of the parse as a flat tree structure in the form of a bracketed
string. The same short sentence would look something like this:
(Sentence (Declarative (NP
(N cows)) (VP (V eat) (COMP
(NP (N grass))))))
set tree indented turns on the parse tree display, displaying
the result of the parse in an indented format sometimes called a northwest tree
The same short sentence would look like this:
Sentence
Declarative
NP
N cows
VP
V eat
COMP
NP
N grass
set tree off disables the display of parse trees altogether.
If no system-level command is given on the line with the system command, then PC-PATR is pushed into the background and a new system command processor (shell) is started. Control is usually returned to PC-PATR in this case by typing exit as the operating system command. ! (exclamation point) is a synonym for system.
The default filetype extension for take is .tak, and the default filename is pcpatr.tak. take files can be nested three deep. That is, the user types take file1, file1 contains the command take file2, and file2 has the command take file3. It would be an error for file3 to contain a take command. This should not prove to be a serious limitation.
A take file can also be specified by using the -t command line option when starting PC-PATR When started, PC-PATR looks for a take file named pcpatr.tak in the current directory to initialize itself with.
Shieber, Stuart M., "Using Restriction to Extend Parsing Algorithms for Complex-feature-based Formalisms," In Proceedings of the 22nd Annual Meeting of the Association for Computational Linguistics, University of Chicago, Chicago, Illinois, 8-12 July 1985, pages 145-152.
Shieber, Stuart M., An Introduction to Unification Based Approaches to Grammar, CSLI Lecture Notes Series, Number 4, Center for the Study of Language and Information, Stanford University, 1986.
Gazdar, Gerald and Chris Mellish, Natural Language Processing in LISP, Addison-Wesley Publishing Company, Reading, MA, 1989.
Reply to WWW@sil.org