I disagree with both unless my understanding is wrong. The first rule
'S' is terminating in both cases and in both cases an 'S' is in the
input so the algorithm should stop after the first replacement. Also
in the second case I suspect a typo in the input string based on your
output string... should it be...

Sample text of:
  "I bought a B of As from T S."
                ^
                +-> I think this 'a' is missing.

On Thu, Dec 17, 2009 at 12:46 PM, R.E. Boss <[email protected]> wrote:
> Do you agree on this?
>
> S -> .shop
> A -> apple
> B -> bag
> T -> the
> the shop -> my brother
> a never used -> .terminating rule
>
> Sample text of:
>   "I bought in S a B of As from T S."
>
> Should generate:
>   "I bought in shop a bag of apples from T S."
>
>
> And how about this?
>
> S -> .shop
> A -> apple S
> B -> bag
> T -> the
> the shop -> my brother
> a never used -> .terminating rule
>
> Sample text of:
>   "I bought B of As from T S."
>
> Should generate:
>   "I bought a bag of apple shops from T S."
>
>
> R.E. Boss
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to