Open Chinese Convert
0.4.3
A project for conversion between Traditional and Simplified Chinese
Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Files
Functions
Variables
Groups
Pages
node
demo.js
Go to the documentation of this file.
1
28
// In your project you should replace './opencc' with 'opencc'
29
var
OpenCC
= require(
'./opencc'
);
30
31
// Load the default Simplified to Traditional config
32
var opencc =
new
OpenCC
(
'zhs2zht.ini'
);
33
34
// Set conversion mode
35
opencc.setConversionMode(
OpenCC
.CONVERSION_FAST);
36
37
// Sync API
38
var converted = opencc.convertSync(
"汉字"
);
39
console.log(converted);
40
41
// Async API
42
opencc.convert(
"汉字"
,
function
(err, converted) {
43
console.log(converted);
44
});
Generated on Fri May 17 2013 14:16:34 for Open Chinese Convert by
1.8.3.1