home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / prolog / 2320 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.3 KB

  1. Path: sparky!uunet!munnari.oz.au!sol.deakin.OZ.AU!sol.deakin.OZ.AU!not-for-mail
  2. From: huang@deakin.OZ.AU (Weiguang Huang)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: How to parse "I say 'I love you'" to ["I", "say", "'I love you'"]
  5. Date: 6 Jan 1993 10:35:43 +1100
  6. Organization: Deakin University, Victoria, Australia
  7. Lines: 40
  8. Message-ID: <1id60fINNprv@sol.deakin.OZ.AU>
  9. References: <1i97a9INN8h@sol.deakin.OZ.AU> <8085@skye.ed.ac.uk>
  10. NNTP-Posting-Host: sol.deakin.oz.au
  11.  
  12. In article <8085@skye.ed.ac.uk> ken@aiai.ed.ac.uk (Ken Johnson) writes:
  13. >
  14. >In article <1i97a9INN8h@sol.deakin.OZ.AU> huang@deakin.OZ.AU (Weiguang
  15. >Huang) writes:
  16. >
  17. ># but how to parse to ["I", "say", "I love you"] ?
  18. >
  19. >The following will do what you want, but I don't think what you describe
  20. >is really what you want to do.  Instead of a list, you should really
  21. >generate a term expressing the structure of the original, so [I, say, I,
  22. >love, you] should really parse to a term such as
  23. >
  24. >   say('I',love('I',you)).
  25.  
  26. >?-  phrase(report(R),['I',say,'I',love,you]).
  27. >
  28. >     R=[I,say,I,love,you]
  29.  
  30.  
  31.     All variables in my program are a string or a list of string, instead
  32. of term nor word nor atom. I want to parse a string "I say 'I love you'" to
  33. a list of string ["I", "say", "'I love you'"].
  34.  
  35. -? tok("I say 'I love you'", R).
  36.  
  37. R=["I", "say", "'I love you'"]
  38.  
  39.     How to do so ?
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.