Re: Crikey!

Date: 2003-07-06 09:01 am (UTC)

I hope it's not too late to answer this question... I've had kinda poor internet access, despite this being a computer language conference.

The rules looked like this (sorta):

1   S     NP VP

1   NP    ProperName
1   NP    Det NBar

1   NBar  Adj NBar
1   NBar  N

1   VP    VTrans NP
1   VP    VIntrans

1   VTrans   kiss
1   VTrans   smite
1   VTrans   carry

1   VIntrans rise
1   VIntrans fall

1   Adj      red
1   Adj      blue
1   Adj      heavy

1   ProperName Arthur
1   ProperName Gwen

1   Det      a
1   Det      an
1   Det      the

1   N        sparrow
1   N        coconut
1   N        wind

The first column indicates relative weight (likelihood in text generation, score in parsing), the second column indicates the symbol.

The harness code was made up of two things:

  1. a parser that, given a sentence, searched this grammar for the highest "weight" sentence
  2. a generator that began at the S token and randomly selected expansions ("randomly" being "according to their proportional weight").
I doubt that programmers would find this part challenging -- the hard part was trying to write a CFG for English.

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

trochee: (Default)
trochee

June 2016

S M T W T F S
   1234
567 89 1011
12131415 161718
19202122232425
2627282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 31st, 2025 05:55 am
Powered by Dreamwidth Studios