Skip to content

Commit

Permalink
Update document_conversion.v1-experimental.js
Browse files Browse the repository at this point in the history
Update document conversion example with a config
  • Loading branch information
germanattanasio committed Nov 22, 2015
1 parent 0aa452c commit f55f078
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions examples/document_conversion.v1-experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ var document_conversion = watson.document_conversion({
// convert a single document
document_conversion.convert({
// (JSON) ANSWER_UNITS, NORMALIZED_HTML, or NORMALIZED_TEXT
file: fs.createReadStream(__dirname + '/resources/document_conversion/sample-docx.docx'),
conversion_target: document_conversion.conversion_target.ANSWER_UNITS
file: fs.createReadStream(__dirname + '/resources/example.html'),
conversion_target: document_conversion.conversion_target.ANSWER_UNITS,
config: {
// split the html file by "h2", "h3" and "h4" tags
html_to_answer_units: {
selectors: [ 'h2','h3', 'h4']
}
}
}, function (err, response) {
if (err) {
console.error(err);
} else {
console.log(JSON.stringify(response, null, 2));
}
});
});

0 comments on commit f55f078

Please sign in to comment.