Subject: [Ltru] Less than a day to go for WG Last Call on matching draft

From: Martin Duerst <[email-masked]>
Date: Thu, 30 Mar 2006 17:43:42 +0900

Dear LTRU WG members,

This is another reminder for the WG Last Call on the matching draft.
We have less than a day for this Last Call. The exact deadline
is Thursday, March 30, 23:00 UTC (Friday, March 31st, 08:00
Japan time, Thursday, March 30, 3pm US Pacific, and so on).

If you haven't read the -11 draft yet, please do so, even if you
have read a previous draft. If you have read the -11 draft, please
report your findings to the list, even if it is just that you haven't
found any issues.

Many thanks,    Martin.

P.S.: I'll update the issues list at
       http://www.sw.it.aoyama.ac.jp/2006/IETF/ltru/ tomorrow,
       after the deadline. 

_______________________________________________
Ltru mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/ltru

---

From: Erkki Kolehmainen <[email-masked]>
Date: Thu, 30 Mar 2006 15:05:05 +0300

Dear All,

I have read the -11 draft, and I haven't found any issues.

Sincerely, Erkki I. Kolehmainen

---

From: "Kent Karlsson" <[email-masked]>
Date: Thu, 30 Mar 2006 18:23:57 +0200 (CEST)

I still object to the text in 3.2.2:

"Subtags not specified, including those at the end of the language range,
are thus treated as if assigned the wildcard value "*"." (and following
examples).

I think that wildcards must be explicit, possibly with the exception of
final ones, but not internal ones. I see no reason for internal ones not
to be explicit.

     /kent k

---

From: John Cowan <[email-masked]>
Date: Thu, 30 Mar 2006 11:56:48 -0500

> final ones, but not internal ones. I see no reason for internal ones not

As the word "thus" indicates, the statement to which you object is a
consequence of the algorithm as described, as you can see by working out
the details.

Are you in fact objecting to the algorithm?

-- 
John Cowan  [email-masked]  www.ccil.org/~cowan  www.ap.org
Any sufficiently-complicated C or Fortran program contains an ad-hoc,
informally-specified bug-ridden slow implementation of half of Common Lisp.
        --Greenspun's Tenth Rule of Programming (rules 1-9 are unknown)

---

From: "Kent Karlsson" <[email-masked]>
Date: Thu, 30 Mar 2006 21:58:12 +0200

John Cowan wrote:
> consequence of the algorithm as described, as you can see by 
> working out the details.
> 

The details of the algorithm paragraph you are referring to are unclear
to
me. But it is very likely that I object to it (if said consequence is
really
what falls out). But it seem to me that the "algorithm" totally ignores
wildcards... Which is rather strange and objectionable...

If the algorithm paragraph can be reformulated for clarity, the better.
(You apparently did not like my way of claryfying it, actually talking
about partial orders rather than *pretending* there isn't one.)

	/kent k

---

From: "Kent Karlsson" <[email-masked]>
Date: Thu, 30 Mar 2006 22:47:38 +0200 (CEST)

/kent k

---

From: John Cowan <[email-masked]>
Date: Thu, 30 Mar 2006 17:22:31 -0500

> about partial orders rather than *pretending* there isn't one.)

Here's my attempt:

1. A subtag in the extended language  matches a subtag in the language
tag if and only if they are the same when compared case-insensitively
or the range's subtag is "*".

2.  If the first subtag in the range does not match the first subtag in
the tag, the overall match fails.  Otherwise, remove the first subtags
from both the range and the tag.

3.  While there are more subtags left in the range:

	3a.  If the first remaining subtag in the range is "*", remove
	it and continue with the loop.

	3b.  Otherwise, if there are no more subtags in the tag, the
	match fails.

	3c.  Otherwise, compare the first remaining subtag in the range
	with the first remaining subtag in the tag.  If they match,
	remove both of them and continue with the loop.

	3d.  Otherwise, if the tag's subtag is a "singleton" (a single
	letter or digit, which in this case includes the private-use
	subtag 'x') the match fails.

	3e.  Otherwise, remove the tag's subtag and continue with
	the loop.

