John kicked the bucket

LING 388: Language and Computers Sandiway Fong Lecture 27 Administrivia 1. 
2. 
3. 
4. 
5. 
Review of translator so far Idioms TCEs Homework OpLonal Homework Bi-­‐direcLonal English grammar declaraLve sentence Bi-­‐direcLonal English grammar object wh-­‐quesLon Bi-­‐direcLonal English grammar subject wh-­‐quesLon Bi-­‐direcLonal English grammar yes/no-­‐quesLon Bi-­‐direcLonal Japanese Grammar phrase structure rules compuLng predarg(P,A1,A2,Type) Bi-­‐direcLonal Japanese Grammar lexical entries Translator Translator Translator Milestone •  A programming milestone in this course has been reached… •  You know how to implement grammars for mulLple languages •  We’ve seen techniques for implemenLng a variety of simple syntacLc phenomena: basic declaraLve sentences, English passives, progressives, wh-­‐quesLons, Japanese passives and wh-­‐quesLons. •  Use of extra arguments: record a parse, agreement, pass informaLon up the rule hierarchy •  Compute (Stanford Parser style) syntax trees •  Compute predicate-­‐argument structures for the translator English Idioms •  Consider the English sentence: –  John kicked the bucket –  Two possible interpretaLons: Idioma'c: “John died” Literal: John kicked the bucket idioms: non-­‐composiLon meaning i.e. meaning of idiom “die” cannot be inferred from the meaning of the cons;tu;ve words kick and bucket English Idioms •  Let’s implement the idiomaLc meaning first: –  John kicked the bucket (fixed.. frozen VP expression) –  #John kicked the buckets –  #John kicked a bucket PA representaLon predarg(V,Subject,Object,Type)
predarg(die+past,john,none,decl)
vp(predarg(die+past,_,none,decl),vbd,_) -­‐-­‐> [kicked,the,bucket]. English Idioms •  Let’s implement the literal meaning next: –  John kicked the bucket –  John kicked the buckets –  John kicked a bucket Note: two parses! (compare with next slide) We need to add the verb kick and the nouns bucket and buckets to the English grammar English Idioms •  Let’s implement the literal meaning next: –  John kicked the bucket –  John kicked the buckets –  John kicked a bucket Note: one parse only! English Idiom TranslaLon •  Let’s modify the Japanese grammar (jg26.pl) to handle the following Japanese sentences: –  Taroo-­‐ga baketsu-­‐o keAa –  predarg(keru+past,taroo,baketsu,decl)
• 
• 
• 
• 
• 
baketsu (バケツ) (bucket) kema = keru-­‐past (kick) kerimashita = keru+past (kick) formal shibaita = shibaku+past (kick) shibakimashita = shibaku+past (kick) formal –  Taroo-­‐ga shinda –  predarg(shinu+past,taroo,none,decl) •  shinda = shinu+past (die) •  nakunama = nakunaru+past •  nakunarimashita English Idiom TranslaLon •  We will also need to modify the translaLon table to handle: •  baketsu (バケツ) (bucket) •  kema = keru+past (kick) •  kerimashita = keru+past (kick) •  shinda = shinu+past (die) Homework 6: Japanese Idioms Part 1: Modify j26.pl to implement the idioma;c meaning •  Examples taroo-­‐ga sensei-­‐ni goma-­‐o suma predarg(odateru+past,taroo,sensei,decl) taroo-­‐nom teacher-­‐dat sesame-­‐acc grinded “John flaAered the teacher” taroo-­‐ga Hanako-­‐ni goma-­‐o suma taroo-­‐nom Hanako-­‐dat sesame-­‐acc grinded “John flaAered Mary” ni = (dat) daLve Case marker –  odateta is the Japanese counterpart for flattered – 
– 
– 
– 
– 
– 
– 
Step 1: add sensei, hanako Step 2: add VP rule for the idiom odateru suru Homework 6: Japanese Idioms •  Examples Part 2: Implement the English transla;on of the Japanese idiom idioma;c meaning taroo-­‐ga sensei-­‐ni goma-­‐o suma taroo-­‐nom teacher-­‐dat sesame-­‐acc grinded “John flaAered the teacher” taroo-­‐ga Hanako-­‐ni goma-­‐o suma taroo-­‐nom Hanako-­‐dat sesame-­‐acc grinded “John flaAered Mary” ni = (dat) daLve Case marker –  odateta is the Japanese counterpart for flattered – 
– 
– 
– 
– 
– 
– 
hanako predarg(odateru+past,taroo,sensei,decl) => predarg(flamer+past,john,teacher,decl) John flamered the teacher OpLonal Homework •  Implement translaLon of the following Japanese passive sentences: Hint: OpLonal Homework •  Implement translaLon of the following Japanese passive sentences: Problem: using a variable for the 2nd argument doesn't work for translaLon (see next slide) Hint: make it 'none' and have translaLon of 'none' (Japanese) be 'none' English OpLonal Homework OvergeneraLon: variable as 2nd argument allows anything to subsLtute InstrucLons • 
• 
• 
• 
For both homeworks, submit your code. Submit the example runs. Explain your modificaLons to the code. Due date: next Monday (evening) What do other systems do? •  Explore Google Translate Japanese Idioms •  Example:
– 
– 
– 
– 
• 
case parLcles -­‐ga が -­‐o を -­‐ni に 太郎が先生にごまをすった
taroo-­‐ga sensei-­‐ni goma-­‐o suma Taroo-­‐NOM teacher-­‐DAT sesame-­‐ACC grind+PAST Taroo flamered the teacher Note on input methods (MacOS X) 101 Japanese Idioms hmp://www.amazon.com/Listen-­‐Learn-­‐101-­‐Japanese-­‐Idioms/dp/084428341X •  Listen & Learn: 101 Japanese Idioms Michael Maynard •  Sample pages from book is available online Sesame grinder: gomasuri (ごますり) •  gomasuri (ごますり) Sesame grinder: gomasuri (ごますり) •  gomasuri (ごますり) Sesame grinder: gomasuri (ごますり) •  gomasuri (ごますり) you have to figure out how to enter Japanese examples... you can use an online Japanese dicLonary e.g. hmp://jisho.org/