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
Variables
opencc.js File Reference

Node.js API. More...

Go to the source code of this file.

## Variables
var | path = require('path')
var | binding = require('../build/Release/binding')
var | assetsPath = path.resolve(__dirname, '../build/Release')
var | getConfigPath
var | OpenCC
OpenCC | CONVERSION_FAST = 0
| Default conversion mode.
OpenCC | CONVERSION_SEGMENT_ONLY = 1
| Only converts text into segments.
OpenCC | CONVERSION_LIST_CANDIDATES = 2
| List all candidates of every segment.
OpenCC prototype | convert
OpenCC prototype | convertSync
OpenCC prototype | setConversionMode

## Detailed Description

Node.js API.

Open Chinese Convert

Copyright 2010-2013 BYVoid byvoi.nosp@m.d@by.nosp@m.void..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file opencc.js.

## Variable Documentation

OpenCC prototype convert

Initial value:
= function (input, callback) {
return this.handler.convert(input.toString(), callback);
}

Definition at line 88 of file opencc.js.

OpenCC prototype convertSync

Initial value:
= function (input) {
return this.handler.convertSync(input.toString());
}

Definition at line 101 of file opencc.js.

var getConfigPath

Initial value:
= function (config) {
var configPath = config;
if (config[0] !== '/' && config[1] !== ':') {
configPath = path.join(assetsPath, config);
}
return configPath;
}

Definition at line 33 of file opencc.js.

var OpenCC

Initial value:
= module.exports = function (config) {
if (!config) {
config = 'zhs2zht.ini';
}
config = getConfigPath(config);
this.handler = new binding.Opencc(config);
}

Definition at line 49 of file opencc.js.

OpenCC prototype setConversionMode

Initial value:
= function (conversionMode) {
return this.handler.setConversionMode(conversionMode);
}

Definition at line 113 of file opencc.js.