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 Curl. Show all posts
Showing posts with label Curl. Show all posts

Monday, September 8, 2014

Curl char type and the CharGraphic class


Over at kanji.aule-browser.com I have a Curl applet embedded in HTML as part of my efforts to learn to read and write Japanese kanji.

What is interesting is this : try to select the top 6 or 7 rows in the left-hand widget ; now try to paste them into the HTML TextArea below or the Curl RichTextEdit to the right.

See something odd?  Two of the kanji are not copied.  Try again and observe the selection range.  Two kanji do not hi-light.

Expression-based Curl is homoiconic, so here is the declarative code/data implicated :

{krow "0014","0000",'〇'}
{krow "0002","2850",'一'}
{krow "0003","1688",'ニ'}
{krow "0437","2851",{on-yomi-only {CharGraphic '丁'}}}
{krow "0009","2854",{CharGraphic '七'}}
{krow "0018","2542",{on-yomi-only 万}}
{krow "0657","2885",'丈'}
{krow "0004","1689",'三'}
{krow "0041","2876",'上'}
{krow "0040","2862",'下'}
{krow "0049","2890",{on-yomi-only 不}}
{krow "0858","2887",'与'}
|| first 12 rows of 'data'

The single-quoted kanji are of type char. At random I have replaced them with CharGraphic instances in either the minimal expression or within the {on-yomi-only } macro that paints some characters RED.




Monday, August 11, 2014

Curl flashcard maker for Conning's Kodansha Kanji Learner's Course


Did you recently acquire the 2nd Ed. of Halpern's Kodansha Kanji Learner's Dictionary ? The 2nd Ed. has the Unicode value for the kanji. In the example below that value is 9801.

Here is a snap of the Curl applet that I use on my desktop with the Unicode values found in Andrew Scott Conning's 2013 Kodansha Kanji Learner's Course : ( note the 4 markup macros named EmFontSize, CardFontSize, FrontSide and KJ )


Monday, August 4, 2014

Kodansha KLC kanji : first 500 in groups using Curl web markup


What you see below is the post to the kanjirecog blog shown here as Curl markup instead of HTML :

