Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

You can't take damsel here now.


devel / comp.lang.prolog / Re: Bringing Unicode to Prolog (Dogelog Runtime)

SubjectAuthor
* Bringing Unicode to Prolog (Dogelog Runtime)Mild Shock
`- Bringing Unicode to Prolog (Dogelog Runtime)Mild Shock

1
Re: Bringing Unicode to Prolog (Dogelog Runtime)

<09b8853c-9da7-482f-b98a-2819fdd02a00n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10049&group=comp.lang.prolog#10049

  copy link   Newsgroups: comp.lang.prolog
X-Received: by 2002:ac8:7d96:0:b0:40e:b4f2:b38e with SMTP id c22-20020ac87d96000000b0040eb4f2b38emr10596qtd.2.1690790447235;
Mon, 31 Jul 2023 01:00:47 -0700 (PDT)
X-Received: by 2002:a4a:370f:0:b0:56c:85cc:b378 with SMTP id
r15-20020a4a370f000000b0056c85ccb378mr6223146oor.1.1690790446858; Mon, 31 Jul
2023 01:00:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!tncsrv06.tnetconsulting.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.prolog
Date: Mon, 31 Jul 2023 01:00:46 -0700 (PDT)
In-Reply-To: <7a9e3b0d-0929-45e3-b7d2-318d9bd1f069n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=77.57.50.239; posting-account=UjEXBwoAAAAOk5fiB8WdHvZddFg9nJ9r
NNTP-Posting-Host: 77.57.50.239
References: <scd8ii$2qa$1@solani.org> <4ca4a4d0-d91a-45b4-81b3-0bc46818f141n@googlegroups.com>
<7a9e3b0d-0929-45e3-b7d2-318d9bd1f069n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <09b8853c-9da7-482f-b98a-2819fdd02a00n@googlegroups.com>
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
From: burse...@gmail.com (Mild Shock)
Injection-Date: Mon, 31 Jul 2023 08:00:47 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2310
 by: Mild Shock - Mon, 31 Jul 2023 08:00 UTC

Note: Do not confuse multillingual strings, as introduced
by recent Dogelog Player, with Unicode encoding.
I am using the phrase "multilingual strings" for a text

database. Interestingly I managed to make the text
database declarative. Means the strings/3 entries
are not order dependent. You can place languages into
the multifile predicate in any order,

and it will pick the most specific string independent
of the order of the strings/3 facts. I was replicating
the Java Script Resource Bundle lookup on a finer
grained level, by this simple Prolog code:

get_string(Key, Locale, Value) :-
sys_locale_ancestor(Locale, Parent),
strings(Key, Parent, Res), !,
Value = Res.

% sys_locale_ancestor(+Atom, -Atom)
sys_locale_ancestor(L, L).
sys_locale_ancestor(L, M) :-
last_sub_atom(L, P, _, _, '_'),
sub_atom(L, 0, P, _, M).
sys_locale_ancestor(_, '').

The above assumes that locale identifiers use
underscore separator. It also assumes the last_sub_atom/3
predicate from Novacore, unfortunatel ISO Core has
only sub_atom/3, but no last_sub_atom/3.

Re: Bringing Unicode to Prolog (Dogelog Runtime)

<ua7q1n$60o$1@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10050&group=comp.lang.prolog#10050

  copy link   Newsgroups: comp.lang.prolog
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: janbu...@fastmail.fm (Mild Shock)
Newsgroups: comp.lang.prolog
Subject: Re: Bringing Unicode to Prolog (Dogelog Runtime)
Date: Mon, 31 Jul 2023 10:06:17 +0200
Message-ID: <ua7q1n$60o$1@solani.org>
References: <scd8ii$2qa$1@solani.org>
<4ca4a4d0-d91a-45b4-81b3-0bc46818f141n@googlegroups.com>
<7a9e3b0d-0929-45e3-b7d2-318d9bd1f069n@googlegroups.com>
<09b8853c-9da7-482f-b98a-2819fdd02a00n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 31 Jul 2023 08:06:15 -0000 (UTC)
Injection-Info: solani.org;
logging-data="6168"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17
Cancel-Lock: sha1:M/e+/Ks6eiQqwjbWxiH4Ab3vMjM=
In-Reply-To: <09b8853c-9da7-482f-b98a-2819fdd02a00n@googlegroups.com>
X-User-ID: eJwFwYEBgDAIA7CXJi1FzgFh/59g4tCjLygX/frlM5bhtjXN6aYnymlnotGbruAcnO7TCu07ABZZFqRqfkwZFSg=
 by: Mild Shock - Mon, 31 Jul 2023 08:06 UTC

For locales, see also:

Creating global software: Text handling and localization
in Taligent’s CommonPoint application system
Mark Davis et al. - 1996
https://dev.antiguru.de/davis.pdf

I wasn't sure whether the get_string/3 implementation
will perform. In Jekejeke Prolog, since it has
multi-argument indexing, each string/3 lookup with

mode (+,+,-) will be a little bit faster, whereas
Doglog Player, which has only first argument indexing
will use a little bit more time, since it needs

a scan, can only lookup the Key via an index,
but will scan for the Parent. If the text database
isn't extremly large and/or if the locales do

not have extremly many segments, this is a
non-issue I guess. And Dogelog Player might get
multi-argument indexing in the future.

Mild Shock schrieb:
> Note: Do not confuse multillingual strings, as introduced
> by recent Dogelog Player, with Unicode encoding.
> I am using the phrase "multilingual strings" for a text
>
> database. Interestingly I managed to make the text
> database declarative. Means the strings/3 entries
> are not order dependent. You can place languages into
> the multifile predicate in any order,
>
> and it will pick the most specific string independent
> of the order of the strings/3 facts. I was replicating
> the Java Script Resource Bundle lookup on a finer
> grained level, by this simple Prolog code:
>
> get_string(Key, Locale, Value) :-
> sys_locale_ancestor(Locale, Parent),
> strings(Key, Parent, Res), !,
> Value = Res.
>
> % sys_locale_ancestor(+Atom, -Atom)
> sys_locale_ancestor(L, L).
> sys_locale_ancestor(L, M) :-
> last_sub_atom(L, P, _, _, '_'),
> sub_atom(L, 0, P, _, M).
> sys_locale_ancestor(_, '').
>
> The above assumes that locale identifiers use
> underscore separator. It also assumes the last_sub_atom/3
> predicate from Novacore, unfortunatel ISO Core has
> only sub_atom/3, but no last_sub_atom/3.
>


devel / comp.lang.prolog / Re: Bringing Unicode to Prolog (Dogelog Runtime)

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor