Logtalk 2.24.0 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1282 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
20
Logtalk/examples/encodings/NOTES
Normal file
20
Logtalk/examples/encodings/NOTES
Normal file
@@ -0,0 +1,20 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.24.0
|
||||
|
||||
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
||||
|
||||
To load this example and for sample queries, please see the SCRIPT file.
|
||||
|
||||
This is a very simple example of using the new, experimental encoding/1
|
||||
directive, which is fully based on the directive with the same name found
|
||||
on recent development releases of SWI-Prolog. Currently, this example
|
||||
requires Logtalk to be run with the SWI-Prolog compiler.
|
||||
|
||||
The "babel.lgt" source file uses UTF-8 encoding. When browsing its code,
|
||||
be sure to use a text editor that supports this encoding. In addition,
|
||||
you may need to configure your text editor to open the source file using
|
||||
this encoding. If you are using the SWI-Prolog GUI application on Windows,
|
||||
be sure to select a font which supports Unicode characters.
|
46
Logtalk/examples/encodings/SCRIPT
Normal file
46
Logtalk/examples/encodings/SCRIPT
Normal file
@@ -0,0 +1,46 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.24.0
|
||||
|
||||
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
||||
|
||||
% start by loading the example:
|
||||
|
||||
| ?- logtalk_load(encodings(loader)).
|
||||
...
|
||||
|
||||
|
||||
% query the table of "Hello world!" messages:
|
||||
|
||||
| ?- babel::hello_world(Code, Text).
|
||||
|
||||
Code = el
|
||||
Text = 'Γειάσου κόσμος!' ;
|
||||
|
||||
Code = en
|
||||
Text = 'Hello world!' ;
|
||||
|
||||
Code = es
|
||||
Text = '¡Hola mundo!' ;
|
||||
|
||||
Code = ja
|
||||
Text = 'こんにちは世界!' ;
|
||||
|
||||
Code = ko
|
||||
Text = '여보세요 세계!' ;
|
||||
|
||||
Code = nl
|
||||
Text = 'Hello wereld!' ;
|
||||
|
||||
Code = pt
|
||||
Text = 'Olá mundo!' ;
|
||||
|
||||
Code = ru
|
||||
Text = 'Здравствулте! мир!' ;
|
||||
|
||||
Code = zh
|
||||
Text = '你好世界!'
|
||||
|
||||
Yes
|
29
Logtalk/examples/encodings/babel.lgt
Normal file
29
Logtalk/examples/encodings/babel.lgt
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
:- encoding(utf8).
|
||||
|
||||
|
||||
:- object(babel).
|
||||
|
||||
:- info([
|
||||
version is 1.0,
|
||||
author is 'Paulo Moura',
|
||||
date is 2005/04/06,
|
||||
comment is 'Simple test of the encoding/1 directive.']).
|
||||
|
||||
:- public(hello_world/2).
|
||||
:- mode(hello_world(?atom, ?atom), zero_or_more).
|
||||
:- info(hello_world/2, [
|
||||
comment is 'Table of "hello world" messages in several languages (using ISO 639-2 two letter language codes for indexing).',
|
||||
argnames is ['Language', 'Text']]).
|
||||
|
||||
hello_world(el, 'Γειάσου κόσμος!').
|
||||
hello_world(en, 'Hello world!').
|
||||
hello_world(es, '¡Hola mundo!').
|
||||
hello_world(ja, 'こんにちは世界!').
|
||||
hello_world(ko, '여보세요 세계!').
|
||||
hello_world(nl, 'Hello wereld!').
|
||||
hello_world(pt, 'Olá mundo!').
|
||||
hello_world(ru, 'Здравствулте! мир!').
|
||||
hello_world(zh, '你好世界!').
|
||||
|
||||
:- end_object.
|
4
Logtalk/examples/encodings/loader.lgt
Normal file
4
Logtalk/examples/encodings/loader.lgt
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
:- initialization(
|
||||
logtalk_load([
|
||||
babel])).
|
Reference in New Issue
Block a user