opencc SQL reference
Complete SQL API lookup for opencc v0.1.0 (vendored OpenCC 1.4.2): all 16 built-in configs, conversion and inspection functions, catalog views, and the opencc.preload GUC.
All functions and views live in the fixed opencc schema. Conversion, detection, and inspection functions are IMMUTABLE and PARALLEL SAFE within a release and require a UTF8 database.
Built-in configs
| Config | Source → Target | Regional phrases | Maturity | Shorthand function |
|---|---|---|---|---|
s2t / t2s | zh-Hans ↔ zh-Hant | No | stable | opencc.s2t() / opencc.t2s() |
s2tw / tw2s | zh-Hans ↔ zh-TW | No | stable | opencc.s2tw() / opencc.tw2s() |
s2twp / tw2sp | zh-Hans ↔ zh-TW | Yes | stable | opencc.s2twp() / opencc.tw2sp() |
s2hk / hk2s | zh-Hans ↔ zh-HK | No | stable | opencc.s2hk() / opencc.hk2s() |
s2hkp / hk2sp | zh-Hans ↔ zh-HK | Yes | developing | opencc.s2hkp() / opencc.hk2sp() |
t2tw / tw2t | zh-Hant ↔ zh-TW | No | stable | opencc.t2tw() / opencc.tw2t() |
t2hk / hk2t | zh-Hant ↔ zh-HK | No | stable | opencc.t2hk() / opencc.hk2t() |
t2jp / jp2t | zh-Hant ↔ ja | No | experimental | opencc.t2jp() / opencc.jp2t() |
Conversion functions
Script detection and inspection
opencc.detect(input text), ,- Heuristic script classification:
none,neutral,simplified,traditional,mixed, orjapanese. opencc.script_stats(input text), ,- Returns
(han integer, simplified integer, traditional integer, kana integer). opencc.explain(input text, config text), ,- Returns
(seq integer, source text, steps text[], output text)showing every conversion stage per segment.