4.  When the range has no more subtags, the match succeeds.

So it is indeed true that wildcard subtags and missing subtags are treated
in the same way, except of course for the first subtag.

Below is an extremely literal translation into Perl of the above
pseudo-code.

============cut here============
#!/usr/bin/perl -w
# Implement and test RFC 3066bis extended matching
# John Cowan places this code in the public domain, but reserves
# the moral right to be known as the author.

use strict;

# Subtag matching
sub submatch {
	my ($subrange, $subtag) = @_;
	return 1 if $subrange eq "*";
	$subrange = lc($subrange);
	$subtag = lc($subtag);
	return $subrange eq $subtag;
	}

# Tag matching
sub match {
	my ($range, $tag) = @_;
	my @range = split(/-/, $range);
	my @tag = split(/-/, $tag);

	return 0 unless submatch($range[0], $tag[0]);
	shift @range;
	shift @tag;

	while (@range) {
		if ($range[0] eq "*") {
			shift @range;
			}
		elsif (@tag == 0) {
			return 0;
			}
		elsif (submatch($range[0], $tag[0])) {
			shift @range;
			shift @tag;
			}
		elsif (length($tag[0]) == 1) {
			return 0;
			}
		else {
			shift @tag;
			}
		}
	return 1;
	}

# Tag testing
sub test {
	my ($range, $tag) = @_;
	print "Range $range ",
		match($range, $tag) ? "matches" : "does not match",
		" tag $tag\n";
	}

# Successes
test("de-*-DE", "de-DE");
test("de-*-DE", "de-Latn-DE");
test("de-*-DE", "de-Latf-DE");
test("de-*-DE", "de-de");
test("de-*-DE", "de-DE-x-goethe");
test("de-*-DE", "de-Latn-DE-1996");

# Failures
test("de-*-DE", "de");
test("de-*-DE", "de-x-DE");
test("de-*-DE", "de-Deva");

# Successes (no wildcard)
test("de-DE", "de-DE");
test("de-DE", "de-Latn-DE");
test("de-DE", "de-Latf-DE");
test("de-DE", "de-de");
test("de-DE", "de-DE-x-goethe");
test("de-DE", "de-Latn-DE-1996");

# Failures (no wildcard)
test("de-DE", "de");
test("de-DE", "de-x-DE");
test("de-DE", "de-Deva");
============cut here============

-- 
Well, I have news for our current leaders       John Cowan
and the leaders of tomorrow: the Bill of        [email-masked]
Rights is not a frivolous luxury, in force      http://www.ccil.org/~cowan
only during times of peace and prosperity.      http://www.ap.org
We don't just push it to the side when the going gets tough.  --Molly Ivins

---

From: John Cowan <[email-masked]>
Date: Thu, 30 Mar 2006 17:26:27 -0500

> > about partial orders rather than *pretending* there isn't one.)

Addison and LTRUers: in case it's not obvious, this is a proposal for replacing
the second and third paragraphs of 3.2.2.

-- 
He played King Lear as though           John Cowan <[email-masked]>
someone had played the ace.             http://www.ccil.org/~cowan
        --Eugene Field                  http://www.ap.org

---

From: "Addison Phillips" <[email-masked]>
Date: Thu, 30 Mar 2006 14:35:46 -0800

It was clear to me. Seems better to enumerate it this way that as formless
text.

Addison

Addison Phillips
Internationalization Architect - Yahoo! Inc.

Internationalization is an architecture.
It is not a feature. 

> -----Original Message-----
> From: John Cowan [mailto:[email-masked]]
> Sent: 2006?3?30? 14:26
> To: Kent Karlsson
> Cc: [email-masked]
> Subject: Re: [Ltru] Less than a day to go for WG Last Call on matching
> draft
> 
> Scripsi:
> 
> > Kent Karlsson scripsit:
> >