diff options
| author | Craig Leinoff <leinoff@un.org> | 2014-01-06 18:11:33 -0500 |
|---|---|---|
| committer | Craig Leinoff <leinoff@un.org> | 2014-01-06 18:11:33 -0500 |
| commit | d9fbde9f0b200da41888df0189e0b83f983ed46a (patch) | |
| tree | a7a1c0fa4e0836f4599c3f04641853d3a548eb45 /lib/index.js | |
| parent | 24b0789dfacffd38fc16724ea1b2b8a14b49b29d (diff) | |
Adding heuristicis processing as separate step.
Diffstat (limited to 'lib/index.js')
| -rw-r--r-- | lib/index.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/index.js b/lib/index.js index 4c35f31..65ec467 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,5 @@ var docxReader = require("./docx-reader"); +var HeuristicsProcessor = require("./heuristics-processor").HeuristicsProcessor; var DocumentConverter = require("./document-to-html").DocumentConverter; var htmlPaths = require("./html-paths"); var documentMatchers = require("./document-matchers"); @@ -38,6 +39,9 @@ Converter.prototype.convertToHtml = function(inputOptions) { var options = this._options; return read(inputOptions) .then(function(documentResult) { + return processHeuristics(documentResult); + }) + .then(function(documentResult) { return convertDocumentToHtml(documentResult, options); }); } @@ -51,6 +55,11 @@ function read(inputOptions) { return docxReader.read(inputOptions); } +function processHeuristics(documentResult) { + var heuristicsProcessor = new HeuristicsProcessor(); + return heuristicsProcessor.processHeuristics(documentResult); +} + function convertDocumentToHtml(documentResult, options) { var documentConverter = new DocumentConverter(options); return documentResult.flatMapThen(function(document) { |
