Subject: Re: [replace Capital letters]

From: Fatih Hocaoglu <[email-masked]>
Date: 17 Aug 00 11:07:59 MDT

that's the answer;

to_small(X,Y):- name(X,L),
  change(L,Lx),
  name(Y,Lx).

change([],[]).
change([X|M],[Y|MM]):-(X>64, X<91),!,
        Y is X+32,
   change(M,MM);
   Y is X,
  change(M,MM).

try this,

?- to_small('FaTIH hoCAOgLU',X).
   X = 'fatih hocaoglu'

fatih

"A. Obdeijn" <[email-masked]> wrote:
Can anyone tell me if there's a simple way to replace CAPITAL LETTERS by
small letters, in a list of words?

the case is the following:
i ask for a sentence, the user writes a sentence, including capital
letters, and then i want to parse this sentence,
which is not possible, since the capitals are seen as variables. So what
i want to do is replace the capitals by normal letters.

Arnold

----------------
* To UNSUBSCRIBE, please use the HTML form at

    http://www.swi.psy.uva.nl/projects/SWI-Prolog/index.html#mailinglist

or send mail to [email-masked] using the Subject:
"unsubscribe"
(without the quotes) and *no* message body.

** An ARCHIVE of this list is maintained at

    http://www.swi.psy.uva.nl/projects/SWI-Prolog/mailinglist/archive/

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1