on the Curl Web Content Markup Language

on the Curl Web Content Markup and Programming Language from www.curl.com and www.curlap.com
Showing posts with label Japanese. Show all posts
Showing posts with label Japanese. Show all posts

Thursday, August 29, 2013

Your fonts that are Unicode Japanese capable


This morning I wrote a nihongo fonts applet … a Curl browser applet (Linux, Mac, Windows) that shows which (if any) of your fonts on your device can display the Japanese Unicode character "zen" 禅 character … or it advises you that you have no such fonts … or advises you that you still have not installed the Curl 8 browser plugin.

The fonts true name (for use in a CSS or Curl style) is displayed in that font … as is the test character 禅. The font-size is 24pt. The next version will make that font size user-selectable as em or pt.

The title line is in the first of your Asian-capable Unicode fonts (by alphabetical order.) The entire applet is only a couple of lines of procedural-style Curl and then the applet ends with the layout as a simple declarative-style Curl expression.

I can send you the desktop app version by request.


Saturday, October 13, 2012

Monday, June 4, 2012

serialization of an off-line text resource


To see the effect of my Curl serialization effort look at the speed of the small daily pages such as http://www.aule-browser.com/kanji/poets/basho-mee-indexed.html

The new daily page generated fast and it loads very fast. I have already cycled twice through the BIN serialization files as I find minor transcription errors in the principal text resource - but that text resource now does not need to reside on the applet web server !

Here is a snapshot for





Sunday, June 3, 2012

serialization for text source integrity


I now have a Curl applet up using only serialized data as the source - this will make all of the "Learn Kanji" applets faster hereafter and help keep my fingers off my input text source !

The applet uses the {deserialize } macro to load its data and does not reach the original source.

The approach will result in much faster "kanji of the day" applets using the Basho Haiku as their learning resource as no iteration through the data will occur at load time and the applets are one degree away from the vulnerable source.

This will be even more significant when working with no SQL and no JSON for the large JMDict Japanese resource as well as the smaller Kanjidic2 and its Edict2.

Entire arrays are serialized with a simple call to a stream to write one object.  The object classes are declared as serializable and all affected fields have at least a default value.

The result is that my own annotations are kept independent of the source file.

I may turn this same approach to an applet for viewing the tags in my 9000+ Firefox booksmarks so as to avoid both HTML and JSON.

Here is a snap:






Tuesday, May 29, 2012

Monday, May 28, 2012

Curl data versus JSON data (light-weight markup)

Here is the top of a validated JSON katakana data file for Japanese e-learning:

{"katakana": [
{"ucs": "30AB", "utf-8": "E382AB", "kana": "カ", "info": "katakana letter KA"},
{"ucs": "30AC", "utf-8": "E382AC", "kana": "ガ", "info": "katakana letter GA"},
{"ucs": "30AD", "utf-8": "E382AD", "kana": "キ", "info": "katakana letter KI"},
{"ucs": "30AE", "utf-8": "E382AE", "kana": "ギ", "info": "katakana letter GI"},

and here is the Curl:

{let katakana-array:{Array-of Katakana} = {new {Array-of Katakana},
{Katakana "30AB", "E382AB", "カ", "katakana letter KA"},
{Katakana "30AC", "E382AC", "ガ", "katakana
letter GA"},
{Katakana "30AD", "E382AD", "キ", "katakana
letter KI"},
{Katakana "30AE", "E382AE", "ギ", "katakana
letter GI"},

In Curl, both require field definitions for processing - except that the Curl data requres a minimal class definition and a default constructor declaring all fields as being assigned (simple value class).

Of course both could have been reduced to mere arrays of strings, but then the iteration over the data would use no tags or keys.  The Curl version is tagged, but internally:

{define-value-class public final Katakana
  field private constant ucs-code:String || = "0000"
  field private constant utf8-code:String || = "000000"
  field private constant kana-char:String || = {String '\u5B57'} || "字"
  field private constant kana-name:String || = "Ji"
  {getter public {ucs}:String
    {return self.ucs-code}
  }
  {getter public {utf-8}:String
    {return self.utf8-code}
  }
  {getter public {katakana}:String
    {return self.kana-char}
  }
  {getter public {character}:String
    {return self.kana-name}
  }
  {constructor {default ucs:String, utf:String, kana:String, info:String}
    set self.ucs-code = ucs
    set self.utf8-code = utf
    set self.kana-char = kana
    set self.kana-name = info
  }
 }
{include "./katakana-unicode.scurl"}

The iterator block accesses each instance as, e.g., val.ucs and so forth.

In fairness, the JSON could have been

{"katakana-array": [
{"katakana": ["ucs": "30AB", "utf-8": "E382AB", "kana": "カ", "info": "katakana letter KA"]},

but it further complicated iterating over the data.

In the Curl applet the Curl data is processed dramatically faster, naturally.

The JSON data can be used anywhere, e.g., by Pharo Smalltalk or jQuery in web page widgets.

Note: the UTF-8 can be used to urlencode:  "E382B6" becomes %E3%82%B6 for a URL.

Here is one result using the Curl data: (click to view)

 

The applet is located at www.aule-browser.com/kanji/kana-charts.html



Saturday, April 28, 2012

Tuttle Kanji Flashcard app


At http://www.aule-browser.com/kanji/tuttle-henshall-kanji.html there is now a Curl applet for the Tuttle kanji cards ( I am still on the red flashcard set ! )

I used this card as a reminder of the Bayware "Power" Kanji software for Windows 95 later marketed by Transparent Language as Kanji Power2 or some such.  That software had some real strengths in its visual interactive approach to syntax and post-position particles for Who-Where-When-verb basics and modifier-before-modified.

The strength of the Tuttle cards is that each flashcard includes four 2-Kanji combinations with the Kanji of that card.  At my age, my quarrel is with the small font for these - also an issue with the O'Neill paperback.

Font-size is even an issue in Firefox with the Perapera plugin as using CTRL-+ for the browser window content causes the plugin's popups to explode in size.

The Curl* applet illustrated above includes the UNICODE value and the Henshall number.

Request a variant, and I can produce it in about an hour (skip-code, Nelson etc) so long as the information is in the Kanjidic2 XML file.

I will post a download link for the CSV file for the Tuttle flash card set for anyone using Excel or the like.  Now to go look on-line for the "green" set ...

* Curl requires the Curl browser plugin from curl.com or curlap.com (in Japanese.) Curl is in version 8.0 and is very secure and my preferred alternative to Java as both language and browser plugin.  I will add desktop versions today or soon.