Re: Accented letters
- From: Aaron Sloman <A.Sloman@xxxxxxxxxxxxx>
- Date: Tue, 7 Aug 2007 20:23:51 +0000 (UTC)
aliba <linden@xxxxxxxxxx> wrote:
Date: Tue, 07 Aug 2007 05:37:24 -0700
How can I code accented letters of foreign languages - e.g., in
French, "=E0", "=E9", "=F4", ","=F9", etc. - in Poplog Prolog?
The same question applies to the apostrophe sign (ASCII code 39).
So far, I have been unable to scan these special characters,
which are recognized without difficulty by tokenizers implemented in
other Edingurgh compatible Prologs, in Poplog Prolog.
I thought this was going to be tricky, but it turns out that Poplog
Prolog uses the same conventions for expressing ascii codes in
strings and atoms as Poplog Pop11 does, as described in the Pop-11
help file:
HELP ASCII
All the special codes start with backslash "\". Some follow unix
conventions, e.g.
ASCII Typed as Represents
32 `\s` the code for a space
13 `\r` the code for a carriage return
10 `\n` the code for a line feed
8 `\b` the code for a back space
9 `\t` the code for a tab
27 `\e` the code for an escape
92 `\\` the code for the backslash itself
In a string (or Prolog atom or string) the string quote character
(apostrophe) is represented by
\'
Control characters:
`\^a` or `\^A` is CTRL-A (ASCII 1)
`\^b` or `\^B` is CTRL-B (ASCII 2)
etc.
A further convention allowed in strings is the representation of an
ASCII code by an integer between the brackets in \(..). E.g.
'\(65)\(66)' =>
is equivalent to
'AB' =>
Other characters can be represented the same way, e.g.
In Poplog prolog
?-write(' \(224) \(233) \(244) \(249) \' \(39) ').
produces
à é ô ù ' ' yes
I don't know whether the first four characters will survive posting
view the news system, but they should correspond to:
=E0 =E9 =F4 =F9
Aaron
http://www.cs.bham.ac.uk/~axs/
.
- Follow-Ups:
- Re: Accented letters
- From: Chris Dollin
- Re: Accented letters
- References:
- Accented letters
- From: aliba
- Accented letters
- Prev by Date: Accented letters
- Next by Date: Re: Accented letters
- Previous by thread: Accented letters
- Next by thread: Re: Accented letters
- Index(es):
Relevant Pages
|