{curl-file-attributes character-encoding = "utf8"}
{br} {k 12, 丸} {k 13, 円} {k 14, 〇}
{br} {k 15, 人}
{br} {k 16, 百} {k 17, 千} {k 18, 万}
{br} {k 19, 口} {k 20, 田}
{br} {k 21, 目}
{br} {k 22, 川}
{br} {k 23, 月} {k 24, 明} {k 25, 曜}
{br} {k 26, 火} {k 27, 水}
{br} {k 28, 木} {k 29, 金} {k 30, 土} {k 31, 本} {k 32, 東}
{br} {k 33, 大} {k 34, 小} {k 35, 中}
{br} {k 36, 生}
{br} {k 37, 山} {k 38, 出}
{br} {k 39, 入} {k 40, 下} {k 41, 上} {k 42, 止} {k 43, 正}
{br} {k 44, 足} {k 45, 定} {k 46, 手} {k 47, 用} {k 48, 無} {k 49, 不} {k 50, 回}
{br} {k 51, 言} {k 52, 舌} {k 53, 話} {k 54, 活}
{br} {k 55, 行} {k 56, 心} {k 57, 耳} {k 58, 又} {k 59, 取} {k 60, 身}
{br} {k 61, 休} {k 62, 体} {k 63, 信} {k 64, 付} {k 65, 受} {k 66, 以}
{br} {k 67, 立} {k 68, 部} {k 69, 倍} {k 70, 成} {k 71, 代}
{br} {k 72, 王} {k 73, 玉} {k 74, 宝} {k 75, 国} {k 76, 白} {k 77, 皇} {k 78, 全}
{br} {k 79, 書} {k 80, 事}
{br} {k 81, 自} {k 82, 貝} {k 83, 見}
{br} {k 84, 力} {k 85, 刀} {k 86, 切} {k 87, 刃} {k 88, 分}
{br} {k 89, 公} {k 90, 別} {k 91, 長}
{br} {k 92, 男} {k 93, 女} {k 94, 子} {k 95, 好} {k 96, 安} {k 97, 案}
{br} {k 98, 字} {k 99, 学} {k 100, 父} {k 101, 文} {k 102, 交} {k 103, 校}
{br} {k 104, 母} {k 105, 毎} {k 106, 海} {k 107, 者}
{br} {k 108, 工} {k 109, 式} {k 110, 弐} {k 111, 武}
{br} {k 112, 糸} {k 113, 前} {k 114, 後}
{br} {k 115, 午} {k 116, 牛} {k 117, 年} {k 118, 件}
{br} {k 119, 条} {k 120, 化} {k 121, 花} {k 122, 北} {k 123, 比} {k 124, 背}
{br} {k 125, 車} {k 126, 気} {k 127, 汽} {k 128, 性} {k 129, 畑}
{br} {k 130, 青} {k 131, 麦} {k 132, 素} {k 133, 毒}
{br} {k 134, 先} {k 135, 洗} {k 136, 元} {k 137, 光} {k 138, 去} {k 139, 法}
{br} {k 140, 走} {k 141, 当} {k 142, 思}
{br} {k 143, 早} {k 144, 草} {k 145, 朝} {k 146, 潮}
{br} {k 147, 形} {k 148, 発} {k 149, 廃}
{br} {k 150, 音} {k 151, 意}
{br} {k 152, 作} {k 153, 昨}
{br} {k 154, 雨} {k 155, 電}
{br} {k 156, 頁} {k 157, 首} {k 158, 道} {k 159, 通}
{br} {k 160, 乳}
{br} {k 161, 豆} {k 162, 頭}
{br} {k 163, 予} {k 164, 矛} {k 165, 預}
{br} {k 166, 句} {k 167, 旬} {k 168, 勺} {k 169, 的} {k 170, 約}
{br} {k 171, 勿} {k 172, 物} {k 173, 方} {k 174, 防}
{br} {k 175, 面} {k 176, 画} {k 177, 両} {k 178, 岡} {k 179, 満}
{br} {k 180, 顔} {k 181, 産}
{br} {k 182, 同} {k 183, 向} {k 184, 尚} {k 185, 高} {k 186, 圧}
{br} {k 187, 地} {k 188, 池} {k 189, 他} {k 190, 集} {k 191, 進}
{br} {k 192, 込} {k 193, 斤} {k 194, 近} {k 195, 辺} {k 196, 最}
{br} {k 197, 皿} {k 198, 血} {k 199, 温} {k 200, 湿}
{br} {k 201, 爪} {k 202, 瓜} {k 203, 巾} {k 204, 布} {k 205, 市} {k 206, 吊}
{br} {k 207, 泉} {k 208, 原} {k 209, 源} {k 210, 線} {k 211, 綿} {k 212, 絹} {k 213, 錦} {k 214, 願}
{br} {k 215, 内} {k 216, 肉} {k 217, 猪} {k 218, 豚} {k 219, 家}
{br} {k 220, 吾} {k 221, 我} {k 222, 語} {k 223, 伝} {k 224, 転} {k 225, 芸} {k 226, 会}
{br} {k 227, 合} {k 228, 今} {k 229, 令} {k 230, 念}
{br} {k 231, 印} {k 232, 命} {k 233, 亡}
{br} {k 234, 米} {k 235, 粒} {k 236, 和} {k 237, 私} {k 238, 広} {k 239, 細}
{br} {k 240, 林} {k 241, 森} {k 242, 松} {k 243, 竹} {k 244, 都} {k 245, 京}
{br} {k 246, 政} {k 247, 府}
{br} {k 248, 戸} {k 249, 所}
{br} {k 250, 至} {k 251, 致} {k 252, 屋} {k 253, 室}
{br} {k 254, 古} {k 255, 居} {k 256, 局} {k 257, 故} {k 258, 胡} {k 259, 湖}
{br} {k 260, 固} {k 261, 箇} {k 262, 個} {k 263, 且} {k 264, 組}
{br} {k 265, 夕} {k 266, 外} {k 267, 多} {k 268, 汐} {k 269, 名}
{br} {k 270, 天} {k 271, 未} {k 272, 末} {k 273, 味} {k 274, 来} {k 275, 新} {k 276, 親}
{br} {k 277, 欠} {k 278, 次} {k 279, 席} {k 280, 度} {k 281, 渡}
{br} {k 282, 限} {k 283, 銀} {k 284, 根} {k 285, 良} {k 286, 郎} {k 287, 廊}
{br} {k 288, 食} {k 289, 飲}
{br} {k 290, 官} {k 291, 館} {k 292, 宿}
{br} {k 293, 犬} {k 294, 太}
{br} {k 295, 器}
{br} {k 296, 凶} {k 297, 区} {k 298, 図} {k 299, 番}
{br} {k 300, 号} {k 301, 品} {k 302, 楽} {k 303, 薬}
{br} {k 304, 周} {k 305, 週} {k 306, 調}
{br} {k 307, 束} {k 308, 整} {k 309, 数} {k 310, 類}
{br} {k 311, 示} {k 312, 禁} {k 313, 礼} {k 314, 社} {k 315, 申} {k 316, 神}
{br} {k 317, 員} {k 318, 質}
{br} {k 319, 党} {k 320, 堂} {k 321, 常}
{br} {k 322, 賞} {k 323, 償} {k 324, 掌} {k 325, 覚}
{br} {k 326, 悟} {k 327, 感} {k 328, 央} {k 329, 映} {k 330, 決} {k 331, 快}
{br} {k 332, 英}
{br} {k 333, 並} {k 334, 平} {k 335, 半}
{br} {k 336, 馬} {k 337, 尺} {k 338, 尽} {k 339, 駅} {k 340, 鳥} {k 341, 島}
{br} {k 342, 角}
{br} {k 343, 虫} {k 344, 触} {k 345, 解} {k 346, 独}
{br} {k 347, 店} {k 348, 占} {k 349, 点}
{br} {k 350, 士}
{br} {k 351, 商}
{br} {k 352, 買}
{br} {k 353, 売} {k 354, 続} {k 355, 読}
{br} {k 356, 共} {k 357, 供} {k 358, 洪} {k 359, 昔}
{br} {k 360, 冬} {k 361, 寒} {k 362, 春} {k 363, 夏} {k 364, 秋}
{br} {k 365, 主} {k 366, 住} {k 367, 駐} {k 368, 注}
{br} {k 369, 志} {k 370, 誌} {k 371, 仕} {k 372, 任}
{br} {k 373, 支} {k 374, 反} {k 375, 坂} {k 376, 阪} {k 377, 飯} {k 378, 返}
{br} {k 379, 雑}
{br} {k 380, 乱}
{br} {k 381, 寸} {k 382, 寺} {k 383, 時} {k 384, 持} {k 385, 特} {k 386, 待} {k 387, 得} {k 388, 侍} {k 389, 詩}
{br} {k 390, 即} {k 391, 節} {k 392, 筋} {k 393, 等}
{br} {k 394, 均}
{br} {k 395, 季} {k 396, 委}
{br} {k 397, 穴} {k 398, 空} {k 399, 友} {k 400, 有}
{br} {k 401, 左} {k 402, 右}
{br} {k 403, 石} {k 404, 若} {k 405, 苦} {k 406, 在} {k 407, 存}
{br} {k 408, 干} {k 409, 刊} {k 410, 汗} {k 411, 竿}
{br} {k 412, 利}
{br} {k 413, 害}
{br} {k 414, 益} {k 415, 溢}
{br} {k 416, 割}
{br} {k 417, 憲}
{br} {k 418, 羽} {k 419, 翌} {k 420, 習}
{br} {k 421, 弓} {k 422, 引} {k 423, 強} {k 424, 弱}
{br} {k 425, 風}
{br} {k 426, 己} {k 427, 記} {k 428, 紀} {k 429, 改} {k 430, 起}
{br} {k 431, 姓}
{br} {k 432, 由} {k 433, 油}
{br} {k 434, 井} {k 435, 囲} {k 436, 丼}
{br} {k 437, 丁} {k 438, 寧} {k 439, 町} {k 440, 灯} {k 441, 庁} {k 442, 貯}
{br} {k 443, 易} {k 444, 賜} {k 445, 場} {k 446, 湯}
{br} {k 447, 門} {k 448, 間} {k 449, 閉} {k 450, 開} {k 451, 関} {k 452, 問} {k 453, 聞}
{br} {k 454, 訪} {k 455, 送} {k 456, 券} {k 457, 包} {k 458, 巻} {k 459, 圏} {k 460, 勝}
{br} {k 461, 戦} {k 462, 単} {k 463, 簡} {k 464, 過} {k 465, 骨} {k 466, 昼}
{br} {k 467, 夜} {k 468, 液} {k 469, 戒} {k 470, 幾} {k 471, 畿} {k 472, 磯} {k 473, 機} {k 474, 械}
{br} {k 475, 飛} {k 476, 氏} {k 477, 民} {k 478, 紙} {k 479, 低} {k 480, 抵} {k 481, 邸} {k 482, 底}
{br} {k 483, 巨} {k 484, 臣}
{br} {k 485, 基} {k 486, 期}
{br} {k 487, 毛} {k 488, 尾}
{br} {k 489, 育}
{br} {k 490, 羊} {k 491, 洋}
{br} {k 492, 魚} {k 493, 鮮} {k 494, 蘇}
{br} {k 495, 詳} {k 496, 祥}
{br} {k 497, 美} {k 498, 業} {k 499, 実} {k 500, 養} {k 501, 様}
{br} {k 502, 企}
{br} {k 503, 曲} {k 504, 典}
{br} {k 505, 興} {k 506, 輿}
{br} {k 507, 竜} {k 508, 滝} {k 509, 籠} {k 510, 辰} {k 511, 農} {k 512, 濃} {k 513, 豊}
{br} 

