From d9fbde9f0b200da41888df0189e0b83f983ed46a Mon Sep 17 00:00:00 2001 From: Craig Leinoff Date: Mon, 6 Jan 2014 18:11:33 -0500 Subject: Adding heuristicis processing as separate step. --- lib/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/index.js') 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"); @@ -37,6 +38,9 @@ function Converter(options) { 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) { -- cgit v1.2.3