W3C home > Mailing lists > Public > public-i18n-its-ig@w3.org > March 2009

Language tag analyzer

From: Felix Sasaki <felix.sasaki@fh-potsdam.de>
Date: Wed, 25 Mar 2009 02:34:25 +0900
Message-ID: <ba4134970903241034h7978bf05u29e322c2a58194d1@mail.gmail.com>
To: public-i18n-its-ig@w3.org
Hi all,

as a potential application of the language information data category I have
written a language tag analyzer, see
and an example of an erroneous language tag
this is implemented in XSLT, but I am working on a Java implementation, see
attachment. Currently it checks the syntax of language tags, but not against
the subtag registry. You can evoke it e.g. by
public static void main(String[] args) {
    LangTag lt =
        new LangTag(args[0], false); // a language tag (args[0] is created
and analysed. Validation is not here yet, so set to false.
    for (int i = 0; i < lt.getSubtagNum(); i++) { // iterating through all
        System.out.println(lt.getSubtag(i).subtag + " is of type " +
lt.getSubtag(i).type); // getting the type of the subtag
    System.out.println("Wellformed language tag: " + lt.wellformed); // a
flag for checking if the syntax of the language tag is OK.

Maybe that's something to integrate in Yves's java implementation.



Received on Tuesday, 24 March 2009 17:35:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:11:27 UTC