File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,14 @@ function adjective(phrases: AdjectivePhrase, depth: number): string {
76
76
function preposition ( preposition : Preposition ) : string {
77
77
return `${ word ( preposition . preposition ) } ${ noun ( preposition . object , 0 ) } ` ;
78
78
}
79
- function clause ( clause : Clause ) : string {
80
- switch ( clause . type ) {
79
+ function clause ( ast : Clause ) : string {
80
+ switch ( ast . type ) {
81
81
case "free form" :
82
- return clause . text ;
82
+ return ast . text ;
83
83
case "interjection" :
84
- return word ( clause . interjection ) ;
84
+ return word ( ast . interjection ) ;
85
85
case "implied it's" : {
86
- const verb = clause . verb ;
86
+ const verb = ast . verb ;
87
87
let text : string ;
88
88
switch ( verb . type ) {
89
89
case "linking noun" :
@@ -96,9 +96,13 @@ function clause(clause: Clause): string {
96
96
return [ text ! , ...verb . preposition . map ( preposition ) ] . join ( " " ) ;
97
97
}
98
98
case "subject phrase" :
99
- return noun ( clause . subject , 0 ) ;
99
+ return noun ( ast . subject , 0 ) ;
100
+ case "vocative" :
101
+ return `${ ast . call } ${ noun ( ast . addressee , 0 ) } ` ;
102
+ case "dependent" :
103
+ return `${ ast . conjunction } ${ clause ( ast . clause ) } ` ;
100
104
default :
101
- throw new TodoError ( `composing ${ clause . type } ` ) ;
105
+ throw new TodoError ( `composing ${ ast . type } ` ) ;
102
106
}
103
107
}
104
108
function sentence ( sentence : Sentence ) : string {
You can’t perform that action at this time.
0 commit comments