Skip to content

Commit 39a5403

Browse files
committed
Demo app and docs
0 parents  commit 39a5403

File tree

86 files changed

+35957
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+35957
-0
lines changed

deno/latest/README.md

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[Seonbi] client library for Deno
2+
================================
3+
4+
[![Latest version][Tag badge]][Deno module]
5+
6+
*[Seonbi] is an HTML preprocessor that makes typographic/orthographic
7+
adjustments on Korean text. See the [website][Seonbi] for details.*
8+
9+
This directory contains a simple client library which manages and communicates
10+
with Seonbi HTTP API server. The `transform()` function and `Seonbi` class
11+
automatically downloads the Seonbi executable binary and runs the server under
12+
the hood.
13+
14+
Here's an example code for one-shot transformation:
15+
16+
~~~~ typescript
17+
import { transform } from "https://deno.land/x/seonbi/mod.ts";
18+
19+
const input = "디노를 通해 쓰는 선비";
20+
const output = transform(input);
21+
console.log(output); // 디노를 통해 쓰는 선비
22+
~~~~
23+
24+
When there are multiple inputs to transform, makes a `Seonbi` instance and
25+
call its `transform()` method multiple times so that the server subprocess
26+
are not spawned needlessly more than once:
27+
28+
29+
~~~~ typescript
30+
import { Seonbi } from "https://deno.land/x/seonbi/mod.ts";
31+
32+
const inputs = [
33+
"序詩",
34+
"看板 없는 거리",
35+
"太初의 아침",
36+
"무서운 時間",
37+
"눈 오는 地圖",
38+
"별 헤는 밤",
39+
"슬픈 族屬",
40+
];
41+
const seonbi = new Seonbi();
42+
const outputs = await Promise.all(inputs.map(input => seonbi.transform(input)));
43+
console.log(outputs);
44+
/*
45+
[
46+
"서시",
47+
"간판 없는 거리",
48+
"태초의 아침",
49+
"무서운 시간",
50+
"눈 오는 지도",
51+
"별 헤는 밤",
52+
"슬픈 족속",
53+
]
54+
*/
55+
~~~~
56+
57+
[Seonbi]: https://github.com/dahlia/seonbi
58+
[Tag badge]: https://img.shields.io/github/v/tag/dahlia/seonbi
59+
[Deno module]: https://deno.land/x/seonbi

0 commit comments

Comments
 (0)