|| # eof line 277 ########################################


The {k } could be your user defined layout macro or a function coded in the Curl web content programming language, an expression-based PL from MIT in Cambridge MA and now at SCSK Corp in Tokyo.

My next version will use a function to emit Curl TextShape objects within a container, so they will become an array with each {k ... } separated by commas, all line break {br} deleted and '{k' replaced with maybe {KLCTextShaper to give a more explanatory name for instances of objects. An easy transition from declarative markup to data.

Sunday, May 26, 2013

Curl in Linux Firefox 17 fix


You must follow the advice at communities.curl.com concerning main process and

dom.ipc.plugins.enabled.libcurl-surge.so 

which you must add to the Firefox about:config page as a boolean using a right-click and NEW ; set it to false

Restart Firefox.

Curl app's should now run again in Firefox.

I have tested this solution with Curl 8.0 in CentOS 6.4 i386 in Firefox 17.0.6 in a situation where Curl ran fine in linux Opera, IDE was good but Curl would not run in Firefox.

CentOS prep included adding gcc environment for libstdc.so, libssl for libcrypt.so and libXext packages installed priot to installing RTE and IDE.

CentOS 32-bit is being run in VirtualBox on Windows 7 64-bit SP1 Home Prem on an i7 Quad core with 16GB of RAM.  CentOS is given 1024M and 8GB fixed virtual disk.



Sunday, March 10, 2013

WikizPad


Curl will make an easier wiki-pad than WikidPad because the Curl RichEditArea can generate the markup : The REA has both curl-source parse and format methods.

WikidPad is unable to display some of the input formatting until exported !  But Curl is a web content language for both data and processes - Curl offers both declarative markup and expression-based programming (rather like rebol, but without the graphics and UI issues and comes with two (2) developer IDE options (the Curl Lab or an Eclipse plugin.)

The security concern of generated markup can be addressed by requiring privilege for the applet and using a signed pcurl file along with encrypted text store.

WikizPad will offer one pane for formatting markup as RTF and one pane for editing markup as text (but with RTF appearance as desired for ease of edits.)

At the moment the features are being used for an SRS FlashCard edit/gen app, so reuse will be straight-forward.

[ more to follow ]



Saturday, March 9, 2013

customized Curl flashcard


Some Curl flashcard markup proposals in the testbed viewer :



See
 http://www.aule-browser.com/flashcards/flashcard-kanji-03.dcurl
for Curl desktop code or
 flashcards/flashcard-kanji-03.curl
to run a test in the browser.

The test markup is
{EmFontSize 36pt}
{CardFontSize 18pt}
{CardBackground "blue"}
{HiLight "red"}
    {FrontSide color="gold", 
 日本語の漢字は {KJ \u9801} がです。
}

Friday, March 8, 2013

Curl flashcard markup


Here are three snaps of user editing flashcard output format using Curl as the markup :


then after an edit


then after a Curl markup edit



Wednesday, March 6, 2013

wikibooks as Curl ebooks


wikibooks as Curl ebooks

Currently some wiki books can be exported as PDF, ODT or ZIM.

[ what this space ]




Tuesday, February 19, 2013

Curl surge-do help FAQ


Here are some valid uses of the Curl executable file named "surge-do" :
 /opt/curl/surge/9/bin/surge-do --edit "%1"

/opt/curl/surge/9/bin/surge-do --launch "%1"

/opt/curl/surge/9/bin/surge-do --browse "%1"

/opt/curl/surge/9/bin/surge-do --open "%1"

Running curl itself in that ./bin as ./curl --help would give you

Usage:
  -h --help                : Prints a Usage message to stdout and exits.
  -v --version             : Prints a version-number to stdout and exits.
  --lazy-compilation       : Requests that certain methods should be compiled lazily (normally the default).
  -l --no-lazy-compilation : Requests that no methods should be compiled lazily (the opposite of --lazy-compilation).
  --lazy-types             : Requests that certain types should be compiled lazily (normally the default).
  -t --no-lazy-types       : Requests that no types should be compiled lazily (the opposite of '--lazy-types').
  --show-gc                : Report GC information to the console.
  --verify-integrity       : Enable extra verifications of internal integrity.
  --host-console           : Force use of the host console.
  --trust                  : Trust all applets.
  --graphics-info          : Show a description of the available graphics driver, then exit.
  --force-graphics-hw      : Force use of the native graphics driver, even if it may be unstable.
  --safe-graphics          : Force use of the software graphics.
  --                       : Halts option-parsing. The rest of the arguments are passed directly on to the application.
  --batch-mode             : Run in batch mode (dialog boxes and such are illegal).
  -D --use-console-debugger: Enable use of the console debugger.
  --no-use-console-debugger: Disable use of the console debugger.
  --resync                 : Force resynchronization of all files as of process start time.
  --tag-console            : Tag each line of console output with the time and thread.
  --debug                  : Activate additional debug code in the given package.
  --debug-graphics         : Activate additional debug code in the graphics system.
  --sse2                   : Enable generation of SSE2 instructions.
  --no-sse2                : Disable generation of SSE2 instructions.
  --cache                  : Enable persistent caching of packages.
  -H --default-heap-size   : Set default starting heap size (e.g. 6M or 3200K).
  -i --redirect-stdin      : Redirect standard-input from a file.
  -o --redirect-stdout     : Redirect (append) standard-output to a file.
  -e --redirect-stderr     : Redirect (append) standard-error to a file.
  --utf8-stdin             : Use UTF8 character encoding for 'stdin'.
  --utf8-stdout            : Use UTF8 character encoding for 'stdout'.
  --utf8-stderr            : Use UTF8 character encoding for 'stderr'.
  --privileged             : Run with 'privilege'.
  --unprivileged           : Run without 'privilege'.
  --preload                : Preload a given file (using evaluate).
  --eval                   : Evaluate a string.
  -s --shell               : Enter interactive shell mode.
  --default-exit           : Default exit value for scripts.
  --do-not-panic           : Do not panic. Just abort instead.

The flag -l is used when running a .xcurl script

[ more to follow] 




Friday, July 20, 2012

Save Knowtes

I was force to add a SAVE button to my web page notepad and its for scratch note areas.

The details are posted over at the Curl Community.

The local web app on my PC now has these before and after:

and

Thursday, July 19, 2012

alpha testers


I am looking for alpha testers for a Curl app (www.curl.com) - just a utility.

Would you consider ?  It is intended to help recall secure multi-word passphrases used as alternatives to passwords. It is web browser based in this alpha (no JavaScript but does use Curl )

There is a snapshot view at passphrases.aule-browser.com

I have committed to moving this to Pharo Smalltalk 2.0 for Android.  Curl also has an Android app generator called CAEDE at curlap.com

And then there is Mobl ...

( I sometimes generate Curl markup with Seaside in Pharo or VW Smalltalk but Seaside remains very tied to SGML in some base classes.)




Tuesday, July 17, 2012

Minimalist Web Notes

Here is my minimalist web notes app without tables, SQL, JavaScript or HTML5:


This runs against local binary files using Curl 7.0 or Curl 8.0 from curlap.com

I am running the current Curl beta for the Caede Android app builder.

Wednesday, July 11, 2012

Curl Knowtepage


This is the Curl equivalent to our Knowte Firefox re-sizable text areas:


And compared to the Knote TiddlyWiki's EXE, this applet has a tiny footprint.

Here is an HTML wrapper for the Curl applet: http://www.aule-browser.com/knowtepages/index-curl.html.

You can install the Curl browser plugin at curl.com (English) or curlap.com (Japanese.)

Pale Moon browser


I am very happy with Pale Moon as a Firefox browser build for 32-bit Windows.

This looks to be a great way to run Curl applets on an Atom netbook with Windows.  There are also 64-bit versions.

I have been running 12.1.2

Thursday, July 5, 2012

SCSK Curl and Beta Etiquette

SCSK's Curl team disabled my local PC applets.

How? By expiring the runtime engine for their Andoid development CAEDE beta IDE.

So I reinstall the old 8.0 runtime Surge® engine.

Nope. No applet will run under that 8.0.0 browser plugin until the NON-browser 8.0.1 IDE is uninstalled ( a separate selectable/optional step in the uninstaller itself !! )

My Smalltalk vendor did something like this back in the big merger that killed Smalltalk (it was years before I was willing to buy another professional Smalltalk IDE license.)

Now Instantiations owns the VA code and Pharo may get onto Android devices.  And there is the Mobl language - and Red may replace Rebol.

In its day, Borland could be outrageous as could IBM and Microsoft and Oracle.  But we are now in the post-Java manager-gotta-buzzword era -  are we not?  Don't managers now talk about "open-source methodology" as if that meant something? JavaScript is no longer a bad ECMA joke?

But here I am - hung out to dry again by a language vendor.

Challenge: name one web app framework that generates non-HTML markup such as Curl without significant revisions which break updates. No, it is not yet Seaside 3.0.x - that future must wait a little longer.

Remember when XHTML was declared by committee to be the future of web  markup?  Ahem.  How long can it take me to start calling HTML5 simply 'HTML' ?  By 2014?

At least I never fell for Google Gears ... just DBX, Nuon, OS/2 SOM/DSOM, Rebol 3 ...

Sunday, July 1, 2012

Android app for passphrase mnemonics


How quickly can CAEDE take the Curl desktop passphrases application to running as an Android app on 4.1 "Jelly Bean"?

Wednesday, June 27, 2012

Curl versus prototype.js

Here is what the prototype.js site suggests:

var Person = Class.create({
  initialize: function(name) {
    this.name = name;
  },
  say: function(message) {
    return this.name + ': ' + message;
  }
});

var Pirate = Class.create(Person, {
  say: function($super, message) {
    return $super(message) + ', yarr!';
  }
});

Here is my Curl equivalent

{define-class public Person
  field public-get private-set name:String
  {method public {say msg:String}:String
    {return {String self.name, ": ", msg}}
  }
  {constructor {default name:String}
    set self.name = name
  }
}

{define-class public Pirate {inherits Person}
  {constructor {default name:String}
    {construct-super name}
  }
  {method public {say msg:String}:String
    {return {String {super.say msg}, ", yarr!"} }
  }
}

Now here is my naive test code:
{output {{Pirate "Long-John"}.say "ahoy matey"}}
and here is the output:
Long-John: ahoy matey, yarr!

Note the lack of sigil's, var's and strange parenthetical matings.
But Curl also has 3D graphics and 2D paths and db interfaces and an IDE ... and now generates Android app's. Oh ... and a debugging environment with graphical inspectors and color outline  and fill debug inspection highlighters ... and is almost Smalltalk-ish LISP.
And from the same DARPA project as WWW.  SCSK Curl  (formerly MIT Curl).
Did I mention multiple inheritance? Mix-in's ? Anonymous proc's? Async workers?

{after (10s * long-wait) do
   {more-than-HTML-JS-lib for-the-web}
}
|| public classes, library classes, packages, imports, includes, macros, enums, Array-2-of
|| abstract classes, final classes, sealed classes, shared, serializable,deprecated,open ...

Tuesday, May 29, 2012

Japanese Punctuation in UNICODE


Over at http://www.aule-browser.com/kanji/kana-charts-curl.html there is now  a view of all Japanese punctuation listed at ja.wikipedia.org with UNICODE 16-bit and often also the utf-8 for urlencode.

Unfortunately, my favourite HanaMinA font was not adequate to the task, but neither were any of the default Unicode DejaVu, Lucida or Arial fonts.

Here is a snap of the result:


The font-family selection for punctuation characters required the use of a CharClass - a char-map class in Curl.  A total of 4 font families contributed to forming a complete list - most often with half-width presentation preserved.




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